feat(chat): sync multi-role backend APIs

This commit is contained in:
2026-07-20 11:29:54 +08:00
parent 16b5c16e76
commit b6fdc912ae
84 changed files with 1488 additions and 439 deletions
@@ -39,7 +39,7 @@ describe("subscription exit helpers", () => {
it("uses explicit chat image return urls first", async () => {
consumePendingChatImageReturnMock.mockResolvedValue({
reason: "image_paywall",
characterId: "character_elio",
characterId: "elio",
messageId: "msg_1",
returnUrl: "/chat?image=msg_1",
createdAt: 1,
@@ -74,14 +74,14 @@ describe("subscription exit helpers", () => {
it("returns directly to private room without consuming chat state", async () => {
consumePendingChatImageReturnMock.mockResolvedValue({
reason: "image_paywall",
characterId: "character_elio",
characterId: "elio",
messageId: "msg_1",
returnUrl: "/chat?image=msg_1",
createdAt: 1,
});
peekPendingChatUnlockMock.mockResolvedValue({
reason: "single_message_unlock",
characterId: "character_elio",
characterId: "elio",
displayMessageId: "msg_1",
messageId: "msg_1",
kind: "image",
@@ -104,7 +104,7 @@ describe("subscription exit helpers", () => {
it("keeps private room ahead of stale chat state after payment", async () => {
peekPendingChatUnlockMock.mockResolvedValue({
reason: "single_message_unlock",
characterId: "character_elio",
characterId: "elio",
displayMessageId: "msg_1",
messageId: "msg_1",
kind: "image",
@@ -123,7 +123,7 @@ describe("subscription exit helpers", () => {
it("keeps pending chat unlocks ahead of chat fallback after payment", async () => {
peekPendingChatUnlockMock.mockResolvedValue({
reason: "single_message_unlock",
characterId: "character_elio",
characterId: "elio",
displayMessageId: "msg_1",
messageId: "msg_1",
kind: "image",
@@ -141,7 +141,7 @@ describe("subscription exit helpers", () => {
it("peeks chat unlock return urls without clearing them", async () => {
peekPendingChatUnlockMock.mockResolvedValue({
reason: "single_message_unlock",
characterId: "character_elio",
characterId: "elio",
displayMessageId: "msg_1",
messageId: "msg_1",
kind: "image",
@@ -160,7 +160,7 @@ describe("subscription exit helpers", () => {
consumePendingChatImageReturnMock.mockResolvedValue(null);
peekPendingChatUnlockMock.mockResolvedValue({
reason: "single_message_unlock",
characterId: "character_elio",
characterId: "elio",
displayMessageId: "msg_1",
messageId: "msg_1",
kind: "image",