@ttt-productions/ttt-core 0.78.20 → 0.78.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/admin-labels.d.ts +1 -1
- package/dist/constants/admin-labels.js +2 -2
- package/dist/constants/admin-labels.js.map +1 -1
- package/dist/constants/center-stage-rooms.js +1 -1
- package/dist/constants/center-stage-rooms.js.map +1 -1
- package/dist/constants/company-mascots.js +1 -1
- package/dist/constants/company-mascots.js.map +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/media-processing.d.ts +13 -0
- package/dist/constants/media-processing.d.ts.map +1 -0
- package/dist/constants/media-processing.js +18 -0
- package/dist/constants/media-processing.js.map +1 -0
- package/dist/constants/publish-attestations.js +1 -1
- package/dist/constants/publish-attestations.js.map +1 -1
- package/dist/constants/safety-confirmation-phrases.js +1 -1
- package/dist/constants/safety-confirmation-phrases.js.map +1 -1
- package/dist/doc-schemas/account-deletion.js +1 -1
- package/dist/doc-schemas/account-deletion.js.map +1 -1
- package/dist/doc-schemas/moderation.d.ts +2 -0
- package/dist/doc-schemas/moderation.d.ts.map +1 -1
- package/dist/doc-schemas/registry.d.ts +18 -0
- package/dist/doc-schemas/registry.d.ts.map +1 -1
- package/dist/doc-schemas/registry.js +1 -1
- package/dist/doc-schemas/registry.js.map +1 -1
- package/dist/doc-schemas/safety/age.js +1 -1
- package/dist/doc-schemas/safety/age.js.map +1 -1
- package/dist/doc-schemas/safety/evidence.js +1 -1
- package/dist/doc-schemas/safety/evidence.js.map +1 -1
- package/dist/doc-schemas/safety/foundation.d.ts +3 -3
- package/dist/doc-schemas/safety/foundation.d.ts.map +1 -1
- package/dist/doc-schemas/safety/foundation.js +3 -3
- package/dist/doc-schemas/safety/foundation.js.map +1 -1
- package/dist/doc-schemas/square-announcement-jobs.d.ts +1 -1
- package/dist/doc-schemas/square-announcement-jobs.js +2 -2
- package/dist/doc-schemas/square-announcement-jobs.js.map +1 -1
- package/dist/media/pending-media.d.ts +32 -0
- package/dist/media/pending-media.d.ts.map +1 -1
- package/dist/media/target-info.js +1 -1
- package/dist/media/target-info.js.map +1 -1
- package/dist/paths/collections.js +2 -2
- package/dist/paths/collections.js.map +1 -1
- package/dist/paths/path-builders.js +1 -1
- package/dist/paths/path-builders.js.map +1 -1
- package/dist/paths/related-ids.js +1 -1
- package/dist/paths/related-ids.js.map +1 -1
- package/dist/safety/active-safety-case-alert.js +1 -1
- package/dist/safety/active-safety-case-alert.js.map +1 -1
- package/dist/safety/ncii-intake-derivations.js +1 -1
- package/dist/safety/ncii-intake-derivations.js.map +1 -1
- package/dist/safety/resource-keys.js +1 -1
- package/dist/safety/resource-keys.js.map +1 -1
- package/dist/schemas/chat.js +1 -1
- package/dist/schemas/chat.js.map +1 -1
- package/dist/schemas/craft-skills.js +1 -1
- package/dist/schemas/craft-skills.js.map +1 -1
- package/dist/schemas/hall-library.js +1 -1
- package/dist/schemas/hall-library.js.map +1 -1
- package/dist/schemas/notification.js +1 -1
- package/dist/schemas/notification.js.map +1 -1
- package/dist/schemas/safety.d.ts +1 -1
- package/dist/schemas/safety.js +1 -1
- package/dist/schemas/safety.js.map +1 -1
- package/dist/types/admin-ops.d.ts +1 -1
- package/dist/types/admin-ops.d.ts.map +1 -1
- package/dist/types/admin-ops.js +1 -1
- package/dist/types/admin-ops.js.map +1 -1
- package/dist/types/admin-users.js +1 -1
- package/dist/types/admin-users.js.map +1 -1
- package/dist/types/social.d.ts +1 -1
- package/dist/types/social.js.map +1 -1
- package/dist/upload-variables/create-admin-audition-variables.js +1 -1
- package/dist/upload-variables/create-admin-audition-variables.js.map +1 -1
- package/dist/upload-variables/create-work-project-audition-variables.js +1 -1
- package/dist/upload-variables/create-work-project-audition-variables.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foundation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;IACrD,eAAe,EAAE,yBAAyB;IAC1C,cAAc,EAAE,wBAAwB;IACxC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC/C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC3C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ;;;;;0CAK0C;AAC1C,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC","sourcesContent":["// Trust & Safety — shared foundation enums + the canonical target locator.\n//\n// This file is the SINGLE SOURCE for every enum and locator that crosses more\n// than one T&S cluster (report spine, case spine, holds, evidence, sagas,\n// NCMEC, NCII). Cluster document-schema files import their value sets from\n// HERE so two clusters can never define the same enum with drifting values.\n// Every value is transcribed verbatim from docs/code_changes_needed/\n// trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A (the frozen spec) — no\n// invented values, no placeholders.\n//\n// Cross-boundary: these types are consumed by both functions/src and src/ in\n// ttt-prod, so they live in ttt-core (the single source of truth for the\n// backend↔frontend boundary) and surface on the `@ttt-productions/ttt-core/\n// doc-schemas` subpath.\n\nimport { z } from 'zod';\nimport {\n MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH,\n MAX_SAFETY_ADMIN_NOTE_LENGTH,\n} from '../../constants/business.js';\n\n// ===========================================================================\n// A1 — Report reasons + reportable item types\n// ===========================================================================\n\n/** The controlling report-reason taxonomy (fixes the client/server drift\n * TS-032). The two protected reasons fork into a childSafetyCase / nciiCase. */\nexport const ReportReasonSchema = z.enum([\n 'Spam',\n 'Harassment',\n 'Hate Speech',\n 'Violence or Threats',\n 'Sexual Content',\n 'Self-Harm',\n 'Impersonation',\n 'Intellectual Property',\n 'Child Safety Concern', // → protected fork: childSafetyCase\n 'Nonconsensual Intimate Image (NCII)', // → protected fork: nciiCase\n 'Not related to on-site entertainment',\n 'Other',\n]);\nexport type ReportReason = z.infer<typeof ReportReasonSchema>;\n\n/** The two reasons that take the mandatory in-process protected branch. */\nexport const PROTECTED_REPORT_REASONS = [\n 'Child Safety Concern',\n 'Nonconsensual Intimate Image (NCII)',\n] as const satisfies readonly ReportReason[];\n\n/** Which protected fork a protected-reason report committed. */\nexport const ProtectedForkSchema = z.enum(['childSafetyCase', 'nciiCase']);\nexport type ProtectedFork = z.infer<typeof ProtectedForkSchema>;\n\n/** EXACTLY the `reportableItems` keys in ttt-prod src/lib/report-config.ts. A\n * ttt-prod CI test asserts this enum and `reportableItems` stay in sync (the\n * sync test lives app-side because report-config.ts is app-side). */\nexport const ReportableItemTypeSchema = z.enum([\n 'username',\n 'craft-skill',\n 'commission-listing',\n 'commission-proposal',\n 'square-streetz-post',\n 'profile-picture',\n 'guild-invite-message',\n 'guild-chat-message',\n // A single message in a WORK-PARTY admin correspondence thread (pendingAdminDispatches\n // partyKind 'workProject' — the one multi-member chat surface transported through\n // Firestore `conversationMessages`). The resolver enforces the work-party kind\n // server-side; user↔admin support threads are NOT reportable (an admin is already a\n // participant in every thread — DJ ruling 2026-07-13).\n 'admin-work-message',\n 'hall-library-item',\n // [EUAS-017] a single Hall sub-item (a Tale chapter / Tune track / Television episode). The\n // `hallItem` TargetLocatorV1 already carries an optional `subItemId`; the report UI passes the\n // sub-item id + its parent hall item, and the resolver derives the canonical sub-item path\n // server-side. Admins can already hide a single sub-item (runSetHallSubItemHidden) — this makes the\n // matching user-facing report reachable.\n 'hall-library-sub-item',\n 'audition',\n 'audition-entry',\n 'work-project',\n 'work-asset',\n 'work-realm',\n]);\nexport type ReportableItemType = z.infer<typeof ReportableItemTypeSchema>;\n\n/** The DO-transported chat report types — no Firestore message doc / owner exists to\n * hold at intake (H-04 V1); the resolver goes through the signed chat-Worker context\n * read. `admin-work-message` is NOT here: its messages are Firestore docs. Derived\n * subset — compile-linked to the canonical enum, never a re-declared string set. */\nexport const CHAT_REPORT_ITEM_TYPES = [\n 'guild-chat-message',\n 'guild-invite-message',\n] as const satisfies readonly ReportableItemType[];\n\n/** Item types whose report work-view renders the content-action (moderate) panel —\n * the backend moderation cores accept these. Compile-linked subset of the enum. */\nexport const CONTENT_ACTION_PANEL_ITEM_TYPES = [\n 'square-streetz-post',\n 'audition',\n 'audition-entry',\n 'commission-listing',\n 'commission-proposal',\n 'work-asset',\n 'profile-picture',\n 'hall-library-item',\n 'hall-library-sub-item',\n 'craft-skill',\n // Work-party admin correspondence message — single-doc hidden flip (2026-07-13).\n 'admin-work-message',\n] as const satisfies readonly ReportableItemType[];\nexport type ContentActionPanelItemType = (typeof CONTENT_ACTION_PANEL_ITEM_TYPES)[number];\n\n// ===========================================================================\n// A11 — Target locator (the ONE typed locator used by allegations, temp holds,\n// removal targets, and the report resolver) + privacy-safe summary\n// ===========================================================================\n\n/** Discriminated locator — replaces every all-optional `contentRef`. Every\n * hideable surface in report-config.ts has a typed locator ([H-02]). */\nexport const TargetLocatorV1Schema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('mediaAsset'), mediaAssetId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('hallItem'), hallItemId: z.string().min(1), subItemId: z.string().min(1).optional() }).strict(),\n z.object({ kind: z.literal('squarePost'), postId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('profileImage'), profileUid: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('username'), profileUid: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('craftSkill'), profileUid: z.string().min(1), craftSkillId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('commissionListing'), commissionListingId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('commissionProposal'), commissionListingId: z.string().min(1), commissionProposalId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('workProject'), workProjectId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('workAsset'), workProjectId: z.string().min(1), workAssetId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('workRealm'), workRealmId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('audition'), auditionId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('auditionEntry'), auditionId: z.string().min(1), auditionEntryId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('guildInviteMessage'), channelId: z.string().min(1), messageId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('chatAttachment'), channelId: z.string().min(1), messageId: z.string().min(1), attachmentId: z.string().min(1) }).strict(),\n // [H-04 V1] Plain guild chat message (text-only or Worker-unresolved). Distinct from\n // `chatAttachment` (which carries an actual attachment id) so a text-only protected chat\n // report has a clean, unambiguous locator without misusing the attachment variant.\n z.object({ kind: z.literal('guildChatMessage'), channelId: z.string().min(1), messageId: z.string().min(1) }).strict(),\n // A work-party admin correspondence message — a Firestore doc at\n // pendingAdminDispatches/{adminDispatchId}/conversationMessages/{messageId} (unlike the\n // DO-addressed guildChatMessage/guildInviteMessage locators, messageId here is a doc id,\n // not a numeric seq).\n z.object({ kind: z.literal('adminWorkMessage'), adminDispatchId: z.string().min(1), messageId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('url'), url: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('additionalText'), textRef: z.string().min(1) }).strict(),\n]);\nexport type TargetLocatorV1 = z.infer<typeof TargetLocatorV1Schema>;\n\n/** The set of locator discriminants — used wherever only the `kind` is needed. */\nexport const TargetLocatorKindSchema = z.enum([\n 'mediaAsset',\n 'hallItem',\n 'squarePost',\n 'profileImage',\n 'username',\n 'craftSkill',\n 'commissionListing',\n 'commissionProposal',\n 'workProject',\n 'workAsset',\n 'workRealm',\n 'audition',\n 'auditionEntry',\n 'guildInviteMessage',\n 'chatAttachment',\n // [H-04 V1] Plain guild chat message locator (text-only / Worker-unresolved protected report).\n 'guildChatMessage',\n // Work-party admin correspondence message (Firestore conversationMessages doc).\n 'adminWorkMessage',\n 'url',\n 'additionalText',\n]);\nexport type TargetLocatorKind = z.infer<typeof TargetLocatorKindSchema>;\n\n/** Privacy-safe summary ONLY — no narrative / PII; used on roots + public rows. */\nexport const TargetLocatorSummaryV1Schema = z.object({\n kind: TargetLocatorKindSchema,\n surfaceLabel: z.string(),\n hasResolvedTarget: z.boolean(),\n}).strict();\nexport type TargetLocatorSummaryV1 = z.infer<typeof TargetLocatorSummaryV1Schema>;\n\n// ===========================================================================\n// A9 — Reporting determination + NCMEC submission state\n// ===========================================================================\n\n/** Case-level reporting determination (Finding-H6). The ONLY carrier of \"no\n * NCMEC report required\" — `notRequired` was removed from NcmecSubmissionState. */\nexport const ReportDispositionSchema = z.enum([\n 'undetermined',\n 'reportRequired',\n 'notRequired',\n 'correctedNoApparentViolation',\n]);\nexport type ReportDisposition = z.infer<typeof ReportDispositionSchema>;\n\n/** Reason codes for the privileged setReportDisposition command (§A9). The first five are the\n * not-required / exception reasons (no NCMEC report ever arose, or a triggering signal was\n * corrected); the last two are the report-required reasons (a report IS legally required). The\n * disposition↔reason pairing is enforced by the ONE cross-field rule below (Rule 36). */\nexport const ReportDispositionReasonCodeSchema = z.enum([\n 'outOfScopeNotCsea',\n 'basisInvalidatedFalseMatch',\n 'duplicateOfFiledReport',\n 'leDirectedNoReport',\n 'nonReportableSafetyConfirmed',\n // Report-required reasons — valid ONLY with disposition 'reportRequired'.\n 'apparentCsamConfirmed', // human review confirmed apparent CSAM\n 'hashMatchValidated', // validated hash match\n]);\nexport type ReportDispositionReasonCode = z.infer<typeof ReportDispositionReasonCodeSchema>;\n\n/** The reason codes that ASSERT a reporting obligation — legal ONLY with 'reportRequired'.\n * Compile-linked subset of the canonical reason enum. */\nexport const REPORT_REQUIRED_DISPOSITION_REASON_CODES = [\n 'apparentCsamConfirmed',\n 'hashMatchValidated',\n] as const satisfies readonly ReportDispositionReasonCode[];\n\n/** The not-required / exception reason codes — legal with every disposition that does NOT assert a\n * reporting obligation ('notRequired', 'correctedNoApparentViolation'). Compile-linked subset. */\nexport const NOT_REQUIRED_DISPOSITION_REASON_CODES = [\n 'outOfScopeNotCsea',\n 'basisInvalidatedFalseMatch',\n 'duplicateOfFiledReport',\n 'leDirectedNoReport',\n 'nonReportableSafetyConfirmed',\n] as const satisfies readonly ReportDispositionReasonCode[];\n\n/** The ONE cross-field pairing (§A9, Rule 36): which reason codes each disposition permits.\n * Declared HERE once; both the setReportDisposition input (case.ts) and the SafetyDispositionAction\n * console command (admin.ts) apply `refineReportDispositionReasonCode` derived from this map rather\n * than re-declaring the pairing. 'undetermined' is the initial state, never an operator-settable\n * target, so it permits NO reason code (the operator command excludes it). Typed as an exhaustive\n * Record so a new disposition fails to compile until its permitted codes are declared. */\nexport const REPORT_DISPOSITION_ALLOWED_REASON_CODES: Record<\n ReportDisposition,\n readonly ReportDispositionReasonCode[]\n> = {\n undetermined: [],\n reportRequired: REPORT_REQUIRED_DISPOSITION_REASON_CODES,\n notRequired: NOT_REQUIRED_DISPOSITION_REASON_CODES,\n correctedNoApparentViolation: NOT_REQUIRED_DISPOSITION_REASON_CODES,\n};\n\n/** Shared cross-field refinement enforcing the disposition↔reason pairing above. Applied by BOTH\n * the setReportDisposition input schemas and the SafetyDispositionAction console command so the\n * rule lives in exactly one place. Reports the failure on the `dispositionReasonCode` path. */\nexport function refineReportDispositionReasonCode(\n value: { disposition: ReportDisposition; dispositionReasonCode: ReportDispositionReasonCode },\n ctx: z.RefinementCtx,\n): void {\n if (!REPORT_DISPOSITION_ALLOWED_REASON_CODES[value.disposition].includes(value.dispositionReasonCode)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['dispositionReasonCode'],\n message: `Reason code '${value.dispositionReasonCode}' is not valid for disposition '${value.disposition}'.`,\n });\n }\n}\n\n/** Shared cross-field rule (§A9): disposition 'reportRequired' MUST carry at least one evidence ref —\n * a reporting obligation can only be asserted once the evidence has been revealed. Every OTHER\n * disposition ('notRequired', 'correctedNoApparentViolation', 'undetermined') MAY leave evidenceRefs\n * empty. Declared HERE once (Rule 36) and applied — alongside refineReportDispositionReasonCode — by\n * BOTH the setReportDisposition input schemas (case.ts) and the SafetyStagedAction console command\n * (admin.ts), never re-declared. Reports the failure on the `evidenceRefs` path. */\nexport function refineReportDispositionEvidenceRefs(\n value: { disposition: ReportDisposition; evidenceRefs: readonly string[] },\n ctx: z.RefinementCtx,\n): void {\n if (value.disposition === 'reportRequired' && value.evidenceRefs.length === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['evidenceRefs'],\n message:\n \"Disposition 'reportRequired' requires at least one evidence ref (evidence must have been revealed).\",\n });\n }\n}\n\n// ===========================================================================\n// [EUAS-008] Structured safety-case CLOSURE record — the operator's terminal\n// determination persisted when a CSAM / NCII case is closed via the guided\n// resolution flow (resolveAdminTask). Embedded on the NCII case (`closure`) and on\n// a child-safety `decisions/{id}` row (kind `caseClosed`) so both case types carry\n// the SAME structured outcome/summary/note + actor/timestamp — not just a status\n// flip. This does NOT replace the case lifecycle's own terminal status; it records\n// WHO closed it, WHY, and with what outcome.\n// ===========================================================================\n\n/** founded = a violation was substantiated; unfounded = no violation on review. */\nexport const SafetyCaseClosureOutcomeSchema = z.enum(['founded', 'unfounded']);\nexport type SafetyCaseClosureOutcome = z.infer<typeof SafetyCaseClosureOutcomeSchema>;\n\n/** The structured closure record written on a safety-case close. */\nexport const SafetyCaseClosureV1Schema = z.object({\n outcome: SafetyCaseClosureOutcomeSchema,\n resolutionSummary: z.string().min(1).max(MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH),\n adminNote: z.string().max(MAX_SAFETY_ADMIN_NOTE_LENGTH).optional(),\n closedByUid: z.string().min(1),\n closedAt: z.number(),\n}).strict();\nexport type SafetyCaseClosureV1 = z.infer<typeof SafetyCaseClosureV1Schema>;\n\n/** NCMEC submission lifecycle — MANUAL-PORTAL model (§A9). NO `notRequired` (that is\n * ReportDisposition). There is no automated ispws API: a report-needed obligation sits in\n * `awaitingManualFiling` from enqueue until the operator files on the NCMEC portal and records the\n * confirmation (markNcmecPortalComplete → `completed`). Jobs are born `awaitingManualFiling`; the\n * case-list `ncmecStatus` projection uses the same value (no separate `queued` state). There is no\n * in-app retraction — corrections are portal-manual (correction-lifecycle decision). The old\n * API-drive states\n * (opening/open/uploading/addingFileDetails/finishing/retryableFailure/ambiguousResult/permanentFailure)\n * were removed with the live-API client. */\nexport const NcmecSubmissionStateSchema = z.enum([\n 'awaitingManualFiling',\n 'completed',\n]);\nexport type NcmecSubmissionState = z.infer<typeof NcmecSubmissionStateSchema>;\n\n// ===========================================================================\n// A3 — Safety-hold + resource-command vocabularies (the ONE destructive-guard\n// authority). The NCII/storage resource types live in THIS enum (H1 fix).\n// ===========================================================================\n\nexport const SafetyHoldResourceTypeSchema = z.enum([\n 'contentDoc',\n 'mediaAsset',\n 'account',\n 'chatMessageRange',\n 'channel',\n 'nciiTemporaryTarget',\n 'storageObject',\n 'reportEvidenceObject',\n]);\nexport type SafetyHoldResourceType = z.infer<typeof SafetyHoldResourceTypeSchema>;\n\n/** Lifecycle/retention regime governed by the A3 compatibility matrix. */\nexport const SafetyHoldClassSchema = z.enum([\n 'childSafety',\n 'nciiTemporary',\n 'legalRetention',\n 'preservationEvidence',\n // An OPEN ordinary (non-protected) content report places an account-level hold\n // (resourceType 'account', ownerUid = the reported user) so a user can't delete\n // their data out from under an unreviewed report (e.g. a DMCA/IP complaint, then\n // delete-to-clear-tracks). blocksDeletion + blocksAnonymization; released when the\n // report group's admin close-out resolves it. Durable (no expiresAt).\n 'ordinaryReport',\n]);\nexport type SafetyHoldClass = z.infer<typeof SafetyHoldClassSchema>;\n\n/** Resource-scoped destructive command kinds (A3). */\nexport const SafetyCommandKindSchema = z.enum([\n 'nciiRemoval',\n 'csamActiveByteRemoval',\n 'evidenceDisposition',\n]);\nexport type SafetyCommandKind = z.infer<typeof SafetyCommandKindSchema>;\n\n// ===========================================================================\n// Reviewer-capability matrix (§A11 [M4] + §A9). One solo operator holds all\n// at launch; every privileged command checks the SPECIFIC capability + reauth.\n// ===========================================================================\n\nexport const SafetyReviewerCapabilitySchema = z.enum([\n 'nciiRequestReviewer',\n 'nciiEvidenceReviewer',\n 'nciiAppealReviewer',\n 'childSafetyReviewer',\n 'legalDispositionAuthority',\n]);\nexport type SafetyReviewerCapability = z.infer<typeof SafetyReviewerCapabilitySchema>;\n\n// ===========================================================================\n// A7 — Registration-completion outcome (DOMAIN enum; replaces the unsafe\n// generic gRPC retryable/terminal code lists). Only a domain outcome feeds the\n// orphan-Auth deletion policy.\n// ===========================================================================\n\nexport const RegistrationCompletionOutcomeSchema = z.enum([\n 'completed',\n 'alreadyCompletedSameUid',\n 'retryableInfrastructureFailure',\n 'reauthenticationRequired',\n 'appCheckRetryRequired',\n 'nonceExpired',\n 'nonceUnknown',\n 'nonceConsumedDifferentUid',\n 'sessionHashMismatch',\n 'attestationSignatureInvalid',\n 'privateDataConflict',\n 'policyVersionRejected',\n]);\nexport type RegistrationCompletionOutcome = z.infer<typeof RegistrationCompletionOutcomeSchema>;\n\n// ===========================================================================\n// A11 — NCII / TAKE IT DOWN shared vocabularies (consumed by BOTH NCII clusters)\n// ===========================================================================\n\n/** Closed enum of required field codes — completeness + public missing-fields. */\nexport const TakeItDownFieldCodeSchema = z.enum([\n 'requesterName',\n 'contactEmail',\n 'contactPhone',\n 'requesterRole',\n 'electronicSignature',\n 'authorityBasis',\n 'authorityCertification',\n 'authorityEvidence',\n 'targetLocator',\n 'nonconsentStatement',\n 'supportingFacts',\n 'goodFaithCertification',\n]);\nexport type TakeItDownFieldCode = z.infer<typeof TakeItDownFieldCodeSchema>;\n\n/** Closed PUBLIC-SAFE reason codes — never reveal evidence/uploader/crossover. */\nexport const TakeItDownPublicReasonCodeSchema = z.enum([\n 'needMoreInformation',\n 'couldNotVerifyRequesterRole',\n 'couldNotLocateContent',\n 'outsideCoveredScope',\n 'duplicateOfExistingRequest',\n 'removedSuccessfully',\n 'underReview',\n 'closedSeeNotice',\n]);\nexport type TakeItDownPublicReasonCode = z.infer<typeof TakeItDownPublicReasonCodeSchema>;\n\n/** Validity-failure reason codes ([H2]). `incomplete` is a COMPLETENESS state,\n * NEVER a validity state. */\nexport const TakeItDownInvalidReasonCodeSchema = z.enum([\n 'missingSignature',\n 'missingLocator',\n 'missingNonconsentStatement',\n 'missingContactInformation',\n 'requesterNotDepictedPersonOrAuthorizedRepresentative',\n 'authorityNotEstablished',\n 'locatorNotResolvableAfterReasonableEffort',\n 'requestOutsideCoveredDepiction',\n 'duplicateSuperseded',\n 'fraudulentOrBadFaith',\n 'otherCounselApproved',\n]);\nexport type TakeItDownInvalidReasonCode = z.infer<typeof TakeItDownInvalidReasonCodeSchema>;\n\n/** Requester role (depicted person vs authorized representative). */\nexport const TakeItDownRequesterRoleSchema = z.enum(['depictedPerson', 'authorizedRepresentative']);\nexport type TakeItDownRequesterRole = z.infer<typeof TakeItDownRequesterRoleSchema>;\n\n/** Two-axis state: completeness vs validity (H2). */\nexport const TakeItDownCompletenessStatusSchema = z.enum(['incomplete', 'complete']);\nexport type TakeItDownCompletenessStatus = z.infer<typeof TakeItDownCompletenessStatusSchema>;\n\nexport const TakeItDownValidityStatusSchema = z.enum(['pending', 'valid', 'invalid', 'unableToLocate']);\nexport type TakeItDownValidityStatus = z.infer<typeof TakeItDownValidityStatusSchema>;\n\n/** The public no-login status-page status set (root + statusProjection). No\n * appeal model — no `appealedCorrected` (the appeal/reinstatement flow was\n * removed; protected reports have no uploader appeal/notice/reinstatement). */\nexport const TakeItDownPublicStatusSchema = z.enum([\n 'received',\n 'needsMoreInfo',\n 'validInProgress',\n 'completed',\n 'unableToLocate',\n 'invalidGeneralReason',\n]);\nexport type TakeItDownPublicStatus = z.infer<typeof TakeItDownPublicStatusSchema>;\n\n/** Request action types ([L1]). */\nexport const NciiActionTypeSchema = z.enum([\n 'intakeReceived',\n 'completenessDecided',\n 'validityDecided',\n 'tempHoldPlaced',\n 'tempHoldReleased',\n 'removalStarted',\n 'removalCompleted',\n 'hashBlockReversed',\n 'childSafetyCaseLinked',\n 'legalDispositionRecorded',\n]);\nexport type NciiActionType = z.infer<typeof NciiActionTypeSchema>;\n\nexport const NciiActionResultSchema = z.enum(['succeeded', 'failed', 'deferred', 'rejected']);\nexport type NciiActionResult = z.infer<typeof NciiActionResultSchema>;\n\n/** Honest derived completion ([H4]) — never 'completed' for a partial failure. */\nexport const NciiRemovalCompletionOutcomeSchema = z.enum([\n 'completed',\n 'completedWithApprovedException',\n 'unableToComplete',\n]);\nexport type NciiRemovalCompletionOutcome = z.infer<typeof NciiRemovalCompletionOutcomeSchema>;\n\nexport const NciiTargetSurfaceSchema = z.enum([\n 'original',\n 'hallCopy',\n 'profileMedia',\n 'chatAttachment',\n 'variant',\n 'cacheServing',\n 'exactHashMatch',\n]);\nexport type NciiTargetSurface = z.infer<typeof NciiTargetSurfaceSchema>;\n\nexport const NciiTargetOutcomeSchema = z.enum([\n 'pending',\n 'removed',\n 'tombstoned',\n 'verifiedGone',\n 'leftoverRetrying',\n 'unableToComplete',\n 'terminalException',\n]);\nexport type NciiTargetOutcome = z.infer<typeof NciiTargetOutcomeSchema>;\n\n/** CLOSED terminal-exception enum — a technical outage is NOT an exception. */\nexport const NciiTerminalExceptionSchema = z.enum([\n 'legallyPermittedRetention',\n 'contentNotPresentVerified',\n 'counselApprovedException',\n]);\nexport type NciiTerminalException = z.infer<typeof NciiTerminalExceptionSchema>;\n\n/** Internal operational case status ([H7]).\n *\n * [R12] close-lifecycle states: clicking **Close** (after the strict-closable gate passes)\n * applies the staged actions and moves the case to `processing` — it STAYS pinned/in-queue,\n * NEVER cleared on the click. The NCII removal worker flips the case to the terminal `closed`\n * ONLY on VERIFIED removal completion (clearing the pin via onSafetyCaseClosed). If the\n * removal saga exhausts its retries (dead-letter), the case moves to `failed` — kept pinned,\n * surfaced in the Safety Console failed-jobs view, with a Restart that re-arms the job. Both\n * are explicit values (never derived). */\nexport const NciiInternalStatusSchema = z.enum([\n 'open',\n 'removalInProgress',\n 'processing',\n 'failed',\n 'removed',\n 'rejected',\n 'closed',\n]);\nexport type NciiInternalStatus = z.infer<typeof NciiInternalStatusSchema>;\n\n/** Child-safety linkage status on an NCII case ([H7]). */\nexport const NciiChildSafetyLinkStatusSchema = z.enum([\n 'none',\n 'assessmentPending',\n 'linked',\n 'resolvedNoChildSafetyCase',\n]);\nexport type NciiChildSafetyLinkStatus = z.infer<typeof NciiChildSafetyLinkStatusSchema>;\n\n// ===========================================================================\n// A11 [F4] — child-safety crossover (possible-minor ≠ automatic CSAM).\n// Embedded on nciiCases. childSafetyCaseId lives HERE (one canonical place).\n// ===========================================================================\n\nexport const NciiMinorAssessmentSchema = z.enum(['adult', 'unknown', 'possibleMinor', 'confirmedMinor']);\nexport type NciiMinorAssessment = z.infer<typeof NciiMinorAssessmentSchema>;\n\nexport const NciiCsamAssessmentSchema = z.enum([\n 'notAssessed',\n 'notApparent',\n 'apparentViolation',\n 'validatedHashMatch',\n]);\nexport type NciiCsamAssessment = z.infer<typeof NciiCsamAssessmentSchema>;\n\nexport const NciiChildSafetyCrossoverSchema = z.object({\n minorAssessment: NciiMinorAssessmentSchema,\n csamAssessment: NciiCsamAssessmentSchema,\n childSafetyCaseId: z.string().min(1).optional(),\n assessedByUid: z.string().min(1).optional(),\n assessedAt: z.number().optional(),\n}).strict();\nexport type NciiChildSafetyCrossover = z.infer<typeof NciiChildSafetyCrossoverSchema>;\n\n/** [H-2] Per-leg lifecycle status for the possible-minor crossover side-effects (serving-deny,\n * PhotoDNA) persisted on the crossover child-safety case (see ChildSafetyCaseV1.crossoverLegs).\n * `pending` is the in-transaction initial marker the assessment writes before the post-commit leg\n * runs; the leg then flips it to `done` (succeeded) or `failed` (captureException'd, awaiting a\n * reconcile/replay). A leg is ABSENT (not `pending`) when it never applied — an external / no-media\n * target has no bytes to deny or scan. */\nexport const SafetyCrossoverLegStatusSchema = z.enum(['pending', 'done', 'failed']);\nexport type SafetyCrossoverLegStatus = z.infer<typeof SafetyCrossoverLegStatusSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"foundation.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/foundation.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,2EAA2E;AAC3E,4EAA4E;AAC5E,qEAAqE;AACrE,4EAA4E;AAC5E,oCAAoC;AACpC,EAAE;AACF,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,wBAAwB;AAExB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,oCAAoC,EACpC,4BAA4B,GAC7B,MAAM,6BAA6B,CAAC;AAErC,8EAA8E;AAC9E,8CAA8C;AAC9C,8EAA8E;AAE9E;gFACgF;AAChF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;IACvC,MAAM;IACN,YAAY;IACZ,aAAa;IACb,qBAAqB;IACrB,gBAAgB;IAChB,WAAW;IACX,eAAe;IACf,uBAAuB;IACvB,sBAAsB,EAAE,oCAAoC;IAC5D,qCAAqC,EAAE,6BAA6B;IACpE,sCAAsC;IACtC,OAAO;CACR,CAAC,CAAC;AAGH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,sBAAsB;IACtB,qCAAqC;CACK,CAAC;AAE7C,gEAAgE;AAChE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;AAG3E;;qEAEqE;AACrE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC7C,UAAU;IACV,aAAa;IACb,oBAAoB;IACpB,qBAAqB;IACrB,qBAAqB;IACrB,iBAAiB;IACjB,sBAAsB;IACtB,oBAAoB;IACpB,uFAAuF;IACvF,kFAAkF;IAClF,+EAA+E;IAC/E,oFAAo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CAAC;AAGH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,eAAe,EAAE,yBAAyB;IAC1C,cAAc,EAAE,wBAAwB;IACxC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC/C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC3C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ;;;;;0CAK0C;AAC1C,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC","sourcesContent":["// Trust & Safety — shared foundation enums + the canonical target locator.\n//\n// This file is the SINGLE SOURCE for every enum and locator that crosses more\n// than one T&S cluster (report spine, case spine, holds, evidence, sagas,\n// NCMEC, NCII). Cluster document-schema files import their value sets from\n// HERE so two clusters can never define the same enum with drifting values.\n// Every value is transcribed verbatim from docs/code_changes_needed/\n// trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A (the frozen spec) — no\n// invented values, no placeholders.\n//\n// Cross-boundary: these types are consumed by both functions/src and src/ in\n// ttt-prod, so they live in ttt-core (the single source of truth for the\n// backend↔frontend boundary) and surface on the `@ttt-productions/ttt-core/\n// doc-schemas` subpath.\n\nimport { z } from 'zod';\nimport {\n MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH,\n MAX_SAFETY_ADMIN_NOTE_LENGTH,\n} from '../../constants/business.js';\n\n// ===========================================================================\n// A1 — Report reasons + reportable item types\n// ===========================================================================\n\n/** The controlling report-reason taxonomy (fixes the client/server drift\n * TS-032). The two protected reasons fork into a childSafetyCase / nciiCase. */\nexport const ReportReasonSchema = z.enum([\n 'Spam',\n 'Harassment',\n 'Hate Speech',\n 'Violence or Threats',\n 'Sexual Content',\n 'Self-Harm',\n 'Impersonation',\n 'Intellectual Property',\n 'Child Safety Concern', // → protected fork: childSafetyCase\n 'Nonconsensual Intimate Image (NCII)', // → protected fork: nciiCase\n 'Not related to on-site entertainment',\n 'Other',\n]);\nexport type ReportReason = z.infer<typeof ReportReasonSchema>;\n\n/** The two reasons that take the mandatory in-process protected branch. */\nexport const PROTECTED_REPORT_REASONS = [\n 'Child Safety Concern',\n 'Nonconsensual Intimate Image (NCII)',\n] as const satisfies readonly ReportReason[];\n\n/** Which protected fork a protected-reason report committed. */\nexport const ProtectedForkSchema = z.enum(['childSafetyCase', 'nciiCase']);\nexport type ProtectedFork = z.infer<typeof ProtectedForkSchema>;\n\n/** EXACTLY the `reportableItems` keys in ttt-prod src/lib/report-config.ts. A\n * ttt-prod CI test asserts this enum and `reportableItems` stay in sync (the\n * sync test lives app-side because report-config.ts is app-side). */\nexport const ReportableItemTypeSchema = z.enum([\n 'username',\n 'craft-skill',\n 'commission-listing',\n 'commission-proposal',\n 'square-streetz-post',\n 'profile-picture',\n 'guild-invite-message',\n 'guild-chat-message',\n // A single message in a WORK-PARTY admin correspondence thread (pendingAdminDispatches\n // partyKind 'workProject' — the one multi-member chat surface transported through\n // Firestore `conversationMessages`). The resolver enforces the work-party kind\n // server-side; user↔admin support threads are NOT reportable (an admin is already a\n // participant in every thread — DJ ruling 2026-07-13).\n 'admin-work-message',\n 'hall-library-item',\n // [EUAS-017] a single Hall sub-item (a Tale chapter / Tune track / Television episode). The\n // `hallItem` TargetLocatorV1 already carries an optional `subItemId`; the report UI passes the\n // sub-item id + its parent hall item, and the resolver derives the canonical sub-item path\n // server-side. Admins can already hide a single sub-item (runSetHallSubItemHidden) — this makes the\n // matching user-facing report reachable.\n 'hall-library-sub-item',\n 'audition',\n 'audition-entry',\n 'work-project',\n 'work-asset',\n 'work-realm',\n]);\nexport type ReportableItemType = z.infer<typeof ReportableItemTypeSchema>;\n\n/** The DO-transported chat report types — no Firestore message doc / owner exists to\n * hold at intake (H-04 V1); the resolver goes through the signed chat-Worker context\n * read. `admin-work-message` is NOT here: its messages are Firestore docs. Derived\n * subset — compile-linked to the canonical enum, never a re-declared string set. */\nexport const CHAT_REPORT_ITEM_TYPES = [\n 'guild-chat-message',\n 'guild-invite-message',\n] as const satisfies readonly ReportableItemType[];\n\n/** Item types whose report work-view renders the content-action (moderate) panel —\n * the backend moderation cores accept these. Compile-linked subset of the enum. */\nexport const CONTENT_ACTION_PANEL_ITEM_TYPES = [\n 'square-streetz-post',\n 'audition',\n 'audition-entry',\n 'commission-listing',\n 'commission-proposal',\n 'work-asset',\n 'profile-picture',\n 'hall-library-item',\n 'hall-library-sub-item',\n 'craft-skill',\n // Work-party admin correspondence message — single-doc hidden flip (2026-07-13).\n 'admin-work-message',\n] as const satisfies readonly ReportableItemType[];\nexport type ContentActionPanelItemType = (typeof CONTENT_ACTION_PANEL_ITEM_TYPES)[number];\n\n// ===========================================================================\n// A11 — Target locator (the ONE typed locator used by allegations, temp holds,\n// removal targets, and the report resolver) + privacy-safe summary\n// ===========================================================================\n\n/** Discriminated locator — replaces every all-optional `contentRef`. Every\n * hideable surface in report-config.ts has a typed locator ([H-02]). */\nexport const TargetLocatorV1Schema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('mediaAsset'), mediaAssetId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('hallItem'), hallItemId: z.string().min(1), subItemId: z.string().min(1).optional() }).strict(),\n z.object({ kind: z.literal('squarePost'), postId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('profileImage'), profileUid: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('username'), profileUid: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('craftSkill'), profileUid: z.string().min(1), craftSkillId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('commissionListing'), commissionListingId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('commissionProposal'), commissionListingId: z.string().min(1), commissionProposalId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('workProject'), workProjectId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('workAsset'), workProjectId: z.string().min(1), workAssetId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('workRealm'), workRealmId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('audition'), auditionId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('auditionEntry'), auditionId: z.string().min(1), auditionEntryId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('guildInviteMessage'), channelId: z.string().min(1), messageId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('chatAttachment'), channelId: z.string().min(1), messageId: z.string().min(1), attachmentId: z.string().min(1) }).strict(),\n // [H-04 V1] Plain guild chat message (text-only or Worker-unresolved). Distinct from\n // `chatAttachment` (which carries an actual attachment id) so a text-only protected chat\n // report has a clean, unambiguous locator without misusing the attachment variant.\n z.object({ kind: z.literal('guildChatMessage'), channelId: z.string().min(1), messageId: z.string().min(1) }).strict(),\n // A work-party admin correspondence message — a Firestore doc at\n // pendingAdminDispatches/{adminDispatchId}/conversationMessages/{messageId} (unlike the\n // DO-addressed guildChatMessage/guildInviteMessage locators, messageId here is a doc id,\n // not a numeric seq).\n z.object({ kind: z.literal('adminWorkMessage'), adminDispatchId: z.string().min(1), messageId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('url'), url: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('additionalText'), textRef: z.string().min(1) }).strict(),\n]);\nexport type TargetLocatorV1 = z.infer<typeof TargetLocatorV1Schema>;\n\n/** The set of locator discriminants — used wherever only the `kind` is needed. */\nexport const TargetLocatorKindSchema = z.enum([\n 'mediaAsset',\n 'hallItem',\n 'squarePost',\n 'profileImage',\n 'username',\n 'craftSkill',\n 'commissionListing',\n 'commissionProposal',\n 'workProject',\n 'workAsset',\n 'workRealm',\n 'audition',\n 'auditionEntry',\n 'guildInviteMessage',\n 'chatAttachment',\n // [H-04 V1] Plain guild chat message locator (text-only / Worker-unresolved protected report).\n 'guildChatMessage',\n // Work-party admin correspondence message (Firestore conversationMessages doc).\n 'adminWorkMessage',\n 'url',\n 'additionalText',\n]);\nexport type TargetLocatorKind = z.infer<typeof TargetLocatorKindSchema>;\n\n/** Privacy-safe summary ONLY — no narrative / PII; used on roots + public rows. */\nexport const TargetLocatorSummaryV1Schema = z.object({\n kind: TargetLocatorKindSchema,\n surfaceLabel: z.string(),\n hasResolvedTarget: z.boolean(),\n}).strict();\nexport type TargetLocatorSummaryV1 = z.infer<typeof TargetLocatorSummaryV1Schema>;\n\n// ===========================================================================\n// A9 — Reporting determination + NCMEC submission state\n// ===========================================================================\n\n/** Case-level reporting determination (Finding-H6). The ONLY carrier of \"no\n * NCMEC report required\" — `notRequired` was removed from NcmecSubmissionState. */\nexport const ReportDispositionSchema = z.enum([\n 'undetermined',\n 'reportRequired',\n 'notRequired',\n 'correctedNoApparentViolation',\n]);\nexport type ReportDisposition = z.infer<typeof ReportDispositionSchema>;\n\n/** Reason codes for the privileged setReportDisposition command (§A9). The first five are the\n * not-required / exception reasons (no NCMEC report ever arose, or a triggering signal was\n * corrected); the last two are the report-required reasons (a report IS legally required). The\n * disposition↔reason pairing is enforced by the ONE cross-field rule below (ARCH-102). */\nexport const ReportDispositionReasonCodeSchema = z.enum([\n 'outOfScopeNotCsea',\n 'basisInvalidatedFalseMatch',\n 'duplicateOfFiledReport',\n 'leDirectedNoReport',\n 'nonReportableSafetyConfirmed',\n // Report-required reasons — valid ONLY with disposition 'reportRequired'.\n 'apparentCsamConfirmed', // human review confirmed apparent CSAM\n 'hashMatchValidated', // validated hash match\n]);\nexport type ReportDispositionReasonCode = z.infer<typeof ReportDispositionReasonCodeSchema>;\n\n/** The reason codes that ASSERT a reporting obligation — legal ONLY with 'reportRequired'.\n * Compile-linked subset of the canonical reason enum. */\nexport const REPORT_REQUIRED_DISPOSITION_REASON_CODES = [\n 'apparentCsamConfirmed',\n 'hashMatchValidated',\n] as const satisfies readonly ReportDispositionReasonCode[];\n\n/** The not-required / exception reason codes — legal with every disposition that does NOT assert a\n * reporting obligation ('notRequired', 'correctedNoApparentViolation'). Compile-linked subset. */\nexport const NOT_REQUIRED_DISPOSITION_REASON_CODES = [\n 'outOfScopeNotCsea',\n 'basisInvalidatedFalseMatch',\n 'duplicateOfFiledReport',\n 'leDirectedNoReport',\n 'nonReportableSafetyConfirmed',\n] as const satisfies readonly ReportDispositionReasonCode[];\n\n/** The ONE cross-field pairing (§A9, ARCH-102): which reason codes each disposition permits.\n * Declared HERE once; both the setReportDisposition input (case.ts) and the SafetyDispositionAction\n * console command (admin.ts) apply `refineReportDispositionReasonCode` derived from this map rather\n * than re-declaring the pairing. 'undetermined' is the initial state, never an operator-settable\n * target, so it permits NO reason code (the operator command excludes it). Typed as an exhaustive\n * Record so a new disposition fails to compile until its permitted codes are declared. */\nexport const REPORT_DISPOSITION_ALLOWED_REASON_CODES: Record<\n ReportDisposition,\n readonly ReportDispositionReasonCode[]\n> = {\n undetermined: [],\n reportRequired: REPORT_REQUIRED_DISPOSITION_REASON_CODES,\n notRequired: NOT_REQUIRED_DISPOSITION_REASON_CODES,\n correctedNoApparentViolation: NOT_REQUIRED_DISPOSITION_REASON_CODES,\n};\n\n/** Shared cross-field refinement enforcing the disposition↔reason pairing above. Applied by BOTH\n * the setReportDisposition input schemas and the SafetyDispositionAction console command so the\n * rule lives in exactly one place. Reports the failure on the `dispositionReasonCode` path. */\nexport function refineReportDispositionReasonCode(\n value: { disposition: ReportDisposition; dispositionReasonCode: ReportDispositionReasonCode },\n ctx: z.RefinementCtx,\n): void {\n if (!REPORT_DISPOSITION_ALLOWED_REASON_CODES[value.disposition].includes(value.dispositionReasonCode)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['dispositionReasonCode'],\n message: `Reason code '${value.dispositionReasonCode}' is not valid for disposition '${value.disposition}'.`,\n });\n }\n}\n\n/** Shared cross-field rule (§A9): disposition 'reportRequired' MUST carry at least one evidence ref —\n * a reporting obligation can only be asserted once the evidence has been revealed. Every OTHER\n * disposition ('notRequired', 'correctedNoApparentViolation', 'undetermined') MAY leave evidenceRefs\n * empty. Declared HERE once (ARCH-102) and applied — alongside refineReportDispositionReasonCode — by\n * BOTH the setReportDisposition input schemas (case.ts) and the SafetyStagedAction console command\n * (admin.ts), never re-declared. Reports the failure on the `evidenceRefs` path. */\nexport function refineReportDispositionEvidenceRefs(\n value: { disposition: ReportDisposition; evidenceRefs: readonly string[] },\n ctx: z.RefinementCtx,\n): void {\n if (value.disposition === 'reportRequired' && value.evidenceRefs.length === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['evidenceRefs'],\n message:\n \"Disposition 'reportRequired' requires at least one evidence ref (evidence must have been revealed).\",\n });\n }\n}\n\n// ===========================================================================\n// [EUAS-008] Structured safety-case CLOSURE record — the operator's terminal\n// determination persisted when a CSAM / NCII case is closed via the guided\n// resolution flow (resolveAdminTask). Embedded on the NCII case (`closure`) and on\n// a child-safety `decisions/{id}` row (kind `caseClosed`) so both case types carry\n// the SAME structured outcome/summary/note + actor/timestamp — not just a status\n// flip. This does NOT replace the case lifecycle's own terminal status; it records\n// WHO closed it, WHY, and with what outcome.\n// ===========================================================================\n\n/** founded = a violation was substantiated; unfounded = no violation on review. */\nexport const SafetyCaseClosureOutcomeSchema = z.enum(['founded', 'unfounded']);\nexport type SafetyCaseClosureOutcome = z.infer<typeof SafetyCaseClosureOutcomeSchema>;\n\n/** The structured closure record written on a safety-case close. */\nexport const SafetyCaseClosureV1Schema = z.object({\n outcome: SafetyCaseClosureOutcomeSchema,\n resolutionSummary: z.string().min(1).max(MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH),\n adminNote: z.string().max(MAX_SAFETY_ADMIN_NOTE_LENGTH).optional(),\n closedByUid: z.string().min(1),\n closedAt: z.number(),\n}).strict();\nexport type SafetyCaseClosureV1 = z.infer<typeof SafetyCaseClosureV1Schema>;\n\n/** NCMEC submission lifecycle — MANUAL-PORTAL model (§A9). NO `notRequired` (that is\n * ReportDisposition). There is no automated ispws API: a report-needed obligation sits in\n * `awaitingManualFiling` from enqueue until the operator files on the NCMEC portal and records the\n * confirmation (markNcmecPortalComplete → `completed`). Jobs are born `awaitingManualFiling`; the\n * case-list `ncmecStatus` projection uses the same value (no separate `queued` state). There is no\n * in-app retraction — corrections are portal-manual (correction-lifecycle decision). The old\n * API-drive states\n * (opening/open/uploading/addingFileDetails/finishing/retryableFailure/ambiguousResult/permanentFailure)\n * were removed with the live-API client. */\nexport const NcmecSubmissionStateSchema = z.enum([\n 'awaitingManualFiling',\n 'completed',\n]);\nexport type NcmecSubmissionState = z.infer<typeof NcmecSubmissionStateSchema>;\n\n// ===========================================================================\n// A3 — Safety-hold + resource-command vocabularies (the ONE destructive-guard\n// authority). The NCII/storage resource types live in THIS enum (H1 fix).\n// ===========================================================================\n\nexport const SafetyHoldResourceTypeSchema = z.enum([\n 'contentDoc',\n 'mediaAsset',\n 'account',\n 'chatMessageRange',\n 'channel',\n 'nciiTemporaryTarget',\n 'storageObject',\n 'reportEvidenceObject',\n]);\nexport type SafetyHoldResourceType = z.infer<typeof SafetyHoldResourceTypeSchema>;\n\n/** Lifecycle/retention regime governed by the A3 compatibility matrix. */\nexport const SafetyHoldClassSchema = z.enum([\n 'childSafety',\n 'nciiTemporary',\n 'legalRetention',\n 'preservationEvidence',\n // An OPEN ordinary (non-protected) content report places an account-level hold\n // (resourceType 'account', ownerUid = the reported user) so a user can't delete\n // their data out from under an unreviewed report (e.g. a DMCA/IP complaint, then\n // delete-to-clear-tracks). blocksDeletion + blocksAnonymization; released when the\n // report group's admin close-out resolves it. Durable (no expiresAt).\n 'ordinaryReport',\n]);\nexport type SafetyHoldClass = z.infer<typeof SafetyHoldClassSchema>;\n\n/** Resource-scoped destructive command kinds (A3). */\nexport const SafetyCommandKindSchema = z.enum([\n 'nciiRemoval',\n 'csamActiveByteRemoval',\n 'evidenceDisposition',\n]);\nexport type SafetyCommandKind = z.infer<typeof SafetyCommandKindSchema>;\n\n// ===========================================================================\n// Reviewer-capability matrix (§A11 [M4] + §A9). One solo operator holds all\n// at launch; every privileged command checks the SPECIFIC capability + reauth.\n// ===========================================================================\n\nexport const SafetyReviewerCapabilitySchema = z.enum([\n 'nciiRequestReviewer',\n 'nciiEvidenceReviewer',\n 'nciiAppealReviewer',\n 'childSafetyReviewer',\n 'legalDispositionAuthority',\n]);\nexport type SafetyReviewerCapability = z.infer<typeof SafetyReviewerCapabilitySchema>;\n\n// ===========================================================================\n// A7 — Registration-completion outcome (DOMAIN enum; replaces the unsafe\n// generic gRPC retryable/terminal code lists). Only a domain outcome feeds the\n// orphan-Auth deletion policy.\n// ===========================================================================\n\nexport const RegistrationCompletionOutcomeSchema = z.enum([\n 'completed',\n 'alreadyCompletedSameUid',\n 'retryableInfrastructureFailure',\n 'reauthenticationRequired',\n 'appCheckRetryRequired',\n 'nonceExpired',\n 'nonceUnknown',\n 'nonceConsumedDifferentUid',\n 'sessionHashMismatch',\n 'attestationSignatureInvalid',\n 'privateDataConflict',\n 'policyVersionRejected',\n]);\nexport type RegistrationCompletionOutcome = z.infer<typeof RegistrationCompletionOutcomeSchema>;\n\n// ===========================================================================\n// A11 — NCII / TAKE IT DOWN shared vocabularies (consumed by BOTH NCII clusters)\n// ===========================================================================\n\n/** Closed enum of required field codes — completeness + public missing-fields. */\nexport const TakeItDownFieldCodeSchema = z.enum([\n 'requesterName',\n 'contactEmail',\n 'contactPhone',\n 'requesterRole',\n 'electronicSignature',\n 'authorityBasis',\n 'authorityCertification',\n 'authorityEvidence',\n 'targetLocator',\n 'nonconsentStatement',\n 'supportingFacts',\n 'goodFaithCertification',\n]);\nexport type TakeItDownFieldCode = z.infer<typeof TakeItDownFieldCodeSchema>;\n\n/** Closed PUBLIC-SAFE reason codes — never reveal evidence/uploader/crossover. */\nexport const TakeItDownPublicReasonCodeSchema = z.enum([\n 'needMoreInformation',\n 'couldNotVerifyRequesterRole',\n 'couldNotLocateContent',\n 'outsideCoveredScope',\n 'duplicateOfExistingRequest',\n 'removedSuccessfully',\n 'underReview',\n 'closedSeeNotice',\n]);\nexport type TakeItDownPublicReasonCode = z.infer<typeof TakeItDownPublicReasonCodeSchema>;\n\n/** Validity-failure reason codes ([H2]). `incomplete` is a COMPLETENESS state,\n * NEVER a validity state. */\nexport const TakeItDownInvalidReasonCodeSchema = z.enum([\n 'missingSignature',\n 'missingLocator',\n 'missingNonconsentStatement',\n 'missingContactInformation',\n 'requesterNotDepictedPersonOrAuthorizedRepresentative',\n 'authorityNotEstablished',\n 'locatorNotResolvableAfterReasonableEffort',\n 'requestOutsideCoveredDepiction',\n 'duplicateSuperseded',\n 'fraudulentOrBadFaith',\n 'otherCounselApproved',\n]);\nexport type TakeItDownInvalidReasonCode = z.infer<typeof TakeItDownInvalidReasonCodeSchema>;\n\n/** Requester role (depicted person vs authorized representative). */\nexport const TakeItDownRequesterRoleSchema = z.enum(['depictedPerson', 'authorizedRepresentative']);\nexport type TakeItDownRequesterRole = z.infer<typeof TakeItDownRequesterRoleSchema>;\n\n/** Two-axis state: completeness vs validity (H2). */\nexport const TakeItDownCompletenessStatusSchema = z.enum(['incomplete', 'complete']);\nexport type TakeItDownCompletenessStatus = z.infer<typeof TakeItDownCompletenessStatusSchema>;\n\nexport const TakeItDownValidityStatusSchema = z.enum(['pending', 'valid', 'invalid', 'unableToLocate']);\nexport type TakeItDownValidityStatus = z.infer<typeof TakeItDownValidityStatusSchema>;\n\n/** The public no-login status-page status set (root + statusProjection). No\n * appeal model — no `appealedCorrected` (the appeal/reinstatement flow was\n * removed; protected reports have no uploader appeal/notice/reinstatement). */\nexport const TakeItDownPublicStatusSchema = z.enum([\n 'received',\n 'needsMoreInfo',\n 'validInProgress',\n 'completed',\n 'unableToLocate',\n 'invalidGeneralReason',\n]);\nexport type TakeItDownPublicStatus = z.infer<typeof TakeItDownPublicStatusSchema>;\n\n/** Request action types ([L1]). */\nexport const NciiActionTypeSchema = z.enum([\n 'intakeReceived',\n 'completenessDecided',\n 'validityDecided',\n 'tempHoldPlaced',\n 'tempHoldReleased',\n 'removalStarted',\n 'removalCompleted',\n 'hashBlockReversed',\n 'childSafetyCaseLinked',\n 'legalDispositionRecorded',\n]);\nexport type NciiActionType = z.infer<typeof NciiActionTypeSchema>;\n\nexport const NciiActionResultSchema = z.enum(['succeeded', 'failed', 'deferred', 'rejected']);\nexport type NciiActionResult = z.infer<typeof NciiActionResultSchema>;\n\n/** Honest derived completion ([H4]) — never 'completed' for a partial failure. */\nexport const NciiRemovalCompletionOutcomeSchema = z.enum([\n 'completed',\n 'completedWithApprovedException',\n 'unableToComplete',\n]);\nexport type NciiRemovalCompletionOutcome = z.infer<typeof NciiRemovalCompletionOutcomeSchema>;\n\nexport const NciiTargetSurfaceSchema = z.enum([\n 'original',\n 'hallCopy',\n 'profileMedia',\n 'chatAttachment',\n 'variant',\n 'cacheServing',\n 'exactHashMatch',\n]);\nexport type NciiTargetSurface = z.infer<typeof NciiTargetSurfaceSchema>;\n\nexport const NciiTargetOutcomeSchema = z.enum([\n 'pending',\n 'removed',\n 'tombstoned',\n 'verifiedGone',\n 'leftoverRetrying',\n 'unableToComplete',\n 'terminalException',\n]);\nexport type NciiTargetOutcome = z.infer<typeof NciiTargetOutcomeSchema>;\n\n/** CLOSED terminal-exception enum — a technical outage is NOT an exception. */\nexport const NciiTerminalExceptionSchema = z.enum([\n 'legallyPermittedRetention',\n 'contentNotPresentVerified',\n 'counselApprovedException',\n]);\nexport type NciiTerminalException = z.infer<typeof NciiTerminalExceptionSchema>;\n\n/** Internal operational case status ([H7]).\n *\n * [R12] close-lifecycle states: clicking **Close** (after the strict-closable gate passes)\n * applies the staged actions and moves the case to `processing` — it STAYS pinned/in-queue,\n * NEVER cleared on the click. The NCII removal worker flips the case to the terminal `closed`\n * ONLY on VERIFIED removal completion (clearing the pin via onSafetyCaseClosed). If the\n * removal saga exhausts its retries (dead-letter), the case moves to `failed` — kept pinned,\n * surfaced in the Safety Console failed-jobs view, with a Restart that re-arms the job. Both\n * are explicit values (never derived). */\nexport const NciiInternalStatusSchema = z.enum([\n 'open',\n 'removalInProgress',\n 'processing',\n 'failed',\n 'removed',\n 'rejected',\n 'closed',\n]);\nexport type NciiInternalStatus = z.infer<typeof NciiInternalStatusSchema>;\n\n/** Child-safety linkage status on an NCII case ([H7]). */\nexport const NciiChildSafetyLinkStatusSchema = z.enum([\n 'none',\n 'assessmentPending',\n 'linked',\n 'resolvedNoChildSafetyCase',\n]);\nexport type NciiChildSafetyLinkStatus = z.infer<typeof NciiChildSafetyLinkStatusSchema>;\n\n// ===========================================================================\n// A11 [F4] — child-safety crossover (possible-minor ≠ automatic CSAM).\n// Embedded on nciiCases. childSafetyCaseId lives HERE (one canonical place).\n// ===========================================================================\n\nexport const NciiMinorAssessmentSchema = z.enum(['adult', 'unknown', 'possibleMinor', 'confirmedMinor']);\nexport type NciiMinorAssessment = z.infer<typeof NciiMinorAssessmentSchema>;\n\nexport const NciiCsamAssessmentSchema = z.enum([\n 'notAssessed',\n 'notApparent',\n 'apparentViolation',\n 'validatedHashMatch',\n]);\nexport type NciiCsamAssessment = z.infer<typeof NciiCsamAssessmentSchema>;\n\nexport const NciiChildSafetyCrossoverSchema = z.object({\n minorAssessment: NciiMinorAssessmentSchema,\n csamAssessment: NciiCsamAssessmentSchema,\n childSafetyCaseId: z.string().min(1).optional(),\n assessedByUid: z.string().min(1).optional(),\n assessedAt: z.number().optional(),\n}).strict();\nexport type NciiChildSafetyCrossover = z.infer<typeof NciiChildSafetyCrossoverSchema>;\n\n/** [H-2] Per-leg lifecycle status for the possible-minor crossover side-effects (serving-deny,\n * PhotoDNA) persisted on the crossover child-safety case (see ChildSafetyCaseV1.crossoverLegs).\n * `pending` is the in-transaction initial marker the assessment writes before the post-commit leg\n * runs; the leg then flips it to `done` (succeeded) or `failed` (captureException'd, awaiting a\n * reconcile/replay). A leg is ABSENT (not `pending`) when it never applied — an external / no-media\n * target has no bytes to deny or scan. */\nexport const SafetyCrossoverLegStatusSchema = z.enum(['pending', 'done', 'failed']);\nexport type SafetyCrossoverLegStatus = z.infer<typeof SafetyCrossoverLegStatusSchema>;\n"]}
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import type { SquareStreetzPostType } from './social.js';
|
|
3
3
|
import type { SquareStreetzPostPayload } from '../types/social.js';
|
|
4
4
|
/**
|
|
5
|
-
* The ONE canonical derivation of a Square announcement outbox job id (
|
|
5
|
+
* The ONE canonical derivation of a Square announcement outbox job id (ARCH-102 —
|
|
6
6
|
* every enqueue site, the outbox worker, and tests derive from HERE, never a
|
|
7
7
|
* hand-rolled template): `${announcementType}_${primaryDocId}`, where
|
|
8
8
|
* `primaryDocId` is the announcing action's natural-key doc id (e.g.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
//
|
|
9
9
|
// jobId — DETERMINISTIC (collision over duplication): derived from the announcing
|
|
10
10
|
// action's natural key via `buildSquareAnnouncementJobId` below — the ONE canonical
|
|
11
|
-
// derivation (
|
|
11
|
+
// derivation (ARCH-102); enqueue sites, the worker, and tests MUST call it, never
|
|
12
12
|
// hand-roll the template. The enqueue MUST use `.create()` at this id inside the
|
|
13
13
|
// announcing transaction, so a replayed/retried transaction COLLIDES with the
|
|
14
14
|
// already-enqueued job instead of duplicating the announcement.
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
import { z } from 'zod';
|
|
19
19
|
import { SquareStreetzPostTypeSchema } from './social.js';
|
|
20
20
|
/**
|
|
21
|
-
* The ONE canonical derivation of a Square announcement outbox job id (
|
|
21
|
+
* The ONE canonical derivation of a Square announcement outbox job id (ARCH-102 —
|
|
22
22
|
* every enqueue site, the outbox worker, and tests derive from HERE, never a
|
|
23
23
|
* hand-rolled template): `${announcementType}_${primaryDocId}`, where
|
|
24
24
|
* `primaryDocId` is the announcing action's natural-key doc id (e.g.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"square-announcement-jobs.js","sourceRoot":"","sources":["../../src/doc-schemas/square-announcement-jobs.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,iFAAiF;AACjF,+EAA+E;AAC/E,4EAA4E;AAC5E,4EAA4E;AAC5E,8DAA8D;AAC9D,qDAAqD;AACrD,EAAE;AACF,kFAAkF;AAClF,oFAAoF;AACpF,
|
|
1
|
+
{"version":3,"file":"square-announcement-jobs.js","sourceRoot":"","sources":["../../src/doc-schemas/square-announcement-jobs.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,iFAAiF;AACjF,+EAA+E;AAC/E,4EAA4E;AAC5E,4EAA4E;AAC5E,8DAA8D;AAC9D,qDAAqD;AACrD,EAAE;AACF,kFAAkF;AAClF,oFAAoF;AACpF,kFAAkF;AAClF,iFAAiF;AACjF,8EAA8E;AAC9E,gEAAgE;AAChE,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAE/E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAI1D;;;;;;;;GAQG;AACH,MAAM,UAAU,4BAA4B,CAC1C,gBAAuC,EACvC,YAAoB;IAEpB,OAAO,GAAG,gBAAgB,IAAI,YAAY,EAAE,CAAC;AAC/C,CAAC;AAeD,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CACrD,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,EAC1C,EAAE,OAAO,EAAE,+CAA+C,EAAE,CAC7D,CAAC;AAEF,kFAAkF;AAClF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,IAAI,EAAE,2BAA2B;IACjC,OAAO,EAAE,+BAA+B;CACzC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,IAAI,CAAC;IACtD,SAAS,EAAE,uCAAuC;IAClD,YAAY,EAAE,0BAA0B;IACxC,WAAW,EAAE,6DAA6D;IAC1E,MAAM,EAAE,mDAAmD;CAC5D,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC;KACzC,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,wEAAwE;IACxE,YAAY,EAAE,6BAA6B;IAC3C;;kEAE8D;IAC9D,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IACxC,MAAM,EAAE,iCAAiC;IACzC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC5C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// squareAnnouncementJobs/{jobId} — durable outbox for AUTOMATIC Square Streetz\n// announcements. The announcing domain enqueues a job in the SAME transaction as\n// its state commit (commission accepted, new audition/commission/work-project,\n// craft-skill create/delete, profile-picture update, …) instead of awaiting\n// runManageSquareStreetzPost inside the callable; the outbox trigger worker\n// drains the job and applies the announcement. Admin-SDK-only\n// (`allow read, write: if false`); NO client access.\n//\n// jobId — DETERMINISTIC (collision over duplication): derived from the announcing\n// action's natural key via `buildSquareAnnouncementJobId` below — the ONE canonical\n// derivation (ARCH-102); enqueue sites, the worker, and tests MUST call it, never\n// hand-roll the template. The enqueue MUST use `.create()` at this id inside the\n// announcing transaction, so a replayed/retried transaction COLLIDES with the\n// already-enqueued job instead of duplicating the announcement.\n//\n// Timestamps follow the app-wide epoch-ms number convention (Date.now()). No\n// native-TTL field on this doc — `dead` jobs are retained for operator replay.\n\nimport { z } from 'zod';\nimport { SquareStreetzPostTypeSchema } from './social.js';\nimport type { SquareStreetzPostType } from './social.js';\nimport type { SquareStreetzPostPayload } from '../types/social.js';\n\n/**\n * The ONE canonical derivation of a Square announcement outbox job id (ARCH-102 —\n * every enqueue site, the outbox worker, and tests derive from HERE, never a\n * hand-rolled template): `${announcementType}_${primaryDocId}`, where\n * `primaryDocId` is the announcing action's natural-key doc id (e.g.\n * `NEW_CRAFT_SKILL_${craftSkillId}`, `NEW_WORK_PROJECT_${workProjectId}`,\n * `COMMISSION_ACCEPTED_${commissionProposalId}`). Deterministic so a replayed\n * transaction's `.create()` collides instead of duplicating the announcement.\n */\nexport function buildSquareAnnouncementJobId(\n announcementType: SquareStreetzPostType,\n primaryDocId: string,\n): string {\n return `${announcementType}_${primaryDocId}`;\n}\n\n/**\n * Payload half of the announcement input — exactly what the\n * runManageSquareStreetzPost dispatcher accepts: the canonical\n * SquareStreetzPostPayload plus the two dispatcher-level extras (`projectId`,\n * and the pattern-C pre-minted `postId` for USER_POST). Validated structurally\n * (a plain object) and TYPED precisely; the dispatcher re-validates domain\n * fields when the worker delivers (same posture as chatMessageOutbox.payload).\n */\nexport type SquareAnnouncementPayload = SquareStreetzPostPayload & {\n projectId?: string;\n postId?: string;\n};\n\nexport const SquareAnnouncementPayloadSchema = z.custom<SquareAnnouncementPayload>(\n (v) => typeof v === 'object' && v !== null,\n { message: 'Expected a Square announcement payload object' },\n);\n\n/** The discriminated announcement input (`{ type, payload }`) the job carries. */\nexport const SquareAnnouncementInputSchema = z.object({\n type: SquareStreetzPostTypeSchema,\n payload: SquareAnnouncementPayloadSchema,\n});\nexport type SquareAnnouncementInput = z.infer<typeof SquareAnnouncementInputSchema>;\n\nexport const SquareAnnouncementJobStatusSchema = z.enum([\n 'pending', // enqueued; awaiting the outbox worker\n 'processing', // claimed by a worker run\n 'delivered', // announcement applied to the Streetz feed; terminal success\n 'dead', // retries exhausted — retained for operator replay\n]);\nexport type SquareAnnouncementJobStatus = z.infer<typeof SquareAnnouncementJobStatusSchema>;\n\nexport const SquareAnnouncementJobSchema = z\n .object({\n jobId: z.string().min(1),\n /** The exact runManageSquareStreetzPost input the worker dispatches. */\n announcement: SquareAnnouncementInputSchema,\n /** The announcing action's natural-key ids, keyed by field name (e.g.\n * `{ craftSkillId: '…' }`, `{ commissionListingId: '…', commissionProposalId: '…' }`) —\n * the same key(s) the deterministic jobId is derived from. */\n source: z.record(z.string(), z.string()),\n status: SquareAnnouncementJobStatusSchema,\n attemptCount: z.number().int().nonnegative(),\n lastError: z.string().optional(),\n createdAt: z.number(),\n updatedAt: z.number(),\n })\n .strict();\nexport type SquareAnnouncementJob = z.infer<typeof SquareAnnouncementJobSchema>;\n"]}
|
|
@@ -371,6 +371,8 @@ export declare const PendingMediaPendingSchema: z.ZodObject<{
|
|
|
371
371
|
createdAt: z.ZodNumber;
|
|
372
372
|
updatedAt: z.ZodNumber;
|
|
373
373
|
processingStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
374
|
+
processingAttemptCount: z.ZodOptional<z.ZodNumber>;
|
|
375
|
+
processingLeaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
374
376
|
terminalAt: z.ZodOptional<z.ZodNumber>;
|
|
375
377
|
}, z.core.$strict>;
|
|
376
378
|
export declare const PendingMediaProcessingSchema: z.ZodObject<{
|
|
@@ -420,6 +422,8 @@ export declare const PendingMediaProcessingSchema: z.ZodObject<{
|
|
|
420
422
|
createdAt: z.ZodNumber;
|
|
421
423
|
updatedAt: z.ZodNumber;
|
|
422
424
|
processingStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
425
|
+
processingAttemptCount: z.ZodOptional<z.ZodNumber>;
|
|
426
|
+
processingLeaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
423
427
|
terminalAt: z.ZodOptional<z.ZodNumber>;
|
|
424
428
|
}, z.core.$strict>;
|
|
425
429
|
export declare const PendingMediaCompletedSchema: z.ZodObject<{
|
|
@@ -792,6 +796,8 @@ export declare const PendingMediaCompletedSchema: z.ZodObject<{
|
|
|
792
796
|
createdAt: z.ZodNumber;
|
|
793
797
|
updatedAt: z.ZodNumber;
|
|
794
798
|
processingStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
799
|
+
processingAttemptCount: z.ZodOptional<z.ZodNumber>;
|
|
800
|
+
processingLeaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
795
801
|
}, z.core.$strict>;
|
|
796
802
|
export declare const PendingMediaFailedSchema: z.ZodObject<{
|
|
797
803
|
status: z.ZodLiteral<"failed">;
|
|
@@ -855,6 +861,8 @@ export declare const PendingMediaFailedSchema: z.ZodObject<{
|
|
|
855
861
|
createdAt: z.ZodNumber;
|
|
856
862
|
updatedAt: z.ZodNumber;
|
|
857
863
|
processingStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
864
|
+
processingAttemptCount: z.ZodOptional<z.ZodNumber>;
|
|
865
|
+
processingLeaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
858
866
|
}, z.core.$strict>;
|
|
859
867
|
export declare const PendingMediaRejectedSchema: z.ZodObject<{
|
|
860
868
|
status: z.ZodLiteral<"rejected">;
|
|
@@ -1232,6 +1240,8 @@ export declare const PendingMediaRejectedSchema: z.ZodObject<{
|
|
|
1232
1240
|
createdAt: z.ZodNumber;
|
|
1233
1241
|
updatedAt: z.ZodNumber;
|
|
1234
1242
|
processingStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
1243
|
+
processingAttemptCount: z.ZodOptional<z.ZodNumber>;
|
|
1244
|
+
processingLeaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
1235
1245
|
}, z.core.$strict>;
|
|
1236
1246
|
export declare const PendingMediaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1237
1247
|
status: z.ZodLiteral<"pending">;
|
|
@@ -1280,6 +1290,8 @@ export declare const PendingMediaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1280
1290
|
createdAt: z.ZodNumber;
|
|
1281
1291
|
updatedAt: z.ZodNumber;
|
|
1282
1292
|
processingStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
1293
|
+
processingAttemptCount: z.ZodOptional<z.ZodNumber>;
|
|
1294
|
+
processingLeaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
1283
1295
|
terminalAt: z.ZodOptional<z.ZodNumber>;
|
|
1284
1296
|
}, z.core.$strict>, z.ZodObject<{
|
|
1285
1297
|
status: z.ZodLiteral<"processing">;
|
|
@@ -1328,6 +1340,8 @@ export declare const PendingMediaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1328
1340
|
createdAt: z.ZodNumber;
|
|
1329
1341
|
updatedAt: z.ZodNumber;
|
|
1330
1342
|
processingStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
1343
|
+
processingAttemptCount: z.ZodOptional<z.ZodNumber>;
|
|
1344
|
+
processingLeaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
1331
1345
|
terminalAt: z.ZodOptional<z.ZodNumber>;
|
|
1332
1346
|
}, z.core.$strict>, z.ZodObject<{
|
|
1333
1347
|
status: z.ZodLiteral<"completed">;
|
|
@@ -1699,6 +1713,8 @@ export declare const PendingMediaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1699
1713
|
createdAt: z.ZodNumber;
|
|
1700
1714
|
updatedAt: z.ZodNumber;
|
|
1701
1715
|
processingStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
1716
|
+
processingAttemptCount: z.ZodOptional<z.ZodNumber>;
|
|
1717
|
+
processingLeaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
1702
1718
|
}, z.core.$strict>, z.ZodObject<{
|
|
1703
1719
|
status: z.ZodLiteral<"failed">;
|
|
1704
1720
|
failedAt: z.ZodNumber;
|
|
@@ -1761,6 +1777,8 @@ export declare const PendingMediaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1761
1777
|
createdAt: z.ZodNumber;
|
|
1762
1778
|
updatedAt: z.ZodNumber;
|
|
1763
1779
|
processingStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
1780
|
+
processingAttemptCount: z.ZodOptional<z.ZodNumber>;
|
|
1781
|
+
processingLeaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
1764
1782
|
}, z.core.$strict>, z.ZodObject<{
|
|
1765
1783
|
status: z.ZodLiteral<"rejected">;
|
|
1766
1784
|
rejectedAt: z.ZodNumber;
|
|
@@ -2137,6 +2155,8 @@ export declare const PendingMediaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2137
2155
|
createdAt: z.ZodNumber;
|
|
2138
2156
|
updatedAt: z.ZodNumber;
|
|
2139
2157
|
processingStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
2158
|
+
processingAttemptCount: z.ZodOptional<z.ZodNumber>;
|
|
2159
|
+
processingLeaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
2140
2160
|
}, z.core.$strict>], "status">;
|
|
2141
2161
|
export declare const ArchivedPendingMediaCompletedSchema: z.ZodObject<{
|
|
2142
2162
|
status: z.ZodLiteral<"completed">;
|
|
@@ -2509,6 +2529,8 @@ export declare const ArchivedPendingMediaCompletedSchema: z.ZodObject<{
|
|
|
2509
2529
|
createdAt: z.ZodNumber;
|
|
2510
2530
|
updatedAt: z.ZodNumber;
|
|
2511
2531
|
processingStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
2532
|
+
processingAttemptCount: z.ZodOptional<z.ZodNumber>;
|
|
2533
|
+
processingLeaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
2512
2534
|
}, z.core.$strict>;
|
|
2513
2535
|
export declare const ArchivedPendingMediaFailedSchema: z.ZodObject<{
|
|
2514
2536
|
status: z.ZodLiteral<"failed">;
|
|
@@ -2573,6 +2595,8 @@ export declare const ArchivedPendingMediaFailedSchema: z.ZodObject<{
|
|
|
2573
2595
|
createdAt: z.ZodNumber;
|
|
2574
2596
|
updatedAt: z.ZodNumber;
|
|
2575
2597
|
processingStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
2598
|
+
processingAttemptCount: z.ZodOptional<z.ZodNumber>;
|
|
2599
|
+
processingLeaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
2576
2600
|
}, z.core.$strict>;
|
|
2577
2601
|
export declare const ArchivedPendingMediaRejectedSchema: z.ZodObject<{
|
|
2578
2602
|
status: z.ZodLiteral<"rejected">;
|
|
@@ -2951,6 +2975,8 @@ export declare const ArchivedPendingMediaRejectedSchema: z.ZodObject<{
|
|
|
2951
2975
|
createdAt: z.ZodNumber;
|
|
2952
2976
|
updatedAt: z.ZodNumber;
|
|
2953
2977
|
processingStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
2978
|
+
processingAttemptCount: z.ZodOptional<z.ZodNumber>;
|
|
2979
|
+
processingLeaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
2954
2980
|
}, z.core.$strict>;
|
|
2955
2981
|
export declare const ArchivedPendingMediaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2956
2982
|
status: z.ZodLiteral<"completed">;
|
|
@@ -3323,6 +3349,8 @@ export declare const ArchivedPendingMediaSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
3323
3349
|
createdAt: z.ZodNumber;
|
|
3324
3350
|
updatedAt: z.ZodNumber;
|
|
3325
3351
|
processingStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
3352
|
+
processingAttemptCount: z.ZodOptional<z.ZodNumber>;
|
|
3353
|
+
processingLeaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
3326
3354
|
}, z.core.$strict>, z.ZodObject<{
|
|
3327
3355
|
status: z.ZodLiteral<"failed">;
|
|
3328
3356
|
failedAt: z.ZodNumber;
|
|
@@ -3386,6 +3414,8 @@ export declare const ArchivedPendingMediaSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
3386
3414
|
createdAt: z.ZodNumber;
|
|
3387
3415
|
updatedAt: z.ZodNumber;
|
|
3388
3416
|
processingStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
3417
|
+
processingAttemptCount: z.ZodOptional<z.ZodNumber>;
|
|
3418
|
+
processingLeaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
3389
3419
|
}, z.core.$strict>, z.ZodObject<{
|
|
3390
3420
|
status: z.ZodLiteral<"rejected">;
|
|
3391
3421
|
rejectedAt: z.ZodNumber;
|
|
@@ -3763,6 +3793,8 @@ export declare const ArchivedPendingMediaSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
3763
3793
|
createdAt: z.ZodNumber;
|
|
3764
3794
|
updatedAt: z.ZodNumber;
|
|
3765
3795
|
processingStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
3796
|
+
processingAttemptCount: z.ZodOptional<z.ZodNumber>;
|
|
3797
|
+
processingLeaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
3766
3798
|
}, z.core.$strict>], "status">;
|
|
3767
3799
|
export type PendingMediaErrorCategory = z.infer<typeof PendingMediaErrorCategorySchema>;
|
|
3768
3800
|
export type PendingMediaResult = z.infer<typeof PendingMediaResultSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending-media.d.ts","sourceRoot":"","sources":["../../src/media/pending-media.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAS7B,eAAO,MAAM,+BAA+B;;;;;;;EAA0C,CAAC;AACvF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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yB,CAAC,KAAK,EAAE,OAAO,GAAG,oBAAoB,CAE9E"}
|
|
@@ -8,7 +8,7 @@ export const CraftSkillMediaTargetInfoSchema = z
|
|
|
8
8
|
.object({
|
|
9
9
|
// No craftSkillId: the backend mints the craft-skill doc id from the pendingMedia id;
|
|
10
10
|
// a client-supplied id was dead input the processor ignored, so it is not accepted.
|
|
11
|
-
// The canonical display/transport media-type family — never re-declared (
|
|
11
|
+
// The canonical display/transport media-type family — never re-declared (ARCH-102).
|
|
12
12
|
skillType: MediaTypeSchema,
|
|
13
13
|
originalFileName: z.string().min(1),
|
|
14
14
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"target-info.js","sourceRoot":"","sources":["../../src/media/target-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,kCAAkC,EAAE,MAAM,YAAY,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EACL,YAAY,EACZ,eAAe,EACf,2BAA2B,EAC3B,iCAAiC,EACjC,yBAAyB,EACzB,+BAA+B,EAC/B,6BAA6B,EAC7B,iCAAiC,EACjC,6BAA6B,EAC7B,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAElC,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAEpE,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC;KAC7C,MAAM,CAAC;IACN,sFAAsF;IACtF,oFAAoF;IACpF,mFAAmF;IACnF,SAAS,EAAE,eAAe;IAC1B,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACpC,CAAC;KACD,MA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AAC,OAAO,sCAAsC,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;QAC9G,KAAK,6BAA6B,CAAC,CAAC,OAAO,yCAAyC,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;QACpH,KAAK,aAAa,CAAC,CAAC,OAAO,0BAA0B,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;QACrF,KAAK,eAAe,CAAC,CAAC,OAAO,4BAA4B,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;QACzF,KAAK,kBAAkB,CAAC,CAAC,OAAO,8BAA8B,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;QAC9F,KAAK,kBAAkB,CAAC,CAAC,OAAO,8BAA8B,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;QAC9F,KAAK,0BAA0B,CAAC,CAAC,OAAO,sCAAsC,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;QAC9G,KAAK,0BAA0B,CAAC,CAAC,OAAO,sCAAsC,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;QAC9G,KAAK,+BAA+B,CAAC,CAAC,OAAO,8BAA8B,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;QAC3G,KAAK,YAAY,CAAC,CAAC,OAAO,yBAAyB,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;QACnF,KAAK,eAAe,CAAC,CAAC,OAAO,4BAA4B,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;QACzF,OAAO,CAAC,CAAC,OAAO,WAAW,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC","sourcesContent":["import { z } from \"zod\";\nimport type { FileOrigin } from \"./file-origin.js\";\nimport { MentionSchema, rejectDuplicateMentionPlaceholders } from \"./atoms.js\";\nimport { TRADE_PROFESSION_OPTIONS, TRADE_PROFESSION_VALUES } from \"../constants/options.js\";\nimport { MediaTypeSchema } from \"../doc-schemas/social.js\";\nimport {\n MAX_MENTIONS,\n MAX_POST_LENGTH,\n MAX_COMMISSION_TITLE_LENGTH,\n MAX_COMMISSION_DESCRIPTION_LENGTH,\n MAX_AUDITION_TITLE_LENGTH,\n MAX_AUDITION_DESCRIPTION_LENGTH,\n MAX_WORK_PROJECT_STAKE_SHARES,\n MAX_SPONSORED_AUDITION_AMOUNT_USD,\n MAX_CHAT_REPLY_PREVIEW_LENGTH,\n MIN_CURATED_AUDITION_OPTIONS,\n MAX_CURATED_AUDITION_OPTIONS,\n} from \"../constants/business.js\";\n\nexport const ProfilePictureTargetInfoSchema = z.object({}).strict();\n\nexport const CraftSkillMediaTargetInfoSchema = z\n .object({\n // No craftSkillId: the backend mints the craft-skill doc id from the pendingMedia id;\n // a client-supplied id was dead input the processor ignored, so it is not accepted.\n // The canonical display/transport media-type family — never re-declared (Rule 36).\n skillType: MediaTypeSchema,\n originalFileName: z.string().min(1),\n })\n .strict();\n\n// squareStreetz: mentions array of structured Mention objects. Capped at\n// MAX_MENTIONS with unique placeholders (duplicate placeholders collide at render\n// time — both tokens resolve to the later entity).\nexport const SquareStreetzTargetInfoSchema = z\n .object({\n mentions: z\n .array(MentionSchema)\n .max(MAX_MENTIONS)\n .superRefine(rejectDuplicateMentionPlaceholders),\n })\n .strict();\n\n// Per-origin text (caption) rule for the squareStreetz media-upload path. The caption\n// travels as StartUploadRequest.textContent (top-level, generic + optional) — not inside\n// targetInfo — so `startUpload` validates it with THIS schema when\n// fileOrigin === 'squareStreetz', mirroring the text-post callable's\n// CreateSquareStreetzTextPostInputSchema.textContent (min 1, max MAX_POST_LENGTH). This\n// closes the media-path gap where a caption was accepted unbounded / empty.\nexport const SquareStreetzCaptionSchema = z.string().min(1).max(MAX_POST_LENGTH);\n\n// commission-posting: full commission creation payload.\nexport const CommissionPostingTargetInfoSchema = z\n .object({\n // No commissionListingId: the backend mints the listing id server-side at publish;\n // it is not accepted from the client.\n title: z.string().min(1).max(MAX_COMMISSION_TITLE_LENGTH),\n description: z.string().max(MAX_COMMISSION_DESCRIPTION_LENGTH),\n requiredTradeProfessions: z.array(z.enum(TRADE_PROFESSION_VALUES)).max(TRADE_PROFESSION_OPTIONS.length),\n // min(1): the create core rejects 0 shares (invalid-argument) at PUBLISH — after\n // upload/transcode/moderation — so fail fast at the trust boundary instead of burning\n // the activation-job retry budget on a deterministic dead-letter.\n stakeSharesOffered: z.number().int().min(1).max(MAX_WORK_PROJECT_STAKE_SHARES),\n workProjectId: z.string().min(1),\n })\n .strict();\n\nexport const CommissionProposalTargetInfoSchema = z\n .object({\n commissionListingId: z.string().min(1),\n replyText: z.string().max(MAX_COMMISSION_DESCRIPTION_LENGTH),\n })\n .strict();\n\n// audition-prompt: workProject-owned audition creation payload (workAudition only).\nexport const AuditionPromptTargetInfoSchema = z\n .object({\n // SANCTIONED client-minted upload-batch correlation ID. A curated audition uploads\n // MULTIPLE files that must all share ONE audition id before any Audition doc exists,\n // so the client mints it and stamps every file in the batch with it. The backend must\n // treat it with create-no-overwrite semantics (first write wins; a colliding id from a\n // different actor/batch is rejected, never overwritten). This is NOT a reference to an\n // existing audition (contrast audition-entry's auditionId).\n auditionId: z.string().min(1),\n type: z.literal('workAudition'),\n title: z.string().min(1).max(MAX_AUDITION_TITLE_LENGTH),\n description: z.string().max(MAX_AUDITION_DESCRIPTION_LENGTH),\n openTill: z.number().int().positive(),\n workProjectId: z.string().min(1),\n // min(1): the create core rejects <1 shares at PUBLISH (see CommissionPosting above).\n // Optional — defaults to a floor of 1 at invite time when absent.\n stakeSharesOffered: z.number().int().min(1).max(MAX_WORK_PROJECT_STAKE_SHARES).optional(),\n // Curated vs open audition. Absent ⇒ 'open' (community replies + votes). 'curated' ⇒ the\n // creating work posts the option entries itself and users may ONLY vote (the create/reply\n // callable derives each option entry's isCreatorOption server-side and rejects community replies).\n mode: z.enum(['open', 'curated']).optional(),\n // Curated ONLY: the fixed number of creator option videos (2..8) in the atomic batch, carried from\n // the Create click through targetInfo so the create core sets it on the Audition doc and the reveal\n // coordinator knows when ALL options have landed. Required by the create core when mode==='curated'.\n expectedOptionCount: z.number().int().min(MIN_CURATED_AUDITION_OPTIONS).max(MAX_CURATED_AUDITION_OPTIONS).optional(),\n })\n .strict();\n\n// admin-audition-prompt: admin-operated featured/sponsored audition creation payload.\nexport const AdminAuditionPromptTargetInfoSchema = z\n .object({\n // SANCTIONED client-minted upload-batch correlation ID (see AuditionPromptTargetInfoSchema.\n // auditionId): a curated audition's multiple option videos share this one id before any\n // Audition doc exists; the backend uses create-no-overwrite semantics. NOT a reference to\n // an existing audition.\n auditionId: z.string().min(1),\n type: z.enum(['platformAudition', 'sponsoredAudition']),\n title: z.string().min(1).max(MAX_AUDITION_TITLE_LENGTH),\n description: z.string().max(MAX_AUDITION_DESCRIPTION_LENGTH),\n openTill: z.number().int().positive(),\n sponsoredAuditionAmountUSD: z.number().nonnegative().finite().max(MAX_SPONSORED_AUDITION_AMOUNT_USD).optional(),\n // Curated vs open (see AuditionPromptTargetInfoSchema.mode). Absent ⇒ 'open'.\n mode: z.enum(['open', 'curated']).optional(),\n // Curated ONLY: fixed number of option videos (2..8) in the atomic batch (see\n // AuditionPromptTargetInfoSchema.expectedOptionCount). Required by the create core when curated.\n expectedOptionCount: z.number().int().min(MIN_CURATED_AUDITION_OPTIONS).max(MAX_CURATED_AUDITION_OPTIONS).optional(),\n })\n .strict();\n\nexport const AuditionEntryTargetInfoSchema = z\n .object({\n auditionId: z.string().min(1),\n })\n .strict();\n\n// ───────────────────────────────────────────────────────────────────\n// HALL LIBRARY COVER target info (square / poster / cinematic).\n// All three origins share one shape. The processor uses fileOrigin to\n// pick which field on the target doc gets written (see\n// HALL_LIBRARY_TARGET_FIELDS in `hall-library-target-fields.ts`).\n//\n// itemType discriminates which parent collection — `workProjectTales` vs\n// `workProjectTunes` vs `workProjectTelevision`. fileOrigin alone does NOT\n// disambiguate this because all three cover origins target whichever\n// hallLibrary item the user is editing.\n// ───────────────────────────────────────────────────────────────────\nconst HallLibraryCoverTargetInfoSchema = z\n .object({\n workProjectId: z.string().min(1),\n itemType: z.enum(['tale', 'tune', 'television']),\n itemId: z.string().min(1),\n })\n .strict();\n\nexport const HallLibraryCoverSquareTargetInfoSchema = HallLibraryCoverTargetInfoSchema;\nexport const HallLibraryCoverPosterTargetInfoSchema = HallLibraryCoverTargetInfoSchema;\nexport const HallLibraryCoverCinematicTargetInfoSchema = HallLibraryCoverTargetInfoSchema;\n\n// realm-cover: the Realm's square cover art. The processor writes\n// `realmCoverAssetId` on workRealms/{workRealmId}. Steward-only (the upload\n// callable authorizes against the realm's workStewardUid).\nexport const RealmCoverTargetInfoSchema = z\n .object({\n workRealmId: z.string().min(1),\n })\n .strict();\n\n// ───────────────────────────────────────────────────────────────────\n// SUB-ITEM target info — one shape per item type, NOT per media kind.\n// chapter-photo uses ChapterPhotoTargetInfoSchema.\n// tune-track-photo + tune-track-audio share TuneTrackMediaTargetInfoSchema.\n// television-episode-photo + television-episode-video share TelevisionEpisodeMediaTargetInfoSchema.\n// The processor derives the doc path from these IDs via\n// PATH_BUILDERS.taleChapter / .tuneTrack / .televisionEpisode, and derives the\n// field name from fileOrigin via HALL_LIBRARY_TARGET_FIELDS.\n// ───────────────────────────────────────────────────────────────────\nexport const ChapterPhotoTargetInfoSchema = z\n .object({\n workProjectId: z.string().min(1),\n taleId: z.string().min(1),\n chapterId: z.string().min(1),\n })\n .strict();\n\nconst TuneTrackMediaTargetInfoSchema = z\n .object({\n workProjectId: z.string().min(1),\n tuneId: z.string().min(1),\n trackId: z.string().min(1),\n })\n .strict();\n\nexport const TuneTrackPhotoTargetInfoSchema = TuneTrackMediaTargetInfoSchema;\nexport const TuneTrackAudioTargetInfoSchema = TuneTrackMediaTargetInfoSchema;\n\nconst TelevisionEpisodeMediaTargetInfoSchema = z\n .object({\n workProjectId: z.string().min(1),\n televisionId: z.string().min(1),\n episodeId: z.string().min(1),\n })\n .strict();\n\nexport const TelevisionEpisodePhotoTargetInfoSchema = TelevisionEpisodeMediaTargetInfoSchema;\nexport const TelevisionEpisodeVideoTargetInfoSchema = TelevisionEpisodeMediaTargetInfoSchema;\n\n// guild-chat-message-attachment: discriminated by threadKind.\nconst ChatReplyToSchema = z\n .object({\n messageId: z.string().min(1),\n senderId: z.string().min(1),\n messagePreview: z.string().max(MAX_CHAT_REPLY_PREVIEW_LENGTH),\n })\n .strict();\n\nexport const ChatAttachmentTargetInfoSchema = z.discriminatedUnion('threadKind', [\n z\n .object({\n threadKind: z.literal('guildChatChannel'),\n workProjectId: z.string().min(1),\n guildChatChannelId: z.string().min(1),\n replyTo: ChatReplyToSchema.optional(),\n })\n .strict(),\n z\n .object({\n threadKind: z.literal('guildInvite'),\n guildInviteId: z.string().min(1),\n replyTo: ChatReplyToSchema.optional(),\n })\n .strict(),\n z\n .object({\n threadKind: z.literal('adminSupport'),\n adminDispatchId: z.string().min(1),\n isUserReply: z.boolean(),\n replyTo: ChatReplyToSchema.optional(),\n })\n .strict(),\n]);\n\nexport const WorkAssetTargetInfoSchema = z\n .object({\n workProjectId: z.string().min(1),\n // The folder the file is uploaded INTO (S7 folder system). Custom folders gate\n // upload by trade profession; the default folder accepts any active guildmate.\n folderId: z.string().min(1),\n })\n .strict();\n\n// ---- type aliases ----\n\nexport type ProfilePictureTargetInfo = z.infer<typeof ProfilePictureTargetInfoSchema>;\nexport type CraftSkillMediaTargetInfo = z.infer<typeof CraftSkillMediaTargetInfoSchema>;\nexport type SquareStreetzTargetInfo = z.infer<typeof SquareStreetzTargetInfoSchema>;\nexport type CommissionPostingTargetInfo = z.infer<typeof CommissionPostingTargetInfoSchema>;\nexport type CommissionProposalTargetInfo = z.infer<typeof CommissionProposalTargetInfoSchema>;\nexport type AuditionPromptTargetInfo = z.infer<typeof AuditionPromptTargetInfoSchema>;\nexport type AdminAuditionPromptTargetInfo = z.infer<typeof AdminAuditionPromptTargetInfoSchema>;\nexport type AuditionEntryTargetInfo = z.infer<typeof AuditionEntryTargetInfoSchema>;\nexport type HallLibraryCoverSquareTargetInfo = z.infer<typeof HallLibraryCoverSquareTargetInfoSchema>;\nexport type HallLibraryCoverPosterTargetInfo = z.infer<typeof HallLibraryCoverPosterTargetInfoSchema>;\nexport type HallLibraryCoverCinematicTargetInfo = z.infer<typeof HallLibraryCoverCinematicTargetInfoSchema>;\nexport type RealmCoverTargetInfo = z.infer<typeof RealmCoverTargetInfoSchema>;\nexport type ChapterPhotoTargetInfo = z.infer<typeof ChapterPhotoTargetInfoSchema>;\nexport type TuneTrackPhotoTargetInfo = z.infer<typeof TuneTrackPhotoTargetInfoSchema>;\nexport type TuneTrackAudioTargetInfo = z.infer<typeof TuneTrackAudioTargetInfoSchema>;\nexport type TelevisionEpisodePhotoTargetInfo = z.infer<typeof TelevisionEpisodePhotoTargetInfoSchema>;\nexport type TelevisionEpisodeVideoTargetInfo = z.infer<typeof TelevisionEpisodeVideoTargetInfoSchema>;\nexport type ChatAttachmentTargetInfo = z.infer<typeof ChatAttachmentTargetInfoSchema>;\nexport type WorkAssetTargetInfo = z.infer<typeof WorkAssetTargetInfoSchema>;\n\n// ncii-evidence: ties the uploaded evidence to a take-it-down request by its\n// public reference. The processor attaches the evidence record to that request.\nexport const NciiEvidenceTargetInfoSchema = z\n .object({\n requestReference: z.string().min(1),\n })\n .strict();\nexport type NciiEvidenceTargetInfo = z.infer<typeof NciiEvidenceTargetInfoSchema>;\n\n// Mapped type: given a FileOrigin literal, returns its targetInfo shape.\nexport type TargetInfoFor<O extends FileOrigin> =\n O extends 'profile-picture' ? ProfilePictureTargetInfo\n : O extends 'craft-skill-media' ? CraftSkillMediaTargetInfo\n : O extends 'squareStreetz' ? SquareStreetzTargetInfo\n : O extends 'commission-posting' ? CommissionPostingTargetInfo\n : O extends 'commission-proposal' ? CommissionProposalTargetInfo\n : O extends 'audition-prompt' ? AuditionPromptTargetInfo\n : O extends 'admin-audition-prompt' ? AdminAuditionPromptTargetInfo\n : O extends 'audition-entry' ? AuditionEntryTargetInfo\n : O extends 'hallLibrary-cover-square' ? HallLibraryCoverSquareTargetInfo\n : O extends 'hallLibrary-cover-poster' ? HallLibraryCoverPosterTargetInfo\n : O extends 'hallLibrary-cover-cinematic' ? HallLibraryCoverCinematicTargetInfo\n : O extends 'realm-cover' ? RealmCoverTargetInfo\n : O extends 'chapter-photo' ? ChapterPhotoTargetInfo\n : O extends 'tune-track-photo' ? TuneTrackPhotoTargetInfo\n : O extends 'tune-track-audio' ? TuneTrackAudioTargetInfo\n : O extends 'television-episode-photo' ? TelevisionEpisodePhotoTargetInfo\n : O extends 'television-episode-video' ? TelevisionEpisodeVideoTargetInfo\n : O extends 'guild-chat-message-attachment' ? ChatAttachmentTargetInfo\n : O extends 'work-asset' ? WorkAssetTargetInfo\n : O extends 'ncii-evidence' ? NciiEvidenceTargetInfo\n : never;\n\nfunction assertNever(x: never): never {\n throw new Error(`Unexpected fileOrigin: ${String(x)}`);\n}\n\nexport function parseTargetInfo<O extends FileOrigin>(\n fileOrigin: O,\n raw: unknown\n): TargetInfoFor<O> {\n switch (fileOrigin) {\n case 'profile-picture': return ProfilePictureTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'craft-skill-media': return CraftSkillMediaTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'squareStreetz': return SquareStreetzTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'commission-posting': return CommissionPostingTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'commission-proposal': return CommissionProposalTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'audition-prompt': return AuditionPromptTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'admin-audition-prompt': return AdminAuditionPromptTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'audition-entry': return AuditionEntryTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'hallLibrary-cover-square': return HallLibraryCoverSquareTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'hallLibrary-cover-poster': return HallLibraryCoverPosterTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'hallLibrary-cover-cinematic': return HallLibraryCoverCinematicTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'realm-cover': return RealmCoverTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'chapter-photo': return ChapterPhotoTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'tune-track-photo': return TuneTrackPhotoTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'tune-track-audio': return TuneTrackAudioTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'television-episode-photo': return TelevisionEpisodePhotoTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'television-episode-video': return TelevisionEpisodeVideoTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'guild-chat-message-attachment': return ChatAttachmentTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'work-asset': return WorkAssetTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'ncii-evidence': return NciiEvidenceTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n default: return assertNever(fileOrigin);\n }\n}\n\n\n\n\n"]}
|
|
1
|
+
{"version":3,"file":"target-info.js","sourceRoot":"","sources":["../../src/media/target-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,kCAAkC,EAAE,MAAM,YAAY,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EACL,YAAY,EACZ,eAAe,EACf,2BAA2B,EAC3B,iCAAiC,EACjC,yBAAyB,EACzB,+BAA+B,EAC/B,6BAA6B,EAC7B,iCAAiC,EACjC,6BAA6B,EAC7B,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAElC,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,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ourcesContent":["import { z } from \"zod\";\nimport type { FileOrigin } from \"./file-origin.js\";\nimport { MentionSchema, rejectDuplicateMentionPlaceholders } from \"./atoms.js\";\nimport { TRADE_PROFESSION_OPTIONS, TRADE_PROFESSION_VALUES } from \"../constants/options.js\";\nimport { MediaTypeSchema } from \"../doc-schemas/social.js\";\nimport {\n MAX_MENTIONS,\n MAX_POST_LENGTH,\n MAX_COMMISSION_TITLE_LENGTH,\n MAX_COMMISSION_DESCRIPTION_LENGTH,\n MAX_AUDITION_TITLE_LENGTH,\n MAX_AUDITION_DESCRIPTION_LENGTH,\n MAX_WORK_PROJECT_STAKE_SHARES,\n MAX_SPONSORED_AUDITION_AMOUNT_USD,\n MAX_CHAT_REPLY_PREVIEW_LENGTH,\n MIN_CURATED_AUDITION_OPTIONS,\n MAX_CURATED_AUDITION_OPTIONS,\n} from \"../constants/business.js\";\n\nexport const ProfilePictureTargetInfoSchema = z.object({}).strict();\n\nexport const CraftSkillMediaTargetInfoSchema = z\n .object({\n // No craftSkillId: the backend mints the craft-skill doc id from the pendingMedia id;\n // a client-supplied id was dead input the processor ignored, so it is not accepted.\n // The canonical display/transport media-type family — never re-declared (ARCH-102).\n skillType: MediaTypeSchema,\n originalFileName: z.string().min(1),\n })\n .strict();\n\n// squareStreetz: mentions array of structured Mention objects. Capped at\n// MAX_MENTIONS with unique placeholders (duplicate placeholders collide at render\n// time — both tokens resolve to the later entity).\nexport const SquareStreetzTargetInfoSchema = z\n .object({\n mentions: z\n .array(MentionSchema)\n .max(MAX_MENTIONS)\n .superRefine(rejectDuplicateMentionPlaceholders),\n })\n .strict();\n\n// Per-origin text (caption) rule for the squareStreetz media-upload path. The caption\n// travels as StartUploadRequest.textContent (top-level, generic + optional) — not inside\n// targetInfo — so `startUpload` validates it with THIS schema when\n// fileOrigin === 'squareStreetz', mirroring the text-post callable's\n// CreateSquareStreetzTextPostInputSchema.textContent (min 1, max MAX_POST_LENGTH). This\n// closes the media-path gap where a caption was accepted unbounded / empty.\nexport const SquareStreetzCaptionSchema = z.string().min(1).max(MAX_POST_LENGTH);\n\n// commission-posting: full commission creation payload.\nexport const CommissionPostingTargetInfoSchema = z\n .object({\n // No commissionListingId: the backend mints the listing id server-side at publish;\n // it is not accepted from the client.\n title: z.string().min(1).max(MAX_COMMISSION_TITLE_LENGTH),\n description: z.string().max(MAX_COMMISSION_DESCRIPTION_LENGTH),\n requiredTradeProfessions: z.array(z.enum(TRADE_PROFESSION_VALUES)).max(TRADE_PROFESSION_OPTIONS.length),\n // min(1): the create core rejects 0 shares (invalid-argument) at PUBLISH — after\n // upload/transcode/moderation — so fail fast at the trust boundary instead of burning\n // the activation-job retry budget on a deterministic dead-letter.\n stakeSharesOffered: z.number().int().min(1).max(MAX_WORK_PROJECT_STAKE_SHARES),\n workProjectId: z.string().min(1),\n })\n .strict();\n\nexport const CommissionProposalTargetInfoSchema = z\n .object({\n commissionListingId: z.string().min(1),\n replyText: z.string().max(MAX_COMMISSION_DESCRIPTION_LENGTH),\n })\n .strict();\n\n// audition-prompt: workProject-owned audition creation payload (workAudition only).\nexport const AuditionPromptTargetInfoSchema = z\n .object({\n // SANCTIONED client-minted upload-batch correlation ID. A curated audition uploads\n // MULTIPLE files that must all share ONE audition id before any Audition doc exists,\n // so the client mints it and stamps every file in the batch with it. The backend must\n // treat it with create-no-overwrite semantics (first write wins; a colliding id from a\n // different actor/batch is rejected, never overwritten). This is NOT a reference to an\n // existing audition (contrast audition-entry's auditionId).\n auditionId: z.string().min(1),\n type: z.literal('workAudition'),\n title: z.string().min(1).max(MAX_AUDITION_TITLE_LENGTH),\n description: z.string().max(MAX_AUDITION_DESCRIPTION_LENGTH),\n openTill: z.number().int().positive(),\n workProjectId: z.string().min(1),\n // min(1): the create core rejects <1 shares at PUBLISH (see CommissionPosting above).\n // Optional — defaults to a floor of 1 at invite time when absent.\n stakeSharesOffered: z.number().int().min(1).max(MAX_WORK_PROJECT_STAKE_SHARES).optional(),\n // Curated vs open audition. Absent ⇒ 'open' (community replies + votes). 'curated' ⇒ the\n // creating work posts the option entries itself and users may ONLY vote (the create/reply\n // callable derives each option entry's isCreatorOption server-side and rejects community replies).\n mode: z.enum(['open', 'curated']).optional(),\n // Curated ONLY: the fixed number of creator option videos (2..8) in the atomic batch, carried from\n // the Create click through targetInfo so the create core sets it on the Audition doc and the reveal\n // coordinator knows when ALL options have landed. Required by the create core when mode==='curated'.\n expectedOptionCount: z.number().int().min(MIN_CURATED_AUDITION_OPTIONS).max(MAX_CURATED_AUDITION_OPTIONS).optional(),\n })\n .strict();\n\n// admin-audition-prompt: admin-operated featured/sponsored audition creation payload.\nexport const AdminAuditionPromptTargetInfoSchema = z\n .object({\n // SANCTIONED client-minted upload-batch correlation ID (see AuditionPromptTargetInfoSchema.\n // auditionId): a curated audition's multiple option videos share this one id before any\n // Audition doc exists; the backend uses create-no-overwrite semantics. NOT a reference to\n // an existing audition.\n auditionId: z.string().min(1),\n type: z.enum(['platformAudition', 'sponsoredAudition']),\n title: z.string().min(1).max(MAX_AUDITION_TITLE_LENGTH),\n description: z.string().max(MAX_AUDITION_DESCRIPTION_LENGTH),\n openTill: z.number().int().positive(),\n sponsoredAuditionAmountUSD: z.number().nonnegative().finite().max(MAX_SPONSORED_AUDITION_AMOUNT_USD).optional(),\n // Curated vs open (see AuditionPromptTargetInfoSchema.mode). Absent ⇒ 'open'.\n mode: z.enum(['open', 'curated']).optional(),\n // Curated ONLY: fixed number of option videos (2..8) in the atomic batch (see\n // AuditionPromptTargetInfoSchema.expectedOptionCount). Required by the create core when curated.\n expectedOptionCount: z.number().int().min(MIN_CURATED_AUDITION_OPTIONS).max(MAX_CURATED_AUDITION_OPTIONS).optional(),\n })\n .strict();\n\nexport const AuditionEntryTargetInfoSchema = z\n .object({\n auditionId: z.string().min(1),\n })\n .strict();\n\n// ───────────────────────────────────────────────────────────────────\n// HALL LIBRARY COVER target info (square / poster / cinematic).\n// All three origins share one shape. The processor uses fileOrigin to\n// pick which field on the target doc gets written (see\n// HALL_LIBRARY_TARGET_FIELDS in `hall-library-target-fields.ts`).\n//\n// itemType discriminates which parent collection — `workProjectTales` vs\n// `workProjectTunes` vs `workProjectTelevision`. fileOrigin alone does NOT\n// disambiguate this because all three cover origins target whichever\n// hallLibrary item the user is editing.\n// ───────────────────────────────────────────────────────────────────\nconst HallLibraryCoverTargetInfoSchema = z\n .object({\n workProjectId: z.string().min(1),\n itemType: z.enum(['tale', 'tune', 'television']),\n itemId: z.string().min(1),\n })\n .strict();\n\nexport const HallLibraryCoverSquareTargetInfoSchema = HallLibraryCoverTargetInfoSchema;\nexport const HallLibraryCoverPosterTargetInfoSchema = HallLibraryCoverTargetInfoSchema;\nexport const HallLibraryCoverCinematicTargetInfoSchema = HallLibraryCoverTargetInfoSchema;\n\n// realm-cover: the Realm's square cover art. The processor writes\n// `realmCoverAssetId` on workRealms/{workRealmId}. Steward-only (the upload\n// callable authorizes against the realm's workStewardUid).\nexport const RealmCoverTargetInfoSchema = z\n .object({\n workRealmId: z.string().min(1),\n })\n .strict();\n\n// ───────────────────────────────────────────────────────────────────\n// SUB-ITEM target info — one shape per item type, NOT per media kind.\n// chapter-photo uses ChapterPhotoTargetInfoSchema.\n// tune-track-photo + tune-track-audio share TuneTrackMediaTargetInfoSchema.\n// television-episode-photo + television-episode-video share TelevisionEpisodeMediaTargetInfoSchema.\n// The processor derives the doc path from these IDs via\n// PATH_BUILDERS.taleChapter / .tuneTrack / .televisionEpisode, and derives the\n// field name from fileOrigin via HALL_LIBRARY_TARGET_FIELDS.\n// ───────────────────────────────────────────────────────────────────\nexport const ChapterPhotoTargetInfoSchema = z\n .object({\n workProjectId: z.string().min(1),\n taleId: z.string().min(1),\n chapterId: z.string().min(1),\n })\n .strict();\n\nconst TuneTrackMediaTargetInfoSchema = z\n .object({\n workProjectId: z.string().min(1),\n tuneId: z.string().min(1),\n trackId: z.string().min(1),\n })\n .strict();\n\nexport const TuneTrackPhotoTargetInfoSchema = TuneTrackMediaTargetInfoSchema;\nexport const TuneTrackAudioTargetInfoSchema = TuneTrackMediaTargetInfoSchema;\n\nconst TelevisionEpisodeMediaTargetInfoSchema = z\n .object({\n workProjectId: z.string().min(1),\n televisionId: z.string().min(1),\n episodeId: z.string().min(1),\n })\n .strict();\n\nexport const TelevisionEpisodePhotoTargetInfoSchema = TelevisionEpisodeMediaTargetInfoSchema;\nexport const TelevisionEpisodeVideoTargetInfoSchema = TelevisionEpisodeMediaTargetInfoSchema;\n\n// guild-chat-message-attachment: discriminated by threadKind.\nconst ChatReplyToSchema = z\n .object({\n messageId: z.string().min(1),\n senderId: z.string().min(1),\n messagePreview: z.string().max(MAX_CHAT_REPLY_PREVIEW_LENGTH),\n })\n .strict();\n\nexport const ChatAttachmentTargetInfoSchema = z.discriminatedUnion('threadKind', [\n z\n .object({\n threadKind: z.literal('guildChatChannel'),\n workProjectId: z.string().min(1),\n guildChatChannelId: z.string().min(1),\n replyTo: ChatReplyToSchema.optional(),\n })\n .strict(),\n z\n .object({\n threadKind: z.literal('guildInvite'),\n guildInviteId: z.string().min(1),\n replyTo: ChatReplyToSchema.optional(),\n })\n .strict(),\n z\n .object({\n threadKind: z.literal('adminSupport'),\n adminDispatchId: z.string().min(1),\n isUserReply: z.boolean(),\n replyTo: ChatReplyToSchema.optional(),\n })\n .strict(),\n]);\n\nexport const WorkAssetTargetInfoSchema = z\n .object({\n workProjectId: z.string().min(1),\n // The folder the file is uploaded INTO (S7 folder system). Custom folders gate\n // upload by trade profession; the default folder accepts any active guildmate.\n folderId: z.string().min(1),\n })\n .strict();\n\n// ---- type aliases ----\n\nexport type ProfilePictureTargetInfo = z.infer<typeof ProfilePictureTargetInfoSchema>;\nexport type CraftSkillMediaTargetInfo = z.infer<typeof CraftSkillMediaTargetInfoSchema>;\nexport type SquareStreetzTargetInfo = z.infer<typeof SquareStreetzTargetInfoSchema>;\nexport type CommissionPostingTargetInfo = z.infer<typeof CommissionPostingTargetInfoSchema>;\nexport type CommissionProposalTargetInfo = z.infer<typeof CommissionProposalTargetInfoSchema>;\nexport type AuditionPromptTargetInfo = z.infer<typeof AuditionPromptTargetInfoSchema>;\nexport type AdminAuditionPromptTargetInfo = z.infer<typeof AdminAuditionPromptTargetInfoSchema>;\nexport type AuditionEntryTargetInfo = z.infer<typeof AuditionEntryTargetInfoSchema>;\nexport type HallLibraryCoverSquareTargetInfo = z.infer<typeof HallLibraryCoverSquareTargetInfoSchema>;\nexport type HallLibraryCoverPosterTargetInfo = z.infer<typeof HallLibraryCoverPosterTargetInfoSchema>;\nexport type HallLibraryCoverCinematicTargetInfo = z.infer<typeof HallLibraryCoverCinematicTargetInfoSchema>;\nexport type RealmCoverTargetInfo = z.infer<typeof RealmCoverTargetInfoSchema>;\nexport type ChapterPhotoTargetInfo = z.infer<typeof ChapterPhotoTargetInfoSchema>;\nexport type TuneTrackPhotoTargetInfo = z.infer<typeof TuneTrackPhotoTargetInfoSchema>;\nexport type TuneTrackAudioTargetInfo = z.infer<typeof TuneTrackAudioTargetInfoSchema>;\nexport type TelevisionEpisodePhotoTargetInfo = z.infer<typeof TelevisionEpisodePhotoTargetInfoSchema>;\nexport type TelevisionEpisodeVideoTargetInfo = z.infer<typeof TelevisionEpisodeVideoTargetInfoSchema>;\nexport type ChatAttachmentTargetInfo = z.infer<typeof ChatAttachmentTargetInfoSchema>;\nexport type WorkAssetTargetInfo = z.infer<typeof WorkAssetTargetInfoSchema>;\n\n// ncii-evidence: ties the uploaded evidence to a take-it-down request by its\n// public reference. The processor attaches the evidence record to that request.\nexport const NciiEvidenceTargetInfoSchema = z\n .object({\n requestReference: z.string().min(1),\n })\n .strict();\nexport type NciiEvidenceTargetInfo = z.infer<typeof NciiEvidenceTargetInfoSchema>;\n\n// Mapped type: given a FileOrigin literal, returns its targetInfo shape.\nexport type TargetInfoFor<O extends FileOrigin> =\n O extends 'profile-picture' ? ProfilePictureTargetInfo\n : O extends 'craft-skill-media' ? CraftSkillMediaTargetInfo\n : O extends 'squareStreetz' ? SquareStreetzTargetInfo\n : O extends 'commission-posting' ? CommissionPostingTargetInfo\n : O extends 'commission-proposal' ? CommissionProposalTargetInfo\n : O extends 'audition-prompt' ? AuditionPromptTargetInfo\n : O extends 'admin-audition-prompt' ? AdminAuditionPromptTargetInfo\n : O extends 'audition-entry' ? AuditionEntryTargetInfo\n : O extends 'hallLibrary-cover-square' ? HallLibraryCoverSquareTargetInfo\n : O extends 'hallLibrary-cover-poster' ? HallLibraryCoverPosterTargetInfo\n : O extends 'hallLibrary-cover-cinematic' ? HallLibraryCoverCinematicTargetInfo\n : O extends 'realm-cover' ? RealmCoverTargetInfo\n : O extends 'chapter-photo' ? ChapterPhotoTargetInfo\n : O extends 'tune-track-photo' ? TuneTrackPhotoTargetInfo\n : O extends 'tune-track-audio' ? TuneTrackAudioTargetInfo\n : O extends 'television-episode-photo' ? TelevisionEpisodePhotoTargetInfo\n : O extends 'television-episode-video' ? TelevisionEpisodeVideoTargetInfo\n : O extends 'guild-chat-message-attachment' ? ChatAttachmentTargetInfo\n : O extends 'work-asset' ? WorkAssetTargetInfo\n : O extends 'ncii-evidence' ? NciiEvidenceTargetInfo\n : never;\n\nfunction assertNever(x: never): never {\n throw new Error(`Unexpected fileOrigin: ${String(x)}`);\n}\n\nexport function parseTargetInfo<O extends FileOrigin>(\n fileOrigin: O,\n raw: unknown\n): TargetInfoFor<O> {\n switch (fileOrigin) {\n case 'profile-picture': return ProfilePictureTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'craft-skill-media': return CraftSkillMediaTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'squareStreetz': return SquareStreetzTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'commission-posting': return CommissionPostingTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'commission-proposal': return CommissionProposalTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'audition-prompt': return AuditionPromptTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'admin-audition-prompt': return AdminAuditionPromptTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'audition-entry': return AuditionEntryTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'hallLibrary-cover-square': return HallLibraryCoverSquareTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'hallLibrary-cover-poster': return HallLibraryCoverPosterTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'hallLibrary-cover-cinematic': return HallLibraryCoverCinematicTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'realm-cover': return RealmCoverTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'chapter-photo': return ChapterPhotoTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'tune-track-photo': return TuneTrackPhotoTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'tune-track-audio': return TuneTrackAudioTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'television-episode-photo': return TelevisionEpisodePhotoTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'television-episode-video': return TelevisionEpisodeVideoTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'guild-chat-message-attachment': return ChatAttachmentTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'work-asset': return WorkAssetTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n case 'ncii-evidence': return NciiEvidenceTargetInfoSchema.parse(raw) as TargetInfoFor<O>;\n default: return assertNever(fileOrigin);\n }\n}\n\n\n\n\n"]}
|
|
@@ -64,7 +64,7 @@ export const COLLECTIONS = {
|
|
|
64
64
|
CRAFT_SKILLS_BY_TAG: 'craftSkillsByTag',
|
|
65
65
|
SYSTEM_DATA: '_systemData',
|
|
66
66
|
APP_CONFIG: '_config',
|
|
67
|
-
// Server-only singleton bucket (
|
|
67
|
+
// Server-only singleton bucket (BACKEND-108 — least-privileged reader). Docs whose ONLY
|
|
68
68
|
// readers are Cloud Functions (Admin SDK) live here, never in the public `_config`
|
|
69
69
|
// bucket. Firestore rules deny all client reads/writes on `_serverData`.
|
|
70
70
|
// Docs: agePolicy, nciiPolicy, privilegedReviewerSecurity.
|
|
@@ -276,7 +276,7 @@ export const SPECIAL_DOCS = {
|
|
|
276
276
|
// Trust & Safety — singleton global SLA-monitor heartbeat (safetyMonitorHeartbeat/global).
|
|
277
277
|
SAFETY_MONITOR_HEARTBEAT_GLOBAL: 'global',
|
|
278
278
|
// Trust & Safety — _serverData (server-only) singletons (§A7, §A11). Moved out of the
|
|
279
|
-
// public _config bucket: their only readers are Cloud Functions (
|
|
279
|
+
// public _config bucket: their only readers are Cloud Functions (BACKEND-108).
|
|
280
280
|
AGE_POLICY: 'agePolicy',
|
|
281
281
|
NCII_POLICY: 'nciiPolicy',
|
|
282
282
|
PRIVILEGED_REVIEWER_SECURITY: 'privilegedReviewerSecurity',
|