@ttt-productions/ttt-core 0.78.22 → 0.78.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/constants/business-user.d.ts +1 -1
  2. package/dist/constants/business-user.js +1 -1
  3. package/dist/constants/business-user.js.map +1 -1
  4. package/dist/constants/release-flags.d.ts +2 -2
  5. package/dist/constants/release-flags.d.ts.map +1 -1
  6. package/dist/constants/release-flags.js +2 -2
  7. package/dist/constants/release-flags.js.map +1 -1
  8. package/dist/doc-schemas/chat-sync.d.ts.map +1 -1
  9. package/dist/doc-schemas/chat-sync.js +3 -2
  10. package/dist/doc-schemas/chat-sync.js.map +1 -1
  11. package/dist/doc-schemas/commissions.d.ts +14 -11
  12. package/dist/doc-schemas/commissions.d.ts.map +1 -1
  13. package/dist/doc-schemas/commissions.js +14 -4
  14. package/dist/doc-schemas/commissions.js.map +1 -1
  15. package/dist/doc-schemas/media-activation-jobs.d.ts.map +1 -1
  16. package/dist/doc-schemas/media-activation-jobs.js +4 -3
  17. package/dist/doc-schemas/media-activation-jobs.js.map +1 -1
  18. package/dist/doc-schemas/media-assets.d.ts +2 -2
  19. package/dist/doc-schemas/media-assets.d.ts.map +1 -1
  20. package/dist/doc-schemas/media-assets.js +5 -4
  21. package/dist/doc-schemas/media-assets.js.map +1 -1
  22. package/dist/doc-schemas/messaging.d.ts.map +1 -1
  23. package/dist/doc-schemas/messaging.js +3 -2
  24. package/dist/doc-schemas/messaging.js.map +1 -1
  25. package/dist/doc-schemas/ncii/allegations.js +3 -3
  26. package/dist/doc-schemas/ncii/allegations.js.map +1 -1
  27. package/dist/doc-schemas/ncii/cases.d.ts.map +1 -1
  28. package/dist/doc-schemas/ncii/cases.js +4 -3
  29. package/dist/doc-schemas/ncii/cases.js.map +1 -1
  30. package/dist/doc-schemas/ncii/config.d.ts.map +1 -1
  31. package/dist/doc-schemas/ncii/config.js +4 -3
  32. package/dist/doc-schemas/ncii/config.js.map +1 -1
  33. package/dist/doc-schemas/ncii/holds.js +3 -3
  34. package/dist/doc-schemas/ncii/holds.js.map +1 -1
  35. package/dist/doc-schemas/ncii/removal.js +3 -3
  36. package/dist/doc-schemas/ncii/removal.js.map +1 -1
  37. package/dist/doc-schemas/ncii/requests.d.ts.map +1 -1
  38. package/dist/doc-schemas/ncii/requests.js +4 -3
  39. package/dist/doc-schemas/ncii/requests.js.map +1 -1
  40. package/dist/doc-schemas/notification-ledger.d.ts.map +1 -1
  41. package/dist/doc-schemas/notification-ledger.js +3 -1
  42. package/dist/doc-schemas/notification-ledger.js.map +1 -1
  43. package/dist/doc-schemas/payments.d.ts.map +1 -1
  44. package/dist/doc-schemas/payments.js +2 -1
  45. package/dist/doc-schemas/payments.js.map +1 -1
  46. package/dist/doc-schemas/registry.d.ts +108 -35
  47. package/dist/doc-schemas/registry.d.ts.map +1 -1
  48. package/dist/doc-schemas/registry.js +4 -0
  49. package/dist/doc-schemas/registry.js.map +1 -1
  50. package/dist/doc-schemas/safety/age.d.ts.map +1 -1
  51. package/dist/doc-schemas/safety/age.js +4 -3
  52. package/dist/doc-schemas/safety/age.js.map +1 -1
  53. package/dist/doc-schemas/safety/case-aliases.d.ts.map +1 -1
  54. package/dist/doc-schemas/safety/case-aliases.js +5 -4
  55. package/dist/doc-schemas/safety/case-aliases.js.map +1 -1
  56. package/dist/doc-schemas/safety/case.d.ts.map +1 -1
  57. package/dist/doc-schemas/safety/case.js +4 -3
  58. package/dist/doc-schemas/safety/case.js.map +1 -1
  59. package/dist/doc-schemas/safety/evidence.js +3 -3
  60. package/dist/doc-schemas/safety/evidence.js.map +1 -1
  61. package/dist/doc-schemas/safety/foundation.d.ts.map +1 -1
  62. package/dist/doc-schemas/safety/foundation.js +5 -3
  63. package/dist/doc-schemas/safety/foundation.js.map +1 -1
  64. package/dist/doc-schemas/safety/holds.d.ts.map +1 -1
  65. package/dist/doc-schemas/safety/holds.js +4 -3
  66. package/dist/doc-schemas/safety/holds.js.map +1 -1
  67. package/dist/doc-schemas/safety/monitors.d.ts.map +1 -1
  68. package/dist/doc-schemas/safety/monitors.js +5 -3
  69. package/dist/doc-schemas/safety/monitors.js.map +1 -1
  70. package/dist/doc-schemas/safety/provenance.js +3 -3
  71. package/dist/doc-schemas/safety/provenance.js.map +1 -1
  72. package/dist/doc-schemas/safety/report.d.ts.map +1 -1
  73. package/dist/doc-schemas/safety/report.js +4 -3
  74. package/dist/doc-schemas/safety/report.js.map +1 -1
  75. package/dist/doc-schemas/safety/sagas.js +3 -3
  76. package/dist/doc-schemas/safety/sagas.js.map +1 -1
  77. package/dist/doc-schemas/social.d.ts +130 -0
  78. package/dist/doc-schemas/social.d.ts.map +1 -1
  79. package/dist/doc-schemas/social.js +91 -2
  80. package/dist/doc-schemas/social.js.map +1 -1
  81. package/dist/doc-schemas/square-announcement-jobs.d.ts +306 -14
  82. package/dist/doc-schemas/square-announcement-jobs.d.ts.map +1 -1
  83. package/dist/doc-schemas/square-announcement-jobs.js +15 -2
  84. package/dist/doc-schemas/square-announcement-jobs.js.map +1 -1
  85. package/dist/doc-schemas/user.js +3 -3
  86. package/dist/doc-schemas/user.js.map +1 -1
  87. package/dist/doc-schemas/work-project.js +2 -2
  88. package/dist/doc-schemas/work-project.js.map +1 -1
  89. package/dist/ids/chat-ids.d.ts +3 -2
  90. package/dist/ids/chat-ids.d.ts.map +1 -1
  91. package/dist/ids/chat-ids.js +3 -2
  92. package/dist/ids/chat-ids.js.map +1 -1
  93. package/dist/media/domain-events-admin.d.ts +0 -7
  94. package/dist/media/domain-events-admin.d.ts.map +1 -1
  95. package/dist/media/domain-events-admin.js +0 -11
  96. package/dist/media/domain-events-admin.js.map +1 -1
  97. package/dist/media/domain-events.d.ts +0 -6
  98. package/dist/media/domain-events.d.ts.map +1 -1
  99. package/dist/media/domain-events.js +1 -2
  100. package/dist/media/domain-events.js.map +1 -1
  101. package/dist/media/hall-library-target-fields.js +1 -1
  102. package/dist/media/hall-library-target-fields.js.map +1 -1
  103. package/dist/media/pending-media.d.ts +0 -54
  104. package/dist/media/pending-media.d.ts.map +1 -1
  105. package/dist/media/photodna-coverage.d.ts.map +1 -1
  106. package/dist/media/photodna-coverage.js +5 -3
  107. package/dist/media/photodna-coverage.js.map +1 -1
  108. package/dist/paths/related-ids.js +1 -1
  109. package/dist/paths/related-ids.js.map +1 -1
  110. package/dist/safety/ncii-intake-derivations.d.ts.map +1 -1
  111. package/dist/safety/ncii-intake-derivations.js +4 -2
  112. package/dist/safety/ncii-intake-derivations.js.map +1 -1
  113. package/dist/safety/resource-keys.d.ts +8 -0
  114. package/dist/safety/resource-keys.d.ts.map +1 -1
  115. package/dist/safety/resource-keys.js +12 -1
  116. package/dist/safety/resource-keys.js.map +1 -1
  117. package/dist/schemas/chat.js +3 -3
  118. package/dist/schemas/chat.js.map +1 -1
  119. package/dist/schemas/ncii.js +1 -1
  120. package/dist/schemas/ncii.js.map +1 -1
  121. package/dist/schemas/notification.d.ts +8 -8
  122. package/dist/schemas/notification.d.ts.map +1 -1
  123. package/dist/schemas/notification.js +17 -11
  124. package/dist/schemas/notification.js.map +1 -1
  125. package/dist/types/social.d.ts +1 -45
  126. package/dist/types/social.d.ts.map +1 -1
  127. package/dist/types/social.js.map +1 -1
  128. package/package.json +3 -3
@@ -16,9 +16,10 @@
16
16
  // intake `idempotencyKey` (like `nciiAuthorityEvidence/`), so no `statusProjection`
17
17
  // collection-group lookup remains.
18
18
  //
19
- // Every shape here is transcribed verbatim from docs/code_changes_needed/
20
- // trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A11 (2) + [C-02] + [F7] +
21
- // [F10] — no invented values, no placeholders.
19
+ // Every shape here is transcribed verbatim from the frozen Trust & Safety spec
20
+ // (Appendix A §A11 (2) + [C-02] + [F7] + [F10]) — no invented values, no
21
+ // placeholders; the durable design owner is ttt-prod
22
+ // docs/design/nonconsensual-intimate-imagery-and-take-it-down.md.
22
23
  //
23
24
  // SHARED enums + locator types come from ../safety/foundation.js (the single
24
25
  // source for every cross-cluster enum); they are NEVER redefined here. This
@@ -1 +1 @@
1
- {"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../src/doc-schemas/ncii/requests.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,gFAAgF;AAChF,+EAA+E;AAC/E,oBAAoB;AACpB,EAAE;AACF,kFAAkF;AAClF,0EAA0E;AAC1E,6EAA6E;AAC7E,mFAAmF;AACnF,+BAA+B;AAC/B,EAAE;AACF,oFAAoF;AACpF,uFAAuF;AACvF,oFAAoF;AACpF,wFAAwF;AACxF,oFAAoF;AACpF,mCAAmC;AACnC,EAAE;AACF,0EAA0E;AAC1E,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,+EAA+E;AAC/E,sEAAsE;AACtE,mEAAmE;AACnE,oFAAoF;AACpF,iEAAiE;AACjE,EAAE;AACF,mFAAmF;AACnF,8EAA8E;AAC9E,mFAAmF;AACnF,qFAAqF;AACrF,sFAAsF;AACtF,gBAAgB;AAEhB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,4BAA4B,EAC5B,kCAAkC,EAClC,8BAA8B,EAC9B,iCAAiC,EACjC,4BAA4B,EAC5B,kCAAkC,EAClC,oBAAoB,EACpB,sBAAsB,EACtB,yBAAyB,EACzB,8BAA8B,GAG/B,MAAM,yBAAyB,CAAC;AAEjC,8EAA8E;AAC9E,gFAAgF;AAChF,4EAA4E;AAC5E,oEAAoE;AACpE,6EAA6E;AAC7E,8EAA8E;AAE9E,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,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,KAAK,CAAC,eAAe,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACnE,IAAI,KAAK,CAAC,sBAAsB,KAAK,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IAChF,IAAI,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACjE,8FAA8F;IAC9F,IAAI,KAAK,CAAC,sBAAsB,KAAK,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IAChF,uFAAuF;IACvF,iEAAiE;IACjE,IAAI,QAAQ,CAAC,KAAK,CAAC,oBAAoB,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC1E,OAAO,KAAK,CAAC;AACf,CAAC;AASD;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAsB;IACvD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC3C,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,mBAAmB,CAAC;QACxD,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,kBAAkB,EAAE,QAAQ;KAC7B,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC;AACrE,CAAC","sourcesContent":["// Trust & Safety — NCII statutory TAKE IT DOWN requests (Appendix A §A11, concept\n// (2)) — the SPLIT model: a PII-free root + a restricted requester-PII subdoc +\n// immutable submissions/validityDecisions + operator actions + isolated public\n// evidence uploads.\n//\n// Only a COMPLETE + VALID request can arm the 48h clock. The public no-login form\n// CANNOT submit a \"valid request\" without the required fields; validation\n// failures use the enumerated TakeItDownInvalidReasonCode. The root holds NO\n// requester PII / narrative / signature / authority — those live in the restricted\n// `/private/requester` subdoc.\n//\n// The public post-submission tracking tail (status page / status route / supplement\n// route / status token / public status projection) was removed (DJ 2026-07-02, feature\n// never wanted): the public flow is submit-only, so the status-token fields and the\n// `TakeItDownPublicStatusV1` projection no longer exist. Evidence folders re-key on the\n// intake `idempotencyKey` (like `nciiAuthorityEvidence/`), so no `statusProjection`\n// collection-group lookup remains.\n//\n// Every shape here is transcribed verbatim from docs/code_changes_needed/\n// trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A11 (2) + [C-02] + [F7] +\n// [F10] — no invented values, no placeholders.\n//\n// SHARED enums + locator types come from ../safety/foundation.js (the single\n// source for every cross-cluster enum); they are NEVER redefined here. This\n// cluster IMPORTS TakeItDownRequesterRoleSchema, TargetLocatorSummaryV1Schema,\n// TakeItDownCompletenessStatusSchema, TakeItDownValidityStatusSchema,\n// TakeItDownInvalidReasonCodeSchema, TakeItDownPublicStatusSchema,\n// NciiRemovalCompletionOutcomeSchema, NciiActionTypeSchema, NciiActionResultSchema,\n// TakeItDownFieldCodeSchema, and SafetyReviewerCapabilitySchema.\n//\n// Collection note: this cluster introduces a NEW Firestore collection plus several\n// subcollections (private/requester, submissions, validityDecisions, actions,\n// evidence). Wiring collections.ts / path-builders.ts / registry.ts is deferred to\n// the app leg (the orchestrator binds the schemas + path builders there); the doc-id\n// shapes (including the deterministic intake requestId [H-07]) are documented on each\n// schema below.\n\nimport { z } from 'zod';\nimport { MAX_NCII_ACTION_SUMMARY_LENGTH } from '../../constants/business.js';\nimport {\n TakeItDownRequesterRoleSchema,\n TargetLocatorV1Schema,\n TargetLocatorSummaryV1Schema,\n TakeItDownCompletenessStatusSchema,\n TakeItDownValidityStatusSchema,\n TakeItDownInvalidReasonCodeSchema,\n TakeItDownPublicStatusSchema,\n NciiRemovalCompletionOutcomeSchema,\n NciiActionTypeSchema,\n NciiActionResultSchema,\n TakeItDownFieldCodeSchema,\n SafetyReviewerCapabilitySchema,\n type TakeItDownFieldCode,\n type TakeItDownRequesterRole,\n} from '../safety/foundation.js';\n\n// ===========================================================================\n// §A11 (2) [H1] — ROOT takeItDownRequests/{requestId} = TakeItDownRequestRootV1\n// (NO requester PII / narrative / signature / authority). [H-07] the intake\n// `requestId` is the deterministic sha256('takeItDownRequest:v1:' +\n// idempotencyKey + ':' + normalizedTargetKey) so retries resolve to one doc.\n// ===========================================================================\n\nexport const TakeItDownRequestRootV1Schema = z.object({\n schemaVersion: z.literal(1),\n requestId: z.string().min(1),\n caseId: z.string().min(1).optional(),\n requesterRole: TakeItDownRequesterRoleSchema,\n // privacy-safe summary ONLY — never the narrative\n targetLocatorSummary: TargetLocatorSummaryV1Schema,\n receivedAt: z.number(),\n completenessStatus: TakeItDownCompletenessStatusSchema, // 'incomplete' | 'complete'\n validityStatus: TakeItDownValidityStatusSchema, // 'pending' | 'valid' | 'invalid' | 'unableToLocate'\n invalidReasonCode: TakeItDownInvalidReasonCodeSchema.optional(),\n completenessDeterminedAt: z.number().optional(),\n validityDeterminedAt: z.number().optional(),\n completedBySubmissionId: z.string().min(1).optional(), // which immutable submission completed the request\n validRequestReceivedAt: z.number().optional(), // [F3] EARLIEST complete+valid receipt — pins the clock\n removalDeadlineAt: z.number().optional(), // = validRequestReceivedAt + 48h (non-authoritative projection; [H4])\n publicStatus: TakeItDownPublicStatusSchema,\n requestClosedAt: z.number().optional(), // when the request reached a terminal disposition\n removalCompletionAt: z.number().optional(), // [M-01] set when removal verified-completes\n finalClosedAt: z.number().optional(), // [H-08] = requestClosedAt (no appeal window); arms for EVERY terminal disposition. The request's retention clocks (PII / evidence / status-token) count from here.\n removalCompletionOutcome: NciiRemovalCompletionOutcomeSchema.optional(), // [H4] honest derived completion — NEVER 'completed' for a partial technical failure\n createdAt: z.number(),\n updatedAt: z.number(),\n}).strict();\nexport type TakeItDownRequestRootV1 = z.infer<typeof TakeItDownRequestRootV1Schema>;\n\n// ===========================================================================\n// §A11 (2) [H1] / [F7] — RESTRICTED takeItDownRequests/{requestId}/private/requester\n// = TakeItDownRequesterPrivateV1 (nciiRequestReviewer / nciiEvidenceReviewer only).\n// Holds signature, full contact, narrative, certifications.\n// ===========================================================================\n\n/** electronicSignature.signatureMethod — typed vs drawn signature. */\nexport const TakeItDownSignatureMethodSchema = z.enum(['typedName', 'drawnSignature']);\nexport type TakeItDownSignatureMethod = z.infer<typeof TakeItDownSignatureMethodSchema>;\n\n/** The statutory electronic signature block (embedded on the restricted subdoc). */\nexport const TakeItDownElectronicSignatureV1Schema = z.object({\n signedName: z.string(),\n signedAt: z.number(),\n signatureMethod: TakeItDownSignatureMethodSchema,\n}).strict();\nexport type TakeItDownElectronicSignatureV1 = z.infer<typeof TakeItDownElectronicSignatureV1Schema>;\n\n/** [H-02] Server-owned scan status for the optional authority-proof photo.\n * Written by `onNciiEvidenceUploaded` when the authority-evidence prefix is\n * matched. `pending` until the scan resolves; `clean` = safe for operator\n * review; `matched` = PhotoDNA hit (converges to child-safety path); `rejected`\n * = spoof/magic-byte rejection; `unavailable` = scan could not produce a\n * verdict (fail-closed until resolved). Absence of the photo leaves the status\n * absent — operators must not be shown/allowed to act on proof until `clean`. */\nexport const AuthorityProofScanStatusSchema = z.enum([\n 'pending',\n 'clean',\n 'matched',\n 'rejected',\n 'unavailable',\n]);\nexport type AuthorityProofScanStatus = z.infer<typeof AuthorityProofScanStatusSchema>;\n\n/** [H-02] Server-owned authority-proof scan state. Embedded on the authorized-\n * representative block; written by the `onNciiEvidenceUploaded` trigger (never\n * by the client). Present only when an authority-proof photo was uploaded. */\nexport const AuthorityProofScanStateV1Schema = z.object({\n scanStatus: AuthorityProofScanStatusSchema,\n objectGeneration: z.string().min(1),\n objectHash: z.string().min(1),\n scannedAt: z.number().optional(),\n}).strict();\nexport type AuthorityProofScanStateV1 = z.infer<typeof AuthorityProofScanStateV1Schema>;\n\n/** The authorized-representative block — present only for an\n * `authorizedRepresentative` requester.\n * [H-03] `authorityCertification` is a required good-faith attestation of\n * authority; `authorityEvidenceRef` + `authorityProofScan` are OPTIONAL\n * (presence is supporting material; absence never blocks completeness or the\n * 48h clock). */\nexport const TakeItDownAuthorizedRepresentativeV1Schema = z.object({\n representedPersonName: z.string(),\n authorityBasis: z.string(),\n authorityCertification: z.boolean(),\n authorityEvidenceRef: z.string().min(1).optional(),\n authorityProofScan: AuthorityProofScanStateV1Schema.optional(),\n}).strict();\nexport type TakeItDownAuthorizedRepresentativeV1 = z.infer<typeof TakeItDownAuthorizedRepresentativeV1Schema>;\n\n/** `takeItDownRequests/{requestId}/private/requester` = TakeItDownRequesterPrivateV1.\n * RESTRICTED — nciiRequestReviewer / nciiEvidenceReviewer only. Fixed doc id\n * `requester`. */\nexport const TakeItDownRequesterPrivateV1Schema = z.object({\n schemaVersion: z.literal(1),\n requesterName: z.string(),\n contactEmail: z.string(),\n contactPhone: z.string().optional(),\n electronicSignature: TakeItDownElectronicSignatureV1Schema,\n authorizedRepresentative: TakeItDownAuthorizedRepresentativeV1Schema.optional(),\n nonconsentStatement: z.string(), // the statutory non-consent statement\n supportingFacts: z.string(),\n goodFaithCertification: z.boolean(),\n accuracyCertification: z.boolean().optional(), // NOT a hard validity gate by default — counsel decides\n // The EXACT validated locator the requester submitted (restricted; operator-only — never on the\n // PII-free root, which keeps only TargetLocatorSummaryV1). For the public no-login url-only intake\n // this is the raw `{ kind:'url', url }` so the operator can FIND the on-platform content and\n // mark + link it as NCII evidence (the public intake never auto-resolves a TTT target — C-03\n // anti-abuse). Optional so a not-yet-backfilled request still validates; intake always writes it.\n targetLocator: TargetLocatorV1Schema.optional(),\n createdAt: z.number(),\n updatedAt: z.number(),\n}).strict();\nexport type TakeItDownRequesterPrivateV1 = z.infer<typeof TakeItDownRequesterPrivateV1Schema>;\n\n// ===========================================================================\n// §A11 (2) [H1] — IMMUTABLE takeItDownRequests/{requestId}/submissions/{submissionId}\n// = TakeItDownSubmissionV1 (append-only; the earliest complete receipt is\n// reconstructed from these, never from the mutable root).\n// ===========================================================================\n\n/** Who created a submission. */\nexport const TakeItDownSubmissionCreatedBySchema = z.enum(['requester', 'operator', 'system']);\nexport type TakeItDownSubmissionCreatedBy = z.infer<typeof TakeItDownSubmissionCreatedBySchema>;\n\n/** `takeItDownRequests/{requestId}/submissions/{submissionId}` = TakeItDownSubmissionV1\n * — IMMUTABLE append-only. Doc id `submissionId` is a deterministic/assigned id. */\nexport const TakeItDownSubmissionV1Schema = z.object({\n schemaVersion: z.literal(1),\n submissionId: z.string().min(1),\n sequence: z.number(), // monotonic per request — append order\n receivedAt: z.number(), // the immutable statutory receipt time of THIS submission\n suppliedFieldCodes: z.array(TakeItDownFieldCodeSchema).max(16),\n evidenceIds: z.array(z.string().min(1)).max(16),\n cumulativeRequestSnapshotHash: z.string(), // hash of the cumulative request state as of this submission\n cumulativeCompleteness: TakeItDownCompletenessStatusSchema, // 'incomplete' | 'complete'\n firstCompletedRequest: z.boolean(), // true on the submission whose cumulative state FIRST became complete\n supersedesSubmissionId: z.string().min(1).optional(),\n createdBy: TakeItDownSubmissionCreatedBySchema,\n}).strict();\nexport type TakeItDownSubmissionV1 = z.infer<typeof TakeItDownSubmissionV1Schema>;\n\n// ===========================================================================\n// §A11 (2) [H2] — IMMUTABLE takeItDownRequests/{requestId}/validityDecisions/{decisionId}\n// = TakeItDownValidityDecisionV1 (append-only; the authoritative validity ruling —\n// the root `validityStatus` is its projection). `incomplete` is NEVER a validity\n// result.\n// ===========================================================================\n\n/** The validity-decision result. `incomplete` is a COMPLETENESS state, NEVER a\n * validity result. */\nexport const TakeItDownValidityDecisionResultSchema = z.enum(['valid', 'invalid', 'unableToLocate']);\nexport type TakeItDownValidityDecisionResult = z.infer<typeof TakeItDownValidityDecisionResultSchema>;\n\n/** `takeItDownRequests/{requestId}/validityDecisions/{decisionId}` =\n * TakeItDownValidityDecisionV1 — IMMUTABLE append-only. Doc id `decisionId` is a\n * deterministic/assigned id. */\nexport const TakeItDownValidityDecisionV1Schema = z.object({\n schemaVersion: z.literal(1),\n decisionId: z.string().min(1),\n requestId: z.string().min(1),\n result: TakeItDownValidityDecisionResultSchema,\n basisSubmissionIds: z.array(z.string().min(1)).max(16), // the submissions the decision relied on\n validFromSubmissionId: z.string().min(1).optional(), // the EARLIEST submission whose cumulative snapshot satisfies the valid decision\n validRequestReceivedAt: z.number().optional(), // = that submission's immutable receivedAt (the binding statutory time)\n reasonCode: TakeItDownInvalidReasonCodeSchema.optional(),\n rationaleRef: z.string(), // pointer to a restricted rationale row\n decidedByUid: z.string().min(1),\n decidedAt: z.number(),\n}).strict();\nexport type TakeItDownValidityDecisionV1 = z.infer<typeof TakeItDownValidityDecisionV1Schema>;\n\n// ===========================================================================\n// §A11 (2) [L1] — takeItDownRequests/{requestId}/actions/{actionId} = the request\n// action row (CLOSED enums + a detailRef to a RESTRICTED row, never an inline\n// rationale blob).\n// ===========================================================================\n\n/** `takeItDownRequests/{requestId}/actions/{actionId}` — the [L1] closed-enum +\n * detailRef row. Doc id `actionId` is a deterministic/assigned id. */\nexport const TakeItDownRequestActionV1Schema = z.object({\n schemaVersion: z.literal(1),\n actionId: z.string().min(1),\n at: z.number(),\n actorId: z.string().min(1),\n capability: SafetyReviewerCapabilitySchema, // = the §[M4] matrix capability used\n actionType: NciiActionTypeSchema,\n result: NciiActionResultSchema,\n summary: z.string().max(MAX_NCII_ACTION_SUMMARY_LENGTH), // BOUNDED, non-sensitive\n detailRef: z.string().min(1), // pointer to a RESTRICTED detail row holding any sensitive rationale\n}).strict();\nexport type TakeItDownRequestActionV1 = z.infer<typeof TakeItDownRequestActionV1Schema>;\n\n// ===========================================================================\n// §A11 (2) [F10] — takeItDownRequests/{requestId}/evidence/{evidenceId} = the\n// public-evidence-upload record (account-less + in-app evidence lands in an\n// ISOLATED admin-only Firebase Storage bucket, never R2, never served, no durable\n// URL). Evidence reuses the `ncii-evidence` fileOrigin spec and the ONE shared\n// PhotoDNA scan (image → PhotoDNA; video → frame-extraction → PhotoDNA per frame),\n// byte-exact / no transcode (`preserveOriginal`). It does NOT use the auth-gated\n// `startUpload` path — a not-logged-in victim can't call it — so the browser writes\n// the file DIRECTLY to the isolated bucket (App-Check + create-only + image/video +\n// size-cap storage rules; path keyed by the opaque `requestReference`) and a Storage\n// onFinalize trigger runs that same scan. This record exists ONLY after a CLEAN\n// scan; a validated match opens a child-safety case and the bytes are held there\n// instead (no evidence record, never shown).\n// ===========================================================================\n\n/** `takeItDownRequests/{requestId}/evidence/{evidenceId}` — the [F10] public\n * evidence-upload record. Doc id `evidenceId` is a deterministic/assigned id.\n * INVARIANT: this record NEVER sets `originatingUploaderUid` — enforcement / NCMEC\n * attribution targets the ORIGINAL content's originatingUploaderUid (perpetrator)\n * via MediaOriginLineageV1 (a correlation, not a merge). */\nexport const TakeItDownEvidenceV1Schema = z.object({\n schemaVersion: z.literal(1),\n evidenceId: z.string().min(1),\n requestId: z.string().min(1),\n uploadContext: z.literal('takeItDownEvidence'), // LITERAL tag — never an ordinary content origin\n submitterUid: z.string().min(1).optional(), // the submitter is NEVER auto-actioned for evidence they submit\n bucket: z.string().min(1),\n key: z.string().min(1),\n generation: z.string().min(1),\n contentType: z.string().min(1),\n sizeBytes: z.number(),\n sha256: z.string().min(1),\n md5: z.string().min(1),\n capturedAt: z.number(),\n createdAt: z.number(),\n}).strict();\nexport type TakeItDownEvidenceV1 = z.infer<typeof TakeItDownEvidenceV1Schema>;\n\n// ===========================================================================\n// [H-01] nciiRetainedEvidenceInventory/{inventoryId} = NciiRetainedEvidenceInventoryV1\n// — a durable, OPERATOR-VISIBLE inventory row for an NCII-evidence object that the\n// onNciiEvidenceUploaded scan RETAINED but did NOT record as evidence (orphan /\n// oversized / spoof / malformed / archive-polyglot). The bytes are preserved (NO\n// auto-delete EVER — disposal stays verified-LE-only); this row makes the retained\n// object visible + accountable in the admin console instead of living only in a log\n// line. METADATA only — never bytes, never a served URL.\n// ===========================================================================\n\n/** Why an evidence object was retained without an evidence record. */\nexport const NciiRetainedEvidenceReasonSchema = z.enum([\n 'orphan', // requestReference matched no real request\n 'fileTooLarge', // over maxEvidenceFileBytes\n 'imageTooLarge', // over the decode pixel / dimension budget\n 'archiveOrPolyglot', // archive/polyglot signature\n 'malformedPath', // not a 3-segment nciiEvidence/{ref}/{file} key\n 'scanRejected', // PhotoDNA scan rejected it as a spoof (magic bytes / kind)\n 'capOverflow', // past the per-request count or total-bytes cap — retained but not recorded as evidence\n]);\nexport type NciiRetainedEvidenceReason = z.infer<typeof NciiRetainedEvidenceReasonSchema>;\n\n/** `nciiRetainedEvidenceInventory/{inventoryId}` — the [H-01] retained-object row.\n * Doc id is deterministic on bucket+key+generation (idempotent re-fire). */\nexport const NciiRetainedEvidenceInventoryV1Schema = z.object({\n schemaVersion: z.literal(1),\n inventoryId: z.string().min(1),\n reason: NciiRetainedEvidenceReasonSchema,\n bucket: z.string().min(1),\n key: z.string().min(1),\n generation: z.string().min(1),\n /** The path segment (an orphan reference matches no request). */\n requestReference: z.string().min(1).optional(),\n contentType: z.string().min(1).optional(),\n sizeBytes: z.number().optional(),\n detectedAt: z.number(),\n createdAt: z.number(),\n}).strict();\nexport type NciiRetainedEvidenceInventoryV1 = z.infer<typeof NciiRetainedEvidenceInventoryV1Schema>;\n\n// ===========================================================================\n// §A11 [C-02] — conditional completeness predicate (`computeCompleteness`).\n// requiredFieldCodes(requesterRole) + a contact one-of. These are EMBEDDED /\n// NON-DOC shapes (not Firestore documents): the counsel-ratified required set + a\n// documented predicate. Completeness is NOT \"every TakeItDownFieldCode arrived\".\n// ===========================================================================\n\n/** [C-02] Required field codes for a `depictedPerson` request (counsel-ratified). */\nexport const REQUIRED_FIELD_CODES_DEPICTED_PERSON = [\n 'requesterName',\n 'requesterRole',\n 'electronicSignature',\n 'targetLocator',\n 'nonconsentStatement',\n 'goodFaithCertification',\n] as const satisfies readonly TakeItDownFieldCode[];\n\n/** [C-02 / H-03] Required field codes for an `authorizedRepresentative` request =\n * depicted-person set ∪ { authorityBasis, authorityCertification }.\n * `authorityEvidence` (the optional documentary photo) is NOT required;\n * absence or pending scan never blocks completeness or the 48h clock. */\nexport const REQUIRED_FIELD_CODES_AUTHORIZED_REPRESENTATIVE = [\n ...REQUIRED_FIELD_CODES_DEPICTED_PERSON,\n 'authorityBasis',\n 'authorityCertification',\n] as const satisfies readonly TakeItDownFieldCode[];\n\n/** [C-02] The contact one-of: at least ONE of these must be present (neither is\n * individually required; either alone satisfies it). */\nexport const CONTACT_ONE_OF_FIELD_CODES = [\n 'contactEmail',\n 'contactPhone',\n] as const satisfies readonly TakeItDownFieldCode[];\n\n/** [C-02 / H-03] `requiredFieldCodes(requesterRole)` — the required set.\n * `supportingFacts` is collected but is NOT a completeness gate; `contactEmail` /\n * `contactPhone` are governed by the contact one-of (see CONTACT_ONE_OF_FIELD_CODES),\n * never individually required. `authorityEvidence` (the optional documentary photo)\n * is NOT required; absence or a pending/unavailable scan never blocks completeness\n * or the 48h clock. The implementer uses EXACTLY this set and never hard-requires\n * `contactPhone` or the authorizedRepresentative block on a depicted-person request. */\nexport function requiredFieldCodes(\n requesterRole: TakeItDownRequesterRole,\n): readonly TakeItDownFieldCode[] {\n return requesterRole === 'authorizedRepresentative'\n ? REQUIRED_FIELD_CODES_AUTHORIZED_REPRESENTATIVE\n : REQUIRED_FIELD_CODES_DEPICTED_PERSON;\n}\n\n/** [C-02 / H-02 / H-03] `computeCompleteness` — returns `complete` iff every code in\n * `requiredFieldCodes(requesterRole)` is supplied AND the contact one-of holds;\n * otherwise `incomplete` with the missing codes surfaced (those become\n * `TakeItDownPublicStatusV1.missingFieldCodes`). The missing-set lists the role's\n * unmet required codes, plus a `contactEmail`/`contactPhone` representative for an\n * unmet contact one-of (the implementer/UI decides which contact code to surface;\n * here we surface `contactEmail` as the canonical missing-contact marker).\n * [H-02] The optional authority-proof photo's presence, absence, or pending scan\n * (`authorityProofScan.scanStatus`) is NEVER a gate — completeness is purely the\n * written statutory elements + the authority certification. */\nexport function computeCompleteness(input: {\n requesterRole: TakeItDownRequesterRole;\n suppliedFieldCodes: readonly TakeItDownFieldCode[];\n}): { status: 'incomplete' | 'complete'; missingFieldCodes: TakeItDownFieldCode[] } {\n const supplied = new Set(input.suppliedFieldCodes);\n const missingFieldCodes: TakeItDownFieldCode[] = [];\n\n for (const code of requiredFieldCodes(input.requesterRole)) {\n if (!supplied.has(code)) missingFieldCodes.push(code);\n }\n\n const contactSatisfied = CONTACT_ONE_OF_FIELD_CODES.some((code) => supplied.has(code));\n if (!contactSatisfied) missingFieldCodes.push('contactEmail');\n\n return {\n status: missingFieldCodes.length === 0 ? 'complete' : 'incomplete',\n missingFieldCodes,\n };\n}\n\n// ===========================================================================\n// §A11 [C-02 / H-03] — intake field-code derivation + completeness (SINGLE-SOURCED).\n// `NciiIntakeFacts`, `suppliedFieldCodes`, and `deriveCompleteness` are pure and sit\n// beside `computeCompleteness` so BOTH the public route graph (src/) and the functions\n// graph (functions/src/) import the ONE implementation — the two \"byte-identical\"\n// intakeShared mirrors that had already drifted ([H-03] authorityCertification existed\n// on only one side) are eliminated. These are EMBEDDED / NON-DOC shapes (not Firestore\n// documents).\n// ===========================================================================\n\n/** The decoded intake payload the field-code extractor inspects. The route/callable\n * maps the raw body onto this AFTER zod-validating it. */\nexport interface NciiIntakeFacts {\n readonly requesterRole: TakeItDownRequesterRole;\n readonly requesterName?: string;\n readonly contactEmail?: string;\n readonly contactPhone?: string;\n readonly electronicSignature?: { signedName: string; signatureMethod: string };\n readonly nonconsentStatement?: string;\n readonly supportingFacts?: string;\n readonly goodFaithCertification?: boolean;\n readonly authorityBasis?: string;\n /** [H-03] The required good-faith authority certification. Arms completeness alongside\n * authorityBasis; the optional documentary photo never gates completeness. */\n readonly authorityCertification?: boolean;\n /** [H-03] Optional documentary authority-proof photo ref. Present/absent never blocks\n * completeness or the 48h clock; it is supporting material only. */\n readonly authorityEvidenceRef?: string;\n /** Present only for a resolvable/recorded locator (TTT-hosted or external). */\n readonly hasLocator: boolean;\n}\n\nfunction nonEmpty(s: string | undefined): boolean {\n return typeof s === 'string' && s.trim().length > 0;\n}\n\n/**\n * Derive the set of supplied `TakeItDownFieldCode`s from the decoded facts. This is\n * the bridge between the raw form fields and the enumerated codes the\n * `computeCompleteness` predicate consumes — completeness is NEVER \"every field code\n * arrived\", it is exactly the counsel-ratified required set (handled by\n * `computeCompleteness`) over THIS supplied set.\n */\nexport function suppliedFieldCodes(facts: NciiIntakeFacts): TakeItDownFieldCode[] {\n const codes: TakeItDownFieldCode[] = [];\n if (nonEmpty(facts.requesterName)) codes.push('requesterName');\n if (nonEmpty(facts.contactEmail)) codes.push('contactEmail');\n if (nonEmpty(facts.contactPhone)) codes.push('contactPhone');\n // requesterRole is always present (it is required to even shape the request).\n codes.push('requesterRole');\n if (facts.electronicSignature && nonEmpty(facts.electronicSignature.signedName)) {\n codes.push('electronicSignature');\n }\n if (facts.hasLocator) codes.push('targetLocator');\n if (nonEmpty(facts.nonconsentStatement)) codes.push('nonconsentStatement');\n if (nonEmpty(facts.supportingFacts)) codes.push('supportingFacts');\n if (facts.goodFaithCertification === true) codes.push('goodFaithCertification');\n if (nonEmpty(facts.authorityBasis)) codes.push('authorityBasis');\n // [H-03] authorityCertification is the required authority attestation that arms completeness.\n if (facts.authorityCertification === true) codes.push('authorityCertification');\n // [H-03] authorityEvidence (documentary photo) is OPTIONAL — recorded when present but\n // never a completeness gate; absence never blocks the 48h clock.\n if (nonEmpty(facts.authorityEvidenceRef)) codes.push('authorityEvidence');\n return codes;\n}\n\n/** The full completeness determination: status + the supplied set + the missing set. */\nexport interface NciiCompletenessOutcome {\n readonly status: 'incomplete' | 'complete';\n readonly suppliedFieldCodes: TakeItDownFieldCode[];\n readonly missingFieldCodes: TakeItDownFieldCode[];\n}\n\n/**\n * Compute completeness from the decoded facts using the shared `computeCompleteness`\n * predicate ([C-02]). One call so every intake (public route + logged-in callable +\n * any functions-graph recompute) uses an identical determination.\n */\nexport function deriveCompleteness(facts: NciiIntakeFacts): NciiCompletenessOutcome {\n const supplied = suppliedFieldCodes(facts);\n const { status, missingFieldCodes } = computeCompleteness({\n requesterRole: facts.requesterRole,\n suppliedFieldCodes: supplied,\n });\n return { status, suppliedFieldCodes: supplied, missingFieldCodes };\n}\n"]}
1
+ {"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../src/doc-schemas/ncii/requests.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,gFAAgF;AAChF,+EAA+E;AAC/E,oBAAoB;AACpB,EAAE;AACF,kFAAkF;AAClF,0EAA0E;AAC1E,6EAA6E;AAC7E,mFAAmF;AACnF,+BAA+B;AAC/B,EAAE;AACF,oFAAoF;AACpF,uFAAuF;AACvF,oFAAoF;AACpF,wFAAwF;AACxF,oFAAoF;AACpF,mCAAmC;AACnC,EAAE;AACF,+EAA+E;AAC/E,yEAAyE;AACzE,qDAAqD;AACrD,kEAAkE;AAClE,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,+EAA+E;AAC/E,sEAAsE;AACtE,mEAAmE;AACnE,oFAAoF;AACpF,iEAAiE;AACjE,EAAE;AACF,mFAAmF;AACnF,8EAA8E;AAC9E,mFAAmF;AACnF,qFAAqF;AACrF,sFAAsF;AACtF,gBAAgB;AAEhB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,4BAA4B,EAC5B,kCAAkC,EAClC,8BAA8B,EAC9B,iCAAiC,EACjC,4BAA4B,EAC5B,kCAAkC,EAClC,oBAAoB,EACpB,sBAAsB,EACtB,yBAAyB,EACzB,8BAA8B,GAG/B,MAAM,yBAAyB,CAAC;AAEjC,8EAA8E;AAC9E,gFAAgF;AAChF,4EAA4E;AAC5E,oEAAoE;AACpE,6EAA6E;AAC7E,8EAA8E;AAE9E,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC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C,eAAe,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACnE,IAAI,KAAK,CAAC,sBAAsB,KAAK,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IAChF,IAAI,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACjE,8FAA8F;IAC9F,IAAI,KAAK,CAAC,sBAAsB,KAAK,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IAChF,uFAAuF;IACvF,iEAAiE;IACjE,IAAI,QAAQ,CAAC,KAAK,CAAC,oBAAoB,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC1E,OAAO,KAAK,CAAC;AACf,CAAC;AASD;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAsB;IACvD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC3C,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,mBAAmB,CAAC;QACxD,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,kBAAkB,EAAE,QAAQ;KAC7B,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC;AACrE,CAAC","sourcesContent":["// Trust & Safety — NCII statutory TAKE IT DOWN requests (Appendix A §A11, concept\n// (2)) — the SPLIT model: a PII-free root + a restricted requester-PII subdoc +\n// immutable submissions/validityDecisions + operator actions + isolated public\n// evidence uploads.\n//\n// Only a COMPLETE + VALID request can arm the 48h clock. The public no-login form\n// CANNOT submit a \"valid request\" without the required fields; validation\n// failures use the enumerated TakeItDownInvalidReasonCode. The root holds NO\n// requester PII / narrative / signature / authority — those live in the restricted\n// `/private/requester` subdoc.\n//\n// The public post-submission tracking tail (status page / status route / supplement\n// route / status token / public status projection) was removed (DJ 2026-07-02, feature\n// never wanted): the public flow is submit-only, so the status-token fields and the\n// `TakeItDownPublicStatusV1` projection no longer exist. Evidence folders re-key on the\n// intake `idempotencyKey` (like `nciiAuthorityEvidence/`), so no `statusProjection`\n// collection-group lookup remains.\n//\n// Every shape here is transcribed verbatim from the frozen Trust & Safety spec\n// (Appendix A §A11 (2) + [C-02] + [F7] + [F10]) — no invented values, no\n// placeholders; the durable design owner is ttt-prod\n// docs/design/nonconsensual-intimate-imagery-and-take-it-down.md.\n//\n// SHARED enums + locator types come from ../safety/foundation.js (the single\n// source for every cross-cluster enum); they are NEVER redefined here. This\n// cluster IMPORTS TakeItDownRequesterRoleSchema, TargetLocatorSummaryV1Schema,\n// TakeItDownCompletenessStatusSchema, TakeItDownValidityStatusSchema,\n// TakeItDownInvalidReasonCodeSchema, TakeItDownPublicStatusSchema,\n// NciiRemovalCompletionOutcomeSchema, NciiActionTypeSchema, NciiActionResultSchema,\n// TakeItDownFieldCodeSchema, and SafetyReviewerCapabilitySchema.\n//\n// Collection note: this cluster introduces a NEW Firestore collection plus several\n// subcollections (private/requester, submissions, validityDecisions, actions,\n// evidence). Wiring collections.ts / path-builders.ts / registry.ts is deferred to\n// the app leg (the orchestrator binds the schemas + path builders there); the doc-id\n// shapes (including the deterministic intake requestId [H-07]) are documented on each\n// schema below.\n\nimport { z } from 'zod';\nimport { MAX_NCII_ACTION_SUMMARY_LENGTH } from '../../constants/business.js';\nimport {\n TakeItDownRequesterRoleSchema,\n TargetLocatorV1Schema,\n TargetLocatorSummaryV1Schema,\n TakeItDownCompletenessStatusSchema,\n TakeItDownValidityStatusSchema,\n TakeItDownInvalidReasonCodeSchema,\n TakeItDownPublicStatusSchema,\n NciiRemovalCompletionOutcomeSchema,\n NciiActionTypeSchema,\n NciiActionResultSchema,\n TakeItDownFieldCodeSchema,\n SafetyReviewerCapabilitySchema,\n type TakeItDownFieldCode,\n type TakeItDownRequesterRole,\n} from '../safety/foundation.js';\n\n// ===========================================================================\n// §A11 (2) [H1] — ROOT takeItDownRequests/{requestId} = TakeItDownRequestRootV1\n// (NO requester PII / narrative / signature / authority). [H-07] the intake\n// `requestId` is the deterministic sha256('takeItDownRequest:v1:' +\n// idempotencyKey + ':' + normalizedTargetKey) so retries resolve to one doc.\n// ===========================================================================\n\nexport const TakeItDownRequestRootV1Schema = z.object({\n schemaVersion: z.literal(1),\n requestId: z.string().min(1),\n caseId: z.string().min(1).optional(),\n requesterRole: TakeItDownRequesterRoleSchema,\n // privacy-safe summary ONLY — never the narrative\n targetLocatorSummary: TargetLocatorSummaryV1Schema,\n receivedAt: z.number(),\n completenessStatus: TakeItDownCompletenessStatusSchema, // 'incomplete' | 'complete'\n validityStatus: TakeItDownValidityStatusSchema, // 'pending' | 'valid' | 'invalid' | 'unableToLocate'\n invalidReasonCode: TakeItDownInvalidReasonCodeSchema.optional(),\n completenessDeterminedAt: z.number().optional(),\n validityDeterminedAt: z.number().optional(),\n completedBySubmissionId: z.string().min(1).optional(), // which immutable submission completed the request\n validRequestReceivedAt: z.number().optional(), // [F3] EARLIEST complete+valid receipt — pins the clock\n removalDeadlineAt: z.number().optional(), // = validRequestReceivedAt + 48h (non-authoritative projection; [H4])\n publicStatus: TakeItDownPublicStatusSchema,\n requestClosedAt: z.number().optional(), // when the request reached a terminal disposition\n removalCompletionAt: z.number().optional(), // [M-01] set when removal verified-completes\n finalClosedAt: z.number().optional(), // [H-08] = requestClosedAt (no appeal window); arms for EVERY terminal disposition. The request's retention clocks (PII / evidence / status-token) count from here.\n removalCompletionOutcome: NciiRemovalCompletionOutcomeSchema.optional(), // [H4] honest derived completion — NEVER 'completed' for a partial technical failure\n createdAt: z.number(),\n updatedAt: z.number(),\n}).strict();\nexport type TakeItDownRequestRootV1 = z.infer<typeof TakeItDownRequestRootV1Schema>;\n\n// ===========================================================================\n// §A11 (2) [H1] / [F7] — RESTRICTED takeItDownRequests/{requestId}/private/requester\n// = TakeItDownRequesterPrivateV1 (nciiRequestReviewer / nciiEvidenceReviewer only).\n// Holds signature, full contact, narrative, certifications.\n// ===========================================================================\n\n/** electronicSignature.signatureMethod — typed vs drawn signature. */\nexport const TakeItDownSignatureMethodSchema = z.enum(['typedName', 'drawnSignature']);\nexport type TakeItDownSignatureMethod = z.infer<typeof TakeItDownSignatureMethodSchema>;\n\n/** The statutory electronic signature block (embedded on the restricted subdoc). */\nexport const TakeItDownElectronicSignatureV1Schema = z.object({\n signedName: z.string(),\n signedAt: z.number(),\n signatureMethod: TakeItDownSignatureMethodSchema,\n}).strict();\nexport type TakeItDownElectronicSignatureV1 = z.infer<typeof TakeItDownElectronicSignatureV1Schema>;\n\n/** [H-02] Server-owned scan status for the optional authority-proof photo.\n * Written by `onNciiEvidenceUploaded` when the authority-evidence prefix is\n * matched. `pending` until the scan resolves; `clean` = safe for operator\n * review; `matched` = PhotoDNA hit (converges to child-safety path); `rejected`\n * = spoof/magic-byte rejection; `unavailable` = scan could not produce a\n * verdict (fail-closed until resolved). Absence of the photo leaves the status\n * absent — operators must not be shown/allowed to act on proof until `clean`. */\nexport const AuthorityProofScanStatusSchema = z.enum([\n 'pending',\n 'clean',\n 'matched',\n 'rejected',\n 'unavailable',\n]);\nexport type AuthorityProofScanStatus = z.infer<typeof AuthorityProofScanStatusSchema>;\n\n/** [H-02] Server-owned authority-proof scan state. Embedded on the authorized-\n * representative block; written by the `onNciiEvidenceUploaded` trigger (never\n * by the client). Present only when an authority-proof photo was uploaded. */\nexport const AuthorityProofScanStateV1Schema = z.object({\n scanStatus: AuthorityProofScanStatusSchema,\n objectGeneration: z.string().min(1),\n objectHash: z.string().min(1),\n scannedAt: z.number().optional(),\n}).strict();\nexport type AuthorityProofScanStateV1 = z.infer<typeof AuthorityProofScanStateV1Schema>;\n\n/** The authorized-representative block — present only for an\n * `authorizedRepresentative` requester.\n * [H-03] `authorityCertification` is a required good-faith attestation of\n * authority; `authorityEvidenceRef` + `authorityProofScan` are OPTIONAL\n * (presence is supporting material; absence never blocks completeness or the\n * 48h clock). */\nexport const TakeItDownAuthorizedRepresentativeV1Schema = z.object({\n representedPersonName: z.string(),\n authorityBasis: z.string(),\n authorityCertification: z.boolean(),\n authorityEvidenceRef: z.string().min(1).optional(),\n authorityProofScan: AuthorityProofScanStateV1Schema.optional(),\n}).strict();\nexport type TakeItDownAuthorizedRepresentativeV1 = z.infer<typeof TakeItDownAuthorizedRepresentativeV1Schema>;\n\n/** `takeItDownRequests/{requestId}/private/requester` = TakeItDownRequesterPrivateV1.\n * RESTRICTED — nciiRequestReviewer / nciiEvidenceReviewer only. Fixed doc id\n * `requester`. */\nexport const TakeItDownRequesterPrivateV1Schema = z.object({\n schemaVersion: z.literal(1),\n requesterName: z.string(),\n contactEmail: z.string(),\n contactPhone: z.string().optional(),\n electronicSignature: TakeItDownElectronicSignatureV1Schema,\n authorizedRepresentative: TakeItDownAuthorizedRepresentativeV1Schema.optional(),\n nonconsentStatement: z.string(), // the statutory non-consent statement\n supportingFacts: z.string(),\n goodFaithCertification: z.boolean(),\n accuracyCertification: z.boolean().optional(), // NOT a hard validity gate by default — counsel decides\n // The EXACT validated locator the requester submitted (restricted; operator-only — never on the\n // PII-free root, which keeps only TargetLocatorSummaryV1). For the public no-login url-only intake\n // this is the raw `{ kind:'url', url }` so the operator can FIND the on-platform content and\n // mark + link it as NCII evidence (the public intake never auto-resolves a TTT target — C-03\n // anti-abuse). Optional so a not-yet-backfilled request still validates; intake always writes it.\n targetLocator: TargetLocatorV1Schema.optional(),\n createdAt: z.number(),\n updatedAt: z.number(),\n}).strict();\nexport type TakeItDownRequesterPrivateV1 = z.infer<typeof TakeItDownRequesterPrivateV1Schema>;\n\n// ===========================================================================\n// §A11 (2) [H1] — IMMUTABLE takeItDownRequests/{requestId}/submissions/{submissionId}\n// = TakeItDownSubmissionV1 (append-only; the earliest complete receipt is\n// reconstructed from these, never from the mutable root).\n// ===========================================================================\n\n/** Who created a submission. */\nexport const TakeItDownSubmissionCreatedBySchema = z.enum(['requester', 'operator', 'system']);\nexport type TakeItDownSubmissionCreatedBy = z.infer<typeof TakeItDownSubmissionCreatedBySchema>;\n\n/** `takeItDownRequests/{requestId}/submissions/{submissionId}` = TakeItDownSubmissionV1\n * — IMMUTABLE append-only. Doc id `submissionId` is a deterministic/assigned id. */\nexport const TakeItDownSubmissionV1Schema = z.object({\n schemaVersion: z.literal(1),\n submissionId: z.string().min(1),\n sequence: z.number(), // monotonic per request — append order\n receivedAt: z.number(), // the immutable statutory receipt time of THIS submission\n suppliedFieldCodes: z.array(TakeItDownFieldCodeSchema).max(16),\n evidenceIds: z.array(z.string().min(1)).max(16),\n cumulativeRequestSnapshotHash: z.string(), // hash of the cumulative request state as of this submission\n cumulativeCompleteness: TakeItDownCompletenessStatusSchema, // 'incomplete' | 'complete'\n firstCompletedRequest: z.boolean(), // true on the submission whose cumulative state FIRST became complete\n supersedesSubmissionId: z.string().min(1).optional(),\n createdBy: TakeItDownSubmissionCreatedBySchema,\n}).strict();\nexport type TakeItDownSubmissionV1 = z.infer<typeof TakeItDownSubmissionV1Schema>;\n\n// ===========================================================================\n// §A11 (2) [H2] — IMMUTABLE takeItDownRequests/{requestId}/validityDecisions/{decisionId}\n// = TakeItDownValidityDecisionV1 (append-only; the authoritative validity ruling —\n// the root `validityStatus` is its projection). `incomplete` is NEVER a validity\n// result.\n// ===========================================================================\n\n/** The validity-decision result. `incomplete` is a COMPLETENESS state, NEVER a\n * validity result. */\nexport const TakeItDownValidityDecisionResultSchema = z.enum(['valid', 'invalid', 'unableToLocate']);\nexport type TakeItDownValidityDecisionResult = z.infer<typeof TakeItDownValidityDecisionResultSchema>;\n\n/** `takeItDownRequests/{requestId}/validityDecisions/{decisionId}` =\n * TakeItDownValidityDecisionV1 — IMMUTABLE append-only. Doc id `decisionId` is a\n * deterministic/assigned id. */\nexport const TakeItDownValidityDecisionV1Schema = z.object({\n schemaVersion: z.literal(1),\n decisionId: z.string().min(1),\n requestId: z.string().min(1),\n result: TakeItDownValidityDecisionResultSchema,\n basisSubmissionIds: z.array(z.string().min(1)).max(16), // the submissions the decision relied on\n validFromSubmissionId: z.string().min(1).optional(), // the EARLIEST submission whose cumulative snapshot satisfies the valid decision\n validRequestReceivedAt: z.number().optional(), // = that submission's immutable receivedAt (the binding statutory time)\n reasonCode: TakeItDownInvalidReasonCodeSchema.optional(),\n rationaleRef: z.string(), // pointer to a restricted rationale row\n decidedByUid: z.string().min(1),\n decidedAt: z.number(),\n}).strict();\nexport type TakeItDownValidityDecisionV1 = z.infer<typeof TakeItDownValidityDecisionV1Schema>;\n\n// ===========================================================================\n// §A11 (2) [L1] — takeItDownRequests/{requestId}/actions/{actionId} = the request\n// action row (CLOSED enums + a detailRef to a RESTRICTED row, never an inline\n// rationale blob).\n// ===========================================================================\n\n/** `takeItDownRequests/{requestId}/actions/{actionId}` — the [L1] closed-enum +\n * detailRef row. Doc id `actionId` is a deterministic/assigned id. */\nexport const TakeItDownRequestActionV1Schema = z.object({\n schemaVersion: z.literal(1),\n actionId: z.string().min(1),\n at: z.number(),\n actorId: z.string().min(1),\n capability: SafetyReviewerCapabilitySchema, // = the §[M4] matrix capability used\n actionType: NciiActionTypeSchema,\n result: NciiActionResultSchema,\n summary: z.string().max(MAX_NCII_ACTION_SUMMARY_LENGTH), // BOUNDED, non-sensitive\n detailRef: z.string().min(1), // pointer to a RESTRICTED detail row holding any sensitive rationale\n}).strict();\nexport type TakeItDownRequestActionV1 = z.infer<typeof TakeItDownRequestActionV1Schema>;\n\n// ===========================================================================\n// §A11 (2) [F10] — takeItDownRequests/{requestId}/evidence/{evidenceId} = the\n// public-evidence-upload record (account-less + in-app evidence lands in an\n// ISOLATED admin-only Firebase Storage bucket, never R2, never served, no durable\n// URL). Evidence reuses the `ncii-evidence` fileOrigin spec and the ONE shared\n// PhotoDNA scan (image → PhotoDNA; video → frame-extraction → PhotoDNA per frame),\n// byte-exact / no transcode (`preserveOriginal`). It does NOT use the auth-gated\n// `startUpload` path — a not-logged-in victim can't call it — so the browser writes\n// the file DIRECTLY to the isolated bucket (App-Check + create-only + image/video +\n// size-cap storage rules; path keyed by the opaque `requestReference`) and a Storage\n// onFinalize trigger runs that same scan. This record exists ONLY after a CLEAN\n// scan; a validated match opens a child-safety case and the bytes are held there\n// instead (no evidence record, never shown).\n// ===========================================================================\n\n/** `takeItDownRequests/{requestId}/evidence/{evidenceId}` — the [F10] public\n * evidence-upload record. Doc id `evidenceId` is a deterministic/assigned id.\n * INVARIANT: this record NEVER sets `originatingUploaderUid` — enforcement / NCMEC\n * attribution targets the ORIGINAL content's originatingUploaderUid (perpetrator)\n * via MediaOriginLineageV1 (a correlation, not a merge). */\nexport const TakeItDownEvidenceV1Schema = z.object({\n schemaVersion: z.literal(1),\n evidenceId: z.string().min(1),\n requestId: z.string().min(1),\n uploadContext: z.literal('takeItDownEvidence'), // LITERAL tag — never an ordinary content origin\n submitterUid: z.string().min(1).optional(), // the submitter is NEVER auto-actioned for evidence they submit\n bucket: z.string().min(1),\n key: z.string().min(1),\n generation: z.string().min(1),\n contentType: z.string().min(1),\n sizeBytes: z.number(),\n sha256: z.string().min(1),\n md5: z.string().min(1),\n capturedAt: z.number(),\n createdAt: z.number(),\n}).strict();\nexport type TakeItDownEvidenceV1 = z.infer<typeof TakeItDownEvidenceV1Schema>;\n\n// ===========================================================================\n// [H-01] nciiRetainedEvidenceInventory/{inventoryId} = NciiRetainedEvidenceInventoryV1\n// — a durable, OPERATOR-VISIBLE inventory row for an NCII-evidence object that the\n// onNciiEvidenceUploaded scan RETAINED but did NOT record as evidence (orphan /\n// oversized / spoof / malformed / archive-polyglot). The bytes are preserved (NO\n// auto-delete EVER — disposal stays verified-LE-only); this row makes the retained\n// object visible + accountable in the admin console instead of living only in a log\n// line. METADATA only — never bytes, never a served URL.\n// ===========================================================================\n\n/** Why an evidence object was retained without an evidence record. */\nexport const NciiRetainedEvidenceReasonSchema = z.enum([\n 'orphan', // requestReference matched no real request\n 'fileTooLarge', // over maxEvidenceFileBytes\n 'imageTooLarge', // over the decode pixel / dimension budget\n 'archiveOrPolyglot', // archive/polyglot signature\n 'malformedPath', // not a 3-segment nciiEvidence/{ref}/{file} key\n 'scanRejected', // PhotoDNA scan rejected it as a spoof (magic bytes / kind)\n 'capOverflow', // past the per-request count or total-bytes cap — retained but not recorded as evidence\n]);\nexport type NciiRetainedEvidenceReason = z.infer<typeof NciiRetainedEvidenceReasonSchema>;\n\n/** `nciiRetainedEvidenceInventory/{inventoryId}` — the [H-01] retained-object row.\n * Doc id is deterministic on bucket+key+generation (idempotent re-fire). */\nexport const NciiRetainedEvidenceInventoryV1Schema = z.object({\n schemaVersion: z.literal(1),\n inventoryId: z.string().min(1),\n reason: NciiRetainedEvidenceReasonSchema,\n bucket: z.string().min(1),\n key: z.string().min(1),\n generation: z.string().min(1),\n /** The path segment (an orphan reference matches no request). */\n requestReference: z.string().min(1).optional(),\n contentType: z.string().min(1).optional(),\n sizeBytes: z.number().optional(),\n detectedAt: z.number(),\n createdAt: z.number(),\n}).strict();\nexport type NciiRetainedEvidenceInventoryV1 = z.infer<typeof NciiRetainedEvidenceInventoryV1Schema>;\n\n// ===========================================================================\n// §A11 [C-02] — conditional completeness predicate (`computeCompleteness`).\n// requiredFieldCodes(requesterRole) + a contact one-of. These are EMBEDDED /\n// NON-DOC shapes (not Firestore documents): the counsel-ratified required set + a\n// documented predicate. Completeness is NOT \"every TakeItDownFieldCode arrived\".\n// ===========================================================================\n\n/** [C-02] Required field codes for a `depictedPerson` request (counsel-ratified). */\nexport const REQUIRED_FIELD_CODES_DEPICTED_PERSON = [\n 'requesterName',\n 'requesterRole',\n 'electronicSignature',\n 'targetLocator',\n 'nonconsentStatement',\n 'goodFaithCertification',\n] as const satisfies readonly TakeItDownFieldCode[];\n\n/** [C-02 / H-03] Required field codes for an `authorizedRepresentative` request =\n * depicted-person set ∪ { authorityBasis, authorityCertification }.\n * `authorityEvidence` (the optional documentary photo) is NOT required;\n * absence or pending scan never blocks completeness or the 48h clock. */\nexport const REQUIRED_FIELD_CODES_AUTHORIZED_REPRESENTATIVE = [\n ...REQUIRED_FIELD_CODES_DEPICTED_PERSON,\n 'authorityBasis',\n 'authorityCertification',\n] as const satisfies readonly TakeItDownFieldCode[];\n\n/** [C-02] The contact one-of: at least ONE of these must be present (neither is\n * individually required; either alone satisfies it). */\nexport const CONTACT_ONE_OF_FIELD_CODES = [\n 'contactEmail',\n 'contactPhone',\n] as const satisfies readonly TakeItDownFieldCode[];\n\n/** [C-02 / H-03] `requiredFieldCodes(requesterRole)` — the required set.\n * `supportingFacts` is collected but is NOT a completeness gate; `contactEmail` /\n * `contactPhone` are governed by the contact one-of (see CONTACT_ONE_OF_FIELD_CODES),\n * never individually required. `authorityEvidence` (the optional documentary photo)\n * is NOT required; absence or a pending/unavailable scan never blocks completeness\n * or the 48h clock. The implementer uses EXACTLY this set and never hard-requires\n * `contactPhone` or the authorizedRepresentative block on a depicted-person request. */\nexport function requiredFieldCodes(\n requesterRole: TakeItDownRequesterRole,\n): readonly TakeItDownFieldCode[] {\n return requesterRole === 'authorizedRepresentative'\n ? REQUIRED_FIELD_CODES_AUTHORIZED_REPRESENTATIVE\n : REQUIRED_FIELD_CODES_DEPICTED_PERSON;\n}\n\n/** [C-02 / H-02 / H-03] `computeCompleteness` — returns `complete` iff every code in\n * `requiredFieldCodes(requesterRole)` is supplied AND the contact one-of holds;\n * otherwise `incomplete` with the missing codes surfaced (those become\n * `TakeItDownPublicStatusV1.missingFieldCodes`). The missing-set lists the role's\n * unmet required codes, plus a `contactEmail`/`contactPhone` representative for an\n * unmet contact one-of (the implementer/UI decides which contact code to surface;\n * here we surface `contactEmail` as the canonical missing-contact marker).\n * [H-02] The optional authority-proof photo's presence, absence, or pending scan\n * (`authorityProofScan.scanStatus`) is NEVER a gate — completeness is purely the\n * written statutory elements + the authority certification. */\nexport function computeCompleteness(input: {\n requesterRole: TakeItDownRequesterRole;\n suppliedFieldCodes: readonly TakeItDownFieldCode[];\n}): { status: 'incomplete' | 'complete'; missingFieldCodes: TakeItDownFieldCode[] } {\n const supplied = new Set(input.suppliedFieldCodes);\n const missingFieldCodes: TakeItDownFieldCode[] = [];\n\n for (const code of requiredFieldCodes(input.requesterRole)) {\n if (!supplied.has(code)) missingFieldCodes.push(code);\n }\n\n const contactSatisfied = CONTACT_ONE_OF_FIELD_CODES.some((code) => supplied.has(code));\n if (!contactSatisfied) missingFieldCodes.push('contactEmail');\n\n return {\n status: missingFieldCodes.length === 0 ? 'complete' : 'incomplete',\n missingFieldCodes,\n };\n}\n\n// ===========================================================================\n// §A11 [C-02 / H-03] — intake field-code derivation + completeness (SINGLE-SOURCED).\n// `NciiIntakeFacts`, `suppliedFieldCodes`, and `deriveCompleteness` are pure and sit\n// beside `computeCompleteness` so BOTH the public route graph (src/) and the functions\n// graph (functions/src/) import the ONE implementation — the two \"byte-identical\"\n// intakeShared mirrors that had already drifted ([H-03] authorityCertification existed\n// on only one side) are eliminated. These are EMBEDDED / NON-DOC shapes (not Firestore\n// documents).\n// ===========================================================================\n\n/** The decoded intake payload the field-code extractor inspects. The route/callable\n * maps the raw body onto this AFTER zod-validating it. */\nexport interface NciiIntakeFacts {\n readonly requesterRole: TakeItDownRequesterRole;\n readonly requesterName?: string;\n readonly contactEmail?: string;\n readonly contactPhone?: string;\n readonly electronicSignature?: { signedName: string; signatureMethod: string };\n readonly nonconsentStatement?: string;\n readonly supportingFacts?: string;\n readonly goodFaithCertification?: boolean;\n readonly authorityBasis?: string;\n /** [H-03] The required good-faith authority certification. Arms completeness alongside\n * authorityBasis; the optional documentary photo never gates completeness. */\n readonly authorityCertification?: boolean;\n /** [H-03] Optional documentary authority-proof photo ref. Present/absent never blocks\n * completeness or the 48h clock; it is supporting material only. */\n readonly authorityEvidenceRef?: string;\n /** Present only for a resolvable/recorded locator (TTT-hosted or external). */\n readonly hasLocator: boolean;\n}\n\nfunction nonEmpty(s: string | undefined): boolean {\n return typeof s === 'string' && s.trim().length > 0;\n}\n\n/**\n * Derive the set of supplied `TakeItDownFieldCode`s from the decoded facts. This is\n * the bridge between the raw form fields and the enumerated codes the\n * `computeCompleteness` predicate consumes — completeness is NEVER \"every field code\n * arrived\", it is exactly the counsel-ratified required set (handled by\n * `computeCompleteness`) over THIS supplied set.\n */\nexport function suppliedFieldCodes(facts: NciiIntakeFacts): TakeItDownFieldCode[] {\n const codes: TakeItDownFieldCode[] = [];\n if (nonEmpty(facts.requesterName)) codes.push('requesterName');\n if (nonEmpty(facts.contactEmail)) codes.push('contactEmail');\n if (nonEmpty(facts.contactPhone)) codes.push('contactPhone');\n // requesterRole is always present (it is required to even shape the request).\n codes.push('requesterRole');\n if (facts.electronicSignature && nonEmpty(facts.electronicSignature.signedName)) {\n codes.push('electronicSignature');\n }\n if (facts.hasLocator) codes.push('targetLocator');\n if (nonEmpty(facts.nonconsentStatement)) codes.push('nonconsentStatement');\n if (nonEmpty(facts.supportingFacts)) codes.push('supportingFacts');\n if (facts.goodFaithCertification === true) codes.push('goodFaithCertification');\n if (nonEmpty(facts.authorityBasis)) codes.push('authorityBasis');\n // [H-03] authorityCertification is the required authority attestation that arms completeness.\n if (facts.authorityCertification === true) codes.push('authorityCertification');\n // [H-03] authorityEvidence (documentary photo) is OPTIONAL — recorded when present but\n // never a completeness gate; absence never blocks the 48h clock.\n if (nonEmpty(facts.authorityEvidenceRef)) codes.push('authorityEvidence');\n return codes;\n}\n\n/** The full completeness determination: status + the supplied set + the missing set. */\nexport interface NciiCompletenessOutcome {\n readonly status: 'incomplete' | 'complete';\n readonly suppliedFieldCodes: TakeItDownFieldCode[];\n readonly missingFieldCodes: TakeItDownFieldCode[];\n}\n\n/**\n * Compute completeness from the decoded facts using the shared `computeCompleteness`\n * predicate ([C-02]). One call so every intake (public route + logged-in callable +\n * any functions-graph recompute) uses an identical determination.\n */\nexport function deriveCompleteness(facts: NciiIntakeFacts): NciiCompletenessOutcome {\n const supplied = suppliedFieldCodes(facts);\n const { status, missingFieldCodes } = computeCompleteness({\n requesterRole: facts.requesterRole,\n suppliedFieldCodes: supplied,\n });\n return { status, suppliedFieldCodes: supplied, missingFieldCodes };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"notification-ledger.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/notification-ledger.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;+CAE+C;AAC/C,eAAO,MAAM,iCAAiC;;;;iBAI5C,CAAC;AAKH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkBrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAI9E,eAAO,MAAM,6BAA6B;;;;iBAIxC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
1
+ {"version":3,"file":"notification-ledger.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/notification-ledger.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;+CAE+C;AAC/C,eAAO,MAAM,iCAAiC;;;;iBAI5C,CAAC;AAKH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkBrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAI9E,eAAO,MAAM,6BAA6B;;;;iBAIxC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
@@ -1,5 +1,7 @@
1
1
  // Notification redesign ledger Firestore schemas (chat-edge-rebuild P1).
2
- // Frozen field lists from IMPLEMENTATION_MATRIX.md "Notifications". Admin-SDK-only.
2
+ // The notification-ledger field lists are FROZEN here — this file is their single
3
+ // source; the durable design owner is ttt-prod docs/design/notification-system.md.
4
+ // Admin-SDK-only.
3
5
  // `expireAt` is the only Firestore `Timestamp` field (native TTL); every other
4
6
  // time field is epoch-ms `number`.
5
7
  import { z } from 'zod';
@@ -1 +1 @@
1
- {"version":3,"file":"notification-ledger.js","sourceRoot":"","sources":["../../src/doc-schemas/notification-ledger.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,oFAAoF;AACpF,+EAA+E;AAC/E,mCAAmC;AAEnC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wEAAwE;AACxE,MAAM,aAAa,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC;AAE7C;;+CAE+C;AAC/C,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;IAC3C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;CACzB,CAAC,CAAC;AAEH,+EAA+E;AAC/E,6EAA6E;AAC7E,qEAAqE;AACrE,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;IACvD,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,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ACnB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;IAC1C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,6BAA6B,CAAC;IAC9C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;IACrD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,QAAQ,EAAE,aAAa;CACxB,CAAC,CAAC","sourcesContent":["// Notification redesign ledger Firestore schemas (chat-edge-rebuild P1).\n// Frozen field lists from IMPLEMENTATION_MATRIX.md \"Notifications\". Admin-SDK-only.\n// `expireAt` is the only Firestore `Timestamp` field (native TTL); every other\n// time field is epoch-ms `number`.\n\nimport { z } from 'zod';\n\n/** Native-TTL Timestamp (set only at the resolved-success terminal). */\nconst expireAtField = z.unknown().optional();\n\n/** The materialization payload carried on every delivery row.\n * `actorId` is `null` for system / no-actor occurrences (the engine writes null and\n * never injects it into `latestActorIds`). */\nexport const NotificationDeliveryPayloadSchema = z.object({\n actorId: z.string().nullable(),\n metadata: z.record(z.string(), z.unknown()),\n occurrenceAt: z.number(),\n});\n\n// ── notificationDeliveries/{deliveryId} ─────────────────────────────────────\n// BOTH the recipient ledger AND the occurrence ledger. Shared-admin rows set\n// recipientUid=null (the deliveryId hash uses the literal 'shared').\nexport const NotificationDeliverySchema = z.object({\n deliveryId: z.string(),\n state: z.enum(['queued', 'materialized', 'deadLetter']),\n notificationType: z.string(),\n eventId: z.string(),\n recipientUid: z.string().nullable(),\n aggregationKey: z.string(),\n strategy: z.enum(['increment', 'staticRelight']),\n payload: NotificationDeliveryPayloadSchema,\n payloadVersion: z.number(),\n materializationClass: z.enum(['directQueued', 'realtimeFallback', 'fanoutOrphan', 'retry']),\n createdAt: z.number(),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n materializedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type NotificationDelivery = z.infer<typeof NotificationDeliverySchema>;\n\n// ── notificationFanoutJobs/{jobId} ──────────────────────────────────────────\n// jobId = `${eventId}:${notificationType}`. No `running` state (no leases).\nexport const NotificationFanoutPhaseSchema = z.object({\n selector: z.record(z.string(), z.unknown()),\n cursor: z.unknown().nullable(),\n done: z.boolean(),\n});\n\nexport const NotificationFanoutJobSchema = z.object({\n jobId: z.string(),\n schemaVersion: z.number(),\n notificationType: z.string(),\n eventId: z.string(),\n priority: z.union([z.literal(0), z.literal(1), z.literal(2)]),\n payload: z.record(z.string(), z.unknown()),\n phases: z.array(NotificationFanoutPhaseSchema),\n phaseIndex: z.number(),\n revision: z.number(),\n status: z.enum(['pending', 'complete', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n updatedAt: z.number(),\n completedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type NotificationFanoutJob = z.infer<typeof NotificationFanoutJobSchema>;\n"]}
1
+ {"version":3,"file":"notification-ledger.js","sourceRoot":"","sources":["../../src/doc-schemas/notification-ledger.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,kFAAkF;AAClF,mFAAmF;AACnF,kBAAkB;AAClB,+EAA+E;AAC/E,mCAAmC;AAEnC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wEAAwE;AACxE,MAAM,aAAa,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC;AAE7C;;+CAE+C;AAC/C,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;IAC3C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;CACzB,CAAC,CAAC;AAEH,+EAA+E;AAC/E,6EAA6E;AAC7E,qEAAqE;AACrE,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;IACvD,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IAChD,OAAO,EAAE,iCAAiC;IAC1C,cAAc,EAAE,CAAC,CAAC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,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;IAC1C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,6BAA6B,CAAC;IAC9C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;IACrD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,QAAQ,EAAE,aAAa;CACxB,CAAC,CAAC","sourcesContent":["// Notification redesign ledger Firestore schemas (chat-edge-rebuild P1).\n// The notification-ledger field lists are FROZEN here — this file is their single\n// source; the durable design owner is ttt-prod docs/design/notification-system.md.\n// Admin-SDK-only.\n// `expireAt` is the only Firestore `Timestamp` field (native TTL); every other\n// time field is epoch-ms `number`.\n\nimport { z } from 'zod';\n\n/** Native-TTL Timestamp (set only at the resolved-success terminal). */\nconst expireAtField = z.unknown().optional();\n\n/** The materialization payload carried on every delivery row.\n * `actorId` is `null` for system / no-actor occurrences (the engine writes null and\n * never injects it into `latestActorIds`). */\nexport const NotificationDeliveryPayloadSchema = z.object({\n actorId: z.string().nullable(),\n metadata: z.record(z.string(), z.unknown()),\n occurrenceAt: z.number(),\n});\n\n// ── notificationDeliveries/{deliveryId} ─────────────────────────────────────\n// BOTH the recipient ledger AND the occurrence ledger. Shared-admin rows set\n// recipientUid=null (the deliveryId hash uses the literal 'shared').\nexport const NotificationDeliverySchema = z.object({\n deliveryId: z.string(),\n state: z.enum(['queued', 'materialized', 'deadLetter']),\n notificationType: z.string(),\n eventId: z.string(),\n recipientUid: z.string().nullable(),\n aggregationKey: z.string(),\n strategy: z.enum(['increment', 'staticRelight']),\n payload: NotificationDeliveryPayloadSchema,\n payloadVersion: z.number(),\n materializationClass: z.enum(['directQueued', 'realtimeFallback', 'fanoutOrphan', 'retry']),\n createdAt: z.number(),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n materializedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type NotificationDelivery = z.infer<typeof NotificationDeliverySchema>;\n\n// ── notificationFanoutJobs/{jobId} ──────────────────────────────────────────\n// jobId = `${eventId}:${notificationType}`. No `running` state (no leases).\nexport const NotificationFanoutPhaseSchema = z.object({\n selector: z.record(z.string(), z.unknown()),\n cursor: z.unknown().nullable(),\n done: z.boolean(),\n});\n\nexport const NotificationFanoutJobSchema = z.object({\n jobId: z.string(),\n schemaVersion: z.number(),\n notificationType: z.string(),\n eventId: z.string(),\n priority: z.union([z.literal(0), z.literal(1), z.literal(2)]),\n payload: z.record(z.string(), z.unknown()),\n phases: z.array(NotificationFanoutPhaseSchema),\n phaseIndex: z.number(),\n revision: z.number(),\n status: z.enum(['pending', 'complete', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n updatedAt: z.number(),\n completedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type NotificationFanoutJob = z.infer<typeof NotificationFanoutJobSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/payments.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,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AAC,OAAO,mBAAmB,CAAC,CAAC;AAOhE,eAAO,MAAM,8BAA8B;;;;;;;;;;iBAUzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAQtF,eAAO,MAAM,4BAA4B;;;;;;iBAMvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAMlF,eAAO,MAAM,0BAA0B;;;;;iBAKrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAM9E,eAAO,MAAM,8BAA8B;;;;;;;;;iBASzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAMtF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsBzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAMtF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;iBAWpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -2,7 +2,8 @@
2
2
  // server-only companions: provider refs (Stripe IDs), the idempotency sentinel, the
3
3
  // independent integrity trail, and the paid-event quarantine queue. Types inferred via
4
4
  // z.infer. Money data lives here, never in social.ts.
5
- // See docs/design/donation-payment-system.md and docs/PHASE_6_STRIPE.md.
5
+ // See ttt-prod docs/design/donation-payment-system.md (the design owner for the
6
+ // pledge/Stripe flow).
6
7
  import { z } from 'zod';
7
8
  // pledgePayments/{pledgePaymentId} — public-safe canonical money record. One doc per completed
8
9
  // pledge; never deleted/archived. No Stripe IDs, no supporter message. Auth-readable; server-only
@@ -1 +1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E,gCAAgC;IAC/D,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,2BAA2B;IAChE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,gCAAgC;IACnE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC","sourcesContent":["// Payment / pledge Firestore document SCHEMAS — the public-safe pledge ledger and its\n// server-only companions: provider refs (Stripe IDs), the idempotency sentinel, the\n// independent integrity trail, and the paid-event quarantine queue. Types inferred via\n// z.infer. Money data lives here, never in social.ts.\n// See docs/design/donation-payment-system.md and docs/PHASE_6_STRIPE.md.\n\nimport { z } from 'zod';\n\n// pledgePayments/{pledgePaymentId} — public-safe canonical money record. One doc per completed\n// pledge; never deleted/archived. No Stripe IDs, no supporter message. Auth-readable; server-only\n// writes. netAmount = max(0, amount - refundedAmount - disputeLostAmount) is the sum() target.\n// At launch refundedAmount/disputeLostAmount are 0 so netAmount === amount.\n// (functions/src/payments/runProcessStripePledgeEvent.ts)\nexport const PledgePaymentSchema = z.object({\n pledgePaymentId: z.string(),\n userId: z.string(),\n amount: z.number(), // gross cents charged (Stripe-confirmed amount_total)\n refundedAmount: z.number(), // cumulative refunded cents; LAUNCH default 0\n disputeLostAmount: z.number(), // cents withdrawn on a lost dispute; LAUNCH default 0\n netAmount: z.number(), // max(0, amount - refundedAmount - disputeLostAmount); sum() target\n currency: z.string(), // \"usd\"\n paymentInstrument: z.literal('card'),\n status: z.literal('completed'),\n refundState: z.enum(['none', 'partial', 'full']), // LAUNCH always 'none'\n disputeState: z.enum(['none', 'underReview', 'won', 'lost']), // LAUNCH always 'none'\n // Server timestamp (ms) of the checkout's 18+/public-disclosure attestation, stamped at session\n // creation and carried through Stripe metadata. A paid session missing it is quarantined.\n ageAttestedAt: z.number(),\n createdAt: z.number(),\n updatedAt: z.number(),\n});\nexport type PledgePayment = z.infer<typeof PledgePaymentSchema>;\n\n// pledgePaymentProviderRefs/{pledgePaymentId} — server-only Stripe references for reconciliation\n// and (post-launch) refund/dispute lookup. Rule is permanently `if false` (Admin SDK only) so no\n// Stripe IDs ever sit on an auth-readable doc. One doc per pledge (singular). refundIds/disputeId\n// are refund-ready, defaulted ([] / null) at launch — zero migration when handlers ship.\n// (functions/src/payments/runProcessStripePledgeEvent.ts)\nexport const PledgePaymentProviderRefSchema = z.object({\n pledgePaymentId: z.string(),\n userId: z.string(),\n stripeSessionId: z.string(),\n paymentIntentId: z.string(),\n latestChargeId: z.string().nullable(), // resolved when known; null at launch if not fetched\n refundIds: z.array(z.string()), // post-launch; LAUNCH default []\n disputeId: z.string().nullable(), // post-launch; LAUNCH default null\n createdAt: z.number(),\n updatedAt: z.number(),\n});\nexport type PledgePaymentProviderRef = z.infer<typeof PledgePaymentProviderRefSchema>;\n\n// pledgePaymentTotals/summary — the stored running-totals singleton behind every \"total raised\"\n// surface. Incremented via FieldValue.increment INSIDE the Stripe webhook's pledge-record\n// transaction (same commit as the pledgePayments doc — the two can never drift on a completed\n// pledge); refund/dispute paths decrement when those handlers ship. Auth-readable, server-only\n// writes. An idempotent recompute script rebuilds/verifies it from pledgePayments for drift\n// repair. Shape mirrors the PledgePaymentTotals view-model + updatedAt.\nexport const PledgePaymentTotalsDocSchema = z.object({\n netRaised: z.number(),\n grossRaised: z.number(),\n totalRefunded: z.number(),\n pledgeCount: z.number(),\n updatedAt: z.number(),\n});\nexport type PledgePaymentTotalsDoc = z.infer<typeof PledgePaymentTotalsDocSchema>;\n\n// processedStripeEvents/{stripeEventId} — idempotency sentinel, one doc per processed Stripe\n// event.id, kept forever. Checked + written in the same transaction as the side effect so a\n// redelivered event (completion, expiry, failure, or quarantine) produces no duplicate.\n// pledgePaymentId is set only when the event created a pledge. (runProcessStripePledgeEvent.ts)\nexport const ProcessedStripeEventSchema = z.object({\n eventId: z.string(),\n eventType: z.string(),\n processedAt: z.number(),\n pledgePaymentId: z.string().nullable(),\n});\nexport type ProcessedStripeEvent = z.infer<typeof ProcessedStripeEventSchema>;\n\n// pledgePaymentLedgerEvents/{ledgerId} — independent integrity record from the onPledgePaymentWritten\n// trigger (mirrors stakeShareAuditEvents). before/after are raw doc snapshots (null on create/delete)\n// kept as permissive bags so a malformed/anomalous write is still captured forensically.\n// (functions/src/audit/runPledgePaymentLedgerAudit.ts)\nexport const PledgePaymentLedgerEventSchema = z.object({\n ledgerId: z.string(),\n pledgePaymentId: z.string(),\n subtype: z.string(), // e.g. 'created' | 'anomaly'\n reason: z.string(),\n before: z.record(z.string(), z.unknown()).nullable(),\n after: z.record(z.string(), z.unknown()).nullable(),\n source: z.literal('firestore-trigger'),\n createdAt: z.number(),\n});\nexport type PledgePaymentLedgerEvent = z.infer<typeof PledgePaymentLedgerEventSchema>;\n\n// paymentWebhookQuarantine/{stripeEventId} — admin-readable repair queue for paid-but-malformed\n// events (e.g. missing metadata) that must NOT make Stripe retry. Redaction rule: never store raw\n// payloads, card/billing data, customer email, addresses, or receipt URLs — IDs + a short redacted\n// rawSafeSummary only. (functions/src/payments/runProcessStripePledgeEvent.ts)\nexport const PaymentWebhookQuarantineSchema = z.object({\n eventId: z.string(),\n eventType: z.string(),\n livemode: z.boolean(),\n reason: z.string(),\n recoverable: z.boolean(),\n stripeObjectIds: z.object({\n sessionId: z.string().optional(),\n paymentIntentId: z.string().optional(),\n chargeId: z.string().optional(),\n }),\n pledgePaymentId: z.string().optional(),\n userId: z.string().optional(),\n amount: z.number().optional(),\n currency: z.string().optional(),\n rawSafeSummary: z.string(),\n status: z.enum(['open', 'resolved', 'ignored']),\n adminTaskId: z.string().optional(),\n createdAt: z.number(),\n resolvedAt: z.number().optional(),\n resolvedBy: z.string().optional(),\n resolutionNote: z.string().optional(),\n});\nexport type PaymentWebhookQuarantine = z.infer<typeof PaymentWebhookQuarantineSchema>;\n\n// pledgeRefundRequests/{requestId} — user-initiated pledge refund request (post-launch handler).\n// Lifecycle: requested → (admin approves) initiated → completed, or requested → (admin) denied.\n// NO Stripe ids on this doc — the refund id lands on pledgePaymentProviderRefs.refundIds. Server-only\n// writes. Timestamps are epoch-millis numbers (this repo never uses Firestore Timestamps).\nexport const PledgeRefundRequestSchema = z.object({\n pledgePaymentId: z.string(),\n userId: z.string(),\n amount: z.number(),\n status: z.enum(['requested', 'initiated', 'denied', 'completed']),\n reason: z.string().optional(), // the requester's stated reason\n denialReason: z.string().optional(), // set when an admin denies\n resolvedBy: z.string().optional(), // admin uid who approved/denied\n requestedAt: z.number(),\n resolvedAt: z.number().optional(),\n completedAt: z.number().optional(),\n});\nexport type PledgeRefundRequest = z.infer<typeof PledgeRefundRequestSchema>;\n"]}
1
+ {"version":3,"file":"payments.js","sourceRoot":"","sources":["../../src/doc-schemas/payments.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,oFAAoF;AACpF,uFAAuF;AACvF,sDAAsD;AACtD,gFAAgF;AAChF,uBAAuB;AAEvB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,+FAA+F;AAC/F,kGAAkG;AAClG,+FAA+F;AAC/F,4EAA4E;AAC5E,0DAA0D;AAC1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,sDAAsD;IAC1E,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,8CAA8C;IAC1E,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,sDAAsD;IACrF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,oEAAoE;IAC3F,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,E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C,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC;AAGH,iGAAiG;AACjG,gGAAgG;AAChG,sGAAsG;AACtG,2FAA2F;AAC3F,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;IACjE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,gCAAgC;IAC/D,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,2BAA2B;IAChE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,gCAAgC;IACnE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC","sourcesContent":["// Payment / pledge Firestore document SCHEMAS — the public-safe pledge ledger and its\n// server-only companions: provider refs (Stripe IDs), the idempotency sentinel, the\n// independent integrity trail, and the paid-event quarantine queue. Types inferred via\n// z.infer. Money data lives here, never in social.ts.\n// See ttt-prod docs/design/donation-payment-system.md (the design owner for the\n// pledge/Stripe flow).\n\nimport { z } from 'zod';\n\n// pledgePayments/{pledgePaymentId} — public-safe canonical money record. One doc per completed\n// pledge; never deleted/archived. No Stripe IDs, no supporter message. Auth-readable; server-only\n// writes. netAmount = max(0, amount - refundedAmount - disputeLostAmount) is the sum() target.\n// At launch refundedAmount/disputeLostAmount are 0 so netAmount === amount.\n// (functions/src/payments/runProcessStripePledgeEvent.ts)\nexport const PledgePaymentSchema = z.object({\n pledgePaymentId: z.string(),\n userId: z.string(),\n amount: z.number(), // gross cents charged (Stripe-confirmed amount_total)\n refundedAmount: z.number(), // cumulative refunded cents; LAUNCH default 0\n disputeLostAmount: z.number(), // cents withdrawn on a lost dispute; LAUNCH default 0\n netAmount: z.number(), // max(0, amount - refundedAmount - disputeLostAmount); sum() target\n currency: z.string(), // \"usd\"\n paymentInstrument: z.literal('card'),\n status: z.literal('completed'),\n refundState: z.enum(['none', 'partial', 'full']), // LAUNCH always 'none'\n disputeState: z.enum(['none', 'underReview', 'won', 'lost']), // LAUNCH always 'none'\n // Server timestamp (ms) of the checkout's 18+/public-disclosure attestation, stamped at session\n // creation and carried through Stripe metadata. A paid session missing it is quarantined.\n ageAttestedAt: z.number(),\n createdAt: z.number(),\n updatedAt: z.number(),\n});\nexport type PledgePayment = z.infer<typeof PledgePaymentSchema>;\n\n// pledgePaymentProviderRefs/{pledgePaymentId} — server-only Stripe references for reconciliation\n// and (post-launch) refund/dispute lookup. Rule is permanently `if false` (Admin SDK only) so no\n// Stripe IDs ever sit on an auth-readable doc. One doc per pledge (singular). refundIds/disputeId\n// are refund-ready, defaulted ([] / null) at launch — zero migration when handlers ship.\n// (functions/src/payments/runProcessStripePledgeEvent.ts)\nexport const PledgePaymentProviderRefSchema = z.object({\n pledgePaymentId: z.string(),\n userId: z.string(),\n stripeSessionId: z.string(),\n paymentIntentId: z.string(),\n latestChargeId: z.string().nullable(), // resolved when known; null at launch if not fetched\n refundIds: z.array(z.string()), // post-launch; LAUNCH default []\n disputeId: z.string().nullable(), // post-launch; LAUNCH default null\n createdAt: z.number(),\n updatedAt: z.number(),\n});\nexport type PledgePaymentProviderRef = z.infer<typeof PledgePaymentProviderRefSchema>;\n\n// pledgePaymentTotals/summary — the stored running-totals singleton behind every \"total raised\"\n// surface. Incremented via FieldValue.increment INSIDE the Stripe webhook's pledge-record\n// transaction (same commit as the pledgePayments doc — the two can never drift on a completed\n// pledge); refund/dispute paths decrement when those handlers ship. Auth-readable, server-only\n// writes. An idempotent recompute script rebuilds/verifies it from pledgePayments for drift\n// repair. Shape mirrors the PledgePaymentTotals view-model + updatedAt.\nexport const PledgePaymentTotalsDocSchema = z.object({\n netRaised: z.number(),\n grossRaised: z.number(),\n totalRefunded: z.number(),\n pledgeCount: z.number(),\n updatedAt: z.number(),\n});\nexport type PledgePaymentTotalsDoc = z.infer<typeof PledgePaymentTotalsDocSchema>;\n\n// processedStripeEvents/{stripeEventId} — idempotency sentinel, one doc per processed Stripe\n// event.id, kept forever. Checked + written in the same transaction as the side effect so a\n// redelivered event (completion, expiry, failure, or quarantine) produces no duplicate.\n// pledgePaymentId is set only when the event created a pledge. (runProcessStripePledgeEvent.ts)\nexport const ProcessedStripeEventSchema = z.object({\n eventId: z.string(),\n eventType: z.string(),\n processedAt: z.number(),\n pledgePaymentId: z.string().nullable(),\n});\nexport type ProcessedStripeEvent = z.infer<typeof ProcessedStripeEventSchema>;\n\n// pledgePaymentLedgerEvents/{ledgerId} — independent integrity record from the onPledgePaymentWritten\n// trigger (mirrors stakeShareAuditEvents). before/after are raw doc snapshots (null on create/delete)\n// kept as permissive bags so a malformed/anomalous write is still captured forensically.\n// (functions/src/audit/runPledgePaymentLedgerAudit.ts)\nexport const PledgePaymentLedgerEventSchema = z.object({\n ledgerId: z.string(),\n pledgePaymentId: z.string(),\n subtype: z.string(), // e.g. 'created' | 'anomaly'\n reason: z.string(),\n before: z.record(z.string(), z.unknown()).nullable(),\n after: z.record(z.string(), z.unknown()).nullable(),\n source: z.literal('firestore-trigger'),\n createdAt: z.number(),\n});\nexport type PledgePaymentLedgerEvent = z.infer<typeof PledgePaymentLedgerEventSchema>;\n\n// paymentWebhookQuarantine/{stripeEventId} — admin-readable repair queue for paid-but-malformed\n// events (e.g. missing metadata) that must NOT make Stripe retry. Redaction rule: never store raw\n// payloads, card/billing data, customer email, addresses, or receipt URLs — IDs + a short redacted\n// rawSafeSummary only. (functions/src/payments/runProcessStripePledgeEvent.ts)\nexport const PaymentWebhookQuarantineSchema = z.object({\n eventId: z.string(),\n eventType: z.string(),\n livemode: z.boolean(),\n reason: z.string(),\n recoverable: z.boolean(),\n stripeObjectIds: z.object({\n sessionId: z.string().optional(),\n paymentIntentId: z.string().optional(),\n chargeId: z.string().optional(),\n }),\n pledgePaymentId: z.string().optional(),\n userId: z.string().optional(),\n amount: z.number().optional(),\n currency: z.string().optional(),\n rawSafeSummary: z.string(),\n status: z.enum(['open', 'resolved', 'ignored']),\n adminTaskId: z.string().optional(),\n createdAt: z.number(),\n resolvedAt: z.number().optional(),\n resolvedBy: z.string().optional(),\n resolutionNote: z.string().optional(),\n});\nexport type PaymentWebhookQuarantine = z.infer<typeof PaymentWebhookQuarantineSchema>;\n\n// pledgeRefundRequests/{requestId} — user-initiated pledge refund request (post-launch handler).\n// Lifecycle: requested → (admin approves) initiated → completed, or requested → (admin) denied.\n// NO Stripe ids on this doc — the refund id lands on pledgePaymentProviderRefs.refundIds. Server-only\n// writes. Timestamps are epoch-millis numbers (this repo never uses Firestore Timestamps).\nexport const PledgeRefundRequestSchema = z.object({\n pledgePaymentId: z.string(),\n userId: z.string(),\n amount: z.number(),\n status: z.enum(['requested', 'initiated', 'denied', 'completed']),\n reason: z.string().optional(), // the requester's stated reason\n denialReason: z.string().optional(), // set when an admin denies\n resolvedBy: z.string().optional(), // admin uid who approved/denied\n requestedAt: z.number(),\n resolvedAt: z.number().optional(),\n completedAt: z.number().optional(),\n});\nexport type PledgeRefundRequest = z.infer<typeof PledgeRefundRequestSchema>;\n"]}
@@ -716,7 +716,105 @@ export declare const COLLECTION_SCHEMAS: {
716
716
  NEW_AUDITION: "NEW_AUDITION";
717
717
  NEW_COMMISSION: "NEW_COMMISSION";
718
718
  }>;
719
- payload: z.ZodCustom<import("./square-announcement-jobs.js").SquareAnnouncementPayload, import("./square-announcement-jobs.js").SquareAnnouncementPayload>;
719
+ payload: z.ZodObject<{
720
+ userId: z.ZodString;
721
+ mentions: z.ZodOptional<z.ZodArray<z.ZodObject<{
722
+ placeholder: z.ZodString;
723
+ type: z.ZodEnum<{
724
+ workRealm: "workRealm";
725
+ workProject: "workProject";
726
+ audition: "audition";
727
+ user: "user";
728
+ commission: "commission";
729
+ }>;
730
+ id: z.ZodString;
731
+ }, z.core.$strict>>>;
732
+ newMediaAssetId: z.ZodOptional<z.ZodString>;
733
+ craftSkill: z.ZodOptional<z.ZodObject<{
734
+ id: z.ZodString;
735
+ name: z.ZodString;
736
+ mediaAssetId: z.ZodString;
737
+ type: z.ZodEnum<{
738
+ video: "video";
739
+ image: "image";
740
+ audio: "audio";
741
+ }>;
742
+ tags: z.ZodOptional<z.ZodArray<z.ZodEnum<{
743
+ acting: "acting";
744
+ "voice-over": "voice-over";
745
+ singing: "singing";
746
+ rapping: "rapping";
747
+ "instrumental-performance": "instrumental-performance";
748
+ "dance-choreography": "dance-choreography";
749
+ "stand-up-sketch-comedy": "stand-up-sketch-comedy";
750
+ "writing-storytelling": "writing-storytelling";
751
+ songwriting: "songwriting";
752
+ "poetry-spoken-word": "poetry-spoken-word";
753
+ "drawing-illustration": "drawing-illustration";
754
+ painting: "painting";
755
+ animation: "animation";
756
+ "graphic-design": "graphic-design";
757
+ photography: "photography";
758
+ "cinematography-camera": "cinematography-camera";
759
+ "video-editing": "video-editing";
760
+ "visual-effects": "visual-effects";
761
+ directing: "directing";
762
+ "costume-makeup": "costume-makeup";
763
+ "set-prop-design": "set-prop-design";
764
+ "music-production": "music-production";
765
+ "composing-scoring": "composing-scoring";
766
+ "sound-design": "sound-design";
767
+ }>>>;
768
+ kind: z.ZodOptional<z.ZodEnum<{
769
+ original: "original";
770
+ mimicOnTtt: "mimicOnTtt";
771
+ mimicOffTtt: "mimicOffTtt";
772
+ }>>;
773
+ source: z.ZodOptional<z.ZodObject<{
774
+ type: z.ZodEnum<{
775
+ workProject: "workProject";
776
+ user: "user";
777
+ }>;
778
+ id: z.ZodString;
779
+ }, z.core.$strict>>;
780
+ }, z.core.$strip>>;
781
+ craftSkillId: z.ZodOptional<z.ZodString>;
782
+ workProjectTitle: z.ZodOptional<z.ZodString>;
783
+ workProjectId: z.ZodOptional<z.ZodString>;
784
+ workProjectType: z.ZodOptional<z.ZodEnum<{
785
+ Tales: "Tales";
786
+ Tunes: "Tunes";
787
+ Television: "Television";
788
+ }>>;
789
+ workProjectDescription: z.ZodOptional<z.ZodString>;
790
+ workRealmId: z.ZodOptional<z.ZodString>;
791
+ workRealmTitle: z.ZodOptional<z.ZodString>;
792
+ hallItemId: z.ZodOptional<z.ZodString>;
793
+ hallItemTitle: z.ZodOptional<z.ZodString>;
794
+ hallSubItemType: z.ZodOptional<z.ZodEnum<{
795
+ chapter: "chapter";
796
+ track: "track";
797
+ episode: "episode";
798
+ }>>;
799
+ content: z.ZodOptional<z.ZodString>;
800
+ mediaAssetId: z.ZodOptional<z.ZodString>;
801
+ mediaType: z.ZodOptional<z.ZodEnum<{
802
+ video: "video";
803
+ image: "image";
804
+ audio: "audio";
805
+ other: "other";
806
+ }>>;
807
+ createdAt: z.ZodOptional<z.ZodNumber>;
808
+ auditionId: z.ZodOptional<z.ZodString>;
809
+ commissionListingId: z.ZodOptional<z.ZodString>;
810
+ auditionAnnounceKind: z.ZodOptional<z.ZodEnum<{
811
+ work: "work";
812
+ platform: "platform";
813
+ sponsored: "sponsored";
814
+ }>>;
815
+ projectId: z.ZodOptional<z.ZodString>;
816
+ postId: z.ZodOptional<z.ZodString>;
817
+ }, z.core.$strip>;
720
818
  }, z.core.$strip>;
721
819
  source: z.ZodRecord<z.ZodString, z.ZodString>;
722
820
  status: z.ZodEnum<{
@@ -989,7 +1087,11 @@ export declare const COLLECTION_SCHEMAS: {
989
1087
  pendingMediaId: z.ZodOptional<z.ZodString>;
990
1088
  name: z.ZodString;
991
1089
  mediaAssetId: z.ZodString;
992
- type: z.ZodString;
1090
+ type: z.ZodEnum<{
1091
+ video: "video";
1092
+ image: "image";
1093
+ audio: "audio";
1094
+ }>;
993
1095
  size: z.ZodNumber;
994
1096
  }, z.core.$strip>>;
995
1097
  requiredTradeProfessions: z.ZodArray<z.ZodString>;
@@ -1044,12 +1146,9 @@ export declare const COLLECTION_SCHEMAS: {
1044
1146
  title: z.ZodString;
1045
1147
  description: z.ZodString;
1046
1148
  videoAssetId: z.ZodString;
1047
- mediaType: z.ZodOptional<z.ZodEnum<{
1149
+ mediaType: z.ZodEnum<{
1048
1150
  video: "video";
1049
- image: "image";
1050
- audio: "audio";
1051
- other: "other";
1052
- }>>;
1151
+ }>;
1053
1152
  openTill: z.ZodNumber;
1054
1153
  createdOn: z.ZodNumber;
1055
1154
  createdBy: z.ZodObject<{
@@ -1085,11 +1184,9 @@ export declare const COLLECTION_SCHEMAS: {
1085
1184
  auditionId: z.ZodString;
1086
1185
  workProjectId: z.ZodOptional<z.ZodString>;
1087
1186
  videoAssetId: z.ZodString;
1088
- mediaType: z.ZodOptional<z.ZodEnum<{
1187
+ mediaType: z.ZodEnum<{
1089
1188
  video: "video";
1090
- image: "image";
1091
- other: "other";
1092
- }>>;
1189
+ }>;
1093
1190
  createdBy: z.ZodObject<{
1094
1191
  uid: z.ZodString;
1095
1192
  }, z.core.$strip>;
@@ -2023,12 +2120,6 @@ export declare const COLLECTION_SCHEMAS: {
2023
2120
  thresholdItemId: z.ZodString;
2024
2121
  hallItemId: z.ZodString;
2025
2122
  }, z.core.$strict>;
2026
- }, z.core.$strict>, z.ZodObject<{
2027
- type: z.ZodLiteral<"thresholdLibrary.rejected">;
2028
- ids: z.ZodObject<{
2029
- thresholdItemId: z.ZodString;
2030
- hallItemId: z.ZodString;
2031
- }, z.core.$strict>;
2032
2123
  }, z.core.$strict>, z.ZodObject<{
2033
2124
  type: z.ZodLiteral<"thresholdLibrary.needsRevision">;
2034
2125
  ids: z.ZodObject<{
@@ -2465,12 +2556,6 @@ export declare const COLLECTION_SCHEMAS: {
2465
2556
  thresholdItemId: z.ZodString;
2466
2557
  hallItemId: z.ZodString;
2467
2558
  }, z.core.$strict>;
2468
- }, z.core.$strict>, z.ZodObject<{
2469
- type: z.ZodLiteral<"thresholdLibrary.rejected">;
2470
- ids: z.ZodObject<{
2471
- thresholdItemId: z.ZodString;
2472
- hallItemId: z.ZodString;
2473
- }, z.core.$strict>;
2474
2559
  }, z.core.$strict>, z.ZodObject<{
2475
2560
  type: z.ZodLiteral<"thresholdLibrary.needsRevision">;
2476
2561
  ids: z.ZodObject<{
@@ -2838,12 +2923,6 @@ export declare const COLLECTION_SCHEMAS: {
2838
2923
  thresholdItemId: z.ZodString;
2839
2924
  hallItemId: z.ZodString;
2840
2925
  }, z.core.$strict>;
2841
- }, z.core.$strict>, z.ZodObject<{
2842
- type: z.ZodLiteral<"thresholdLibrary.rejected">;
2843
- ids: z.ZodObject<{
2844
- thresholdItemId: z.ZodString;
2845
- hallItemId: z.ZodString;
2846
- }, z.core.$strict>;
2847
2926
  }, z.core.$strict>, z.ZodObject<{
2848
2927
  type: z.ZodLiteral<"thresholdLibrary.needsRevision">;
2849
2928
  ids: z.ZodObject<{
@@ -3282,12 +3361,6 @@ export declare const COLLECTION_SCHEMAS: {
3282
3361
  thresholdItemId: z.ZodString;
3283
3362
  hallItemId: z.ZodString;
3284
3363
  }, z.core.$strict>;
3285
- }, z.core.$strict>, z.ZodObject<{
3286
- type: z.ZodLiteral<"thresholdLibrary.rejected">;
3287
- ids: z.ZodObject<{
3288
- thresholdItemId: z.ZodString;
3289
- hallItemId: z.ZodString;
3290
- }, z.core.$strict>;
3291
3364
  }, z.core.$strict>, z.ZodObject<{
3292
3365
  type: z.ZodLiteral<"thresholdLibrary.needsRevision">;
3293
3366
  ids: z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/registry.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,CAAC,EAAE,MA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyNkB,CAAC;AAElD,MAAM,MAAM,wBAAwB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAEvE;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;CAmBiC,CAAC;AAEvE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAOvC,CAAC"}
@@ -76,6 +76,10 @@ export const COLLECTION_SCHEMAS = {
76
76
  'workRealms/{workRealmId}': WorkRealmSchema,
77
77
  'guildInviteConversations/{guildInviteId}': GuildInviteConversationSchema,
78
78
  // ===== Square / Social =====
79
+ // SquareStreetzPostSchema is a refined ZodObject (superRefine for the MEDIA-101
80
+ // mediaAssetId↔mediaType pair invariant); the schema-doc generator and the
81
+ // drift-check both unwrap the effect to introspect its shape, so binding the
82
+ // refined schema here is correct.
79
83
  'squareStreetzFeed/activePosts/socialPosts/{postId}': SquareStreetzPostSchema,
80
84
  'squareStreetzFeed/trendingPosts': TrendingPostsSchema,
81
85
  'followEdges/{followEdgeId}': FollowEdgeSchema,