@ttt-productions/ttt-core 0.79.72 → 0.79.73

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.
@@ -406,4 +406,14 @@ export interface NotificationAdminArchivedAuditMetadata {
406
406
  notificationId?: string;
407
407
  handledBy: string;
408
408
  }
409
+ /**
410
+ * Payload of a `notification.adminArchiveAllRequested` audit event — written when an
411
+ * admin enqueues an admin-category archive-all job, in the same commit as the job. It
412
+ * is the event that carries the request's origin: the worker's per-card
413
+ * `notification.adminArchived` events run after the request ended and record none.
414
+ */
415
+ export interface NotificationAdminArchiveAllRequestedAuditMetadata {
416
+ jobId: string;
417
+ requestId: string;
418
+ }
409
419
  //# sourceMappingURL=notification.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/schemas/notification.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4CxB,eAAO,MAAM,wBAAwB,oaA+C3B,CAAC;AAEX,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;EAAmC,CAAC;AACvE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;2CAC2C;AAC3C,eAAO,MAAM,2BAA2B,qCAAsC,CAAC;AAC/E,eAAO,MAAM,yBAAyB;;;;EAAsC,CAAC;AAC7E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,OAAO,CAAC;AACpD,eAAO,MAAM,0BAA0B;;;EAA4B,CAAC;AAEpE,MAAM,WAAW,4BAA4B;IAC3C,8DAA8D;IAC9D,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,uFAAuF;IACvF,QAAQ,EAAE,UAAU,GAAG,QAAQ,CAAC;IAChC,4FAA4F;IAC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AEtF,eAAO,MAAM,sCAAsC;;;;;;;;;iBAEjD,CAAC;AACH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAC;AAItG,eAAO,MAAM,2BAA2B;;;iBAGtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAMhF;;;;GAIG;AACH,MAAM,WAAW,sCAAsC;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,yBAAyB,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,sCAAsC;IACrD,KAAK,EAAE,QAAQ,GAAG,KAAK,CAAC;IACxB,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,iDAAiD;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -12,10 +12,10 @@
12
12
  // materializer. `validateNotificationMetadata` is the one check of a row's or job's `metadata`
13
13
  // against its type, for both lanes.
14
14
  //
15
- // The two notification audit-event payload shapes live here too (the
16
- // `AuditEventType` union members `notification.broadcastSent` /
17
- // `notification.adminArchived` are added in ../types/audit.ts; their actor is
18
- // always an admin mode — `adminReview` / `adminOverride`).
15
+ // The notification audit-event payload shapes live here too (the `AuditEventType`
16
+ // union members `notification.broadcastSent` / `notification.adminArchived` /
17
+ // `notification.adminArchiveAllRequested` are added in ../types/audit.ts; their actor
18
+ // is always an admin mode — `adminReview` / `adminOverride`).
19
19
  import { z } from 'zod';
20
20
  import { userIdSchema, workProjectIdSchema, guildInviteIdSchema, adminDispatchIdSchema, hallItemIdSchema, thresholdItemIdSchema, changeRequestIdSchema, workProjectTypeSchema, notificationFanoutJobIdSchema, storedTitleSchema, reportGroupIdSchema, mediaAssetIdSchema, workRealmIdSchema, realmFileShareRequestIdSchema, documentIdSegmentSchema, activeNotificationIdSchema, } from './atoms.js';
21
21
  import { MAX_THRESHOLD_REVIEW_NOTES_LENGTH, MAX_HALL_CHANGE_REQUEST_REASON_LENGTH, MAX_NOTIFICATION_MESSAGE_LENGTH, MAX_BROADCAST_EXPLICIT_UIDS, } from '../constants/business.js';
@@ -1 +1 @@
1
- {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../src/schemas/notification.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,iFAAiF;AACjF,mFAAmF;AACnF,mFAAmF;AACnF,gFAAgF;AAChF,+FAA+F;AAC/F,oCAAoC;AACpC,EAAE;AACF,qEAAqE;AACrE,gEAAgE;AAChE,8EAA8E;AAC9E,2DAA2D;AAE3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,6BAA6B,EAC7B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iCAAiC,EACjC,qCAAqC,EACrC,+BAA+B,EAC/B,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO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AE,0BAA0B;CACrC,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,KAAK,EAAE,uBAAuB;CAC/B,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,iFAAiF;AACjF,kFAAkF;AAClF,oFAAoF;AACpF,sCAAsC;AACtC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,KAAK,EAAE,6BAA6B;CACrC,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,kGAAkG;AAClG,kGAAkG;AAClG,mFAAmF;AACnF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,KAAK,EAAE,6BAA6B;IACpC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,QAAQ,EAAE,gCAAgC;IAC1C,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7D,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC;CAC9C,CAAC,CAAC;AAGH,4FAA4F;AAC5F,uCAAuC;AACvC,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC","sourcesContent":["// TTT notification contracts.\n//\n// `@ttt-productions/notification-core` is generic — at its package boundary a\n// notification's `metadata` is `Record<string, unknown>`. All TTT notification\n// policy lives here: the canonical type catalog (category / delivery / default\n// channels), the per-type typed `metadata` discriminated union, the broadcast\n// audience selector, and the callable input schemas. There is NO single send\n// chokepoint: ttt-prod has two intake lanes — reliable single/shared occurrences\n// (`writeReliableOccurrenceRow` / `enqueueReliableOccurrence`) and audience fanout\n// (`notificationFanoutJobs` → `processNotificationFanoutJobs`) — which converge on\n// the `notificationDeliveries` ledger, with `materializeDeliveries` as the sole\n// materializer. `validateNotificationMetadata` is the one check of a row's or job's `metadata`\n// against its type, for both lanes.\n//\n// The two notification audit-event payload shapes live here too (the\n// `AuditEventType` union members `notification.broadcastSent` /\n// `notification.adminArchived` are added in ../types/audit.ts; their actor is\n// always an admin mode — `adminReview` / `adminOverride`).\n\nimport { z } from 'zod';\nimport {\n userIdSchema,\n workProjectIdSchema,\n guildInviteIdSchema,\n adminDispatchIdSchema,\n hallItemIdSchema,\n thresholdItemIdSchema,\n changeRequestIdSchema,\n workProjectTypeSchema,\n notificationFanoutJobIdSchema,\n storedTitleSchema,\n reportGroupIdSchema,\n mediaAssetIdSchema,\n workRealmIdSchema,\n realmFileShareRequestIdSchema,\n documentIdSegmentSchema,\n activeNotificationIdSchema,\n} from './atoms.js';\nimport {\n MAX_THRESHOLD_REVIEW_NOTES_LENGTH,\n MAX_HALL_CHANGE_REQUEST_REASON_LENGTH,\n MAX_NOTIFICATION_MESSAGE_LENGTH,\n MAX_BROADCAST_EXPLICIT_UIDS,\n} from '../constants/business.js';\nimport { BROADCAST_MESSAGE_INPUT, BROADCAST_TITLE_INPUT } from '../constants/text-fields.js';\nimport { HallSubItemTypeSchema } from '../doc-schemas/content.js';\nimport { textFieldSchema } from './text-field.js';\nimport { ReportableItemTypeSchema } from '../doc-schemas/safety/foundation.js';\nimport { NotificationFanoutPrioritySchema } from '../doc-schemas/notification-ledger.js';\n\n// A stored broadcast message an announcement's metadata carries (the typed field is the\n// broadcast input's `BROADCAST_MESSAGE_INPUT`).\nconst storedNotificationMessageSchema = z.string().min(1).max(MAX_NOTIFICATION_MESSAGE_LENGTH);\n// The canonical reportable-item enum — never an open string (ARCH-102).\nconst reportedItemTypeSchema = ReportableItemTypeSchema;\nconst reportedItemIdSchema = documentIdSegmentSchema.max(128);\nconst reportIdSchema = documentIdSegmentSchema;\nconst appealIdSchema = documentIdSegmentSchema;\n\n// ============================================================================\n// TYPE + CHANNEL CATALOG\n// ============================================================================\n\nexport const NOTIFICATION_TYPE_VALUES = [\n 'content_report',\n 'guild_invite',\n 'admin_dispatch_reply',\n // The FIRST message of a thread the admin team started — to the user, or to every active\n // member of the Work. A reply is `admin_dispatch_reply`.\n 'admin_dispatch_created',\n 'threshold_library_submission',\n // Author feedback for a Threshold Library review decision (only needs_revision is\n // delivered today — an approval reaches the author via the publish member fanout).\n 'threshold_library_reviewed',\n // Proposer feedback for a PUBLISHED change-request decision (approve/deny).\n 'hall_content_change_request_resolved',\n 'admin_announcement',\n 'followed_content_published',\n // The two audience-fanout triggers (see ttt-prod docs/design/notification-system.md).\n // `member_content_published`: the Hall-publish MEMBER job (\"your work was published!\") — same\n // `thresholdItemId` eventId as the follower job, different type so `deliveryId` stays distinct.\n // `followed_craft_skill_published`: craft-skill publish → the artisan's followers\n // (`staticRelight` strategy — count 1 forever, static copy, no count shown).\n 'member_content_published',\n 'followed_craft_skill_published',\n // Reporter feedback (DJ ruling 2026-07-06): when a report a user submitted is\n // closed as a REAL case WITH action (ordinary report root flips to `actioned`),\n // the reporter gets one light informational card. Never sent on dismissals.\n // Generic copy only — the card must not reveal the reported user, reason, or\n // remedy (a bad-faith reporter must not be able to probe moderation outcomes).\n 'report_action_taken',\n // Appellant feedback for a content-appeal decision (DJ ruling 2026-07-10 —\n // gap found by the hosted E2E build: reviewContentAppeal decided appeals with\n // NO channel reporting the outcome to the appellant). Fired on BOTH approve\n // and deny. It is the appellant's OWN appeal, so unlike report_action_taken\n // there is no privacy ceiling: the card states the outcome plainly and\n // targets My Uploads, where the resulting upload state lives.\n 'content_appeal_reviewed',\n // Realm shared-file promotion approval gate. TWO canonical types, one per direction of the\n // decision — never one type with a recipient discriminator, because they are different\n // cards on different trays with different dedup lifetimes:\n // - `realm_file_share_requested`: a Work file admin asked to share a file into a Realm →\n // the REALM STEWARD, who decides.\n // - `realm_file_share_resolved`: the pending request is no longer pending → the party who\n // did NOT act. `metadata.resolution` distinguishes `approved` | `declined` (to the\n // recorded REQUESTER) from `withdrawn` (to the STEWARD, whose queue card is now stale).\n // OCCURRENCE IDENTITY for both is the request id, so a re-request after a decline is a new\n // card rather than a relight of the resolved one.\n 'realm_file_share_requested',\n 'realm_file_share_resolved',\n] as const;\n\nexport const NotificationTypeSchema = z.enum(NOTIFICATION_TYPE_VALUES);\nexport type NotificationType = z.infer<typeof NotificationTypeSchema>;\n\n/** Delivery channels. Only `inApp` is implemented at launch; `email`/`push` are\n * reserved for future channel handlers. */\nexport const NOTIFICATION_CHANNEL_VALUES = ['inApp', 'email', 'push'] as const;\nexport const NotificationChannelSchema = z.enum(NOTIFICATION_CHANNEL_VALUES);\nexport type NotificationChannel = z.infer<typeof NotificationChannelSchema>;\n\nexport type NotificationCategory = 'user' | 'admin';\nexport const NotificationCategorySchema = z.enum(['user', 'admin']);\n\nexport interface NotificationTypeCatalogEntry {\n /** Which active collection / audience this type writes to. */\n category: NotificationCategory;\n /** `realtime` writes straight to active; `queued` goes through the batch processor. */\n delivery: 'realtime' | 'queued';\n /** Default channel list applied when a send omits `channels`. All `['inApp']` at launch. */\n defaultChannels: NotificationChannel[];\n}\n\n/**\n * The canonical TTT notification type catalog — the source `TTT_NOTIFICATION_CONFIG`\n * (../notifications) derives every type's category/delivery from. `defaultChannels`\n * is `['inApp']` for every type at launch.\n */\nexport const NOTIFICATION_TYPE_CATALOG: Record<NotificationType, NotificationTypeCatalogEntry> = {\n content_report: { category: 'admin', delivery: 'realtime', defaultChannels: ['inApp'] },\n guild_invite: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n admin_dispatch_reply: { category: 'user', delivery: 'realtime', defaultChannels: ['inApp'] },\n admin_dispatch_created: { category: 'user', delivery: 'realtime', defaultChannels: ['inApp'] },\n threshold_library_submission: { category: 'admin', delivery: 'queued', defaultChannels: ['inApp'] },\n threshold_library_reviewed: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n hall_content_change_request_resolved: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n admin_announcement: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n followed_content_published: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n member_content_published: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n followed_craft_skill_published: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n report_action_taken: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n content_appeal_reviewed: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n realm_file_share_requested: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n realm_file_share_resolved: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n};\n\n// ============================================================================\n// PER-TYPE METADATA (discriminated union, keyed by `type`)\n// ============================================================================\n\n/**\n * Typed `metadata` payload for each notification type. The generic package\n * boundary takes `Record<string, unknown>`; the app validates against this\n * before sending so each type's payload is checked like every other callable\n * schema.\n */\nexport const NotificationMetadataByTypeSchema = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('content_report'),\n reportGroupId: reportGroupIdSchema,\n reportedItemType: reportedItemTypeSchema,\n reportedItemId: reportedItemIdSchema,\n }).strict(),\n z.object({\n type: z.literal('guild_invite'),\n workProjectId: workProjectIdSchema,\n guildInviteId: guildInviteIdSchema,\n }).strict(),\n z.object({\n type: z.literal('admin_dispatch_reply'),\n adminDispatchId: adminDispatchIdSchema,\n // Party-generic dispatch: present on workProject-party threads so the card routes\n // to the Work's correspondence surface. Absent on user-party threads (legacy shape).\n partyKind: z.enum(['user', 'workProject']).optional(),\n workProjectId: workProjectIdSchema.optional(),\n }).strict(),\n z.object({\n type: z.literal('admin_dispatch_created'),\n adminDispatchId: adminDispatchIdSchema,\n partyKind: z.enum(['user', 'workProject']),\n // Set on workProject-party threads, so the card routes to the Work.\n workProjectId: workProjectIdSchema.optional(),\n }).strict(),\n z.object({\n type: z.literal('threshold_library_submission'),\n thresholdItemId: thresholdItemIdSchema,\n hallItemId: hallItemIdSchema,\n workProjectId: workProjectIdSchema,\n }).strict(),\n // Author feedback for a review decision. Mirrors what runReviewThresholdItem\n // (ttt-prod) sends: only `needs_revision` is delivered today; `adminNotes` is\n // the reviewer's note, sent as null when the reviewer left none.\n z.object({\n type: z.literal('threshold_library_reviewed'),\n thresholdItemId: thresholdItemIdSchema,\n hallItemId: hallItemIdSchema,\n workProjectId: workProjectIdSchema,\n workProjectType: workProjectTypeSchema,\n itemId: z.string().min(1),\n decision: z.literal('needs_revision'),\n adminNotes: z.string().max(MAX_THRESHOLD_REVIEW_NOTES_LENGTH).nullable(),\n }).strict(),\n // Proposer feedback for a published change-request decision. Mirrors what\n // runReviewHallContentChangeRequest (ttt-prod) sends: `resolutionReason` is\n // required on a deny, optional on an approve — null when absent. The realm\n // grain (R1) sends `workRealmId` with `hallItemId` null; hall grains the\n // reverse.\n z.object({\n type: z.literal('hall_content_change_request_resolved'),\n changeRequestId: changeRequestIdSchema,\n hallItemId: hallItemIdSchema.nullable(),\n workRealmId: z.string().min(1).nullish(),\n workProjectId: workProjectIdSchema,\n decision: z.enum(['approved', 'denied']),\n resolutionReason: z.string().max(MAX_HALL_CHANGE_REQUEST_REASON_LENGTH).nullable(),\n }).strict(),\n z.object({\n type: z.literal('admin_announcement'),\n title: storedTitleSchema,\n message: storedNotificationMessageSchema,\n }).strict(),\n z.object({\n type: z.literal('followed_content_published'),\n workProjectId: workProjectIdSchema,\n workRealmId: workRealmIdSchema.optional(),\n workTitle: storedTitleSchema,\n hallItemId: hallItemIdSchema,\n hallItemTitle: storedTitleSchema,\n hallSubItemType: HallSubItemTypeSchema,\n }).strict(),\n // P7 Hall-publish MEMBER job — same Hall-publication fields as the follower type (it describes\n // the SAME publication to the work's members; the work route + \"your work was published!\" copy\n // are set by the emitter via targetPath/title, not metadata).\n z.object({\n type: z.literal('member_content_published'),\n workProjectId: workProjectIdSchema,\n workRealmId: workRealmIdSchema.optional(),\n workTitle: storedTitleSchema,\n hallItemId: hallItemIdSchema,\n hallItemTitle: storedTitleSchema,\n hallSubItemType: HallSubItemTypeSchema,\n }).strict(),\n // P7 craft-skill publish — points at the artisan whose skills updated. The actor name\n // (\"X uploaded new craft skills\") + the profile/skills route resolve from `artisanUid` at\n // render time (Display Identity Invariant); `staticRelight` shows no count.\n z.object({\n type: z.literal('followed_craft_skill_published'),\n artisanUid: userIdSchema,\n }).strict(),\n // Reporter feedback — metadata is deliberately minimal: `reportId` is the\n // reporter's OWN report-root doc id (deterministic per reporterUid + target,\n // see writeOrdinaryReport), used only as the dedup/aggregation key so a\n // reporter gets at most one card per report they filed. NO fields that\n // identify the reported user/content/remedy may ever be added here.\n z.object({\n type: z.literal('report_action_taken'),\n reportId: reportIdSchema,\n }).strict(),\n // Appellant feedback for a content-appeal decision. `appealId` is the\n // appellant's OWN appeal doc id (the dedup/aggregation key — one card per\n // appeal, a re-decision coalesces); `decision` drives the card copy.\n z.object({\n type: z.literal('content_appeal_reviewed'),\n appealId: appealIdSchema,\n decision: z.enum(['approved', 'denied']),\n }).strict(),\n // Realm shared-file promotion REQUEST → the Realm steward. Ids only: the Realm name, the\n // Work name, the file name, and the requester's display name all resolve at render from\n // these ids (Display Identity Invariant) — a snapshot here would go stale the moment any\n // of them is renamed or moderated.\n z.object({\n type: z.literal('realm_file_share_requested'),\n workRealmId: workRealmIdSchema,\n workProjectId: workProjectIdSchema,\n mediaAssetId: mediaAssetIdSchema,\n workFileId: z.string().min(1),\n // The occurrence/dedup identity — one card per request, forever.\n requestId: realmFileShareRequestIdSchema,\n requestedByUid: userIdSchema,\n }).strict(),\n // Realm shared-file promotion RESOLUTION. `resolution` both drives the card copy AND\n // identifies the audience: `approved`/`declined` go to the recorded requester,\n // `withdrawn` goes to the steward whose pending card is now stale.\n z.object({\n type: z.literal('realm_file_share_resolved'),\n workRealmId: workRealmIdSchema,\n workProjectId: workProjectIdSchema,\n mediaAssetId: mediaAssetIdSchema,\n workFileId: z.string().min(1),\n requestId: realmFileShareRequestIdSchema,\n resolution: z.enum(['approved', 'declined', 'withdrawn']),\n }).strict(),\n]);\nexport type NotificationMetadataByType = z.infer<typeof NotificationMetadataByTypeSchema>;\n\n/**\n * The one check of a notification's `metadata` against its type, for both intake lanes: the\n * reliable lane's delivery rows and the fanout lane's jobs. Metadata never carries the `type`\n * discriminant itself (it would hide the type the notification is sent as). Throws on a mismatch.\n */\nexport function validateNotificationMetadata(\n type: NotificationType,\n metadata: Record<string, unknown>,\n): NotificationMetadataByType {\n if (Object.prototype.hasOwnProperty.call(metadata, 'type')) {\n throw new TypeError('Notification metadata must not carry its own type.');\n }\n return NotificationMetadataByTypeSchema.parse({ ...metadata, type });\n}\n\n// ============================================================================\n// BROADCAST AUDIENCE SELECTOR\n// ============================================================================\n\n/**\n * Admin broadcast audience selector. Stored on a broadcast job; the scheduled\n * fan-out worker resolves a page of it into uids (domain-aware queries live in\n * ttt-prod — the package only ever receives uids).\n */\nexport const BroadcastAudienceSelectorSchema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('allActiveUsers') }).strict(),\n z.object({\n kind: z.literal('explicitUids'),\n // The selector's documented audience cap (dedup + serialized-byte enforcement\n // for work/realm snapshots is app-side). Derives from the ONE named constant.\n uids: z.array(userIdSchema).min(1).max(MAX_BROADCAST_EXPLICIT_UIDS),\n }).strict(),\n z.object({\n kind: z.literal('workMembers'),\n workProjectId: workProjectIdSchema,\n }).strict(),\n z.object({\n kind: z.literal('realmMembers'),\n workRealmId: workRealmIdSchema,\n }).strict(),\n z.object({ kind: z.literal('allArtisans') }).strict(),\n]);\nexport type BroadcastAudienceSelector = z.infer<typeof BroadcastAudienceSelectorSchema>;\n\n// ============================================================================\n// CALLABLE INPUT SCHEMAS\n// ============================================================================\n\nexport const CreateNotificationBroadcastInputSchema = z.object({\n // Client-generated idempotency key — the app derives the broadcast eventId\n // deterministically from (actorUid, requestId) so a lost-ack retry is idempotent.\n requestId: z.string().min(1),\n selector: BroadcastAudienceSelectorSchema,\n title: textFieldSchema(BROADCAST_TITLE_INPUT),\n message: textFieldSchema(BROADCAST_MESSAGE_INPUT),\n}).strict();\nexport type CreateNotificationBroadcastInput = z.infer<typeof CreateNotificationBroadcastInputSchema>;\n\n/** Archive scope: a single notification, or the caller's whole category. */\nexport const ArchiveNotificationScopeSchema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('single'), notificationId: activeNotificationIdSchema }).strict(),\n z.object({ kind: z.literal('all') }).strict(),\n]);\nexport type ArchiveNotificationScope = z.infer<typeof ArchiveNotificationScopeSchema>;\n\n// No `device` field on the archive input — archive metadata is server-derived (A1).\nexport const ArchiveNotificationInputSchema = z.object({\n category: NotificationCategorySchema,\n scope: ArchiveNotificationScopeSchema,\n}).strict();\nexport type ArchiveNotificationInput = z.infer<typeof ArchiveNotificationInputSchema>;\n\n// Shared admin notifications have no per-admin seen state, so only the personal\n// `user` category can be marked seen.\nexport const MarkNotificationsSeenInputSchema = z.object({\n category: z.literal('user'),\n}).strict();\nexport type MarkNotificationsSeenInput = z.infer<typeof MarkNotificationsSeenInputSchema>;\n\n// ============================================================================\n// OBSERVED-GENERATION CALLABLE INPUT SCHEMAS (P6 tray)\n//\n// These are for the NEW observed-generation callables the P6 notification tray\n// will invoke. The LEGACY schemas above (MarkNotificationsSeenInputSchema /\n// ArchiveNotificationInputSchema) remain intact — the legacy callables still use\n// them.\n// ============================================================================\n\n// Max items per mark-seen call matches a sane notification tray page size.\nconst MARK_SEEN_MAX_ITEMS = 50;\n\n/**\n * A single rendered notification row and the generation the UI observed.\n * `activeId` is the Firestore active-notification document id;\n * `observedActivityGeneration` is the opaque token from that document.\n */\nconst SeenItemSchema = z.object({\n activeId: activeNotificationIdSchema,\n observedActivityGeneration: z.string().min(1),\n}).strict();\n\n/**\n * Input for the new observed-generation mark-seen callable (P6 tray).\n *\n * The UI sends only the rows it actually rendered plus their observed\n * `activityGeneration` tokens. The server sets `seenAt = now` ONLY when the\n * card's current `activityGeneration` matches `observedActivityGeneration`;\n * otherwise it is a no-op for that row (activity arrived after render, or a\n * delete+recreate rotated the token).\n *\n * category is always `'user'` — shared admin notifications have no per-admin\n * seen state.\n */\nexport const MarkNotificationsSeenObservedInputSchema = z.object({\n category: z.literal('user'),\n items: z.array(SeenItemSchema).min(1).max(MARK_SEEN_MAX_ITEMS),\n}).strict();\nexport type MarkNotificationsSeenObservedInput = z.infer<typeof MarkNotificationsSeenObservedInputSchema>;\n\n/**\n * Archive scope for the observed-generation callable.\n *\n * `single` — archive one notification card. Carries `notificationId` (the\n * active-card doc id) and `observedActivityGeneration` (the precondition:\n * the server archives only if the card's current generation matches).\n *\n * `all` — archive every card in the category. The per-card generation\n * precondition is applied server-side per card during bounded-page sweeps;\n * the caller supplies no single generation token here because there is no\n * single observed generation for the whole category. (Design choice: archive-all\n * carries no observedActivityGeneration at the top level; the server reads each\n * card's current generation as its own precondition. This is consistent with the\n * frozen \"mark-all/archive-all run bounded pages with stable cursors until\n * exhausted\" protocol (ttt-prod docs/design/notification-system.md) and the\n * archive-history identity formula\n * which keys each occurrence on requestId independently.)\n */\nexport const ArchiveNotificationObservedScopeSchema = z.discriminatedUnion('kind', [\n z.object({\n kind: z.literal('single'),\n notificationId: activeNotificationIdSchema,\n observedActivityGeneration: z.string().min(1),\n }).strict(),\n z.object({\n kind: z.literal('all'),\n }).strict(),\n]);\nexport type ArchiveNotificationObservedScope = z.infer<typeof ArchiveNotificationObservedScopeSchema>;\n\n/**\n * Input for the observed-generation archive callable (P6 tray).\n *\n * `requestId` is a per-call nonce — the tray mints a fresh uuid on every archive /\n * clear-all click, so it is NOT a replay-stability token (R39). Idempotency is provided\n * by ACTIVE-DOC DELETION: a replay finds the card already gone and no-ops, so an archive\n * never double-applies. The server combines `requestId` with the card's `activeId` to\n * form the deterministic history doc id (`hash('notification-archive', category,\n * audienceScope, requestId:activeId)`), so a single archive can never collide on another\n * card's history doc (R35).\n *\n * `category` scopes which active-notification collection is archived\n * (`activeUserNotifications` vs `activeAdminNotifications`) and forms part of\n * the history doc path.\n */\nexport const ArchiveNotificationObservedInputSchema = z.object({\n requestId: z.string().min(1),\n category: NotificationCategorySchema,\n scope: ArchiveNotificationObservedScopeSchema,\n}).strict();\nexport type ArchiveNotificationObservedInput = z.infer<typeof ArchiveNotificationObservedInputSchema>;\n\n/**\n * The `archiveNotification` answer: how many cards this call archived (0 when a single card was\n * relit after it rendered, so the row stays active), and for an archive-all, `hasMore` when the\n * call's bound stopped it before the category was empty. Non-strict (server → client posture).\n */\nexport const ArchiveNotificationResultSchema = z.object({\n success: z.literal(true),\n archived: z.number().int().nonnegative(),\n hasMore: z.boolean().optional(),\n});\nexport type ArchiveNotificationResult = z.infer<typeof ArchiveNotificationResultSchema>;\n\n// ============================================================================\n// SERVER-OWNED ARCHIVE-ALL JOB (replaces the browser clear-all loop)\n//\n// `enqueueArchiveAll` enqueues ONE durable archive-all job scoped to the tab's\n// category (idempotent per user+category+requestId) and returns { jobId }; the\n// bounded server worker drains that category's active cards each in its own\n// atomic archive+audit txn (per-card observed-generation precondition preserved).\n// `getArchiveAllStatus` is polled by the thin client hook. Per-tab scoping is\n// REQUIRED — a job only ever archives its own category, never all tabs.\n// ============================================================================\n\nexport const EnqueueArchiveAllInputSchema = z.object({\n requestId: z.string().min(1),\n category: NotificationCategorySchema,\n}).strict();\nexport type EnqueueArchiveAllInput = z.infer<typeof EnqueueArchiveAllInputSchema>;\n\nexport const GetArchiveAllStatusInputSchema = z.object({\n jobId: documentIdSegmentSchema,\n}).strict();\nexport type GetArchiveAllStatusInput = z.infer<typeof GetArchiveAllStatusInputSchema>;\n\n// Wire contract for the `resumeFanoutJob` callable — the admin console re-arms a\n// dead-lettered notification fanout job by id. Admin console-invoked, but still a\n// wire contract, so it lives here (callable-validation convention) rather than as a\n// local schema in the functions repo.\nexport const ResumeFanoutJobInputSchema = z.object({\n jobId: notificationFanoutJobIdSchema,\n}).strict();\nexport type ResumeFanoutJobInput = z.infer<typeof ResumeFanoutJobInputSchema>;\n\n// One dead-lettered fanout job in the Ops Repairs inventory (`listDeadLetteredFanoutJobs`, oldest\n// first): the job's own identity, type, and priority, when it parked and why, and how long it has\n// been parked. Server → client posture: non-strict, so the backend may add fields.\nexport const DeadLetteredFanoutJobRowSchema = z.object({\n jobId: notificationFanoutJobIdSchema,\n notificationType: z.string(),\n priority: NotificationFanoutPrioritySchema,\n deadLetteredAt: z.number().nullable(),\n lastError: z.string().nullable(),\n ageMs: z.number().nullable(),\n});\nexport type DeadLetteredFanoutJobRow = z.infer<typeof DeadLetteredFanoutJobRowSchema>;\n\nexport const ListDeadLetteredFanoutJobsResultSchema = z.object({\n jobs: z.array(DeadLetteredFanoutJobRowSchema),\n});\nexport type ListDeadLetteredFanoutJobsResult = z.infer<typeof ListDeadLetteredFanoutJobsResultSchema>;\n\n// The `resumeFanoutJob` re-arm: `resumed: false` with a `reason` when the job was no longer\n// dead-lettered (an idempotent no-op).\nexport const ResumeFanoutJobResultSchema = z.object({\n resumed: z.boolean(),\n reason: z.string().optional(),\n});\nexport type ResumeFanoutJobResult = z.infer<typeof ResumeFanoutJobResultSchema>;\n\n// ============================================================================\n// AUDIT EVENT PAYLOADS (admin-only)\n// ============================================================================\n\n/**\n * Payload of a `notification.broadcastSent` audit event — written when an admin\n * enqueues a broadcast. Actor mode is `adminReview` / `adminOverride`. Records\n * the selector (never a pre-resolved uid list) + the job it created.\n */\nexport interface NotificationBroadcastSentAuditMetadata {\n jobId: string;\n selector: BroadcastAudienceSelector;\n title: string;\n}\n\n/**\n * Payload of a `notification.adminArchived` audit event — written when an admin\n * clears a shared admin notification (the `handledBy` action). Actor mode is\n * `adminReview` / `adminOverride`.\n */\nexport interface NotificationAdminArchivedAuditMetadata {\n scope: 'single' | 'all';\n /** Present for single-archive; absent for a category-wide `all` archive. */\n notificationId?: string;\n handledBy: string;\n}\n"]}
1
+ {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../src/schemas/notification.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,iFAAiF;AACjF,mFAAmF;AACnF,mFAAmF;AACnF,gFAAgF;AAChF,+FAA+F;AAC/F,oCAAoC;AACpC,EAAE;AACF,kFAAkF;AAClF,8EAA8E;AAC9E,sFAAsF;AACtF,8DAA8D;AAE9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,6BAA6B,EAC7B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iCAAiC,EACjC,qCAAqC,EACrC,+BAA+B,EAC/B,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAEzF,wFAAwF;AACxF,gDAAgD;AAChD,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,+BAA+B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GZ,iFAAiF;AACjF,kFAAkF;AAClF,oFAAoF;AACpF,sCAAsC;AACtC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,KAAK,EAAE,6BAA6B;CACrC,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,kGAAkG;AAClG,kGAAkG;AAClG,mFAAmF;AACnF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,KAAK,EAAE,6BAA6B;IACpC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,QAAQ,EAAE,gCAAgC;IAC1C,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7D,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC;CAC9C,CAAC,CAAC;AAGH,4FAA4F;AAC5F,uCAAuC;AACvC,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC","sourcesContent":["// TTT notification contracts.\n//\n// `@ttt-productions/notification-core` is generic — at its package boundary a\n// notification's `metadata` is `Record<string, unknown>`. All TTT notification\n// policy lives here: the canonical type catalog (category / delivery / default\n// channels), the per-type typed `metadata` discriminated union, the broadcast\n// audience selector, and the callable input schemas. There is NO single send\n// chokepoint: ttt-prod has two intake lanes — reliable single/shared occurrences\n// (`writeReliableOccurrenceRow` / `enqueueReliableOccurrence`) and audience fanout\n// (`notificationFanoutJobs` → `processNotificationFanoutJobs`) — which converge on\n// the `notificationDeliveries` ledger, with `materializeDeliveries` as the sole\n// materializer. `validateNotificationMetadata` is the one check of a row's or job's `metadata`\n// against its type, for both lanes.\n//\n// The notification audit-event payload shapes live here too (the `AuditEventType`\n// union members `notification.broadcastSent` / `notification.adminArchived` /\n// `notification.adminArchiveAllRequested` are added in ../types/audit.ts; their actor\n// is always an admin mode — `adminReview` / `adminOverride`).\n\nimport { z } from 'zod';\nimport {\n userIdSchema,\n workProjectIdSchema,\n guildInviteIdSchema,\n adminDispatchIdSchema,\n hallItemIdSchema,\n thresholdItemIdSchema,\n changeRequestIdSchema,\n workProjectTypeSchema,\n notificationFanoutJobIdSchema,\n storedTitleSchema,\n reportGroupIdSchema,\n mediaAssetIdSchema,\n workRealmIdSchema,\n realmFileShareRequestIdSchema,\n documentIdSegmentSchema,\n activeNotificationIdSchema,\n} from './atoms.js';\nimport {\n MAX_THRESHOLD_REVIEW_NOTES_LENGTH,\n MAX_HALL_CHANGE_REQUEST_REASON_LENGTH,\n MAX_NOTIFICATION_MESSAGE_LENGTH,\n MAX_BROADCAST_EXPLICIT_UIDS,\n} from '../constants/business.js';\nimport { BROADCAST_MESSAGE_INPUT, BROADCAST_TITLE_INPUT } from '../constants/text-fields.js';\nimport { HallSubItemTypeSchema } from '../doc-schemas/content.js';\nimport { textFieldSchema } from './text-field.js';\nimport { ReportableItemTypeSchema } from '../doc-schemas/safety/foundation.js';\nimport { NotificationFanoutPrioritySchema } from '../doc-schemas/notification-ledger.js';\n\n// A stored broadcast message an announcement's metadata carries (the typed field is the\n// broadcast input's `BROADCAST_MESSAGE_INPUT`).\nconst storedNotificationMessageSchema = z.string().min(1).max(MAX_NOTIFICATION_MESSAGE_LENGTH);\n// The canonical reportable-item enum — never an open string (ARCH-102).\nconst reportedItemTypeSchema = ReportableItemTypeSchema;\nconst reportedItemIdSchema = documentIdSegmentSchema.max(128);\nconst reportIdSchema = documentIdSegmentSchema;\nconst appealIdSchema = documentIdSegmentSchema;\n\n// ============================================================================\n// TYPE + CHANNEL CATALOG\n// ============================================================================\n\nexport const NOTIFICATION_TYPE_VALUES = [\n 'content_report',\n 'guild_invite',\n 'admin_dispatch_reply',\n // The FIRST message of a thread the admin team started — to the user, or to every active\n // member of the Work. A reply is `admin_dispatch_reply`.\n 'admin_dispatch_created',\n 'threshold_library_submission',\n // Author feedback for a Threshold Library review decision (only needs_revision is\n // delivered today — an approval reaches the author via the publish member fanout).\n 'threshold_library_reviewed',\n // Proposer feedback for a PUBLISHED change-request decision (approve/deny).\n 'hall_content_change_request_resolved',\n 'admin_announcement',\n 'followed_content_published',\n // The two audience-fanout triggers (see ttt-prod docs/design/notification-system.md).\n // `member_content_published`: the Hall-publish MEMBER job (\"your work was published!\") — same\n // `thresholdItemId` eventId as the follower job, different type so `deliveryId` stays distinct.\n // `followed_craft_skill_published`: craft-skill publish → the artisan's followers\n // (`staticRelight` strategy — count 1 forever, static copy, no count shown).\n 'member_content_published',\n 'followed_craft_skill_published',\n // Reporter feedback (DJ ruling 2026-07-06): when a report a user submitted is\n // closed as a REAL case WITH action (ordinary report root flips to `actioned`),\n // the reporter gets one light informational card. Never sent on dismissals.\n // Generic copy only — the card must not reveal the reported user, reason, or\n // remedy (a bad-faith reporter must not be able to probe moderation outcomes).\n 'report_action_taken',\n // Appellant feedback for a content-appeal decision (DJ ruling 2026-07-10 —\n // gap found by the hosted E2E build: reviewContentAppeal decided appeals with\n // NO channel reporting the outcome to the appellant). Fired on BOTH approve\n // and deny. It is the appellant's OWN appeal, so unlike report_action_taken\n // there is no privacy ceiling: the card states the outcome plainly and\n // targets My Uploads, where the resulting upload state lives.\n 'content_appeal_reviewed',\n // Realm shared-file promotion approval gate. TWO canonical types, one per direction of the\n // decision — never one type with a recipient discriminator, because they are different\n // cards on different trays with different dedup lifetimes:\n // - `realm_file_share_requested`: a Work file admin asked to share a file into a Realm →\n // the REALM STEWARD, who decides.\n // - `realm_file_share_resolved`: the pending request is no longer pending → the party who\n // did NOT act. `metadata.resolution` distinguishes `approved` | `declined` (to the\n // recorded REQUESTER) from `withdrawn` (to the STEWARD, whose queue card is now stale).\n // OCCURRENCE IDENTITY for both is the request id, so a re-request after a decline is a new\n // card rather than a relight of the resolved one.\n 'realm_file_share_requested',\n 'realm_file_share_resolved',\n] as const;\n\nexport const NotificationTypeSchema = z.enum(NOTIFICATION_TYPE_VALUES);\nexport type NotificationType = z.infer<typeof NotificationTypeSchema>;\n\n/** Delivery channels. Only `inApp` is implemented at launch; `email`/`push` are\n * reserved for future channel handlers. */\nexport const NOTIFICATION_CHANNEL_VALUES = ['inApp', 'email', 'push'] as const;\nexport const NotificationChannelSchema = z.enum(NOTIFICATION_CHANNEL_VALUES);\nexport type NotificationChannel = z.infer<typeof NotificationChannelSchema>;\n\nexport type NotificationCategory = 'user' | 'admin';\nexport const NotificationCategorySchema = z.enum(['user', 'admin']);\n\nexport interface NotificationTypeCatalogEntry {\n /** Which active collection / audience this type writes to. */\n category: NotificationCategory;\n /** `realtime` writes straight to active; `queued` goes through the batch processor. */\n delivery: 'realtime' | 'queued';\n /** Default channel list applied when a send omits `channels`. All `['inApp']` at launch. */\n defaultChannels: NotificationChannel[];\n}\n\n/**\n * The canonical TTT notification type catalog — the source `TTT_NOTIFICATION_CONFIG`\n * (../notifications) derives every type's category/delivery from. `defaultChannels`\n * is `['inApp']` for every type at launch.\n */\nexport const NOTIFICATION_TYPE_CATALOG: Record<NotificationType, NotificationTypeCatalogEntry> = {\n content_report: { category: 'admin', delivery: 'realtime', defaultChannels: ['inApp'] },\n guild_invite: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n admin_dispatch_reply: { category: 'user', delivery: 'realtime', defaultChannels: ['inApp'] },\n admin_dispatch_created: { category: 'user', delivery: 'realtime', defaultChannels: ['inApp'] },\n threshold_library_submission: { category: 'admin', delivery: 'queued', defaultChannels: ['inApp'] },\n threshold_library_reviewed: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n hall_content_change_request_resolved: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n admin_announcement: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n followed_content_published: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n member_content_published: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n followed_craft_skill_published: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n report_action_taken: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n content_appeal_reviewed: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n realm_file_share_requested: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n realm_file_share_resolved: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n};\n\n// ============================================================================\n// PER-TYPE METADATA (discriminated union, keyed by `type`)\n// ============================================================================\n\n/**\n * Typed `metadata` payload for each notification type. The generic package\n * boundary takes `Record<string, unknown>`; the app validates against this\n * before sending so each type's payload is checked like every other callable\n * schema.\n */\nexport const NotificationMetadataByTypeSchema = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('content_report'),\n reportGroupId: reportGroupIdSchema,\n reportedItemType: reportedItemTypeSchema,\n reportedItemId: reportedItemIdSchema,\n }).strict(),\n z.object({\n type: z.literal('guild_invite'),\n workProjectId: workProjectIdSchema,\n guildInviteId: guildInviteIdSchema,\n }).strict(),\n z.object({\n type: z.literal('admin_dispatch_reply'),\n adminDispatchId: adminDispatchIdSchema,\n // Party-generic dispatch: present on workProject-party threads so the card routes\n // to the Work's correspondence surface. Absent on user-party threads (legacy shape).\n partyKind: z.enum(['user', 'workProject']).optional(),\n workProjectId: workProjectIdSchema.optional(),\n }).strict(),\n z.object({\n type: z.literal('admin_dispatch_created'),\n adminDispatchId: adminDispatchIdSchema,\n partyKind: z.enum(['user', 'workProject']),\n // Set on workProject-party threads, so the card routes to the Work.\n workProjectId: workProjectIdSchema.optional(),\n }).strict(),\n z.object({\n type: z.literal('threshold_library_submission'),\n thresholdItemId: thresholdItemIdSchema,\n hallItemId: hallItemIdSchema,\n workProjectId: workProjectIdSchema,\n }).strict(),\n // Author feedback for a review decision. Mirrors what runReviewThresholdItem\n // (ttt-prod) sends: only `needs_revision` is delivered today; `adminNotes` is\n // the reviewer's note, sent as null when the reviewer left none.\n z.object({\n type: z.literal('threshold_library_reviewed'),\n thresholdItemId: thresholdItemIdSchema,\n hallItemId: hallItemIdSchema,\n workProjectId: workProjectIdSchema,\n workProjectType: workProjectTypeSchema,\n itemId: z.string().min(1),\n decision: z.literal('needs_revision'),\n adminNotes: z.string().max(MAX_THRESHOLD_REVIEW_NOTES_LENGTH).nullable(),\n }).strict(),\n // Proposer feedback for a published change-request decision. Mirrors what\n // runReviewHallContentChangeRequest (ttt-prod) sends: `resolutionReason` is\n // required on a deny, optional on an approve — null when absent. The realm\n // grain (R1) sends `workRealmId` with `hallItemId` null; hall grains the\n // reverse.\n z.object({\n type: z.literal('hall_content_change_request_resolved'),\n changeRequestId: changeRequestIdSchema,\n hallItemId: hallItemIdSchema.nullable(),\n workRealmId: z.string().min(1).nullish(),\n workProjectId: workProjectIdSchema,\n decision: z.enum(['approved', 'denied']),\n resolutionReason: z.string().max(MAX_HALL_CHANGE_REQUEST_REASON_LENGTH).nullable(),\n }).strict(),\n z.object({\n type: z.literal('admin_announcement'),\n title: storedTitleSchema,\n message: storedNotificationMessageSchema,\n }).strict(),\n z.object({\n type: z.literal('followed_content_published'),\n workProjectId: workProjectIdSchema,\n workRealmId: workRealmIdSchema.optional(),\n workTitle: storedTitleSchema,\n hallItemId: hallItemIdSchema,\n hallItemTitle: storedTitleSchema,\n hallSubItemType: HallSubItemTypeSchema,\n }).strict(),\n // P7 Hall-publish MEMBER job — same Hall-publication fields as the follower type (it describes\n // the SAME publication to the work's members; the work route + \"your work was published!\" copy\n // are set by the emitter via targetPath/title, not metadata).\n z.object({\n type: z.literal('member_content_published'),\n workProjectId: workProjectIdSchema,\n workRealmId: workRealmIdSchema.optional(),\n workTitle: storedTitleSchema,\n hallItemId: hallItemIdSchema,\n hallItemTitle: storedTitleSchema,\n hallSubItemType: HallSubItemTypeSchema,\n }).strict(),\n // P7 craft-skill publish — points at the artisan whose skills updated. The actor name\n // (\"X uploaded new craft skills\") + the profile/skills route resolve from `artisanUid` at\n // render time (Display Identity Invariant); `staticRelight` shows no count.\n z.object({\n type: z.literal('followed_craft_skill_published'),\n artisanUid: userIdSchema,\n }).strict(),\n // Reporter feedback — metadata is deliberately minimal: `reportId` is the\n // reporter's OWN report-root doc id (deterministic per reporterUid + target,\n // see writeOrdinaryReport), used only as the dedup/aggregation key so a\n // reporter gets at most one card per report they filed. NO fields that\n // identify the reported user/content/remedy may ever be added here.\n z.object({\n type: z.literal('report_action_taken'),\n reportId: reportIdSchema,\n }).strict(),\n // Appellant feedback for a content-appeal decision. `appealId` is the\n // appellant's OWN appeal doc id (the dedup/aggregation key — one card per\n // appeal, a re-decision coalesces); `decision` drives the card copy.\n z.object({\n type: z.literal('content_appeal_reviewed'),\n appealId: appealIdSchema,\n decision: z.enum(['approved', 'denied']),\n }).strict(),\n // Realm shared-file promotion REQUEST → the Realm steward. Ids only: the Realm name, the\n // Work name, the file name, and the requester's display name all resolve at render from\n // these ids (Display Identity Invariant) — a snapshot here would go stale the moment any\n // of them is renamed or moderated.\n z.object({\n type: z.literal('realm_file_share_requested'),\n workRealmId: workRealmIdSchema,\n workProjectId: workProjectIdSchema,\n mediaAssetId: mediaAssetIdSchema,\n workFileId: z.string().min(1),\n // The occurrence/dedup identity — one card per request, forever.\n requestId: realmFileShareRequestIdSchema,\n requestedByUid: userIdSchema,\n }).strict(),\n // Realm shared-file promotion RESOLUTION. `resolution` both drives the card copy AND\n // identifies the audience: `approved`/`declined` go to the recorded requester,\n // `withdrawn` goes to the steward whose pending card is now stale.\n z.object({\n type: z.literal('realm_file_share_resolved'),\n workRealmId: workRealmIdSchema,\n workProjectId: workProjectIdSchema,\n mediaAssetId: mediaAssetIdSchema,\n workFileId: z.string().min(1),\n requestId: realmFileShareRequestIdSchema,\n resolution: z.enum(['approved', 'declined', 'withdrawn']),\n }).strict(),\n]);\nexport type NotificationMetadataByType = z.infer<typeof NotificationMetadataByTypeSchema>;\n\n/**\n * The one check of a notification's `metadata` against its type, for both intake lanes: the\n * reliable lane's delivery rows and the fanout lane's jobs. Metadata never carries the `type`\n * discriminant itself (it would hide the type the notification is sent as). Throws on a mismatch.\n */\nexport function validateNotificationMetadata(\n type: NotificationType,\n metadata: Record<string, unknown>,\n): NotificationMetadataByType {\n if (Object.prototype.hasOwnProperty.call(metadata, 'type')) {\n throw new TypeError('Notification metadata must not carry its own type.');\n }\n return NotificationMetadataByTypeSchema.parse({ ...metadata, type });\n}\n\n// ============================================================================\n// BROADCAST AUDIENCE SELECTOR\n// ============================================================================\n\n/**\n * Admin broadcast audience selector. Stored on a broadcast job; the scheduled\n * fan-out worker resolves a page of it into uids (domain-aware queries live in\n * ttt-prod — the package only ever receives uids).\n */\nexport const BroadcastAudienceSelectorSchema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('allActiveUsers') }).strict(),\n z.object({\n kind: z.literal('explicitUids'),\n // The selector's documented audience cap (dedup + serialized-byte enforcement\n // for work/realm snapshots is app-side). Derives from the ONE named constant.\n uids: z.array(userIdSchema).min(1).max(MAX_BROADCAST_EXPLICIT_UIDS),\n }).strict(),\n z.object({\n kind: z.literal('workMembers'),\n workProjectId: workProjectIdSchema,\n }).strict(),\n z.object({\n kind: z.literal('realmMembers'),\n workRealmId: workRealmIdSchema,\n }).strict(),\n z.object({ kind: z.literal('allArtisans') }).strict(),\n]);\nexport type BroadcastAudienceSelector = z.infer<typeof BroadcastAudienceSelectorSchema>;\n\n// ============================================================================\n// CALLABLE INPUT SCHEMAS\n// ============================================================================\n\nexport const CreateNotificationBroadcastInputSchema = z.object({\n // Client-generated idempotency key — the app derives the broadcast eventId\n // deterministically from (actorUid, requestId) so a lost-ack retry is idempotent.\n requestId: z.string().min(1),\n selector: BroadcastAudienceSelectorSchema,\n title: textFieldSchema(BROADCAST_TITLE_INPUT),\n message: textFieldSchema(BROADCAST_MESSAGE_INPUT),\n}).strict();\nexport type CreateNotificationBroadcastInput = z.infer<typeof CreateNotificationBroadcastInputSchema>;\n\n/** Archive scope: a single notification, or the caller's whole category. */\nexport const ArchiveNotificationScopeSchema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('single'), notificationId: activeNotificationIdSchema }).strict(),\n z.object({ kind: z.literal('all') }).strict(),\n]);\nexport type ArchiveNotificationScope = z.infer<typeof ArchiveNotificationScopeSchema>;\n\n// No `device` field on the archive input — archive metadata is server-derived (A1).\nexport const ArchiveNotificationInputSchema = z.object({\n category: NotificationCategorySchema,\n scope: ArchiveNotificationScopeSchema,\n}).strict();\nexport type ArchiveNotificationInput = z.infer<typeof ArchiveNotificationInputSchema>;\n\n// Shared admin notifications have no per-admin seen state, so only the personal\n// `user` category can be marked seen.\nexport const MarkNotificationsSeenInputSchema = z.object({\n category: z.literal('user'),\n}).strict();\nexport type MarkNotificationsSeenInput = z.infer<typeof MarkNotificationsSeenInputSchema>;\n\n// ============================================================================\n// OBSERVED-GENERATION CALLABLE INPUT SCHEMAS (P6 tray)\n//\n// These are for the NEW observed-generation callables the P6 notification tray\n// will invoke. The LEGACY schemas above (MarkNotificationsSeenInputSchema /\n// ArchiveNotificationInputSchema) remain intact — the legacy callables still use\n// them.\n// ============================================================================\n\n// Max items per mark-seen call matches a sane notification tray page size.\nconst MARK_SEEN_MAX_ITEMS = 50;\n\n/**\n * A single rendered notification row and the generation the UI observed.\n * `activeId` is the Firestore active-notification document id;\n * `observedActivityGeneration` is the opaque token from that document.\n */\nconst SeenItemSchema = z.object({\n activeId: activeNotificationIdSchema,\n observedActivityGeneration: z.string().min(1),\n}).strict();\n\n/**\n * Input for the new observed-generation mark-seen callable (P6 tray).\n *\n * The UI sends only the rows it actually rendered plus their observed\n * `activityGeneration` tokens. The server sets `seenAt = now` ONLY when the\n * card's current `activityGeneration` matches `observedActivityGeneration`;\n * otherwise it is a no-op for that row (activity arrived after render, or a\n * delete+recreate rotated the token).\n *\n * category is always `'user'` — shared admin notifications have no per-admin\n * seen state.\n */\nexport const MarkNotificationsSeenObservedInputSchema = z.object({\n category: z.literal('user'),\n items: z.array(SeenItemSchema).min(1).max(MARK_SEEN_MAX_ITEMS),\n}).strict();\nexport type MarkNotificationsSeenObservedInput = z.infer<typeof MarkNotificationsSeenObservedInputSchema>;\n\n/**\n * Archive scope for the observed-generation callable.\n *\n * `single` — archive one notification card. Carries `notificationId` (the\n * active-card doc id) and `observedActivityGeneration` (the precondition:\n * the server archives only if the card's current generation matches).\n *\n * `all` — archive every card in the category. The per-card generation\n * precondition is applied server-side per card during bounded-page sweeps;\n * the caller supplies no single generation token here because there is no\n * single observed generation for the whole category. (Design choice: archive-all\n * carries no observedActivityGeneration at the top level; the server reads each\n * card's current generation as its own precondition. This is consistent with the\n * frozen \"mark-all/archive-all run bounded pages with stable cursors until\n * exhausted\" protocol (ttt-prod docs/design/notification-system.md) and the\n * archive-history identity formula\n * which keys each occurrence on requestId independently.)\n */\nexport const ArchiveNotificationObservedScopeSchema = z.discriminatedUnion('kind', [\n z.object({\n kind: z.literal('single'),\n notificationId: activeNotificationIdSchema,\n observedActivityGeneration: z.string().min(1),\n }).strict(),\n z.object({\n kind: z.literal('all'),\n }).strict(),\n]);\nexport type ArchiveNotificationObservedScope = z.infer<typeof ArchiveNotificationObservedScopeSchema>;\n\n/**\n * Input for the observed-generation archive callable (P6 tray).\n *\n * `requestId` is a per-call nonce — the tray mints a fresh uuid on every archive /\n * clear-all click, so it is NOT a replay-stability token (R39). Idempotency is provided\n * by ACTIVE-DOC DELETION: a replay finds the card already gone and no-ops, so an archive\n * never double-applies. The server combines `requestId` with the card's `activeId` to\n * form the deterministic history doc id (`hash('notification-archive', category,\n * audienceScope, requestId:activeId)`), so a single archive can never collide on another\n * card's history doc (R35).\n *\n * `category` scopes which active-notification collection is archived\n * (`activeUserNotifications` vs `activeAdminNotifications`) and forms part of\n * the history doc path.\n */\nexport const ArchiveNotificationObservedInputSchema = z.object({\n requestId: z.string().min(1),\n category: NotificationCategorySchema,\n scope: ArchiveNotificationObservedScopeSchema,\n}).strict();\nexport type ArchiveNotificationObservedInput = z.infer<typeof ArchiveNotificationObservedInputSchema>;\n\n/**\n * The `archiveNotification` answer: how many cards this call archived (0 when a single card was\n * relit after it rendered, so the row stays active), and for an archive-all, `hasMore` when the\n * call's bound stopped it before the category was empty. Non-strict (server → client posture).\n */\nexport const ArchiveNotificationResultSchema = z.object({\n success: z.literal(true),\n archived: z.number().int().nonnegative(),\n hasMore: z.boolean().optional(),\n});\nexport type ArchiveNotificationResult = z.infer<typeof ArchiveNotificationResultSchema>;\n\n// ============================================================================\n// SERVER-OWNED ARCHIVE-ALL JOB (replaces the browser clear-all loop)\n//\n// `enqueueArchiveAll` enqueues ONE durable archive-all job scoped to the tab's\n// category (idempotent per user+category+requestId) and returns { jobId }; the\n// bounded server worker drains that category's active cards each in its own\n// atomic archive+audit txn (per-card observed-generation precondition preserved).\n// `getArchiveAllStatus` is polled by the thin client hook. Per-tab scoping is\n// REQUIRED — a job only ever archives its own category, never all tabs.\n// ============================================================================\n\nexport const EnqueueArchiveAllInputSchema = z.object({\n requestId: z.string().min(1),\n category: NotificationCategorySchema,\n}).strict();\nexport type EnqueueArchiveAllInput = z.infer<typeof EnqueueArchiveAllInputSchema>;\n\nexport const GetArchiveAllStatusInputSchema = z.object({\n jobId: documentIdSegmentSchema,\n}).strict();\nexport type GetArchiveAllStatusInput = z.infer<typeof GetArchiveAllStatusInputSchema>;\n\n// Wire contract for the `resumeFanoutJob` callable — the admin console re-arms a\n// dead-lettered notification fanout job by id. Admin console-invoked, but still a\n// wire contract, so it lives here (callable-validation convention) rather than as a\n// local schema in the functions repo.\nexport const ResumeFanoutJobInputSchema = z.object({\n jobId: notificationFanoutJobIdSchema,\n}).strict();\nexport type ResumeFanoutJobInput = z.infer<typeof ResumeFanoutJobInputSchema>;\n\n// One dead-lettered fanout job in the Ops Repairs inventory (`listDeadLetteredFanoutJobs`, oldest\n// first): the job's own identity, type, and priority, when it parked and why, and how long it has\n// been parked. Server → client posture: non-strict, so the backend may add fields.\nexport const DeadLetteredFanoutJobRowSchema = z.object({\n jobId: notificationFanoutJobIdSchema,\n notificationType: z.string(),\n priority: NotificationFanoutPrioritySchema,\n deadLetteredAt: z.number().nullable(),\n lastError: z.string().nullable(),\n ageMs: z.number().nullable(),\n});\nexport type DeadLetteredFanoutJobRow = z.infer<typeof DeadLetteredFanoutJobRowSchema>;\n\nexport const ListDeadLetteredFanoutJobsResultSchema = z.object({\n jobs: z.array(DeadLetteredFanoutJobRowSchema),\n});\nexport type ListDeadLetteredFanoutJobsResult = z.infer<typeof ListDeadLetteredFanoutJobsResultSchema>;\n\n// The `resumeFanoutJob` re-arm: `resumed: false` with a `reason` when the job was no longer\n// dead-lettered (an idempotent no-op).\nexport const ResumeFanoutJobResultSchema = z.object({\n resumed: z.boolean(),\n reason: z.string().optional(),\n});\nexport type ResumeFanoutJobResult = z.infer<typeof ResumeFanoutJobResultSchema>;\n\n// ============================================================================\n// AUDIT EVENT PAYLOADS (admin-only)\n// ============================================================================\n\n/**\n * Payload of a `notification.broadcastSent` audit event — written when an admin\n * enqueues a broadcast. Actor mode is `adminReview` / `adminOverride`. Records\n * the selector (never a pre-resolved uid list) + the job it created.\n */\nexport interface NotificationBroadcastSentAuditMetadata {\n jobId: string;\n selector: BroadcastAudienceSelector;\n title: string;\n}\n\n/**\n * Payload of a `notification.adminArchived` audit event — written when an admin\n * clears a shared admin notification (the `handledBy` action). Actor mode is\n * `adminReview` / `adminOverride`.\n */\nexport interface NotificationAdminArchivedAuditMetadata {\n scope: 'single' | 'all';\n /** Present for single-archive; absent for a category-wide `all` archive. */\n notificationId?: string;\n handledBy: string;\n}\n\n/**\n * Payload of a `notification.adminArchiveAllRequested` audit event — written when an\n * admin enqueues an admin-category archive-all job, in the same commit as the job. It\n * is the event that carries the request's origin: the worker's per-card\n * `notification.adminArchived` events run after the request ended and record none.\n */\nexport interface NotificationAdminArchiveAllRequestedAuditMetadata {\n jobId: string;\n requestId: string;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { AuditEvent } from '@ttt-productions/audit-core';
2
2
  import type { SystemRole } from '../schemas/atoms.js';
3
- export type AuditEventType = 'artisanCreator.grantedToUser' | 'user.accountRegistered' | 'user.statusChanged' | 'user.accountSuspended' | 'user.accountBanned' | 'user.accountUnbanned' | 'user.displayNameResetForced' | 'user.displayNameChanged' | 'user.nonUsArtisanInterestRecorded' | 'user.signedIn' | 'user.passwordResetCompleted' | 'account.deletionRequested' | 'account.deletionCancelled' | 'account.erasureCompleted' | 'account.erasureParkedOnHold' | 'account.erasureSuperseded' | 'admin.systemRoleGranted' | 'admin.systemRoleRevoked' | 'admin.systemRoleSyncedFromDirectEdit' | 'admin.contentAppealReviewed' | 'admin.thresholdItemReviewed' | 'publicDocuments.released' | 'publicDocuments.accepted' | 'admin.reservedUsernamesSeeded' | 'admin.blockedFranchiseNamesSeeded' | 'admin.trademarkChecked' | 'content.parodyDisclaimerApplied' | 'workProject.created' | 'workProject.guildmateUserGuildStandingChanged' | 'workProject.guildmateUserTradeProfessionsChanged' | 'workProject.guildMemberDeparted' | 'workProject.publicDetailsUpdated' | 'workProject.workAssetDeleted' | 'workProject.fileFolderCreated' | 'workProject.fileFolderRenamed' | 'workProject.fileFolderAccessChanged' | 'workProject.fileFolderDeleted' | 'workProject.guildInviteSent' | 'workProject.guildInviteAccepted' | 'workProject.guildInviteDeclined' | 'workProject.guildInviteCancelled' | 'workProject.guildInviteStakeSharesUpdated' | 'workProject.commissionListingCreated' | 'workProject.commissionProposalCreated' | 'workProject.commissionClosed' | 'workProject.commissionProposalSaveToggled' | 'workProject.commissionProposalRejected' | 'workProject.stakeSharesChanged' | 'workProject.stakeShares.created' | 'workProject.stakeShares.increased' | 'workProject.stakeShares.anomaly' | 'workFile.realmShareRequested' | 'workFile.realmShareRequestWithdrawn' | 'workFile.realmSharePromotionApproved' | 'workFile.realmSharePromotionDeclined' | 'workFile.realmFileFolderAssignmentChanged' | 'workFile.realmCanonChanged' | 'workFile.unsharedFromRealm' | 'craftSkill.userCraftSkillDeleted' | 'craftSkill.hidden' | 'craftSkill.restored' | 'craftSkill.removed' | 'content.itemReported' | 'content.violationRecorded' | 'content.thresholdItemSubmitted' | 'content.thresholdItemWithdrawn' | 'content.hallItemPublished' | 'content.hallContentChangeRequestSubmitted' | 'admin.hallContentChangeRequestResolved' | 'content.appealSubmitted' | 'content.violationAccepted' | 'content.hidden' | 'content.restored' | 'content.removed' | 'content.taleWorkGenresUpdated' | 'content.chapterCreated' | 'content.chapterDetailsUpdated' | 'content.tuneWorkGenresUpdated' | 'content.tuneTrackCreated' | 'content.tuneTrackDetailsUpdated' | 'content.televisionWorkGenresUpdated' | 'content.televisionEpisodeCreated' | 'content.televisionEpisodeDetailsUpdated' | 'payment.sessionCreated' | 'payment.pledgePaymentCompleted' | 'payment.pledgePaymentAbandoned' | 'payment.pledgePaymentFailed' | 'payment.pledgePaymentQuarantined' | 'payment.pledgePaymentRefunded' | 'payment.pledgePaymentDisputeOpened' | 'payment.pledgePaymentDisputeClosed' | 'payment.pledgeRefundRequested' | 'payment.pledgeRefundRequestResolved' | 'payment.pledgeLedger.recorded' | 'payment.pledgeLedger.anomaly' | 'admin.taskCheckedOut' | 'admin.taskCheckedIn' | 'admin.taskReleased' | 'admin.taskAutoReleased' | 'admin.taskDeferredLater' | 'workProject.auditionCreated' | 'admin.auditionCreated' | 'audition.entryCreated' | 'audition.closedByUser' | 'audition.curatedBatchFailed' | 'system.manualIntervention' | 'system.appConfigUpdated' | 'admin.appModeFlipRecorded' | 'system.pendingMediaArchived' | 'system.orphanUploadsCleanedUp' | 'admin.profanityListSeeded' | 'admin.profanityListCurated' | 'system.videoSlotPublished' | 'admin.videoSlotCleared' | 'admin.systemUidSlotUpdated' | 'social.squareStreetzAgreementsAccepted' | 'social.squareStreetzPostLiked' | 'social.squareStreetzPostUnliked' | 'social.targetFollowed' | 'social.targetUnfollowed' | 'chat.guildChatChannelCreated' | 'chat.guildChatChannelUpdated' | 'chat.guildChatChannelArchived' | 'chat.guildChatChannelUnarchived' | 'chat.guildChatChannelDeleted' | 'chat.adminThreadStarted' | 'chat.adminThreadStatusChanged' | 'conversationFile.deleted' | 'chat.moderationActionRequested' | 'chat.moderationActionApplied' | 'chat.moderationActionFailed' | 'chat.moderationContextRead' | 'notification.broadcastSent' | 'notification.adminArchived' | 'workProject.released' | 'workProject.hidden' | 'workProject.restored' | 'workProject.moderationPlaceholderApplied' | 'workProject.moderationRetitleCleared' | 'workRealm.released' | 'workRealm.detailsUpdated' | 'workRealm.hidden' | 'workRealm.restored' | 'workRealm.moderationPlaceholderApplied' | 'workRealm.moderationRetitleCleared' | 'workRealm.fileFolderCreated' | 'workRealm.fileFolderUpdated' | 'workRealm.fileFolderDeleted' | 'hallItem.moderationPlaceholderApplied' | 'report.childSafetyCaseOpened' | 'report.nciiCaseOpened' | 'childSafety.reportDispositionSet' | 'childSafety.holdReleased' | 'childSafety.accountActionApplied' | 'childSafety.evidenceDisposed' | 'childSafety.quarantineCompleted' | 'childSafety.ncmecSubmissionCompleted' | 'childSafety.ncmecPortalReceiptArtifactRecorded' | 'childSafety.legalProcessRecorded' | 'childSafety.falsePositiveCorrected' | 'user.ageUpgradedToAdult' | 'user.orphanAuthDeleted' | 'user.accountClosedUnder13' | 'user.safetyLocked' | 'ncii.requestReceived' | 'ncii.validityDecided' | 'ncii.tempHoldPlaced' | 'ncii.tempHoldReleased' | 'ncii.removalCompleted' | 'ncii.removalUnableToComplete' | 'ncii.evidenceMarked' | 'ncii.requesterPiiScrubbed' | 'ncii.minorAssessmentSet' | 'ncii.crossoverLegReconciled' | 'safety.privilegedReauthPerformed' | 'safety.privilegedRawLocatorRead' | 'safety.deadlineBreachRecorded';
3
+ export type AuditEventType = 'artisanCreator.grantedToUser' | 'user.accountRegistered' | 'user.statusChanged' | 'user.accountSuspended' | 'user.accountBanned' | 'user.accountUnbanned' | 'user.displayNameResetForced' | 'user.displayNameChanged' | 'user.nonUsArtisanInterestRecorded' | 'user.signedIn' | 'user.passwordResetCompleted' | 'account.deletionRequested' | 'account.deletionCancelled' | 'account.erasureCompleted' | 'account.erasureParkedOnHold' | 'account.erasureSuperseded' | 'admin.systemRoleGranted' | 'admin.systemRoleRevoked' | 'admin.systemRoleSyncedFromDirectEdit' | 'admin.contentAppealReviewed' | 'admin.thresholdItemReviewed' | 'publicDocuments.released' | 'publicDocuments.accepted' | 'admin.reservedUsernamesSeeded' | 'admin.blockedFranchiseNamesSeeded' | 'admin.trademarkChecked' | 'content.parodyDisclaimerApplied' | 'workProject.created' | 'workProject.guildmateUserGuildStandingChanged' | 'workProject.guildmateUserTradeProfessionsChanged' | 'workProject.guildMemberDeparted' | 'workProject.publicDetailsUpdated' | 'workProject.workAssetDeleted' | 'workProject.fileFolderCreated' | 'workProject.fileFolderRenamed' | 'workProject.fileFolderAccessChanged' | 'workProject.fileFolderDeleted' | 'workProject.guildInviteSent' | 'workProject.guildInviteAccepted' | 'workProject.guildInviteDeclined' | 'workProject.guildInviteCancelled' | 'workProject.guildInviteStakeSharesUpdated' | 'workProject.commissionListingCreated' | 'workProject.commissionProposalCreated' | 'workProject.commissionClosed' | 'workProject.commissionProposalSaveToggled' | 'workProject.commissionProposalRejected' | 'workProject.stakeSharesChanged' | 'workProject.stakeShares.created' | 'workProject.stakeShares.increased' | 'workProject.stakeShares.anomaly' | 'workFile.realmShareRequested' | 'workFile.realmShareRequestWithdrawn' | 'workFile.realmSharePromotionApproved' | 'workFile.realmSharePromotionDeclined' | 'workFile.realmFileFolderAssignmentChanged' | 'workFile.realmCanonChanged' | 'workFile.unsharedFromRealm' | 'craftSkill.userCraftSkillDeleted' | 'craftSkill.hidden' | 'craftSkill.restored' | 'craftSkill.removed' | 'content.itemReported' | 'content.violationRecorded' | 'content.thresholdItemSubmitted' | 'content.thresholdItemWithdrawn' | 'content.hallItemPublished' | 'content.hallContentChangeRequestSubmitted' | 'admin.hallContentChangeRequestResolved' | 'content.appealSubmitted' | 'content.violationAccepted' | 'content.hidden' | 'content.restored' | 'content.removed' | 'content.taleWorkGenresUpdated' | 'content.chapterCreated' | 'content.chapterDetailsUpdated' | 'content.tuneWorkGenresUpdated' | 'content.tuneTrackCreated' | 'content.tuneTrackDetailsUpdated' | 'content.televisionWorkGenresUpdated' | 'content.televisionEpisodeCreated' | 'content.televisionEpisodeDetailsUpdated' | 'payment.sessionCreated' | 'payment.pledgePaymentCompleted' | 'payment.pledgePaymentAbandoned' | 'payment.pledgePaymentFailed' | 'payment.pledgePaymentQuarantined' | 'payment.pledgePaymentRefunded' | 'payment.pledgePaymentDisputeOpened' | 'payment.pledgePaymentDisputeClosed' | 'payment.pledgeRefundRequested' | 'payment.pledgeRefundRequestResolved' | 'payment.pledgeLedger.recorded' | 'payment.pledgeLedger.anomaly' | 'admin.taskCheckedOut' | 'admin.taskCheckedIn' | 'admin.taskReleased' | 'admin.taskAutoReleased' | 'admin.taskDeferredLater' | 'workProject.auditionCreated' | 'admin.auditionCreated' | 'audition.entryCreated' | 'audition.closedByUser' | 'audition.curatedBatchFailed' | 'system.manualIntervention' | 'system.appConfigUpdated' | 'admin.appModeFlipRecorded' | 'system.pendingMediaArchived' | 'system.orphanUploadsCleanedUp' | 'admin.profanityListSeeded' | 'admin.profanityListCurated' | 'system.videoSlotPublished' | 'admin.videoSlotCleared' | 'admin.systemUidSlotUpdated' | 'social.squareStreetzAgreementsAccepted' | 'social.squareStreetzPostLiked' | 'social.squareStreetzPostUnliked' | 'social.targetFollowed' | 'social.targetUnfollowed' | 'chat.guildChatChannelCreated' | 'chat.guildChatChannelUpdated' | 'chat.guildChatChannelArchived' | 'chat.guildChatChannelUnarchived' | 'chat.guildChatChannelDeleted' | 'chat.adminThreadStarted' | 'chat.adminThreadStatusChanged' | 'conversationFile.deleted' | 'chat.moderationActionRequested' | 'chat.moderationActionApplied' | 'chat.moderationActionFailed' | 'chat.moderationContextRead' | 'notification.broadcastSent' | 'notification.adminArchived' | 'notification.adminArchiveAllRequested' | 'workProject.released' | 'workProject.hidden' | 'workProject.restored' | 'workProject.moderationPlaceholderApplied' | 'workProject.moderationRetitleCleared' | 'workRealm.released' | 'workRealm.detailsUpdated' | 'workRealm.hidden' | 'workRealm.restored' | 'workRealm.moderationPlaceholderApplied' | 'workRealm.moderationRetitleCleared' | 'workRealm.fileFolderCreated' | 'workRealm.fileFolderUpdated' | 'workRealm.fileFolderDeleted' | 'hallItem.moderationPlaceholderApplied' | 'report.childSafetyCaseOpened' | 'report.nciiCaseOpened' | 'childSafety.reportDispositionSet' | 'childSafety.holdReleased' | 'childSafety.accountActionApplied' | 'childSafety.evidenceDisposed' | 'childSafety.quarantineCompleted' | 'childSafety.ncmecSubmissionCompleted' | 'childSafety.ncmecPortalReceiptArtifactRecorded' | 'childSafety.legalProcessRecorded' | 'childSafety.falsePositiveCorrected' | 'user.ageUpgradedToAdult' | 'user.orphanAuthDeleted' | 'user.accountClosedUnder13' | 'user.safetyLocked' | 'ncii.requestReceived' | 'ncii.validityDecided' | 'ncii.tempHoldPlaced' | 'ncii.tempHoldReleased' | 'ncii.removalCompleted' | 'ncii.removalUnableToComplete' | 'ncii.evidenceMarked' | 'ncii.requesterPiiScrubbed' | 'ncii.minorAssessmentSet' | 'ncii.crossoverLegReconciled' | 'safety.privilegedReauthPerformed' | 'safety.privilegedRawLocatorRead' | 'safety.deadlineBreachRecorded';
4
4
  /**
5
5
  * How the actor was acting when the audited action was performed. This is
6
6
  * orthogonal to the event name — the same event type can be produced by
@@ -1 +1 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/types/audit.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,MAAM,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BAAqB","sourcesContent":["// TTT audit event catalog. The `AuditEventType` union is the canonical list\n// of all sensitive actions the system logs. The `TTTAuditActor` and\n// `TTTAuditTarget` shapes describe who performed the action and what was\n// affected. `TTTAuditEvent` specializes the generic `AuditEvent` from\n// @ttt-productions/audit-core with the TTT-specific shapes.\n//\n// Backend writers and future native/TV/console readers all consume this\n// catalog from here.\n\nimport type { AuditEvent } from '@ttt-productions/audit-core';\nimport type { SystemRole } from '../schemas/atoms.js';\n\nexport type AuditEventType =\n // user status\n | 'artisanCreator.grantedToUser'\n | 'user.accountRegistered'\n | 'user.statusChanged'\n | 'user.accountSuspended'\n | 'user.accountBanned'\n | 'user.accountUnbanned'\n | 'user.displayNameResetForced'\n | 'user.displayNameChanged'\n | 'user.nonUsArtisanInterestRecorded'\n // Credential and session records, each with the request origin: the sign-in the Identity Platform\n // hook records, and a completed password reset, recorded from Identity Platform's own request log.\n | 'user.signedIn'\n | 'user.passwordResetCompleted'\n // account deletion / GDPR erasure (N3)\n | 'account.deletionRequested'\n | 'account.deletionCancelled'\n | 'account.erasureCompleted'\n | 'account.erasureParkedOnHold'\n | 'account.erasureSuperseded'\n // admin actions\n | 'admin.systemRoleGranted'\n | 'admin.systemRoleRevoked'\n | 'admin.systemRoleSyncedFromDirectEdit'\n | 'admin.contentAppealReviewed'\n | 'admin.thresholdItemReviewed'\n // versioned public documents. Payload shapes: PublicDocumentsReleasedAuditPayload /\n // PublicDocumentsAcceptedAuditPayload in ../schemas/public-documents.ts. `accepted` is the\n // ONLY acceptance history (registration and the re-acceptance prompt both write it).\n | 'publicDocuments.released'\n | 'publicDocuments.accepted'\n // admin launch-seed actions (Ready for Launch tab)\n | 'admin.reservedUsernamesSeeded'\n | 'admin.blockedFranchiseNamesSeeded'\n // trademark-assist (advisory check at approval) + parody/real-people disclaimer baked at approval\n | 'admin.trademarkChecked'\n | 'content.parodyDisclaimerApplied'\n // workProject\n | 'workProject.created'\n | 'workProject.guildmateUserGuildStandingChanged'\n | 'workProject.guildmateUserTradeProfessionsChanged'\n // Member self-leave (leaveWorkProject) — pre-publish voluntary exit, shares forfeited to the pool.\n | 'workProject.guildMemberDeparted'\n | 'workProject.publicDetailsUpdated'\n | 'workProject.workAssetDeleted'\n // work-file folders (S7). fileFolderAccessChanged is an ACL change (folder trade-profession\n // view/upload/delete lists gate custom-folder confidentiality) — audited with before/after lists.\n | 'workProject.fileFolderCreated'\n | 'workProject.fileFolderRenamed'\n | 'workProject.fileFolderAccessChanged'\n | 'workProject.fileFolderDeleted'\n | 'workProject.guildInviteSent'\n | 'workProject.guildInviteAccepted'\n | 'workProject.guildInviteDeclined'\n | 'workProject.guildInviteCancelled'\n | 'workProject.guildInviteStakeSharesUpdated'\n | 'workProject.commissionListingCreated'\n | 'workProject.commissionProposalCreated'\n | 'workProject.commissionClosed'\n | 'workProject.commissionProposalSaveToggled'\n | 'workProject.commissionProposalRejected'\n | 'workProject.stakeSharesChanged'\n | 'workProject.stakeShares.created'\n | 'workProject.stakeShares.increased'\n | 'workProject.stakeShares.anomaly'\n // realm shared files — the promotion approval gate. A Work file admin REQUESTS promotion;\n // the Realm steward approves (assigning the folder) or declines; the requester may withdraw\n // while the request is still pending. Every one of these carries the request id, so a\n // request and its resolution are one traceable pair.\n | 'workFile.realmShareRequested'\n | 'workFile.realmShareRequestWithdrawn'\n | 'workFile.realmSharePromotionApproved'\n | 'workFile.realmSharePromotionDeclined'\n // The steward moves an already-approved shared file between realm folders.\n | 'workFile.realmFileFolderAssignmentChanged'\n // Canon toggle on an approved file + the ADMIN-only un-share (sharing is permanent for\n // members once approved; the only way out is an admin acting on a support thread).\n | 'workFile.realmCanonChanged'\n | 'workFile.unsharedFromRealm'\n // craft-skills\n | 'craftSkill.userCraftSkillDeleted'\n | 'craftSkill.hidden'\n | 'craftSkill.restored'\n | 'craftSkill.removed'\n // content\n | 'content.itemReported'\n | 'content.violationRecorded'\n | 'content.thresholdItemSubmitted'\n // Member-initiated pull-back of a still-pending threshold submission (withdraw callable —\n // deletes the threshold doc + admin task, flips the live sub-item back to unpublished).\n | 'content.thresholdItemWithdrawn'\n | 'content.hallItemPublished'\n // Published change requests (text-only at launch): a member proposes new text-field values\n // for a PUBLISHED hall item; an admin approves (server writes values in place) or denies.\n | 'content.hallContentChangeRequestSubmitted'\n | 'admin.hallContentChangeRequestResolved'\n | 'content.appealSubmitted'\n | 'content.violationAccepted'\n | 'content.hidden'\n | 'content.restored'\n | 'content.removed'\n // content (workProject content)\n | 'content.taleWorkGenresUpdated'\n | 'content.chapterCreated'\n | 'content.chapterDetailsUpdated'\n | 'content.tuneWorkGenresUpdated'\n | 'content.tuneTrackCreated'\n | 'content.tuneTrackDetailsUpdated'\n | 'content.televisionWorkGenresUpdated'\n | 'content.televisionEpisodeCreated'\n | 'content.televisionEpisodeDetailsUpdated'\n // money\n | 'payment.sessionCreated'\n | 'payment.pledgePaymentCompleted'\n | 'payment.pledgePaymentAbandoned'\n | 'payment.pledgePaymentFailed'\n | 'payment.pledgePaymentQuarantined'\n // money — refund + dispute lifecycle (post-launch handlers; types added now to avoid a\n // second package publish). Refund REQUESTS are the user-initiated ask; the refund itself is\n // the money movement. Disputes are Stripe-initiated (chargeback) open/close.\n | 'payment.pledgePaymentRefunded'\n | 'payment.pledgePaymentDisputeOpened'\n | 'payment.pledgePaymentDisputeClosed'\n | 'payment.pledgeRefundRequested'\n | 'payment.pledgeRefundRequestResolved'\n // money — independent ledger-integrity trigger (mirrors workProject.stakeShares.*)\n | 'payment.pledgeLedger.recorded'\n | 'payment.pledgeLedger.anomaly'\n // admin task lifecycle\n | 'admin.taskCheckedOut'\n | 'admin.taskCheckedIn'\n | 'admin.taskReleased'\n | 'admin.taskAutoReleased'\n | 'admin.taskDeferredLater'\n // audition\n | 'workProject.auditionCreated'\n | 'admin.auditionCreated'\n | 'audition.entryCreated'\n | 'audition.closedByUser'\n // system-actor event: a curated audition's option batch failed to assemble (media\n // rejection) and its curatedAssemblyStatus flipped to 'failed' (runFailCuratedAudition).\n | 'audition.curatedBatchFailed'\n // system\n | 'system.manualIntervention'\n | 'system.appConfigUpdated'\n // records (never controls) a charter↔full APP_MODE flip after deploy — written\n // by the idempotent recordAppModeFlip admin callable\n | 'admin.appModeFlipRecorded'\n | 'system.pendingMediaArchived'\n | 'system.orphanUploadsCleanedUp'\n | 'admin.profanityListSeeded'\n | 'admin.profanityListCurated'\n // system slots: a slot's new video published (system actor), a video slot cleared, and an\n // account slot set or cleared (admin actors)\n | 'system.videoSlotPublished'\n | 'admin.videoSlotCleared'\n | 'admin.systemUidSlotUpdated'\n // social. Payload shape of the Square agreements acceptance:\n // SquareStreetzAgreementsAcceptedAuditPayload in ../schemas/users.ts.\n | 'social.squareStreetzAgreementsAccepted'\n | 'social.squareStreetzPostLiked'\n | 'social.squareStreetzPostUnliked'\n | 'social.targetFollowed'\n | 'social.targetUnfollowed'\n // chat\n | 'chat.guildChatChannelCreated'\n | 'chat.guildChatChannelUpdated'\n | 'chat.guildChatChannelArchived'\n | 'chat.guildChatChannelUnarchived'\n | 'chat.guildChatChannelDeleted'\n | 'chat.adminThreadStarted'\n | 'chat.adminThreadStatusChanged'\n // conversation files — every successful delete is audited with UID references and\n // canonical resource ids (the conversation ref, conversationFileId, mediaAssetId).\n | 'conversationFile.deleted'\n // chat moderation (DO-owned hide/delete via chatAdminActionCommands) — append-only,\n // deterministic ids hash('chat-moderation-{requested,applied,failed}', requestId, …).\n | 'chat.moderationActionRequested'\n | 'chat.moderationActionApplied'\n | 'chat.moderationActionFailed'\n // case-bound admin context read (read-on-demand, REVIEW-ONLY) — audits the request\n // AND outcome; one event per read keyed deterministically by the read's requestId.\n | 'chat.moderationContextRead'\n // notification (admin-only). Actor mode is always adminReview / adminOverride.\n // Payload shapes: NotificationBroadcastSentAuditMetadata /\n // NotificationAdminArchivedAuditMetadata in ../schemas/notification.ts.\n | 'notification.broadcastSent'\n | 'notification.adminArchived'\n // workProject\n | 'workProject.released'\n | 'workProject.hidden'\n | 'workProject.restored'\n | 'workProject.moderationPlaceholderApplied'\n | 'workProject.moderationRetitleCleared'\n | 'workRealm.released'\n | 'workRealm.detailsUpdated'\n | 'workRealm.hidden'\n | 'workRealm.restored'\n | 'workRealm.moderationPlaceholderApplied'\n | 'workRealm.moderationRetitleCleared'\n // Realm shared-file FOLDER management (steward-curated, Realm-wide-visible names —\n // mirrors the workProject.fileFolder* family). The Realm folder has no access lists, so\n // there is no `AccessChanged` sibling: a rename is the only in-place edit.\n | 'workRealm.fileFolderCreated'\n | 'workRealm.fileFolderUpdated'\n | 'workRealm.fileFolderDeleted'\n // hall-content moderation text-clear remedy (extends the workProject/workRealm placeholder\n // family across Tale/Tune/Television details + their chapter/track/episode sub-items and the\n // published Hall projections). Same past-tense placeholder-applied shape as the pair above.\n | 'hallItem.moderationPlaceholderApplied'\n // trust & safety — child safety / CSAM\n | 'report.childSafetyCaseOpened'\n | 'report.nciiCaseOpened'\n | 'childSafety.reportDispositionSet'\n | 'childSafety.holdReleased'\n | 'childSafety.accountActionApplied'\n | 'childSafety.evidenceDisposed'\n | 'childSafety.quarantineCompleted'\n | 'childSafety.ncmecSubmissionCompleted'\n | 'childSafety.ncmecPortalReceiptArtifactRecorded'\n | 'childSafety.legalProcessRecorded'\n | 'childSafety.falsePositiveCorrected'\n // trust & safety — age / registration\n | 'user.ageUpgradedToAdult'\n | 'user.orphanAuthDeleted'\n | 'user.accountClosedUnder13'\n | 'user.safetyLocked'\n // trust & safety — NCII / TAKE IT DOWN\n | 'ncii.requestReceived'\n | 'ncii.validityDecided'\n | 'ncii.tempHoldPlaced'\n | 'ncii.tempHoldReleased'\n | 'ncii.removalCompleted'\n | 'ncii.removalUnableToComplete'\n // operator marks NCII evidence (e.g. flags/annotates an evidence item on the case) — a reviewed\n // evidence-handling action, audited like the other ncii evidence events.\n | 'ncii.evidenceMarked'\n | 'ncii.requesterPiiScrubbed'\n // operator sets the child-safety crossover minorAssessment on an NCII case (e.g. → possibleMinor):\n // routing action that opens/links a PARALLEL child-safety review + deny-serving + PhotoDNA, WITHOUT\n // touching the NCII removal clock and WITHOUT auto-NCMEC. Payload records from→to assessment.\n | 'ncii.minorAssessmentSet'\n // [H-2] a failed possible-minor crossover leg (serving-deny / PhotoDNA) was reconciled or replayed\n // by an operator/reconciler (crossoverLegs.<leg> failed → done). Payload records which leg + outcome.\n | 'ncii.crossoverLegReconciled'\n // trust & safety — operator security\n // Passkey enrollment/assertion reuses safety.privilegedReauthPerformed (the reauth catalog entry, as\n // the TOTP step-up enroll/confirm/verify phases already do) — no distinct passkey-registration type.\n | 'safety.privilegedReauthPerformed'\n // [P2-08] A privileged operator read of a TAKE IT DOWN request's RAW target locator (the\n // reveal-on-demand, review-only read of the sensitive locator itself — distinct from the\n // reveal reauth above, which is the step-up). One event per read. Mirrors the\n // chat.moderationContextRead privileged-read convention.\n | 'safety.privilegedRawLocatorRead'\n | 'safety.deadlineBreachRecorded';\n\n/**\n * How the actor was acting when the audited action was performed. This is\n * orthogonal to the event name — the same event type can be produced by\n * different actor modes (e.g. a normal member vs. an admin override).\n *\n * - 'user' — authenticated action not tied to Work guild membership\n * - 'guildmateUser' — acting through normal Work guild (guild standing) permissions\n * - 'adminReview' — admin queue/support work on admin surfaces (no guild-permission concept)\n * - 'adminOverride' — system-admin authority superseding normal user/guild permission\n * - 'system' — backend automation: trigger, scheduled job, migration, media pipeline\n */\nexport type TTTAuditActorMode =\n | 'user'\n | 'guildmateUser'\n | 'adminReview'\n | 'adminOverride'\n | 'system';\n\n/** Fields common to every audited actor regardless of mode. `isAdmin` is\n * claim-present metadata only — it records that the caller held an admin\n * claim at the time, NOT that the action was an override. */\nexport type TTTAuditActorBase = {\n uid: string | null;\n isAdmin: boolean;\n};\n\n/** TTT actor shape, discriminated on `actorMode`. The admin system role is\n * REQUIRED on admin modes (adminReview / adminOverride) and FORBIDDEN on\n * non-admin modes (user / guildmateUser / system) — so an admin action can\n * never be audited without recording full-vs-jr, and a non-admin action can\n * never carry a spurious role. */\nexport type TTTAuditActor =\n | (TTTAuditActorBase & {\n actorMode: 'user' | 'guildmateUser' | 'system';\n systemRole?: never;\n })\n | (TTTAuditActorBase & {\n actorMode: 'adminReview' | 'adminOverride';\n systemRole: SystemRole;\n });\n\n/**\n * TTT target shape: the uid the audited action affects (if any), plus the\n * Firestore path of the affected document (if any).\n */\nexport type TTTAuditTarget = { uid: string | null; ref: string | null };\n\n/**\n * The canonical TTT audit event document shape. Specializes the generic\n * `AuditEvent` from @ttt-productions/audit-core with the TTT event-type\n * union, actor shape, target shape, and a generic metadata bag.\n */\nexport type TTTAuditEvent = AuditEvent<\n AuditEventType,\n TTTAuditActor,\n TTTAuditTarget,\n Record<string, unknown>\n>;\n\n"]}
1
+ {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/types/audit.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,oEAAoE;AACpE,yEAAyE;AACzE,sEAAsE;AACtE,4DAA4D;AAC5D,EAAE;AACF,wEAAwE;AACxE,qBAAqB","sourcesContent":["// TTT audit event catalog. The `AuditEventType` union is the canonical list\n// of all sensitive actions the system logs. The `TTTAuditActor` and\n// `TTTAuditTarget` shapes describe who performed the action and what was\n// affected. `TTTAuditEvent` specializes the generic `AuditEvent` from\n// @ttt-productions/audit-core with the TTT-specific shapes.\n//\n// Backend writers and future native/TV/console readers all consume this\n// catalog from here.\n\nimport type { AuditEvent } from '@ttt-productions/audit-core';\nimport type { SystemRole } from '../schemas/atoms.js';\n\nexport type AuditEventType =\n // user status\n | 'artisanCreator.grantedToUser'\n | 'user.accountRegistered'\n | 'user.statusChanged'\n | 'user.accountSuspended'\n | 'user.accountBanned'\n | 'user.accountUnbanned'\n | 'user.displayNameResetForced'\n | 'user.displayNameChanged'\n | 'user.nonUsArtisanInterestRecorded'\n // Credential and session records, each with the request origin: the sign-in the Identity Platform\n // hook records, and a completed password reset, recorded from Identity Platform's own request log.\n | 'user.signedIn'\n | 'user.passwordResetCompleted'\n // account deletion / GDPR erasure (N3)\n | 'account.deletionRequested'\n | 'account.deletionCancelled'\n | 'account.erasureCompleted'\n | 'account.erasureParkedOnHold'\n | 'account.erasureSuperseded'\n // admin actions\n | 'admin.systemRoleGranted'\n | 'admin.systemRoleRevoked'\n | 'admin.systemRoleSyncedFromDirectEdit'\n | 'admin.contentAppealReviewed'\n | 'admin.thresholdItemReviewed'\n // versioned public documents. Payload shapes: PublicDocumentsReleasedAuditPayload /\n // PublicDocumentsAcceptedAuditPayload in ../schemas/public-documents.ts. `accepted` is the\n // ONLY acceptance history (registration and the re-acceptance prompt both write it).\n | 'publicDocuments.released'\n | 'publicDocuments.accepted'\n // admin launch-seed actions (Ready for Launch tab)\n | 'admin.reservedUsernamesSeeded'\n | 'admin.blockedFranchiseNamesSeeded'\n // trademark-assist (advisory check at approval) + parody/real-people disclaimer baked at approval\n | 'admin.trademarkChecked'\n | 'content.parodyDisclaimerApplied'\n // workProject\n | 'workProject.created'\n | 'workProject.guildmateUserGuildStandingChanged'\n | 'workProject.guildmateUserTradeProfessionsChanged'\n // Member self-leave (leaveWorkProject) — pre-publish voluntary exit, shares forfeited to the pool.\n | 'workProject.guildMemberDeparted'\n | 'workProject.publicDetailsUpdated'\n | 'workProject.workAssetDeleted'\n // work-file folders (S7). fileFolderAccessChanged is an ACL change (folder trade-profession\n // view/upload/delete lists gate custom-folder confidentiality) — audited with before/after lists.\n | 'workProject.fileFolderCreated'\n | 'workProject.fileFolderRenamed'\n | 'workProject.fileFolderAccessChanged'\n | 'workProject.fileFolderDeleted'\n | 'workProject.guildInviteSent'\n | 'workProject.guildInviteAccepted'\n | 'workProject.guildInviteDeclined'\n | 'workProject.guildInviteCancelled'\n | 'workProject.guildInviteStakeSharesUpdated'\n | 'workProject.commissionListingCreated'\n | 'workProject.commissionProposalCreated'\n | 'workProject.commissionClosed'\n | 'workProject.commissionProposalSaveToggled'\n | 'workProject.commissionProposalRejected'\n | 'workProject.stakeSharesChanged'\n | 'workProject.stakeShares.created'\n | 'workProject.stakeShares.increased'\n | 'workProject.stakeShares.anomaly'\n // realm shared files — the promotion approval gate. A Work file admin REQUESTS promotion;\n // the Realm steward approves (assigning the folder) or declines; the requester may withdraw\n // while the request is still pending. Every one of these carries the request id, so a\n // request and its resolution are one traceable pair.\n | 'workFile.realmShareRequested'\n | 'workFile.realmShareRequestWithdrawn'\n | 'workFile.realmSharePromotionApproved'\n | 'workFile.realmSharePromotionDeclined'\n // The steward moves an already-approved shared file between realm folders.\n | 'workFile.realmFileFolderAssignmentChanged'\n // Canon toggle on an approved file + the ADMIN-only un-share (sharing is permanent for\n // members once approved; the only way out is an admin acting on a support thread).\n | 'workFile.realmCanonChanged'\n | 'workFile.unsharedFromRealm'\n // craft-skills\n | 'craftSkill.userCraftSkillDeleted'\n | 'craftSkill.hidden'\n | 'craftSkill.restored'\n | 'craftSkill.removed'\n // content\n | 'content.itemReported'\n | 'content.violationRecorded'\n | 'content.thresholdItemSubmitted'\n // Member-initiated pull-back of a still-pending threshold submission (withdraw callable —\n // deletes the threshold doc + admin task, flips the live sub-item back to unpublished).\n | 'content.thresholdItemWithdrawn'\n | 'content.hallItemPublished'\n // Published change requests (text-only at launch): a member proposes new text-field values\n // for a PUBLISHED hall item; an admin approves (server writes values in place) or denies.\n | 'content.hallContentChangeRequestSubmitted'\n | 'admin.hallContentChangeRequestResolved'\n | 'content.appealSubmitted'\n | 'content.violationAccepted'\n | 'content.hidden'\n | 'content.restored'\n | 'content.removed'\n // content (workProject content)\n | 'content.taleWorkGenresUpdated'\n | 'content.chapterCreated'\n | 'content.chapterDetailsUpdated'\n | 'content.tuneWorkGenresUpdated'\n | 'content.tuneTrackCreated'\n | 'content.tuneTrackDetailsUpdated'\n | 'content.televisionWorkGenresUpdated'\n | 'content.televisionEpisodeCreated'\n | 'content.televisionEpisodeDetailsUpdated'\n // money\n | 'payment.sessionCreated'\n | 'payment.pledgePaymentCompleted'\n | 'payment.pledgePaymentAbandoned'\n | 'payment.pledgePaymentFailed'\n | 'payment.pledgePaymentQuarantined'\n // money — refund + dispute lifecycle (post-launch handlers; types added now to avoid a\n // second package publish). Refund REQUESTS are the user-initiated ask; the refund itself is\n // the money movement. Disputes are Stripe-initiated (chargeback) open/close.\n | 'payment.pledgePaymentRefunded'\n | 'payment.pledgePaymentDisputeOpened'\n | 'payment.pledgePaymentDisputeClosed'\n | 'payment.pledgeRefundRequested'\n | 'payment.pledgeRefundRequestResolved'\n // money — independent ledger-integrity trigger (mirrors workProject.stakeShares.*)\n | 'payment.pledgeLedger.recorded'\n | 'payment.pledgeLedger.anomaly'\n // admin task lifecycle\n | 'admin.taskCheckedOut'\n | 'admin.taskCheckedIn'\n | 'admin.taskReleased'\n | 'admin.taskAutoReleased'\n | 'admin.taskDeferredLater'\n // audition\n | 'workProject.auditionCreated'\n | 'admin.auditionCreated'\n | 'audition.entryCreated'\n | 'audition.closedByUser'\n // system-actor event: a curated audition's option batch failed to assemble (media\n // rejection) and its curatedAssemblyStatus flipped to 'failed' (runFailCuratedAudition).\n | 'audition.curatedBatchFailed'\n // system\n | 'system.manualIntervention'\n | 'system.appConfigUpdated'\n // records (never controls) a charter↔full APP_MODE flip after deploy — written\n // by the idempotent recordAppModeFlip admin callable\n | 'admin.appModeFlipRecorded'\n | 'system.pendingMediaArchived'\n | 'system.orphanUploadsCleanedUp'\n | 'admin.profanityListSeeded'\n | 'admin.profanityListCurated'\n // system slots: a slot's new video published (system actor), a video slot cleared, and an\n // account slot set or cleared (admin actors)\n | 'system.videoSlotPublished'\n | 'admin.videoSlotCleared'\n | 'admin.systemUidSlotUpdated'\n // social. Payload shape of the Square agreements acceptance:\n // SquareStreetzAgreementsAcceptedAuditPayload in ../schemas/users.ts.\n | 'social.squareStreetzAgreementsAccepted'\n | 'social.squareStreetzPostLiked'\n | 'social.squareStreetzPostUnliked'\n | 'social.targetFollowed'\n | 'social.targetUnfollowed'\n // chat\n | 'chat.guildChatChannelCreated'\n | 'chat.guildChatChannelUpdated'\n | 'chat.guildChatChannelArchived'\n | 'chat.guildChatChannelUnarchived'\n | 'chat.guildChatChannelDeleted'\n | 'chat.adminThreadStarted'\n | 'chat.adminThreadStatusChanged'\n // conversation files — every successful delete is audited with UID references and\n // canonical resource ids (the conversation ref, conversationFileId, mediaAssetId).\n | 'conversationFile.deleted'\n // chat moderation (DO-owned hide/delete via chatAdminActionCommands) — append-only,\n // deterministic ids hash('chat-moderation-{requested,applied,failed}', requestId, …).\n | 'chat.moderationActionRequested'\n | 'chat.moderationActionApplied'\n | 'chat.moderationActionFailed'\n // case-bound admin context read (read-on-demand, REVIEW-ONLY) — audits the request\n // AND outcome; one event per read keyed deterministically by the read's requestId.\n | 'chat.moderationContextRead'\n // notification (admin-only). Actor mode is always adminReview / adminOverride.\n // Payload shapes: NotificationBroadcastSentAuditMetadata /\n // NotificationAdminArchivedAuditMetadata /\n // NotificationAdminArchiveAllRequestedAuditMetadata in ../schemas/notification.ts.\n | 'notification.broadcastSent'\n | 'notification.adminArchived'\n | 'notification.adminArchiveAllRequested'\n // workProject\n | 'workProject.released'\n | 'workProject.hidden'\n | 'workProject.restored'\n | 'workProject.moderationPlaceholderApplied'\n | 'workProject.moderationRetitleCleared'\n | 'workRealm.released'\n | 'workRealm.detailsUpdated'\n | 'workRealm.hidden'\n | 'workRealm.restored'\n | 'workRealm.moderationPlaceholderApplied'\n | 'workRealm.moderationRetitleCleared'\n // Realm shared-file FOLDER management (steward-curated, Realm-wide-visible names —\n // mirrors the workProject.fileFolder* family). The Realm folder has no access lists, so\n // there is no `AccessChanged` sibling: a rename is the only in-place edit.\n | 'workRealm.fileFolderCreated'\n | 'workRealm.fileFolderUpdated'\n | 'workRealm.fileFolderDeleted'\n // hall-content moderation text-clear remedy (extends the workProject/workRealm placeholder\n // family across Tale/Tune/Television details + their chapter/track/episode sub-items and the\n // published Hall projections). Same past-tense placeholder-applied shape as the pair above.\n | 'hallItem.moderationPlaceholderApplied'\n // trust & safety — child safety / CSAM\n | 'report.childSafetyCaseOpened'\n | 'report.nciiCaseOpened'\n | 'childSafety.reportDispositionSet'\n | 'childSafety.holdReleased'\n | 'childSafety.accountActionApplied'\n | 'childSafety.evidenceDisposed'\n | 'childSafety.quarantineCompleted'\n | 'childSafety.ncmecSubmissionCompleted'\n | 'childSafety.ncmecPortalReceiptArtifactRecorded'\n | 'childSafety.legalProcessRecorded'\n | 'childSafety.falsePositiveCorrected'\n // trust & safety — age / registration\n | 'user.ageUpgradedToAdult'\n | 'user.orphanAuthDeleted'\n | 'user.accountClosedUnder13'\n | 'user.safetyLocked'\n // trust & safety — NCII / TAKE IT DOWN\n | 'ncii.requestReceived'\n | 'ncii.validityDecided'\n | 'ncii.tempHoldPlaced'\n | 'ncii.tempHoldReleased'\n | 'ncii.removalCompleted'\n | 'ncii.removalUnableToComplete'\n // operator marks NCII evidence (e.g. flags/annotates an evidence item on the case) — a reviewed\n // evidence-handling action, audited like the other ncii evidence events.\n | 'ncii.evidenceMarked'\n | 'ncii.requesterPiiScrubbed'\n // operator sets the child-safety crossover minorAssessment on an NCII case (e.g. → possibleMinor):\n // routing action that opens/links a PARALLEL child-safety review + deny-serving + PhotoDNA, WITHOUT\n // touching the NCII removal clock and WITHOUT auto-NCMEC. Payload records from→to assessment.\n | 'ncii.minorAssessmentSet'\n // [H-2] a failed possible-minor crossover leg (serving-deny / PhotoDNA) was reconciled or replayed\n // by an operator/reconciler (crossoverLegs.<leg> failed → done). Payload records which leg + outcome.\n | 'ncii.crossoverLegReconciled'\n // trust & safety — operator security\n // Passkey enrollment/assertion reuses safety.privilegedReauthPerformed (the reauth catalog entry, as\n // the TOTP step-up enroll/confirm/verify phases already do) — no distinct passkey-registration type.\n | 'safety.privilegedReauthPerformed'\n // [P2-08] A privileged operator read of a TAKE IT DOWN request's RAW target locator (the\n // reveal-on-demand, review-only read of the sensitive locator itself — distinct from the\n // reveal reauth above, which is the step-up). One event per read. Mirrors the\n // chat.moderationContextRead privileged-read convention.\n | 'safety.privilegedRawLocatorRead'\n | 'safety.deadlineBreachRecorded';\n\n/**\n * How the actor was acting when the audited action was performed. This is\n * orthogonal to the event name — the same event type can be produced by\n * different actor modes (e.g. a normal member vs. an admin override).\n *\n * - 'user' — authenticated action not tied to Work guild membership\n * - 'guildmateUser' — acting through normal Work guild (guild standing) permissions\n * - 'adminReview' — admin queue/support work on admin surfaces (no guild-permission concept)\n * - 'adminOverride' — system-admin authority superseding normal user/guild permission\n * - 'system' — backend automation: trigger, scheduled job, migration, media pipeline\n */\nexport type TTTAuditActorMode =\n | 'user'\n | 'guildmateUser'\n | 'adminReview'\n | 'adminOverride'\n | 'system';\n\n/** Fields common to every audited actor regardless of mode. `isAdmin` is\n * claim-present metadata only — it records that the caller held an admin\n * claim at the time, NOT that the action was an override. */\nexport type TTTAuditActorBase = {\n uid: string | null;\n isAdmin: boolean;\n};\n\n/** TTT actor shape, discriminated on `actorMode`. The admin system role is\n * REQUIRED on admin modes (adminReview / adminOverride) and FORBIDDEN on\n * non-admin modes (user / guildmateUser / system) — so an admin action can\n * never be audited without recording full-vs-jr, and a non-admin action can\n * never carry a spurious role. */\nexport type TTTAuditActor =\n | (TTTAuditActorBase & {\n actorMode: 'user' | 'guildmateUser' | 'system';\n systemRole?: never;\n })\n | (TTTAuditActorBase & {\n actorMode: 'adminReview' | 'adminOverride';\n systemRole: SystemRole;\n });\n\n/**\n * TTT target shape: the uid the audited action affects (if any), plus the\n * Firestore path of the affected document (if any).\n */\nexport type TTTAuditTarget = { uid: string | null; ref: string | null };\n\n/**\n * The canonical TTT audit event document shape. Specializes the generic\n * `AuditEvent` from @ttt-productions/audit-core with the TTT event-type\n * union, actor shape, target shape, and a generic metadata bag.\n */\nexport type TTTAuditEvent = AuditEvent<\n AuditEventType,\n TTTAuditActor,\n TTTAuditTarget,\n Record<string, unknown>\n>;\n\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttt-productions/ttt-core",
3
- "version": "0.79.72",
3
+ "version": "0.79.73",
4
4
  "description": "Core types, Firestore path constants, and shared constants for TTT Productions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -118,7 +118,7 @@
118
118
  "@ttt-productions/edge-protocol-core": "^0.1.12",
119
119
  "@ttt-productions/input-format-core": "^0.1.1",
120
120
  "@ttt-productions/media-schemas": "^0.14.9",
121
- "@ttt-productions/notification-core": "^0.15.12",
121
+ "@ttt-productions/notification-core": "^0.15.13",
122
122
  "@ttt-productions/report-core": "^0.16.14",
123
123
  "zod": "^4.4.3"
124
124
  },