@ttt-productions/ttt-core 0.79.96 → 0.79.98

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.
Files changed (73) hide show
  1. package/dist/doc-schemas/social.d.ts +50 -0
  2. package/dist/doc-schemas/social.d.ts.map +1 -1
  3. package/dist/doc-schemas/social.js +8 -10
  4. package/dist/doc-schemas/social.js.map +1 -1
  5. package/dist/schemas/admin-dispatch-actions.d.ts +24 -0
  6. package/dist/schemas/admin-dispatch-actions.d.ts.map +1 -1
  7. package/dist/schemas/admin-dispatch-actions.js +19 -3
  8. package/dist/schemas/admin-dispatch-actions.js.map +1 -1
  9. package/dist/schemas/admin.d.ts +82 -1
  10. package/dist/schemas/admin.d.ts.map +1 -1
  11. package/dist/schemas/admin.js +91 -35
  12. package/dist/schemas/admin.js.map +1 -1
  13. package/dist/schemas/auditions.d.ts +6 -0
  14. package/dist/schemas/auditions.d.ts.map +1 -1
  15. package/dist/schemas/auditions.js +6 -2
  16. package/dist/schemas/auditions.js.map +1 -1
  17. package/dist/schemas/chat.d.ts +7 -2
  18. package/dist/schemas/chat.d.ts.map +1 -1
  19. package/dist/schemas/chat.js +10 -10
  20. package/dist/schemas/chat.js.map +1 -1
  21. package/dist/schemas/commissions.d.ts +20 -0
  22. package/dist/schemas/commissions.d.ts.map +1 -1
  23. package/dist/schemas/commissions.js +20 -2
  24. package/dist/schemas/commissions.js.map +1 -1
  25. package/dist/schemas/conversation-files.d.ts +5 -0
  26. package/dist/schemas/conversation-files.d.ts.map +1 -1
  27. package/dist/schemas/conversation-files.js +4 -1
  28. package/dist/schemas/conversation-files.js.map +1 -1
  29. package/dist/schemas/hall-library.d.ts +115 -0
  30. package/dist/schemas/hall-library.d.ts.map +1 -1
  31. package/dist/schemas/hall-library.js +91 -2
  32. package/dist/schemas/hall-library.js.map +1 -1
  33. package/dist/schemas/index.d.ts +1 -1
  34. package/dist/schemas/index.d.ts.map +1 -1
  35. package/dist/schemas/index.js +1 -1
  36. package/dist/schemas/index.js.map +1 -1
  37. package/dist/schemas/ncii.d.ts +269 -0
  38. package/dist/schemas/ncii.d.ts.map +1 -1
  39. package/dist/schemas/ncii.js +46 -26
  40. package/dist/schemas/ncii.js.map +1 -1
  41. package/dist/schemas/notification.d.ts +13 -7
  42. package/dist/schemas/notification.d.ts.map +1 -1
  43. package/dist/schemas/notification.js +14 -32
  44. package/dist/schemas/notification.js.map +1 -1
  45. package/dist/schemas/payments.d.ts +33 -0
  46. package/dist/schemas/payments.d.ts.map +1 -1
  47. package/dist/schemas/payments.js +18 -2
  48. package/dist/schemas/payments.js.map +1 -1
  49. package/dist/schemas/safety.d.ts +234 -0
  50. package/dist/schemas/safety.d.ts.map +1 -1
  51. package/dist/schemas/safety.js +79 -43
  52. package/dist/schemas/safety.js.map +1 -1
  53. package/dist/schemas/stake-share-operation.d.ts +5 -0
  54. package/dist/schemas/stake-share-operation.d.ts.map +1 -1
  55. package/dist/schemas/stake-share-operation.js +8 -13
  56. package/dist/schemas/stake-share-operation.js.map +1 -1
  57. package/dist/schemas/uploads.d.ts +27 -0
  58. package/dist/schemas/uploads.d.ts.map +1 -1
  59. package/dist/schemas/uploads.js +19 -0
  60. package/dist/schemas/uploads.js.map +1 -1
  61. package/dist/schemas/users.d.ts +57 -0
  62. package/dist/schemas/users.d.ts.map +1 -1
  63. package/dist/schemas/users.js +47 -7
  64. package/dist/schemas/users.js.map +1 -1
  65. package/dist/schemas/utility.d.ts +40 -2
  66. package/dist/schemas/utility.d.ts.map +1 -1
  67. package/dist/schemas/utility.js +37 -5
  68. package/dist/schemas/utility.js.map +1 -1
  69. package/dist/schemas/work-project-management.d.ts +55 -3
  70. package/dist/schemas/work-project-management.d.ts.map +1 -1
  71. package/dist/schemas/work-project-management.js +56 -20
  72. package/dist/schemas/work-project-management.js.map +1 -1
  73. package/package.json +2 -2
@@ -24,6 +24,11 @@ export const MarkWorkLaterInputSchema = z.object({
24
24
  taskId: taskIdSchema,
25
25
  extendHours: z.union([z.literal(24), z.literal(48)]),
26
26
  }).strict();
27
+ // `alreadyResolved` answers a task already gone: nothing was written.
28
+ export const MarkWorkLaterResultSchema = z.object({
29
+ success: z.literal(true),
30
+ alreadyResolved: z.literal(true).optional(),
31
+ });
27
32
  /** The two appeal-review decisions (ONE canonical declaration — shared by the review
28
33
  * input and its authoritative result). */
29
34
  export const ContentAppealDecisionSchema = z.enum(['approved', 'denied']);
@@ -33,7 +38,7 @@ export const ReviewContentAppealInputSchema = z.object({
33
38
  decision: ContentAppealDecisionSchema,
34
39
  adminNotes: textFieldSchema(APPEAL_REVIEW_NOTES_INPUT),
35
40
  }).strict();
36
- // Authoritative result of reviewContentAppeal. Non-strict (server → client posture).
41
+ // Authoritative result of reviewContentAppeal.
37
42
  export const ReviewContentAppealResultSchema = z.object({
38
43
  success: z.literal(true),
39
44
  violationId: violationIdSchema,
@@ -43,10 +48,9 @@ export const ReviewContentAppealResultSchema = z.object({
43
48
  * underlying violation was already gone and only the stale task was cleared). */
44
49
  userId: z.string(),
45
50
  /** Operation-receipt audit id — the `admin.contentAppealReviewed` event written in the same
46
- * transaction. Optional/additive so an older backend that omits it still type-checks. */
51
+ * transaction. */
47
52
  auditEventId: z.string().min(1).optional(),
48
53
  });
49
- // --- Public-document content inputs ---
50
54
  // The Admin editors' strict CONTENT schemas, one per public document. A working copy is saved
51
55
  // through `SavePublicDocumentDraftInputSchema` (./public-documents.ts), which pairs each
52
56
  // document id with its content schema here; the content is FULL (a version is the whole
@@ -167,25 +171,33 @@ export const UpdateAppConfigInputSchema = z.object({
167
171
  rateLimitMultiplier: z.number().gt(0).max(1).optional(),
168
172
  }).strict().refine((d) => Object.keys(d).length > 0, { message: 'data must have at least one field' }),
169
173
  }).strict();
174
+ export const UpdateAppConfigResultSchema = z.object({
175
+ success: z.literal(true),
176
+ updatedFields: z.array(z.string()),
177
+ });
170
178
  // recordAppModeFlip records the deployed app mode; it never sets it, so the only input is the
171
179
  // admin's optional milestone evidence.
172
180
  export const RecordAppModeFlipInputSchema = z.object({
173
181
  milestoneEvidence: textFieldSchema(APP_MODE_FLIP_EVIDENCE_INPUT).optional(),
174
182
  }).strict();
175
183
  // What recordAppModeFlip answers: whether this call recorded a change (false when the marker
176
- // already matched the deployed mode) and the mode before and after. Server → client: non-strict.
184
+ // already matched the deployed mode) and the mode before and after.
177
185
  export const RecordAppModeFlipResultSchema = z.object({
178
186
  success: z.literal(true),
179
187
  recorded: z.boolean(),
180
188
  mode: AppModeSchema,
181
189
  previousMode: AppModeSchema.nullable(),
182
190
  });
183
- // --- System slots ---
184
191
  // clearSystemVideoSlot empties one video slot; the server refuses while the slot's upload is still
185
192
  // pending or processing.
186
193
  export const ClearSystemVideoSlotInputSchema = z.object({
187
194
  slotId: SystemVideoSlotIdSchema,
188
195
  }).strict();
196
+ export const ClearSystemVideoSlotResultSchema = z.object({
197
+ success: z.literal(true),
198
+ /** False when the slot already held no video, so nothing changed. */
199
+ cleared: z.boolean(),
200
+ });
189
201
  // updateSystemUidSlot sets one account slot: a `uid` slot takes one account id (null clears it), a
190
202
  // `uidList` slot an ordered list (empty clears it). The value's shape must match the slot's kind.
191
203
  export const UpdateSystemUidSlotInputSchema = z.union([
@@ -198,7 +210,11 @@ export const UpdateSystemUidSlotInputSchema = z.union([
198
210
  value: z.array(userIdSchema).max(MAX_SYSTEM_UID_LIST),
199
211
  }).strict(),
200
212
  ]);
201
- // --- Admin list mutations ---
213
+ export const UpdateSystemUidSlotResultSchema = z.object({
214
+ success: z.literal(true),
215
+ /** False when the slot already held this value, so nothing was written. */
216
+ changed: z.boolean(),
217
+ });
202
218
  const uidSchema = z.string().min(1).max(128);
203
219
  /**
204
220
  * Wire input for the `updateAdminList` callable in ttt-prod.
@@ -222,7 +238,6 @@ export const UpdateAdminListInputSchema = z.object({
222
238
  0, { message: 'At least one of addAdmins/removeAdmins/addJrAdmins/removeJrAdmins must be non-empty.' });
223
239
  // Authoritative result of updateAdminList — the grant/revoke delta counts computed inside
224
240
  // the roster transaction (uids already in their target state are no-ops and not counted).
225
- // Non-strict (server → client result posture).
226
241
  export const UpdateAdminListResultSchema = z.object({
227
242
  success: z.literal(true),
228
243
  adminsGranted: z.number().int().nonnegative(),
@@ -230,26 +245,28 @@ export const UpdateAdminListResultSchema = z.object({
230
245
  jrAdminsGranted: z.number().int().nonnegative(),
231
246
  jrAdminsRevoked: z.number().int().nonnegative(),
232
247
  /** Operation-receipt audit id — the `admin.systemRoleGranted` / `admin.systemRoleRevoked`
233
- * event(s) key off the same roster transaction. Optional/additive. (No single domain id: a
248
+ * event(s) key off the same roster transaction. (No single domain id: a
234
249
  * roster edit spans multiple uids, so only the audit id is a meaningful receipt handle.) */
235
250
  auditEventId: z.string().min(1).optional(),
236
251
  });
237
- // --- Admin moderation: hide / restore / retitle content + Work/Realm objects ---
238
252
  export const CheckTrademarkInputSchema = z.object({
239
253
  // Primary: the work project's title (franchise-level check).
240
254
  workTitle: z.string().min(1).max(MAX_WORK_PROJECT_TITLE_LENGTH),
241
- // Optional: the sub-item title (chapter, track, episode). Checked secondarily.
242
- // `.nullish()` (not `.optional()`): the Firebase callable client serializes an
243
- // undefined argument as JSON null, and the work-view caller passes
244
- // `subItemTitle: subItem?.title` which is undefined when the sub-item hasn't
245
- // loaded — that arrives here as null. A bare `.optional()` would 400 on it.
255
+ // Optional: the sub-item title (chapter, track, episode), checked secondarily; null or absent
256
+ // means there is none to check.
246
257
  subItemTitle: z.string().max(MAX_WORK_PROJECT_TITLE_LENGTH).nullish(),
247
258
  }).strict();
259
+ export const CheckTrademarkResultSchema = z.object({
260
+ curatedMatch: z.boolean(),
261
+ matchedEntry: z.string().nullable(),
262
+ advisory: z.string(),
263
+ checkedAt: z.number(),
264
+ });
248
265
  export const GetReportedContentDetailInputSchema = z.object({
249
266
  reportGroupId: reportGroupIdSchema,
250
267
  }).strict();
251
- // --- getReportedContentDetail result (cross-boundary: produced by the callable in functions/,
252
- // consumed by the admin report work-view) ---
268
+ // getReportedContentDetail's result: produced by the callable in functions/, consumed by the admin
269
+ // report work-view.
253
270
  /** One display-text field of the reported doc, labeled for the review panel. The server returns
254
271
  * EVERY configured non-empty text field for the item type (title, description, body, …) in
255
272
  * display order — never just the first non-empty one. */
@@ -304,13 +321,12 @@ export const GetReportedContentDetailResultSchema = z.object({
304
321
  * and have the clear runner silently drop it. The picker offers only this surface's fields, and
305
322
  * the resolve path re-checks caller-supplied fields against the same set.
306
323
  *
307
- * `.nullish()`: absent on payloads produced before this field existed, and null when the
308
- * reported item is not a clearable text surface at all (a square post, a chat message, a
309
- * profile picture).
324
+ * `.nullish()`: null when the reported item is not a clearable text surface at all (a square
325
+ * post, a chat message, a profile picture).
310
326
  */
311
327
  clearableSurface: moderationClearableSurfaceSchema.nullish(),
312
328
  /** The FROZEN report-time snapshot (captured at intake), so the operator sees what was
313
- * reported even if the author edited the live doc to evade. Null for older reports. */
329
+ * reported even if the author edited the live doc to evade. Null when the report holds none. */
314
330
  reportTimeSnapshot: z.object({
315
331
  capturedText: z.string().nullable(),
316
332
  capturedMediaAssetIds: z.array(z.string()),
@@ -324,29 +340,49 @@ export const HideHallSubItemInputSchema = z.object({
324
340
  subItemId: hallSubItemIdSchema,
325
341
  reason: textFieldSchema(HIDE_REASON_INPUT),
326
342
  }).strict();
343
+ export const HideHallSubItemResultSchema = z.object({
344
+ success: z.literal(true),
345
+ });
327
346
  export const RestoreHallSubItemInputSchema = z.object({
328
347
  hallItemId: hallItemIdSchema,
329
348
  workProjectType: workProjectTypeSchema,
330
349
  subItemId: hallSubItemIdSchema,
331
350
  }).strict();
351
+ export const RestoreHallSubItemResultSchema = z.object({
352
+ success: z.literal(true),
353
+ });
332
354
  export const HideWorkProjectInputSchema = z.object({
333
355
  workProjectId: workProjectIdSchema,
334
356
  reason: textFieldSchema(HIDE_REASON_INPUT),
335
357
  }).strict();
358
+ export const HideWorkProjectResultSchema = z.object({
359
+ success: z.literal(true),
360
+ cascadeId: z.string().min(1),
361
+ });
336
362
  export const HideWorkRealmInputSchema = z.object({
337
363
  workRealmId: workRealmIdSchema,
338
364
  reason: textFieldSchema(HIDE_REASON_INPUT),
339
365
  }).strict();
366
+ export const HideWorkRealmResultSchema = z.object({
367
+ success: z.literal(true),
368
+ cascadeId: z.string().min(1),
369
+ });
340
370
  // `cascadeId` is OPTIONAL: the app backends derive all active cascades for the target when it is
341
371
  // omitted, and restore just that one cascade when it is supplied.
342
372
  export const RestoreWorkProjectInputSchema = z.object({
343
373
  workProjectId: workProjectIdSchema,
344
374
  cascadeId: documentIdSegmentSchema.optional(),
345
375
  }).strict();
376
+ export const RestoreWorkProjectResultSchema = z.object({
377
+ success: z.literal(true),
378
+ });
346
379
  export const RestoreWorkRealmInputSchema = z.object({
347
380
  workRealmId: workRealmIdSchema,
348
381
  cascadeId: documentIdSegmentSchema.optional(),
349
382
  }).strict();
383
+ export const RestoreWorkRealmResultSchema = z.object({
384
+ success: z.literal(true),
385
+ });
350
386
  export const RequireWorkProjectRetitleInputSchema = z.object({
351
387
  reason: textFieldSchema(RETITLE_REASON_INPUT),
352
388
  workProjectId: workProjectIdSchema,
@@ -355,7 +391,11 @@ export const RequireWorkRealmRetitleInputSchema = z.object({
355
391
  reason: textFieldSchema(RETITLE_REASON_INPUT),
356
392
  workRealmId: workRealmIdSchema,
357
393
  }).strict();
358
- // --- Page-level "Clear text (moderation)" callables (per-field extension of the retitle family) ---
394
+ // ONE result for both Work and Realm retitle callables.
395
+ export const RequireRetitleResultSchema = z.object({
396
+ success: z.literal(true),
397
+ });
398
+ // Page-level "Clear text (moderation)" callables: the per-field extension of the retitle family.
359
399
  // The clearable SHELL fields (raw doc field names) for the workProject + workRealm contexts.
360
400
  // Derived from the canonical clearable-field map — the two shell surfaces share the same fields.
361
401
  const ModerationShellClearFieldSchema = z.enum(MODERATION_CLEARABLE_TEXT_FIELDS.workProject);
@@ -369,6 +409,10 @@ export const ClearWorkRealmTextInputSchema = z.object({
369
409
  fields: z.array(ModerationShellClearFieldSchema).min(1),
370
410
  reason: textFieldSchema(CLEAR_TEXT_REASON_INPUT),
371
411
  }).strict();
412
+ // ONE result for both Work and Realm text-clear callables.
413
+ export const ClearModerationTextResultSchema = z.object({
414
+ success: z.literal(true),
415
+ });
372
416
  // The clearable TEXT fields across the whole hall content family — derived from the canonical
373
417
  // map (union of every hall surface's fields), never restated literals.
374
418
  const HallClearFieldSchema = z.enum(HALL_CLEARABLE_TEXT_FIELD_NAMES);
@@ -379,12 +423,22 @@ export const ClearHallContentTextInputSchema = z.object({
379
423
  fields: z.array(HallClearFieldSchema).min(1),
380
424
  reason: textFieldSchema(CLEAR_TEXT_REASON_INPUT),
381
425
  }).strict();
382
- // --- getLatestHideCascade — resolve the latest hide-cascade id for a Work/Realm ---
426
+ export const ClearHallContentTextResultSchema = z.object({
427
+ success: z.literal(true),
428
+ });
429
+ // getLatestHideCascade resolves the latest hide-cascade id for a Work/Realm.
383
430
  export const GetLatestHideCascadeInputSchema = z.object({
384
431
  entityId: documentIdSegmentSchema,
385
432
  targetType: z.enum(['work-project', 'work-realm']),
386
433
  }).strict();
387
- // --- moderateReportedContent — hide / restore / soft perma-remove an individual reported item ---
434
+ export const GetLatestHideCascadeResultSchema = z.object({
435
+ cascadeId: z.string().min(1).nullable(),
436
+ });
437
+ export const GetPendingGuildInviteCountInputSchema = z.object({}).strict();
438
+ export const GetPendingGuildInviteCountResultSchema = z.object({
439
+ count: z.number().int().nonnegative(),
440
+ });
441
+ // moderateReportedContent hides, restores, or soft perma-removes an individual reported item.
388
442
  // The single-item content-action target set (SUBSET of ReportableItemType — excludes the
389
443
  // close-out-only hall-library-sub-item).
390
444
  const MODERATE_REPORTED_CONTENT_TARGET_TYPES = [
@@ -407,7 +461,7 @@ export const ModerateReportedContentInputSchema = z.object({
407
461
  reportedItemId: reportTargetItemIdSchema,
408
462
  parentItemId: reportTargetParentRefSchema.optional(),
409
463
  action: z.enum(['hide', 'restore', 'remove']),
410
- // [EUAS-023] A destructive action (hide/remove) MUST carry a reason; restore is a reversal.
464
+ // A destructive action (hide/remove) MUST carry a reason; restore is a reversal.
411
465
  reason: textFieldSchema(MODERATION_ACTION_REASON_INPUT).optional(),
412
466
  })
413
467
  .strict()
@@ -420,8 +474,8 @@ export const ModerateReportedContentInputSchema = z.object({
420
474
  });
421
475
  }
422
476
  });
423
- // --- resolveAdminTask — the ONE guided close-out for EVERY admin case type ---
424
- // [EUAS-005] The content-action target set ALSO accepts hall-library-sub-item (hide/restore only),
477
+ // resolveAdminTask — the ONE guided close-out for EVERY admin case type.
478
+ // The content-action target set ALSO accepts hall-library-sub-item (hide/restore only),
425
479
  // which routes to the dedicated `runSetHallSubItemHidden` core (not `runModerateReportedContent`).
426
480
  const CONTENT_ACTION_TARGET_TYPES = [
427
481
  'square-streetz-post',
@@ -476,8 +530,8 @@ const WorkObjectActionSchema = z
476
530
  reportedItemId: reportTargetItemIdSchema,
477
531
  })
478
532
  .strict();
479
- // --- The in-flow clear-content disposition (staged counterpart of the page-level clear-text
480
- // callables) ---
533
+ // The in-flow clear-content disposition: the staged counterpart of the page-level clear-text
534
+ // callables.
481
535
  /** The three targets the in-flow text clear can neutralize — the Work/Realm shells plus a single
482
536
  * published hall sub-item. Compile-linked subset of the canonical reportable-item enum. */
483
537
  const CLEAR_CONTENT_TEXT_TARGET_TYPES = [
@@ -575,6 +629,10 @@ export const NormalReportInputSchema = z
575
629
  adminNote: textFieldSchema(CLOSE_OUT_ADMIN_NOTE_INPUT).optional(),
576
630
  })
577
631
  .strict();
632
+ export const ResolveAdminTaskResultSchema = z.object({
633
+ success: z.literal(true),
634
+ auditEventId: z.string().min(1).optional(),
635
+ });
578
636
  const SafetyDispositionActionSchema = z
579
637
  .object({
580
638
  button: z.literal('setReportDisposition'),
@@ -591,7 +649,7 @@ const SafetyDispositionActionSchema = z
591
649
  })
592
650
  .strict();
593
651
  const QuarantineActionSchema = z.object({ button: z.literal('quarantinePreserveFile') }).strict();
594
- // [C-01/EUAS-002] No client-supplied requestId — the linked statutory request id(s) are derived
652
+ // No client-supplied requestId — the linked statutory request id(s) are derived
595
653
  // SERVER-SIDE from the case's `requestLinks` inside `enqueueNciiRemovalForCase`.
596
654
  const HashRemoveActionSchema = z.object({ button: z.literal('hashRemoveFile') }).strict();
597
655
  const SafetyAccountActionSchema = z
@@ -628,12 +686,12 @@ export const SafetyCaseInputSchema = z
628
686
  resolutionSummary: z.string().trim().min(1).max(MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH),
629
687
  actions: z.array(SafetyStagedActionSchema).max(16).default([]),
630
688
  adminNote: textFieldSchema(CLOSE_OUT_ADMIN_NOTE_INPUT).optional(),
631
- // [EUAS-017] Optimistic-concurrency token (`childSafetyCaseList.revision` / `nciiCases.revision`).
689
+ // Optimistic-concurrency token (`childSafetyCaseList.revision` / `nciiCases.revision`).
632
690
  // The close is rejected if the case changed since the operator loaded it — concurrent stale closes
633
- // can't silently overwrite. Optional for backward compatibility; the console always supplies it.
691
+ // can't silently overwrite. Optional; the console always supplies it.
634
692
  expectedRevision: z.number().int().nonnegative().optional(),
635
- // Interim reauth: a single explicit typed confirmation for the privileged safety actions,
636
- // standing in for the passkey two-step until [H-17]. The callable is full-admin gated.
693
+ // Reauth: a single explicit typed confirmation for the privileged safety actions. The
694
+ // callable is full-admin gated.
637
695
  confirmation: z.literal(SAFETY_ACTIONS_CONFIRMATION),
638
696
  })
639
697
  .strict();
@@ -646,9 +704,7 @@ export const ReopenSafetyCaseInputSchema = z
646
704
  confirmation: z.literal(SAFETY_CASE_REOPEN_CONFIRMATION),
647
705
  })
648
706
  .strict();
649
- // ---------------------------------------------------------------------------
650
707
  // Dead-letter operations — adminReplayDeadLetter + getDeadLetters (Ops Repairs).
651
- // ---------------------------------------------------------------------------
652
708
  /** Every ledger the dead-letter replay callable supports. */
653
709
  export const DeadLetterCollectionSchema = z.enum([
654
710
  'chatSyncEvents',