@ttt-productions/ttt-core 0.79.92 → 0.79.93

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 (33) hide show
  1. package/dist/constants/company-mascots.d.ts +27 -2
  2. package/dist/constants/company-mascots.d.ts.map +1 -1
  3. package/dist/constants/company-mascots.js +66 -6
  4. package/dist/constants/company-mascots.js.map +1 -1
  5. package/dist/doc-schemas/media-assets.d.ts +6 -0
  6. package/dist/doc-schemas/media-assets.d.ts.map +1 -1
  7. package/dist/doc-schemas/media-assets.js +8 -0
  8. package/dist/doc-schemas/media-assets.js.map +1 -1
  9. package/dist/doc-schemas/payments.d.ts +4 -0
  10. package/dist/doc-schemas/payments.d.ts.map +1 -1
  11. package/dist/doc-schemas/payments.js +7 -3
  12. package/dist/doc-schemas/payments.js.map +1 -1
  13. package/dist/doc-schemas/safety/foundation.d.ts +44 -20
  14. package/dist/doc-schemas/safety/foundation.d.ts.map +1 -1
  15. package/dist/doc-schemas/safety/foundation.js +96 -52
  16. package/dist/doc-schemas/safety/foundation.js.map +1 -1
  17. package/dist/media/publication/publication-args.d.ts +0 -2
  18. package/dist/media/publication/publication-args.d.ts.map +1 -1
  19. package/dist/media/publication/publication-args.js +31 -33
  20. package/dist/media/publication/publication-args.js.map +1 -1
  21. package/dist/paths/collection-refs.d.ts +1 -0
  22. package/dist/paths/collection-refs.d.ts.map +1 -1
  23. package/dist/paths/collection-refs.js +3 -0
  24. package/dist/paths/collection-refs.js.map +1 -1
  25. package/dist/schemas/notification.d.ts +14 -7
  26. package/dist/schemas/notification.d.ts.map +1 -1
  27. package/dist/schemas/notification.js +42 -23
  28. package/dist/schemas/notification.js.map +1 -1
  29. package/dist/utils/pledge-totals.d.ts +3 -0
  30. package/dist/utils/pledge-totals.d.ts.map +1 -1
  31. package/dist/utils/pledge-totals.js +6 -0
  32. package/dist/utils/pledge-totals.js.map +1 -1
  33. package/package.json +1 -1
@@ -177,6 +177,10 @@ export declare const PledgeRefundRequestStatusSchema: z.ZodEnum<{
177
177
  initiated: "initiated";
178
178
  }>;
179
179
  export type PledgeRefundRequestStatus = z.infer<typeof PledgeRefundRequestStatusSchema>;
180
+ /** What a Stripe refund event settles a request to: completed once the pledge is fully refunded,
181
+ * failed when the refund it carried failed. */
182
+ export declare const PLEDGE_REFUND_EVENT_REQUEST_STATUSES: readonly ["completed", "failed"];
183
+ export type PledgeRefundEventRequestStatus = (typeof PLEDGE_REFUND_EVENT_REQUEST_STATUSES)[number];
180
184
  /** The statuses of a request in flight. A failed request is open too until its follow-up is resolved. */
181
185
  export declare const PLEDGE_REFUND_OPEN_STATUSES: readonly ["requested", "approving", "initiated"];
182
186
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/payments.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,uGAAuG;AACvG,eAAO,MAAM,oBAAoB,sCAAuC,CAAC;AACzE,eAAO,MAAM,uBAAuB;;;;EAA+B,CAAC;AACpE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,qGAAqG;AACrG,eAAO,MAAM,qBAAqB,iDAAkD,CAAC;AACrF,eAAO,MAAM,wBAAwB;;;;;EAAgC,CAAC;AACtE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAS1E,qFAAqF;AACrF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAExE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAEhG;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE;IAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAA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;;;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;AAOtF,eAAO,MAAM,8BAA8B,mFAOjC,CAAC;AACX,eAAO,MAAM,+BAA+B;;;;;;;EAAyC,CAAC;AACtF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;+CAC+C;AAC/C,eAAO,MAAM,oCAAoC,kCAGQ,CAAC;AAC1D,MAAM,MAAM,8BAA8B,GAAG,CAAC,OAAO,oCAAoC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnG,yGAAyG;AACzG,eAAO,MAAM,2BAA2B,kDAIiB,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,2BAA2B,CAAC,GACzE,OAAO,CAGT;AAED,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;iBAoBpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -2,8 +2,6 @@
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 ttt-prod docs/design/donation-payment-system.md (the design owner for the
6
- // pledge/Stripe flow).
7
5
  import { z } from 'zod';
8
6
  import { LegalReviewNoticeReceiptSchema } from './legal-review-notice.js';
9
7
  import { MAX_INTERNAL_REASON_LENGTH } from '../constants/business-admin.js';
@@ -111,7 +109,7 @@ export const PledgePaymentProviderRefSchema = z.object({
111
109
  // Server timestamp (ms) of the checkout's 18+/public-disclosure attestation, stamped at session
112
110
  // creation and carried through Stripe metadata. A paid session missing it is quarantined. It is
113
111
  // fraud-evidence plumbing, not transparency data, so it rides THIS server-only doc and never the
114
- // member-readable pledgePayments ledger (docs/design/donation-payment-system.md § Data model).
112
+ // member-readable pledgePayments ledger.
115
113
  ageAttestedAt: z.number(),
116
114
  // The founder legal-review notice acknowledgment given at checkout (its own required checkbox
117
115
  // on every pledge while the notice is active): the revision and server time, stamped at session
@@ -216,6 +214,12 @@ export const PLEDGE_REFUND_REQUEST_STATUSES = [
216
214
  'failed',
217
215
  ];
218
216
  export const PledgeRefundRequestStatusSchema = z.enum(PLEDGE_REFUND_REQUEST_STATUSES);
217
+ /** What a Stripe refund event settles a request to: completed once the pledge is fully refunded,
218
+ * failed when the refund it carried failed. */
219
+ export const PLEDGE_REFUND_EVENT_REQUEST_STATUSES = [
220
+ 'completed',
221
+ 'failed',
222
+ ];
219
223
  /** The statuses of a request in flight. A failed request is open too until its follow-up is resolved. */
220
224
  export const PLEDGE_REFUND_OPEN_STATUSES = [
221
225
  'requested',
@@ -1 +1 @@
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;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAE5E,uGAAuG;AACvG,MAAM,CAAC,MAAM,oBAAoB,G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CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;IACxE,CAAC;AACH,CAAC,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';\nimport { LegalReviewNoticeReceiptSchema } from './legal-review-notice.js';\nimport { MAX_INTERNAL_REASON_LENGTH } from '../constants/business-admin.js';\n\n/** How much of a pledge has been refunded: `partial` while some net remains, `full` once none does. */\nexport const PLEDGE_REFUND_STATES = ['none', 'partial', 'full'] as const;\nexport const PledgeRefundStateSchema = z.enum(PLEDGE_REFUND_STATES);\nexport type PledgeRefundState = z.infer<typeof PledgeRefundStateSchema>;\n\n/** Where a chargeback dispute stands: `underReview` while open, then `won` or `lost` once closed. */\nexport const PLEDGE_DISPUTE_STATES = ['none', 'underReview', 'won', 'lost'] as const;\nexport const PledgeDisputeStateSchema = z.enum(PLEDGE_DISPUTE_STATES);\nexport type PledgeDisputeState = z.infer<typeof PledgeDisputeStateSchema>;\n\nconst PLEDGE_DISPUTE_STATE_RANK: Record<PledgeDisputeState, number> = {\n none: 0,\n underReview: 1,\n won: 2,\n lost: 2,\n};\n\n/** A dispute state's place on the one-way ladder none < underReview < won | lost. */\nexport function pledgeDisputeStateRank(state: PledgeDisputeState): number {\n return PLEDGE_DISPUTE_STATE_RANK[state];\n}\n\n/**\n * Whether moving ONE dispute from `from` to `to` goes up the ladder. Stripe can deliver a\n * dispute's events late or twice, so within one dispute a closed dispute never reopens to\n * `underReview`, and `won` and `lost` never replace each other.\n */\nexport function isPledgeDisputeAdvance(from: PledgeDisputeState, to: PledgeDisputeState): boolean {\n return pledgeDisputeStateRank(to) > pledgeDisputeStateRank(from);\n}\n\n/**\n * Whether a dispute event may set the pledge's dispute state. The ladder holds per dispute: an\n * event for a different dispute than the recorded `disputeId` (the first one, or a later dispute\n * on the same charge) starts its own ladder, and an event for the recorded dispute applies only as\n * an advance. Ordering across disputes is the observation stamp's job — the handler first refuses\n * an event no newer than `disputeObservedAt`, so a late event of an earlier dispute never lands.\n */\nexport function isPledgeDisputeEventApplicable(\n recorded: { disputeId: string | null; state: PledgeDisputeState },\n event: { disputeId: string; state: PledgeDisputeState },\n): boolean {\n if (recorded.disputeId !== event.disputeId) return true;\n return isPledgeDisputeAdvance(recorded.state, event.state);\n}\n\n/**\n * The pledge's dispute number for a dispute event: the recorded number while the event is about the\n * recorded dispute (the provider ref's `disputeId`), one more for any other dispute — so the first\n * dispute is 1 and each later one adds one. The number is what the member-readable pledge carries in\n * place of Stripe's dispute id, which stays on the server-only provider ref.\n */\nexport function pledgeDisputeNumberForEvent(\n recorded: { disputeId: string | null; disputeNumber: number },\n eventDisputeId: string,\n): number {\n return recorded.disputeId === eventDisputeId ? recorded.disputeNumber : recorded.disputeNumber + 1;\n}\n\n/**\n * Whether a pledge's dispute fields may move from `before` to `after` — the rule an integrity check\n * reads from the pledge alone. Under the same dispute number the state only climbs the ladder (or stays,\n * as a redelivery or a refund leaves it); a number one higher is a new dispute, which starts its own\n * ladder at any state but `none` (its close may arrive before its opening). Any other number change is\n * not a legal transition.\n */\nexport function isPledgeDisputeTransitionLegal(\n before: { disputeNumber: number; disputeState: PledgeDisputeState },\n after: { disputeNumber: number; disputeState: PledgeDisputeState },\n): boolean {\n if (after.disputeNumber === before.disputeNumber) {\n return after.disputeState === before.disputeState || isPledgeDisputeAdvance(before.disputeState, after.disputeState);\n }\n if (after.disputeNumber === before.disputeNumber + 1) return after.disputeState !== 'none';\n return false;\n}\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, by the Stripe webhook alone. netAmount = max(0, amount - refundedAmount - disputeLostAmount)\n// is the sum() target; the refund and dispute handlers recompute it from Stripe's totals.\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, from the Charge's amount_refunded; 0 on a new pledge\n disputeLostAmount: z.number(), // cents withdrawn on a lost dispute; 0 otherwise\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: PledgeRefundStateSchema,\n disputeState: PledgeDisputeStateSchema,\n // How many disputes the pledge has had: 0 until the first, then 1, 2, … (pledgeDisputeNumberForEvent).\n // It tells one dispute from the next on this member-readable doc; Stripe's dispute id stays on the\n // server-only provider ref.\n disputeNumber: z.number().int().nonnegative(),\n // NO ageAttestedAt here: age-attestation evidence is server-only and lives on\n // PledgePaymentProviderRefSchema. This doc is auth-readable by every signed-in member.\n createdAt: z.number(),\n updatedAt: z.number(),\n}).superRefine((val, ctx) => {\n if ((val.disputeNumber === 0) !== (val.disputeState === 'none')) {\n ctx.addIssue({ code: 'custom', path: ['disputeNumber'] });\n }\n});\nexport type PledgePayment = z.infer<typeof PledgePaymentSchema>;\n\n// pledgePaymentProviderRefs/{pledgePaymentId} — server-only Stripe references for reconciliation\n// and refund/dispute lookup, PLUS the age-attestation consent evidence. Rule is permanently\n// `if false` (Admin SDK only) so no Stripe IDs ever sit on an auth-readable doc. One doc per pledge\n// (singular).\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()), // every Stripe refund id seen on the charge; [] on a new pledge\n disputeId: z.string().nullable(), // the dispute the ledger's disputeState describes (the latest opened), null until one opens\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. It is\n // fraud-evidence plumbing, not transparency data, so it rides THIS server-only doc and never the\n // member-readable pledgePayments ledger (docs/design/donation-payment-system.md § Data model).\n ageAttestedAt: z.number(),\n // The founder legal-review notice acknowledgment given at checkout (its own required checkbox\n // on every pledge while the notice is active): the revision and server time, stamped at session\n // creation and carried through the Stripe metadata like `ageAttestedAt`. Absent when the notice\n // was off. Evidence, not transparency data — it rides this server-only doc only.\n legalReviewNotice: LegalReviewNoticeReceiptSchema.optional(),\n // The refund an approval asks Stripe for: written in the transaction that moves its request to\n // `approving` (before Stripe is called), `refundId` stamped once Stripe answers, removed when the\n // request reaches `completed` or `failed`. A request is finished only by a refund matching it.\n refundCorrelation: z\n .object({\n requestId: z.string().min(1),\n intendedAmount: z.number().int().positive(),\n refundId: z.string().min(1).optional(),\n })\n .optional(),\n // The Stripe event time (epoch ms) the refund handler and the dispute handler last applied. Stripe\n // can deliver events out of order, so each handler applies an event only when it is newer.\n refundObservedAt: z.number().optional(),\n disputeObservedAt: z.number().optional(),\n // Stripe's reason for the last failed refund, kept server-side for the admin following up.\n lastRefundFailureReason: z.string().max(MAX_INTERNAL_REASON_LENGTH).optional(),\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); the refund and dispute handlers adjust it in the transaction that changes the pledge,\n// through pledgePaymentTotalsOf (utils/pledge-totals). 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} — a supporter's pledge refund request. Lifecycle: requested →\n// (admin approves) approving → initiated → completed, or → failed when Stripe reports the refund\n// failed, which raises a pledgeRefundFailed admin task; requested → denied by an admin. A full refund of the pledge from anywhere, the Stripe\n// Dashboard included, completes an open request. NO Stripe ids on this doc — they live on\n// pledgePaymentProviderRefs. Server-only writes. Timestamps are epoch-millis numbers.\nexport const PLEDGE_REFUND_REQUEST_STATUSES = [\n 'requested',\n 'approving',\n 'initiated',\n 'denied',\n 'completed',\n 'failed',\n] as const;\nexport const PledgeRefundRequestStatusSchema = z.enum(PLEDGE_REFUND_REQUEST_STATUSES);\nexport type PledgeRefundRequestStatus = z.infer<typeof PledgeRefundRequestStatusSchema>;\n\n/** The statuses of a request in flight. A failed request is open too until its follow-up is resolved. */\nexport const PLEDGE_REFUND_OPEN_STATUSES = [\n 'requested',\n 'approving',\n 'initiated',\n] as const satisfies readonly PledgeRefundRequestStatus[];\n\n/**\n * Whether a request still blocks a new one for its pledge (a pledge has at most one open request):\n * in flight, or failed while an admin is still following the failure up — the supporter may not\n * ask again until that follow-up is resolved.\n */\nexport function isPledgeRefundRequestOpen(\n request: Pick<PledgeRefundRequest, 'status' | 'failureFollowUpResolvedAt'>,\n): boolean {\n if (request.status === 'failed') return request.failureFollowUpResolvedAt === undefined;\n return (PLEDGE_REFUND_OPEN_STATUSES as readonly PledgeRefundRequestStatus[]).includes(request.status);\n}\n\nexport const PledgeRefundRequestSchema = z.object({\n pledgePaymentId: z.string(),\n userId: z.string(),\n amount: z.number(),\n status: PledgeRefundRequestStatusSchema,\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 approvingAt: z.number().optional(), // when an admin's approval began, before Stripe was called\n completedAt: z.number().optional(),\n failedAt: z.number().optional(), // when Stripe reported the refund failed\n // When an admin resolved the failed refund's follow-up task (the refund decision that closes it).\n // Only a failed request carries it; until it is set, the failed request keeps its pledge open.\n failureFollowUpResolvedAt: z.number().optional(),\n}).superRefine((val, ctx) => {\n if (val.failureFollowUpResolvedAt !== undefined && val.status !== 'failed') {\n ctx.addIssue({ code: 'custom', path: ['failureFollowUpResolvedAt'] });\n }\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;AAEtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAE5E,uGAAuG;AACvG,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAU,CAAC;AACzE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAGpE,qGAAqG;AACrG,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,CAAU,CAAC;AACrF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AAGt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C,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,+BAA+B;IACvC,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,EAAE,2DAA2D;IAC/F,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,yCAAyC;IAC1E,kGAAkG;IAClG,+FAA+F;IAC/F,yBAAyB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IAC1B,IAAI,GAAG,CAAC,yBAAyB,KAAK,SAAS,IAAI,GAAG,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC3E,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;IACxE,CAAC;AACH,CAAC,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\nimport { z } from 'zod';\nimport { LegalReviewNoticeReceiptSchema } from './legal-review-notice.js';\nimport { MAX_INTERNAL_REASON_LENGTH } from '../constants/business-admin.js';\n\n/** How much of a pledge has been refunded: `partial` while some net remains, `full` once none does. */\nexport const PLEDGE_REFUND_STATES = ['none', 'partial', 'full'] as const;\nexport const PledgeRefundStateSchema = z.enum(PLEDGE_REFUND_STATES);\nexport type PledgeRefundState = z.infer<typeof PledgeRefundStateSchema>;\n\n/** Where a chargeback dispute stands: `underReview` while open, then `won` or `lost` once closed. */\nexport const PLEDGE_DISPUTE_STATES = ['none', 'underReview', 'won', 'lost'] as const;\nexport const PledgeDisputeStateSchema = z.enum(PLEDGE_DISPUTE_STATES);\nexport type PledgeDisputeState = z.infer<typeof PledgeDisputeStateSchema>;\n\nconst PLEDGE_DISPUTE_STATE_RANK: Record<PledgeDisputeState, number> = {\n none: 0,\n underReview: 1,\n won: 2,\n lost: 2,\n};\n\n/** A dispute state's place on the one-way ladder none < underReview < won | lost. */\nexport function pledgeDisputeStateRank(state: PledgeDisputeState): number {\n return PLEDGE_DISPUTE_STATE_RANK[state];\n}\n\n/**\n * Whether moving ONE dispute from `from` to `to` goes up the ladder. Stripe can deliver a\n * dispute's events late or twice, so within one dispute a closed dispute never reopens to\n * `underReview`, and `won` and `lost` never replace each other.\n */\nexport function isPledgeDisputeAdvance(from: PledgeDisputeState, to: PledgeDisputeState): boolean {\n return pledgeDisputeStateRank(to) > pledgeDisputeStateRank(from);\n}\n\n/**\n * Whether a dispute event may set the pledge's dispute state. The ladder holds per dispute: an\n * event for a different dispute than the recorded `disputeId` (the first one, or a later dispute\n * on the same charge) starts its own ladder, and an event for the recorded dispute applies only as\n * an advance. Ordering across disputes is the observation stamp's job — the handler first refuses\n * an event no newer than `disputeObservedAt`, so a late event of an earlier dispute never lands.\n */\nexport function isPledgeDisputeEventApplicable(\n recorded: { disputeId: string | null; state: PledgeDisputeState },\n event: { disputeId: string; state: PledgeDisputeState },\n): boolean {\n if (recorded.disputeId !== event.disputeId) return true;\n return isPledgeDisputeAdvance(recorded.state, event.state);\n}\n\n/**\n * The pledge's dispute number for a dispute event: the recorded number while the event is about the\n * recorded dispute (the provider ref's `disputeId`), one more for any other dispute — so the first\n * dispute is 1 and each later one adds one. The number is what the member-readable pledge carries in\n * place of Stripe's dispute id, which stays on the server-only provider ref.\n */\nexport function pledgeDisputeNumberForEvent(\n recorded: { disputeId: string | null; disputeNumber: number },\n eventDisputeId: string,\n): number {\n return recorded.disputeId === eventDisputeId ? recorded.disputeNumber : recorded.disputeNumber + 1;\n}\n\n/**\n * Whether a pledge's dispute fields may move from `before` to `after` — the rule an integrity check\n * reads from the pledge alone. Under the same dispute number the state only climbs the ladder (or stays,\n * as a redelivery or a refund leaves it); a number one higher is a new dispute, which starts its own\n * ladder at any state but `none` (its close may arrive before its opening). Any other number change is\n * not a legal transition.\n */\nexport function isPledgeDisputeTransitionLegal(\n before: { disputeNumber: number; disputeState: PledgeDisputeState },\n after: { disputeNumber: number; disputeState: PledgeDisputeState },\n): boolean {\n if (after.disputeNumber === before.disputeNumber) {\n return after.disputeState === before.disputeState || isPledgeDisputeAdvance(before.disputeState, after.disputeState);\n }\n if (after.disputeNumber === before.disputeNumber + 1) return after.disputeState !== 'none';\n return false;\n}\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, by the Stripe webhook alone. netAmount = max(0, amount - refundedAmount - disputeLostAmount)\n// is the sum() target; the refund and dispute handlers recompute it from Stripe's totals.\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, from the Charge's amount_refunded; 0 on a new pledge\n disputeLostAmount: z.number(), // cents withdrawn on a lost dispute; 0 otherwise\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: PledgeRefundStateSchema,\n disputeState: PledgeDisputeStateSchema,\n // How many disputes the pledge has had: 0 until the first, then 1, 2, … (pledgeDisputeNumberForEvent).\n // It tells one dispute from the next on this member-readable doc; Stripe's dispute id stays on the\n // server-only provider ref.\n disputeNumber: z.number().int().nonnegative(),\n // NO ageAttestedAt here: age-attestation evidence is server-only and lives on\n // PledgePaymentProviderRefSchema. This doc is auth-readable by every signed-in member.\n createdAt: z.number(),\n updatedAt: z.number(),\n}).superRefine((val, ctx) => {\n if ((val.disputeNumber === 0) !== (val.disputeState === 'none')) {\n ctx.addIssue({ code: 'custom', path: ['disputeNumber'] });\n }\n});\nexport type PledgePayment = z.infer<typeof PledgePaymentSchema>;\n\n// pledgePaymentProviderRefs/{pledgePaymentId} — server-only Stripe references for reconciliation\n// and refund/dispute lookup, PLUS the age-attestation consent evidence. Rule is permanently\n// `if false` (Admin SDK only) so no Stripe IDs ever sit on an auth-readable doc. One doc per pledge\n// (singular).\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()), // every Stripe refund id seen on the charge; [] on a new pledge\n disputeId: z.string().nullable(), // the dispute the ledger's disputeState describes (the latest opened), null until one opens\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. It is\n // fraud-evidence plumbing, not transparency data, so it rides THIS server-only doc and never the\n // member-readable pledgePayments ledger.\n ageAttestedAt: z.number(),\n // The founder legal-review notice acknowledgment given at checkout (its own required checkbox\n // on every pledge while the notice is active): the revision and server time, stamped at session\n // creation and carried through the Stripe metadata like `ageAttestedAt`. Absent when the notice\n // was off. Evidence, not transparency data — it rides this server-only doc only.\n legalReviewNotice: LegalReviewNoticeReceiptSchema.optional(),\n // The refund an approval asks Stripe for: written in the transaction that moves its request to\n // `approving` (before Stripe is called), `refundId` stamped once Stripe answers, removed when the\n // request reaches `completed` or `failed`. A request is finished only by a refund matching it.\n refundCorrelation: z\n .object({\n requestId: z.string().min(1),\n intendedAmount: z.number().int().positive(),\n refundId: z.string().min(1).optional(),\n })\n .optional(),\n // The Stripe event time (epoch ms) the refund handler and the dispute handler last applied. Stripe\n // can deliver events out of order, so each handler applies an event only when it is newer.\n refundObservedAt: z.number().optional(),\n disputeObservedAt: z.number().optional(),\n // Stripe's reason for the last failed refund, kept server-side for the admin following up.\n lastRefundFailureReason: z.string().max(MAX_INTERNAL_REASON_LENGTH).optional(),\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); the refund and dispute handlers adjust it in the transaction that changes the pledge,\n// through pledgePaymentTotalsOf (utils/pledge-totals). 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} — a supporter's pledge refund request. Lifecycle: requested →\n// (admin approves) approving → initiated → completed, or → failed when Stripe reports the refund\n// failed, which raises a pledgeRefundFailed admin task; requested → denied by an admin. A full refund of the pledge from anywhere, the Stripe\n// Dashboard included, completes an open request. NO Stripe ids on this doc — they live on\n// pledgePaymentProviderRefs. Server-only writes. Timestamps are epoch-millis numbers.\nexport const PLEDGE_REFUND_REQUEST_STATUSES = [\n 'requested',\n 'approving',\n 'initiated',\n 'denied',\n 'completed',\n 'failed',\n] as const;\nexport const PledgeRefundRequestStatusSchema = z.enum(PLEDGE_REFUND_REQUEST_STATUSES);\nexport type PledgeRefundRequestStatus = z.infer<typeof PledgeRefundRequestStatusSchema>;\n\n/** What a Stripe refund event settles a request to: completed once the pledge is fully refunded,\n * failed when the refund it carried failed. */\nexport const PLEDGE_REFUND_EVENT_REQUEST_STATUSES = [\n 'completed',\n 'failed',\n] as const satisfies readonly PledgeRefundRequestStatus[];\nexport type PledgeRefundEventRequestStatus = (typeof PLEDGE_REFUND_EVENT_REQUEST_STATUSES)[number];\n\n/** The statuses of a request in flight. A failed request is open too until its follow-up is resolved. */\nexport const PLEDGE_REFUND_OPEN_STATUSES = [\n 'requested',\n 'approving',\n 'initiated',\n] as const satisfies readonly PledgeRefundRequestStatus[];\n\n/**\n * Whether a request still blocks a new one for its pledge (a pledge has at most one open request):\n * in flight, or failed while an admin is still following the failure up — the supporter may not\n * ask again until that follow-up is resolved.\n */\nexport function isPledgeRefundRequestOpen(\n request: Pick<PledgeRefundRequest, 'status' | 'failureFollowUpResolvedAt'>,\n): boolean {\n if (request.status === 'failed') return request.failureFollowUpResolvedAt === undefined;\n return (PLEDGE_REFUND_OPEN_STATUSES as readonly PledgeRefundRequestStatus[]).includes(request.status);\n}\n\nexport const PledgeRefundRequestSchema = z.object({\n pledgePaymentId: z.string(),\n userId: z.string(),\n amount: z.number(),\n status: PledgeRefundRequestStatusSchema,\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 approvingAt: z.number().optional(), // when an admin's approval began, before Stripe was called\n completedAt: z.number().optional(),\n failedAt: z.number().optional(), // when Stripe reported the refund failed\n // When an admin resolved the failed refund's follow-up task (the refund decision that closes it).\n // Only a failed request carries it; until it is set, the failed request keeps its pledge open.\n failureFollowUpResolvedAt: z.number().optional(),\n}).superRefine((val, ctx) => {\n if (val.failureFollowUpResolvedAt !== undefined && val.status !== 'failed') {\n ctx.addIssue({ code: 'custom', path: ['failureFollowUpResolvedAt'] });\n }\n});\nexport type PledgeRefundRequest = z.infer<typeof PledgeRefundRequestSchema>;\n"]}
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- /** The controlling report-reason taxonomy (fixes the client/server drift
3
- * TS-032). The two protected reasons fork into a childSafetyCase / nciiCase. */
2
+ /** The controlling report-reason taxonomy, shared by client and server. The two protected
3
+ * reasons fork into a childSafetyCase / nciiCase. */
4
4
  export declare const ReportReasonSchema: z.ZodEnum<{
5
5
  Spam: "Spam";
6
6
  Harassment: "Harassment";
@@ -47,7 +47,7 @@ export declare const ReportableItemTypeSchema: z.ZodEnum<{
47
47
  }>;
48
48
  export type ReportableItemType = z.infer<typeof ReportableItemTypeSchema>;
49
49
  /** The DO-transported chat report types — no Firestore message doc / owner exists to
50
- * hold at intake (H-04 V1); the resolver goes through the signed chat-Worker context
50
+ * hold at intake; the resolver goes through the signed chat-Worker context
51
51
  * read. These are the ONLY reportable message surfaces. Derived subset — compile-linked
52
52
  * to the canonical enum, never a re-declared string set. */
53
53
  export declare const CHAT_REPORT_ITEM_TYPES: readonly ["guild-chat-message", "guild-invite-message"];
@@ -55,8 +55,32 @@ export declare const CHAT_REPORT_ITEM_TYPES: readonly ["guild-chat-message", "gu
55
55
  * the backend moderation cores accept these. Compile-linked subset of the enum. */
56
56
  export declare const CONTENT_ACTION_PANEL_ITEM_TYPES: readonly ["square-streetz-post", "audition", "audition-entry", "commission-listing", "commission-proposal", "work-asset", "profile-picture", "hall-library-item", "hall-library-sub-item", "craft-skill", "conversation-file"];
57
57
  export type ContentActionPanelItemType = (typeof CONTENT_ACTION_PANEL_ITEM_TYPES)[number];
58
- /** Discriminated locator — replaces every all-optional `contentRef`. Every
59
- * hideable surface in report-config.ts has a typed locator ([H-02]). */
58
+ /** Single-doc content the moderation hide/restore core resolves to one doc with one `hidden` flag.
59
+ * A craft skill is not one: it is denormalized across its per-user doc and tag-index mirrors, so
60
+ * the hide owner reads it as its own set of documents. */
61
+ export declare const MODERATABLE_ITEM_TYPES: readonly ["square-streetz-post", "audition", "audition-entry", "commission-listing", "commission-proposal", "work-asset", "profile-picture", "hall-library-item", "conversation-file"];
62
+ export type ModeratableItemType = (typeof MODERATABLE_ITEM_TYPES)[number];
63
+ /** Moderation types whose canonical doc has NO doc-level `hidden` flag (a strict mediaAsset doc, a
64
+ * userProfile that must never be wholesale-hidden, a Conversation File record that carries
65
+ * references only): hiding one IS the media-serving deny on its asset. */
66
+ export declare const MEDIA_SERVING_ONLY_ITEM_TYPES: readonly ["work-asset", "profile-picture", "conversation-file"];
67
+ export type MediaServingOnlyItemType = (typeof MEDIA_SERVING_ONLY_ITEM_TYPES)[number];
68
+ /** Types moderated by a block on their own mediaAssetId, never an owner-level block: their
69
+ * processor's owner key is not the reported asset id, so an owner block would never match at the
70
+ * serving Worker. */
71
+ export declare const ASSET_LEVEL_BLOCK_ITEM_TYPES: readonly ["work-asset", "conversation-file"];
72
+ export type AssetLevelBlockItemType = (typeof ASSET_LEVEL_BLOCK_ITEM_TYPES)[number];
73
+ /** Reported targets the admin's single-doc content remedies (hide, restore, perma-remove) apply
74
+ * to. A Conversation File is the other shared-file surface, so it takes the same remedies as a
75
+ * Work file. */
76
+ export declare const SINGLE_DOC_TARGET_TYPES: readonly ["square-streetz-post", "audition", "audition-entry", "commission-listing", "commission-proposal", "work-asset", "profile-picture", "hall-library-item", "craft-skill", "conversation-file"];
77
+ /** The single-doc targets hide and restore apply to: a Hall sub-item is hide/restore-only (its core
78
+ * has no perma-remove), so it joins these and not perma-remove. */
79
+ export declare const SINGLE_DOC_HIDE_RESTORE_TARGET_TYPES: readonly ["square-streetz-post", "audition", "audition-entry", "commission-listing", "commission-proposal", "work-asset", "profile-picture", "hall-library-item", "craft-skill", "conversation-file", "hall-library-sub-item"];
80
+ /** Hall content reports whose admin content window offers the full-page Hall item preview. */
81
+ export declare const HALL_LIBRARY_TARGET_TYPES: readonly ["hall-library-item", "hall-library-sub-item"];
82
+ /** Discriminated locator, never an all-optional `contentRef`. Every hideable surface in
83
+ * report-config.ts has a typed locator. */
60
84
  export declare const TargetLocatorV1Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
61
85
  kind: z.ZodLiteral<"mediaAsset">;
62
86
  mediaAssetId: z.ZodString;
@@ -176,8 +200,8 @@ export declare const TargetLocatorSummaryV1Schema: z.ZodObject<{
176
200
  hasResolvedTarget: z.ZodBoolean;
177
201
  }, z.core.$strict>;
178
202
  export type TargetLocatorSummaryV1 = z.infer<typeof TargetLocatorSummaryV1Schema>;
179
- /** Case-level reporting determination (Finding-H6). The ONLY carrier of "no
180
- * NCMEC report required" — `notRequired` was removed from NcmecSubmissionState. */
203
+ /** Case-level reporting determination. The ONLY carrier of "no NCMEC report required" —
204
+ * NcmecSubmissionState has no `notRequired`. */
181
205
  export declare const ReportDispositionSchema: z.ZodEnum<{
182
206
  undetermined: "undetermined";
183
207
  reportRequired: "reportRequired";
@@ -185,7 +209,7 @@ export declare const ReportDispositionSchema: z.ZodEnum<{
185
209
  correctedNoApparentViolation: "correctedNoApparentViolation";
186
210
  }>;
187
211
  export type ReportDisposition = z.infer<typeof ReportDispositionSchema>;
188
- /** Reason codes for the privileged setReportDisposition command (§A9). The first five are the
212
+ /** Reason codes for the privileged setReportDisposition command. The first five are the
189
213
  * not-required / exception reasons (no NCMEC report ever arose, or a triggering signal was
190
214
  * corrected); the last two are the report-required reasons (a report IS legally required). The
191
215
  * disposition↔reason pairing is enforced by the ONE cross-field rule below (ARCH-102). */
@@ -205,7 +229,7 @@ export declare const REPORT_REQUIRED_DISPOSITION_REASON_CODES: readonly ["appare
205
229
  /** The not-required / exception reason codes — legal with every disposition that does NOT assert a
206
230
  * reporting obligation ('notRequired', 'correctedNoApparentViolation'). Compile-linked subset. */
207
231
  export declare const NOT_REQUIRED_DISPOSITION_REASON_CODES: readonly ["outOfScopeNotCsea", "basisInvalidatedFalseMatch", "duplicateOfFiledReport", "leDirectedNoReport", "nonReportableSafetyConfirmed"];
208
- /** The ONE cross-field pairing (§A9, ARCH-102): which reason codes each disposition permits.
232
+ /** The ONE cross-field pairing (ARCH-102): which reason codes each disposition permits.
209
233
  * Declared HERE once; both the setReportDisposition input (case.ts) and the SafetyDispositionAction
210
234
  * console command (admin.ts) apply `refineReportDispositionReasonCode` derived from this map rather
211
235
  * than re-declaring the pairing. 'undetermined' is the initial state, never an operator-settable
@@ -219,7 +243,7 @@ export declare function refineReportDispositionReasonCode(value: {
219
243
  disposition: ReportDisposition;
220
244
  dispositionReasonCode: ReportDispositionReasonCode;
221
245
  }, ctx: z.RefinementCtx): void;
222
- /** Shared cross-field rule (§A9): disposition 'reportRequired' MUST carry at least one evidence ref —
246
+ /** Shared cross-field rule: disposition 'reportRequired' MUST carry at least one evidence ref —
223
247
  * a reporting obligation can only be asserted once the evidence has been revealed. Every OTHER
224
248
  * disposition ('notRequired', 'correctedNoApparentViolation', 'undetermined') MAY leave evidenceRefs
225
249
  * empty. Declared HERE once (ARCH-102) and applied — alongside refineReportDispositionReasonCode — by
@@ -247,7 +271,7 @@ export declare const SafetyCaseClosureV1Schema: z.ZodObject<{
247
271
  closedAt: z.ZodNumber;
248
272
  }, z.core.$strict>;
249
273
  export type SafetyCaseClosureV1 = z.infer<typeof SafetyCaseClosureV1Schema>;
250
- /** NCMEC submission lifecycle — MANUAL-PORTAL model (§A9). NO `notRequired` (that is
274
+ /** NCMEC submission lifecycle — MANUAL-PORTAL model. NO `notRequired` (that is
251
275
  * ReportDisposition). There is no automated ispws API: a report-needed obligation sits in
252
276
  * `awaitingManualFiling` from enqueue until the operator files on the NCMEC portal and records the
253
277
  * confirmation (markNcmecPortalComplete → `completed`). Jobs are born `awaitingManualFiling`; the
@@ -272,7 +296,7 @@ export declare const SafetyHoldResourceTypeSchema: z.ZodEnum<{
272
296
  reportEvidenceObject: "reportEvidenceObject";
273
297
  }>;
274
298
  export type SafetyHoldResourceType = z.infer<typeof SafetyHoldResourceTypeSchema>;
275
- /** Lifecycle/retention regime governed by the A3 compatibility matrix. */
299
+ /** Lifecycle/retention regime governed by the hold compatibility matrix. */
276
300
  export declare const SafetyHoldClassSchema: z.ZodEnum<{
277
301
  childSafety: "childSafety";
278
302
  nciiTemporary: "nciiTemporary";
@@ -281,7 +305,7 @@ export declare const SafetyHoldClassSchema: z.ZodEnum<{
281
305
  ordinaryReport: "ordinaryReport";
282
306
  }>;
283
307
  export type SafetyHoldClass = z.infer<typeof SafetyHoldClassSchema>;
284
- /** Resource-scoped destructive command kinds (A3). */
308
+ /** Resource-scoped destructive command kinds. */
285
309
  export declare const SafetyCommandKindSchema: z.ZodEnum<{
286
310
  nciiRemoval: "nciiRemoval";
287
311
  csamActiveByteRemoval: "csamActiveByteRemoval";
@@ -337,7 +361,7 @@ export declare const TakeItDownPublicReasonCodeSchema: z.ZodEnum<{
337
361
  closedSeeNotice: "closedSeeNotice";
338
362
  }>;
339
363
  export type TakeItDownPublicReasonCode = z.infer<typeof TakeItDownPublicReasonCodeSchema>;
340
- /** Validity-failure reason codes ([H2]). `incomplete` is a COMPLETENESS state,
364
+ /** Validity-failure reason codes. `incomplete` is a COMPLETENESS state,
341
365
  * NEVER a validity state. */
342
366
  export declare const TakeItDownInvalidReasonCodeSchema: z.ZodEnum<{
343
367
  missingSignature: "missingSignature";
@@ -359,7 +383,7 @@ export declare const TakeItDownRequesterRoleSchema: z.ZodEnum<{
359
383
  authorizedRepresentative: "authorizedRepresentative";
360
384
  }>;
361
385
  export type TakeItDownRequesterRole = z.infer<typeof TakeItDownRequesterRoleSchema>;
362
- /** Two-axis state: completeness vs validity (H2). */
386
+ /** Two-axis state: completeness vs validity. */
363
387
  export declare const TakeItDownCompletenessStatusSchema: z.ZodEnum<{
364
388
  incomplete: "incomplete";
365
389
  complete: "complete";
@@ -384,7 +408,7 @@ export declare const TakeItDownPublicStatusSchema: z.ZodEnum<{
384
408
  invalidGeneralReason: "invalidGeneralReason";
385
409
  }>;
386
410
  export type TakeItDownPublicStatus = z.infer<typeof TakeItDownPublicStatusSchema>;
387
- /** Request action types ([L1]). */
411
+ /** Request action types. */
388
412
  export declare const NciiActionTypeSchema: z.ZodEnum<{
389
413
  intakeReceived: "intakeReceived";
390
414
  completenessDecided: "completenessDecided";
@@ -405,7 +429,7 @@ export declare const NciiActionResultSchema: z.ZodEnum<{
405
429
  rejected: "rejected";
406
430
  }>;
407
431
  export type NciiActionResult = z.infer<typeof NciiActionResultSchema>;
408
- /** Honest derived completion ([H4]) — never 'completed' for a partial failure. */
432
+ /** Honest derived completion — never 'completed' for a partial failure. */
409
433
  export declare const NciiRemovalCompletionOutcomeSchema: z.ZodEnum<{
410
434
  completed: "completed";
411
435
  completedWithApprovedException: "completedWithApprovedException";
@@ -439,9 +463,9 @@ export declare const NciiTerminalExceptionSchema: z.ZodEnum<{
439
463
  counselApprovedException: "counselApprovedException";
440
464
  }>;
441
465
  export type NciiTerminalException = z.infer<typeof NciiTerminalExceptionSchema>;
442
- /** Internal operational case status ([H7]).
466
+ /** Internal operational case status.
443
467
  *
444
- * [R12] close-lifecycle states: clicking **Close** (after the strict-closable gate passes)
468
+ * Close-lifecycle states: clicking **Close** (after the strict-closable gate passes)
445
469
  * applies the staged actions and moves the case to `processing` — it STAYS pinned/in-queue,
446
470
  * NEVER cleared on the click. The NCII removal worker flips the case to the terminal `closed`
447
471
  * ONLY on VERIFIED removal completion (clearing the pin via onSafetyCaseClosed). If the
@@ -458,7 +482,7 @@ export declare const NciiInternalStatusSchema: z.ZodEnum<{
458
482
  closed: "closed";
459
483
  }>;
460
484
  export type NciiInternalStatus = z.infer<typeof NciiInternalStatusSchema>;
461
- /** Child-safety linkage status on an NCII case ([H7]). */
485
+ /** Child-safety linkage status on an NCII case. */
462
486
  export declare const NciiChildSafetyLinkStatusSchema: z.ZodEnum<{
463
487
  none: "none";
464
488
  assessmentPending: "assessmentPending";
@@ -1 +1 @@
1
- {"version":3,"file":"foundation.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/safety/foundation.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB;gFACgF;AAChF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;EAa7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,2EAA2E;AAC3E,eAAO,MAAM,wBAAwB,0EAGO,CAAC;AAE7C,gEAAgE;AAChE,eAAO,MAAM,mBAAmB;;;EAA0C,CAAC;AAC3E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;qEAEqE;AACrE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;EA+BnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;;4DAG4D;AAC5D,eAAO,MAAM,sBAAsB,yDAGe,CAAC;AAEnD;mFACmF;AACnF,eAAO,MAAM,+BAA+B,gOAeM,CAAC;AACnD,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,CAAC,CAAC;AAO1F;wEACwE;AACxE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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