@ttt-productions/ttt-core 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/doc-schemas/audit.d.ts +2 -2
- package/dist/doc-schemas/messaging.d.ts +100 -0
- package/dist/doc-schemas/messaging.d.ts.map +1 -1
- package/dist/doc-schemas/messaging.js +19 -0
- package/dist/doc-schemas/messaging.js.map +1 -1
- package/dist/doc-schemas/moderation.d.ts +50 -44
- package/dist/doc-schemas/moderation.d.ts.map +1 -1
- package/dist/doc-schemas/moderation.js +13 -6
- package/dist/doc-schemas/moderation.js.map +1 -1
- package/dist/doc-schemas/notifications.d.ts +154 -4
- package/dist/doc-schemas/notifications.d.ts.map +1 -1
- package/dist/doc-schemas/notifications.js +37 -0
- package/dist/doc-schemas/notifications.js.map +1 -1
- package/dist/doc-schemas/operational.d.ts +82 -0
- package/dist/doc-schemas/operational.d.ts.map +1 -1
- package/dist/doc-schemas/operational.js +30 -0
- package/dist/doc-schemas/operational.js.map +1 -1
- package/dist/doc-schemas/registry.d.ts +697 -66
- package/dist/doc-schemas/registry.d.ts.map +1 -1
- package/dist/doc-schemas/registry.js +35 -36
- package/dist/doc-schemas/registry.js.map +1 -1
- package/dist/doc-schemas/report-docs.d.ts +91 -0
- package/dist/doc-schemas/report-docs.d.ts.map +1 -1
- package/dist/doc-schemas/report-docs.js +22 -0
- package/dist/doc-schemas/report-docs.js.map +1 -1
- package/dist/doc-schemas/social.d.ts +56 -0
- package/dist/doc-schemas/social.d.ts.map +1 -1
- package/dist/doc-schemas/social.js +24 -0
- package/dist/doc-schemas/social.js.map +1 -1
- package/dist/doc-schemas/system.d.ts +25 -0
- package/dist/doc-schemas/system.d.ts.map +1 -1
- package/dist/doc-schemas/system.js +13 -0
- package/dist/doc-schemas/system.js.map +1 -1
- package/dist/media/target-info.d.ts +12 -12
- package/dist/paths/collections.d.ts +1 -1
- package/dist/paths/collections.d.ts.map +1 -1
- package/dist/paths/collections.js +2 -1
- package/dist/paths/collections.js.map +1 -1
- package/dist/paths/path-builders.d.ts +0 -1
- package/dist/paths/path-builders.d.ts.map +1 -1
- package/dist/paths/path-builders.js +0 -1
- package/dist/paths/path-builders.js.map +1 -1
- package/dist/schemas/chat.d.ts +29 -29
- package/package.json +1 -1
|
@@ -53,6 +53,7 @@ export declare const TTTAuditEventSchema: z.ZodObject<{
|
|
|
53
53
|
type: string;
|
|
54
54
|
id: string;
|
|
55
55
|
result: "success" | "failure";
|
|
56
|
+
metadata: Record<string, unknown>;
|
|
56
57
|
timestamp: number;
|
|
57
58
|
schemaVersion: number;
|
|
58
59
|
actor: {
|
|
@@ -72,13 +73,13 @@ export declare const TTTAuditEventSchema: z.ZodObject<{
|
|
|
72
73
|
ip: string | null;
|
|
73
74
|
userAgent: string | null;
|
|
74
75
|
region: string | null;
|
|
75
|
-
metadata: Record<string, unknown>;
|
|
76
76
|
failureReason: string | null;
|
|
77
77
|
correlationId: string | null;
|
|
78
78
|
}, {
|
|
79
79
|
type: string;
|
|
80
80
|
id: string;
|
|
81
81
|
result: "success" | "failure";
|
|
82
|
+
metadata: Record<string, unknown>;
|
|
82
83
|
timestamp: number;
|
|
83
84
|
schemaVersion: number;
|
|
84
85
|
actor: {
|
|
@@ -98,7 +99,6 @@ export declare const TTTAuditEventSchema: z.ZodObject<{
|
|
|
98
99
|
ip: string | null;
|
|
99
100
|
userAgent: string | null;
|
|
100
101
|
region: string | null;
|
|
101
|
-
metadata: Record<string, unknown>;
|
|
102
102
|
failureReason: string | null;
|
|
103
103
|
correlationId: string | null;
|
|
104
104
|
}>;
|
|
@@ -359,4 +359,104 @@ export declare const AdminDispatchSchema: z.ZodObject<{
|
|
|
359
359
|
closedBy?: string | undefined;
|
|
360
360
|
}>;
|
|
361
361
|
export type AdminDispatch = z.infer<typeof AdminDispatchSchema>;
|
|
362
|
+
export declare const ChatMessageV1Schema: z.ZodObject<{
|
|
363
|
+
senderId: z.ZodString;
|
|
364
|
+
text: z.ZodString;
|
|
365
|
+
createdAt: z.ZodNumber;
|
|
366
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
367
|
+
threadId: z.ZodOptional<z.ZodString>;
|
|
368
|
+
type: z.ZodOptional<z.ZodString>;
|
|
369
|
+
attachment: z.ZodOptional<z.ZodObject<{
|
|
370
|
+
id: z.ZodString;
|
|
371
|
+
name: z.ZodString;
|
|
372
|
+
type: z.ZodEnum<["image", "video", "audio", "text"]>;
|
|
373
|
+
size: z.ZodNumber;
|
|
374
|
+
url: z.ZodOptional<z.ZodString>;
|
|
375
|
+
storagePath: z.ZodString;
|
|
376
|
+
status: z.ZodOptional<z.ZodEnum<["pending", "ready", "failed"]>>;
|
|
377
|
+
failureReason: z.ZodOptional<z.ZodString>;
|
|
378
|
+
}, "strict", z.ZodTypeAny, {
|
|
379
|
+
type: "image" | "video" | "audio" | "text";
|
|
380
|
+
id: string;
|
|
381
|
+
name: string;
|
|
382
|
+
size: number;
|
|
383
|
+
storagePath: string;
|
|
384
|
+
status?: "pending" | "ready" | "failed" | undefined;
|
|
385
|
+
url?: string | undefined;
|
|
386
|
+
failureReason?: string | undefined;
|
|
387
|
+
}, {
|
|
388
|
+
type: "image" | "video" | "audio" | "text";
|
|
389
|
+
id: string;
|
|
390
|
+
name: string;
|
|
391
|
+
size: number;
|
|
392
|
+
storagePath: string;
|
|
393
|
+
status?: "pending" | "ready" | "failed" | undefined;
|
|
394
|
+
url?: string | undefined;
|
|
395
|
+
failureReason?: string | undefined;
|
|
396
|
+
}>>;
|
|
397
|
+
replyTo: z.ZodOptional<z.ZodObject<{
|
|
398
|
+
messageId: z.ZodString;
|
|
399
|
+
senderId: z.ZodString;
|
|
400
|
+
messagePreview: z.ZodString;
|
|
401
|
+
}, "strict", z.ZodTypeAny, {
|
|
402
|
+
messageId: string;
|
|
403
|
+
senderId: string;
|
|
404
|
+
messagePreview: string;
|
|
405
|
+
}, {
|
|
406
|
+
messageId: string;
|
|
407
|
+
senderId: string;
|
|
408
|
+
messagePreview: string;
|
|
409
|
+
}>>;
|
|
410
|
+
isSystemMessage: z.ZodOptional<z.ZodBoolean>;
|
|
411
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
412
|
+
}, "strip", z.ZodTypeAny, {
|
|
413
|
+
createdAt: number;
|
|
414
|
+
text: string;
|
|
415
|
+
senderId: string;
|
|
416
|
+
type?: string | undefined;
|
|
417
|
+
messageId?: string | undefined;
|
|
418
|
+
threadId?: string | undefined;
|
|
419
|
+
attachment?: {
|
|
420
|
+
type: "image" | "video" | "audio" | "text";
|
|
421
|
+
id: string;
|
|
422
|
+
name: string;
|
|
423
|
+
size: number;
|
|
424
|
+
storagePath: string;
|
|
425
|
+
status?: "pending" | "ready" | "failed" | undefined;
|
|
426
|
+
url?: string | undefined;
|
|
427
|
+
failureReason?: string | undefined;
|
|
428
|
+
} | undefined;
|
|
429
|
+
replyTo?: {
|
|
430
|
+
messageId: string;
|
|
431
|
+
senderId: string;
|
|
432
|
+
messagePreview: string;
|
|
433
|
+
} | undefined;
|
|
434
|
+
isSystemMessage?: boolean | undefined;
|
|
435
|
+
meta?: Record<string, unknown> | undefined;
|
|
436
|
+
}, {
|
|
437
|
+
createdAt: number;
|
|
438
|
+
text: string;
|
|
439
|
+
senderId: string;
|
|
440
|
+
type?: string | undefined;
|
|
441
|
+
messageId?: string | undefined;
|
|
442
|
+
threadId?: string | undefined;
|
|
443
|
+
attachment?: {
|
|
444
|
+
type: "image" | "video" | "audio" | "text";
|
|
445
|
+
id: string;
|
|
446
|
+
name: string;
|
|
447
|
+
size: number;
|
|
448
|
+
storagePath: string;
|
|
449
|
+
status?: "pending" | "ready" | "failed" | undefined;
|
|
450
|
+
url?: string | undefined;
|
|
451
|
+
failureReason?: string | undefined;
|
|
452
|
+
} | undefined;
|
|
453
|
+
replyTo?: {
|
|
454
|
+
messageId: string;
|
|
455
|
+
senderId: string;
|
|
456
|
+
messagePreview: string;
|
|
457
|
+
} | undefined;
|
|
458
|
+
isSystemMessage?: boolean | undefined;
|
|
459
|
+
meta?: Record<string, unknown> | undefined;
|
|
460
|
+
}>;
|
|
461
|
+
export type ChatMessageV1Doc = z.infer<typeof ChatMessageV1Schema>;
|
|
362
462
|
//# sourceMappingURL=messaging.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/messaging.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/messaging.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAejC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAQhE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW9B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// live in @ttt-productions/chat-core (ChatMessageV1); ttt-core owns the thread docs.
|
|
4
4
|
// Types inferred via z.infer.
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
+
import { ReplyToSchema, ChatAttachmentSchema } from '@ttt-productions/chat-schemas';
|
|
6
7
|
import { InviteSourceSchema } from '../schemas/work-project-management.js';
|
|
7
8
|
const userRefSchema = z.object({ uid: z.string() });
|
|
8
9
|
export const GuildChatChannelSchema = z.object({
|
|
@@ -59,4 +60,22 @@ export const AdminDispatchSchema = z.object({
|
|
|
59
60
|
readByUser: z.boolean(),
|
|
60
61
|
closedBy: z.string().optional(),
|
|
61
62
|
});
|
|
63
|
+
// Per-message body stored in the three chat collections — guildChatMessages, conversationMessages,
|
|
64
|
+
// and inviteMessages. All three are written by ONE path (runSendGuildChatMessage: senderId/text/
|
|
65
|
+
// createdAt + optional replyTo/attachment); the admin-dispatch INITIAL message
|
|
66
|
+
// (runStartAdminSupportThread) additionally stores `messageId`. This is the STORED shape — a relaxed
|
|
67
|
+
// @ttt-productions/chat-core ChatMessageV1: `messageId` is the doc id (only sometimes persisted) and
|
|
68
|
+
// `threadId` is not stored. Reuses the chat-schemas Zod shapes for attachment + replyTo.
|
|
69
|
+
export const ChatMessageV1Schema = z.object({
|
|
70
|
+
senderId: z.string(),
|
|
71
|
+
text: z.string(),
|
|
72
|
+
createdAt: z.number(),
|
|
73
|
+
messageId: z.string().optional(),
|
|
74
|
+
threadId: z.string().optional(),
|
|
75
|
+
type: z.string().optional(),
|
|
76
|
+
attachment: ChatAttachmentSchema.optional(),
|
|
77
|
+
replyTo: ReplyToSchema.optional(),
|
|
78
|
+
isSystemMessage: z.boolean().optional(),
|
|
79
|
+
meta: z.record(z.string(), z.unknown()).optional(),
|
|
80
|
+
});
|
|
62
81
|
//# sourceMappingURL=messaging.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../src/doc-schemas/messaging.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,sFAAsF;AACtF,qFAAqF;AACrF,8BAA8B;AAE9B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC3C,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACnC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,iFAAiF;IACjF,2EAA2E;IAC3E,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,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G;AACjG,+EAA+E;AAC/E,qGAAqG;AACrG,qGAAqG;AACrG,yFAAyF;AACzF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,UAAU,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC3C,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE;IACjC,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC"}
|
|
@@ -4,9 +4,13 @@ export declare const ContentViolationSchema: z.ZodObject<{
|
|
|
4
4
|
userId: z.ZodString;
|
|
5
5
|
fileType: z.ZodString;
|
|
6
6
|
violationType: z.ZodOptional<z.ZodEnum<["text", "media"]>>;
|
|
7
|
-
originalFileName: z.ZodString;
|
|
8
7
|
reason: z.ZodString;
|
|
9
|
-
|
|
8
|
+
timestamp: z.ZodNumber;
|
|
9
|
+
appealStatus: z.ZodEnum<["none", "pending", "approved", "denied"]>;
|
|
10
|
+
flaggedWords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
11
|
+
originalText: z.ZodOptional<z.ZodString>;
|
|
12
|
+
originalFileName: z.ZodOptional<z.ZodString>;
|
|
13
|
+
scores: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
10
14
|
adult: z.ZodString;
|
|
11
15
|
violence: z.ZodString;
|
|
12
16
|
racy: z.ZodString;
|
|
@@ -18,18 +22,10 @@ export declare const ContentViolationSchema: z.ZodObject<{
|
|
|
18
22
|
adult: string;
|
|
19
23
|
violence: string;
|
|
20
24
|
racy: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
rejectedFilePath: z.ZodString;
|
|
25
|
+
}>>>;
|
|
26
|
+
rejectedFilePath: z.ZodOptional<z.ZodString>;
|
|
24
27
|
rejectedFileUrl: z.ZodOptional<z.ZodString>;
|
|
25
|
-
|
|
26
|
-
appealMessage: z.ZodOptional<z.ZodString>;
|
|
27
|
-
appealedAt: z.ZodOptional<z.ZodNumber>;
|
|
28
|
-
reviewedBy: z.ZodOptional<z.ZodString>;
|
|
29
|
-
reviewedAt: z.ZodOptional<z.ZodNumber>;
|
|
30
|
-
reviewDecision: z.ZodOptional<z.ZodEnum<["approved", "denied"]>>;
|
|
31
|
-
reviewNotes: z.ZodOptional<z.ZodString>;
|
|
32
|
-
pendingFile: z.ZodObject<{
|
|
28
|
+
pendingFile: z.ZodOptional<z.ZodObject<{
|
|
33
29
|
status: z.ZodOptional<z.ZodLiteral<"pending">>;
|
|
34
30
|
id: z.ZodOptional<z.ZodString>;
|
|
35
31
|
userId: z.ZodOptional<z.ZodString>;
|
|
@@ -92,22 +88,35 @@ export declare const ContentViolationSchema: z.ZodObject<{
|
|
|
92
88
|
} | undefined;
|
|
93
89
|
processingStartedAt?: number | undefined;
|
|
94
90
|
terminalAt?: number | undefined;
|
|
95
|
-
}
|
|
91
|
+
}>>;
|
|
92
|
+
appealMessage: z.ZodOptional<z.ZodString>;
|
|
93
|
+
appealedAt: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
reviewedBy: z.ZodOptional<z.ZodString>;
|
|
95
|
+
reviewedAt: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
reviewDecision: z.ZodOptional<z.ZodEnum<["approved", "denied"]>>;
|
|
97
|
+
reviewNotes: z.ZodOptional<z.ZodString>;
|
|
96
98
|
}, "strip", z.ZodTypeAny, {
|
|
97
99
|
userId: string;
|
|
98
100
|
id: string;
|
|
99
|
-
|
|
101
|
+
fileType: string;
|
|
100
102
|
reason: string;
|
|
101
103
|
timestamp: number;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
appealStatus: "pending" | "approved" | "none" | "denied";
|
|
105
|
+
reviewedAt?: number | undefined;
|
|
106
|
+
reviewedBy?: string | undefined;
|
|
107
|
+
originalFileName?: string | undefined;
|
|
108
|
+
appealMessage?: string | undefined;
|
|
109
|
+
rejectedFilePath?: string | undefined;
|
|
110
|
+
violationType?: "text" | "media" | undefined;
|
|
111
|
+
flaggedWords?: string[] | undefined;
|
|
112
|
+
originalText?: string | undefined;
|
|
113
|
+
scores?: {
|
|
104
114
|
adult: string;
|
|
105
115
|
violence: string;
|
|
106
116
|
racy: string;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
pendingFile: {
|
|
117
|
+
} | null | undefined;
|
|
118
|
+
rejectedFileUrl?: string | undefined;
|
|
119
|
+
pendingFile?: {
|
|
111
120
|
status?: "pending" | undefined;
|
|
112
121
|
userId?: string | undefined;
|
|
113
122
|
id?: string | undefined;
|
|
@@ -126,30 +135,32 @@ export declare const ContentViolationSchema: z.ZodObject<{
|
|
|
126
135
|
} | undefined;
|
|
127
136
|
processingStartedAt?: number | undefined;
|
|
128
137
|
terminalAt?: number | undefined;
|
|
129
|
-
};
|
|
130
|
-
reviewedAt?: number | undefined;
|
|
131
|
-
reviewedBy?: string | undefined;
|
|
132
|
-
violationType?: "text" | "media" | undefined;
|
|
133
|
-
rejectedFileUrl?: string | undefined;
|
|
134
|
-
appealMessage?: string | undefined;
|
|
138
|
+
} | undefined;
|
|
135
139
|
appealedAt?: number | undefined;
|
|
136
140
|
reviewDecision?: "approved" | "denied" | undefined;
|
|
137
141
|
reviewNotes?: string | undefined;
|
|
138
142
|
}, {
|
|
139
143
|
userId: string;
|
|
140
144
|
id: string;
|
|
141
|
-
|
|
145
|
+
fileType: string;
|
|
142
146
|
reason: string;
|
|
143
147
|
timestamp: number;
|
|
144
|
-
|
|
145
|
-
|
|
148
|
+
appealStatus: "pending" | "approved" | "none" | "denied";
|
|
149
|
+
reviewedAt?: number | undefined;
|
|
150
|
+
reviewedBy?: string | undefined;
|
|
151
|
+
originalFileName?: string | undefined;
|
|
152
|
+
appealMessage?: string | undefined;
|
|
153
|
+
rejectedFilePath?: string | undefined;
|
|
154
|
+
violationType?: "text" | "media" | undefined;
|
|
155
|
+
flaggedWords?: string[] | undefined;
|
|
156
|
+
originalText?: string | undefined;
|
|
157
|
+
scores?: {
|
|
146
158
|
adult: string;
|
|
147
159
|
violence: string;
|
|
148
160
|
racy: string;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
pendingFile: {
|
|
161
|
+
} | null | undefined;
|
|
162
|
+
rejectedFileUrl?: string | undefined;
|
|
163
|
+
pendingFile?: {
|
|
153
164
|
status?: "pending" | undefined;
|
|
154
165
|
userId?: string | undefined;
|
|
155
166
|
id?: string | undefined;
|
|
@@ -168,12 +179,7 @@ export declare const ContentViolationSchema: z.ZodObject<{
|
|
|
168
179
|
} | undefined;
|
|
169
180
|
processingStartedAt?: number | undefined;
|
|
170
181
|
terminalAt?: number | undefined;
|
|
171
|
-
};
|
|
172
|
-
reviewedAt?: number | undefined;
|
|
173
|
-
reviewedBy?: string | undefined;
|
|
174
|
-
violationType?: "text" | "media" | undefined;
|
|
175
|
-
rejectedFileUrl?: string | undefined;
|
|
176
|
-
appealMessage?: string | undefined;
|
|
182
|
+
} | undefined;
|
|
177
183
|
appealedAt?: number | undefined;
|
|
178
184
|
reviewDecision?: "approved" | "denied" | undefined;
|
|
179
185
|
reviewNotes?: string | undefined;
|
|
@@ -233,9 +239,9 @@ export declare const ContentAppealTaskSchema: z.ZodObject<{
|
|
|
233
239
|
summary: string;
|
|
234
240
|
priority: number;
|
|
235
241
|
fileType: string;
|
|
236
|
-
rejectedFilePath: string;
|
|
237
|
-
appealMessage: string;
|
|
238
242
|
rejectionReason: string;
|
|
243
|
+
appealMessage: string;
|
|
244
|
+
rejectedFilePath: string;
|
|
239
245
|
completedAt?: number | undefined;
|
|
240
246
|
itemData?: unknown;
|
|
241
247
|
}, {
|
|
@@ -257,9 +263,9 @@ export declare const ContentAppealTaskSchema: z.ZodObject<{
|
|
|
257
263
|
summary: string;
|
|
258
264
|
priority: number;
|
|
259
265
|
fileType: string;
|
|
260
|
-
rejectedFilePath: string;
|
|
261
|
-
appealMessage: string;
|
|
262
266
|
rejectionReason: string;
|
|
267
|
+
appealMessage: string;
|
|
268
|
+
rejectedFilePath: string;
|
|
263
269
|
completedAt?: number | undefined;
|
|
264
270
|
itemData?: unknown;
|
|
265
271
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moderation.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/moderation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"moderation.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/moderation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAItE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,6BAA6B,0CAAwC,CAAC;AACnF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,6BAA6B,8CAA4C,CAAC;AACvF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,wCAAwC,0EAKnD,CAAC;AACH,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC;AAE1G,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;EAQ5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC"}
|
|
@@ -9,24 +9,31 @@ export const ContentViolationSchema = z.object({
|
|
|
9
9
|
userId: z.string(),
|
|
10
10
|
fileType: z.string(),
|
|
11
11
|
violationType: z.enum(['text', 'media']).optional(),
|
|
12
|
-
originalFileName: z.string(),
|
|
13
12
|
reason: z.string(),
|
|
13
|
+
timestamp: z.number(),
|
|
14
|
+
appealStatus: z.enum(['none', 'pending', 'approved', 'denied']),
|
|
15
|
+
// Text violations (moderateTextOrThrow / media-result-handler 'text_rejected') write these and
|
|
16
|
+
// omit the media-only fields below; media violations (logContentViolation) do the reverse.
|
|
17
|
+
flaggedWords: z.array(z.string()).optional(),
|
|
18
|
+
originalText: z.string().optional(),
|
|
19
|
+
// Media-only fields. Optional because text violations omit them, and `scores` is nullable
|
|
20
|
+
// because moderateTextOrThrow writes `scores: result.scores ?? null`.
|
|
21
|
+
originalFileName: z.string().optional(),
|
|
14
22
|
scores: z.object({
|
|
15
23
|
adult: z.string(),
|
|
16
24
|
violence: z.string(),
|
|
17
25
|
racy: z.string(),
|
|
18
|
-
}),
|
|
19
|
-
|
|
20
|
-
rejectedFilePath: z.string(),
|
|
26
|
+
}).nullable().optional(),
|
|
27
|
+
rejectedFilePath: z.string().optional(),
|
|
21
28
|
rejectedFileUrl: z.string().optional(),
|
|
22
|
-
|
|
29
|
+
pendingFile: PendingMediaPendingSchema.partial().optional(),
|
|
30
|
+
// Appeal lifecycle (submitContentAppeal / reviewContentAppeal).
|
|
23
31
|
appealMessage: z.string().optional(),
|
|
24
32
|
appealedAt: z.number().optional(),
|
|
25
33
|
reviewedBy: z.string().optional(),
|
|
26
34
|
reviewedAt: z.number().optional(),
|
|
27
35
|
reviewDecision: z.enum(['approved', 'denied']).optional(),
|
|
28
36
|
reviewNotes: z.string().optional(),
|
|
29
|
-
pendingFile: PendingMediaPendingSchema.partial(),
|
|
30
37
|
});
|
|
31
38
|
// content-appeal admin task: the generic AdminTask specialized to 'content-appeal' plus
|
|
32
39
|
// the appeal-specific denormalized fields used by the admin review view.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moderation.js","sourceRoot":"","sources":["../../src/doc-schemas/moderation.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,+EAA+E;AAC/E,8BAA8B;AAE9B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7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AAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC"}
|
|
@@ -22,8 +22,8 @@ export declare const NotificationDocSchema: z.ZodObject<{
|
|
|
22
22
|
createdAt: number;
|
|
23
23
|
updatedAt: number;
|
|
24
24
|
metadata: Record<string, unknown>;
|
|
25
|
-
dedupKey: string;
|
|
26
25
|
category: string;
|
|
26
|
+
dedupKey: string;
|
|
27
27
|
targetUserId: string | null;
|
|
28
28
|
count: number;
|
|
29
29
|
latestActorIds: string[];
|
|
@@ -37,8 +37,8 @@ export declare const NotificationDocSchema: z.ZodObject<{
|
|
|
37
37
|
createdAt: number;
|
|
38
38
|
updatedAt: number;
|
|
39
39
|
metadata: Record<string, unknown>;
|
|
40
|
-
dedupKey: string;
|
|
41
40
|
category: string;
|
|
41
|
+
dedupKey: string;
|
|
42
42
|
targetUserId: string | null;
|
|
43
43
|
count: number;
|
|
44
44
|
latestActorIds: string[];
|
|
@@ -91,8 +91,8 @@ export declare const NotificationHistoryDocSchema: z.ZodObject<{
|
|
|
91
91
|
createdAt: number;
|
|
92
92
|
updatedAt: number;
|
|
93
93
|
metadata: Record<string, unknown>;
|
|
94
|
-
dedupKey: string;
|
|
95
94
|
category: string;
|
|
95
|
+
dedupKey: string;
|
|
96
96
|
targetUserId: string | null;
|
|
97
97
|
count: number;
|
|
98
98
|
latestActorIds: string[];
|
|
@@ -112,8 +112,8 @@ export declare const NotificationHistoryDocSchema: z.ZodObject<{
|
|
|
112
112
|
createdAt: number;
|
|
113
113
|
updatedAt: number;
|
|
114
114
|
metadata: Record<string, unknown>;
|
|
115
|
-
dedupKey: string;
|
|
116
115
|
category: string;
|
|
116
|
+
dedupKey: string;
|
|
117
117
|
targetUserId: string | null;
|
|
118
118
|
count: number;
|
|
119
119
|
latestActorIds: string[];
|
|
@@ -151,4 +151,154 @@ export declare const PendingNotificationSchema: z.ZodObject<{
|
|
|
151
151
|
targetUserId: string | null;
|
|
152
152
|
actorId: string;
|
|
153
153
|
}>;
|
|
154
|
+
export declare const FollowerReleaseJobSchema: z.ZodObject<{
|
|
155
|
+
jobId: z.ZodString;
|
|
156
|
+
workProjectId: z.ZodString;
|
|
157
|
+
workTitle: z.ZodString;
|
|
158
|
+
hallItemId: z.ZodString;
|
|
159
|
+
hallItemTitle: z.ZodString;
|
|
160
|
+
hallSubItemType: z.ZodEnum<["chapter", "track", "episode"]>;
|
|
161
|
+
stewardUid: z.ZodString;
|
|
162
|
+
canonRealmId: z.ZodNullable<z.ZodString>;
|
|
163
|
+
status: z.ZodEnum<["pending", "complete", "failed"]>;
|
|
164
|
+
phase: z.ZodEnum<["work", "realm"]>;
|
|
165
|
+
cursor: z.ZodNullable<z.ZodString>;
|
|
166
|
+
totalSent: z.ZodNumber;
|
|
167
|
+
createdAt: z.ZodNumber;
|
|
168
|
+
updatedAt: z.ZodNumber;
|
|
169
|
+
}, "strip", z.ZodTypeAny, {
|
|
170
|
+
status: "pending" | "failed" | "complete";
|
|
171
|
+
hallItemId: string;
|
|
172
|
+
workProjectId: string;
|
|
173
|
+
createdAt: number;
|
|
174
|
+
updatedAt: number;
|
|
175
|
+
workTitle: string;
|
|
176
|
+
hallItemTitle: string;
|
|
177
|
+
hallSubItemType: "chapter" | "track" | "episode";
|
|
178
|
+
jobId: string;
|
|
179
|
+
stewardUid: string;
|
|
180
|
+
canonRealmId: string | null;
|
|
181
|
+
phase: "work" | "realm";
|
|
182
|
+
cursor: string | null;
|
|
183
|
+
totalSent: number;
|
|
184
|
+
}, {
|
|
185
|
+
status: "pending" | "failed" | "complete";
|
|
186
|
+
hallItemId: string;
|
|
187
|
+
workProjectId: string;
|
|
188
|
+
createdAt: number;
|
|
189
|
+
updatedAt: number;
|
|
190
|
+
workTitle: string;
|
|
191
|
+
hallItemTitle: string;
|
|
192
|
+
hallSubItemType: "chapter" | "track" | "episode";
|
|
193
|
+
jobId: string;
|
|
194
|
+
stewardUid: string;
|
|
195
|
+
canonRealmId: string | null;
|
|
196
|
+
phase: "work" | "realm";
|
|
197
|
+
cursor: string | null;
|
|
198
|
+
totalSent: number;
|
|
199
|
+
}>;
|
|
200
|
+
export type FollowerReleaseJob = z.infer<typeof FollowerReleaseJobSchema>;
|
|
201
|
+
export declare const NotificationBroadcastJobSchema: z.ZodObject<{
|
|
202
|
+
jobId: z.ZodString;
|
|
203
|
+
selector: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
204
|
+
kind: z.ZodLiteral<"allActiveUsers">;
|
|
205
|
+
}, "strict", z.ZodTypeAny, {
|
|
206
|
+
kind: "allActiveUsers";
|
|
207
|
+
}, {
|
|
208
|
+
kind: "allActiveUsers";
|
|
209
|
+
}>, z.ZodObject<{
|
|
210
|
+
kind: z.ZodLiteral<"explicitUids">;
|
|
211
|
+
uids: z.ZodArray<z.ZodString, "many">;
|
|
212
|
+
}, "strict", z.ZodTypeAny, {
|
|
213
|
+
kind: "explicitUids";
|
|
214
|
+
uids: string[];
|
|
215
|
+
}, {
|
|
216
|
+
kind: "explicitUids";
|
|
217
|
+
uids: string[];
|
|
218
|
+
}>, z.ZodObject<{
|
|
219
|
+
kind: z.ZodLiteral<"workMembers">;
|
|
220
|
+
workProjectId: z.ZodString;
|
|
221
|
+
}, "strict", z.ZodTypeAny, {
|
|
222
|
+
workProjectId: string;
|
|
223
|
+
kind: "workMembers";
|
|
224
|
+
}, {
|
|
225
|
+
workProjectId: string;
|
|
226
|
+
kind: "workMembers";
|
|
227
|
+
}>, z.ZodObject<{
|
|
228
|
+
kind: z.ZodLiteral<"realmMembers">;
|
|
229
|
+
workRealmId: z.ZodString;
|
|
230
|
+
}, "strict", z.ZodTypeAny, {
|
|
231
|
+
workRealmId: string;
|
|
232
|
+
kind: "realmMembers";
|
|
233
|
+
}, {
|
|
234
|
+
workRealmId: string;
|
|
235
|
+
kind: "realmMembers";
|
|
236
|
+
}>, z.ZodObject<{
|
|
237
|
+
kind: z.ZodLiteral<"allArtisans">;
|
|
238
|
+
}, "strict", z.ZodTypeAny, {
|
|
239
|
+
kind: "allArtisans";
|
|
240
|
+
}, {
|
|
241
|
+
kind: "allArtisans";
|
|
242
|
+
}>]>;
|
|
243
|
+
title: z.ZodString;
|
|
244
|
+
message: z.ZodString;
|
|
245
|
+
actorUid: z.ZodString;
|
|
246
|
+
actorSystemRole: z.ZodOptional<z.ZodString>;
|
|
247
|
+
status: z.ZodEnum<["pending", "complete", "failed"]>;
|
|
248
|
+
cursor: z.ZodNullable<z.ZodString>;
|
|
249
|
+
totalSent: z.ZodNumber;
|
|
250
|
+
createdAt: z.ZodNumber;
|
|
251
|
+
updatedAt: z.ZodNumber;
|
|
252
|
+
}, "strip", z.ZodTypeAny, {
|
|
253
|
+
message: string;
|
|
254
|
+
status: "pending" | "failed" | "complete";
|
|
255
|
+
title: string;
|
|
256
|
+
createdAt: number;
|
|
257
|
+
actorUid: string;
|
|
258
|
+
updatedAt: number;
|
|
259
|
+
selector: {
|
|
260
|
+
kind: "allActiveUsers";
|
|
261
|
+
} | {
|
|
262
|
+
kind: "explicitUids";
|
|
263
|
+
uids: string[];
|
|
264
|
+
} | {
|
|
265
|
+
workProjectId: string;
|
|
266
|
+
kind: "workMembers";
|
|
267
|
+
} | {
|
|
268
|
+
workRealmId: string;
|
|
269
|
+
kind: "realmMembers";
|
|
270
|
+
} | {
|
|
271
|
+
kind: "allArtisans";
|
|
272
|
+
};
|
|
273
|
+
jobId: string;
|
|
274
|
+
cursor: string | null;
|
|
275
|
+
totalSent: number;
|
|
276
|
+
actorSystemRole?: string | undefined;
|
|
277
|
+
}, {
|
|
278
|
+
message: string;
|
|
279
|
+
status: "pending" | "failed" | "complete";
|
|
280
|
+
title: string;
|
|
281
|
+
createdAt: number;
|
|
282
|
+
actorUid: string;
|
|
283
|
+
updatedAt: number;
|
|
284
|
+
selector: {
|
|
285
|
+
kind: "allActiveUsers";
|
|
286
|
+
} | {
|
|
287
|
+
kind: "explicitUids";
|
|
288
|
+
uids: string[];
|
|
289
|
+
} | {
|
|
290
|
+
workProjectId: string;
|
|
291
|
+
kind: "workMembers";
|
|
292
|
+
} | {
|
|
293
|
+
workRealmId: string;
|
|
294
|
+
kind: "realmMembers";
|
|
295
|
+
} | {
|
|
296
|
+
kind: "allArtisans";
|
|
297
|
+
};
|
|
298
|
+
jobId: string;
|
|
299
|
+
cursor: string | null;
|
|
300
|
+
totalSent: number;
|
|
301
|
+
actorSystemRole?: string | undefined;
|
|
302
|
+
}>;
|
|
303
|
+
export type NotificationBroadcastJob = z.infer<typeof NotificationBroadcastJobSchema>;
|
|
154
304
|
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/notifications.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/notifications.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAehC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;EAG7B,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIvC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;EAQpC,CAAC;AAKH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAenC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAK1E,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAazC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// Canonical TYPES live in @ttt-productions/notification-core; parity is asserted in
|
|
6
6
|
// parity.test.ts so these schemas cannot silently drift from the package types.
|
|
7
7
|
import { z } from 'zod';
|
|
8
|
+
import { BroadcastAudienceSelectorSchema } from '../schemas/notification.js';
|
|
8
9
|
export const NotificationDocSchema = z.object({
|
|
9
10
|
id: z.string(),
|
|
10
11
|
type: z.string(),
|
|
@@ -39,4 +40,40 @@ export const PendingNotificationSchema = z.object({
|
|
|
39
40
|
metadata: z.record(z.string(), z.unknown()),
|
|
40
41
|
createdAt: z.number(),
|
|
41
42
|
});
|
|
43
|
+
// followerReleaseJobs/{jobId} — Cloud-Functions-only fan-out job: enqueueFollowerReleaseJob (post
|
|
44
|
+
// Hall-publish) → processFollowerReleaseJobs drains Work followers, then canon-Realm followers.
|
|
45
|
+
// (functions/src/notifications/followerReleaseJobs.ts)
|
|
46
|
+
export const FollowerReleaseJobSchema = z.object({
|
|
47
|
+
jobId: z.string(),
|
|
48
|
+
workProjectId: z.string(),
|
|
49
|
+
workTitle: z.string(),
|
|
50
|
+
hallItemId: z.string(),
|
|
51
|
+
hallItemTitle: z.string(),
|
|
52
|
+
hallSubItemType: z.enum(['chapter', 'track', 'episode']),
|
|
53
|
+
stewardUid: z.string(),
|
|
54
|
+
canonRealmId: z.string().nullable(),
|
|
55
|
+
status: z.enum(['pending', 'complete', 'failed']),
|
|
56
|
+
phase: z.enum(['work', 'realm']),
|
|
57
|
+
cursor: z.string().nullable(),
|
|
58
|
+
totalSent: z.number(),
|
|
59
|
+
createdAt: z.number(),
|
|
60
|
+
updatedAt: z.number(),
|
|
61
|
+
});
|
|
62
|
+
// notificationBroadcastJobs/{jobId} — Cloud-Functions-only admin-broadcast fan-out job:
|
|
63
|
+
// createNotificationBroadcast stores the audience selector (never a resolved uid list);
|
|
64
|
+
// processNotificationBroadcastJobs drains it. (functions/src/notifications/createNotificationBroadcast.ts)
|
|
65
|
+
export const NotificationBroadcastJobSchema = z.object({
|
|
66
|
+
jobId: z.string(),
|
|
67
|
+
selector: BroadcastAudienceSelectorSchema,
|
|
68
|
+
title: z.string(),
|
|
69
|
+
message: z.string(),
|
|
70
|
+
actorUid: z.string(),
|
|
71
|
+
// ctx.admin (a SystemRole role string); modeled loosely — SystemRole is a ttt-prod-only union.
|
|
72
|
+
actorSystemRole: z.string().optional(),
|
|
73
|
+
status: z.enum(['pending', 'complete', 'failed']),
|
|
74
|
+
cursor: z.string().nullable(),
|
|
75
|
+
totalSent: z.number(),
|
|
76
|
+
createdAt: z.number(),
|
|
77
|
+
updatedAt: z.number(),
|
|
78
|
+
});
|
|
42
79
|
//# sourceMappingURL=notifications.js.map
|