@ttt-productions/ttt-core 0.79.50 → 0.79.52

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.
@@ -93,6 +93,8 @@ export declare const MAX_DMCA_CONTACT_ROWS = 20;
93
93
  export declare const MAX_DMCA_CONTACT_LABEL_LENGTH = 100;
94
94
  export declare const MAX_DMCA_CONTACT_VALUE_LENGTH = 500;
95
95
  export declare const MAX_MAINTENANCE_MESSAGE_LENGTH = 2000;
96
+ /** `_appConfig/app.appVersion` — the force-refresh version string VersionGate compares. */
97
+ export declare const MAX_APP_VERSION_LENGTH = 64;
96
98
  /** Announcement-banner copy on `_appConfig/app.announcementMessage`. Deliberately far
97
99
  * shorter than the maintenance message: the announcement renders as a one-line banner
98
100
  * on the landing page and login screen, not a full-page takeover. */
@@ -1 +1 @@
1
- {"version":3,"file":"business-admin.d.ts","sourceRoot":"","sources":["../../src/constants/business-admin.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAEnF,eAAO,MAAM,oBAAoB;;;;;CAKvB,CAAC;AAEX;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB;;;;;IAK9B;;uDAEmD;;CAE3C,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAE/F,mFAAmF;AACnF,eAAO,MAAM,4BAA4B;;;;;CAK/B,CAAC;AAIX,yDAAyD;AACzD,eAAO,MAAM,iCAAiC,MAAM,CAAC;AAErD,qEAAqE;AACrE,eAAO,MAAM,sCAAsC,OAAO,CAAC;AAI3D,6DAA6D;AAC7D,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C;gEACgE;AAChE,eAAO,MAAM,iCAAiC,OAA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ANCE_MESSAGE_LENGTH = 2000;
111
+ /** `_appConfig/app.appVersion` — the force-refresh version string VersionGate compares. */
112
+ export const MAX_APP_VERSION_LENGTH = 64;
111
113
  /** Announcement-banner copy on `_appConfig/app.announcementMessage`. Deliberately far
112
114
  * shorter than the maintenance message: the announcement renders as a one-line banner
113
115
  * on the landing page and login screen, not a full-page takeover. */
@@ -1 +1 @@
1
- {"version":3,"file":"business-admin.js","sourceRoot":"","sources":["../../src/constants/business-admin.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,8DAA8D;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,qCAAqC;AAErC,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,QAAQ,EAAE,CAAC;IACX,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,GAAG,EAAE,CAAC;CACE,CAAC;AAIX,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,KAAK;CACA,CAAC;AAEX;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,EAAE,EAAE;IACP,MAAM,EAAE,GAAG;IACX,IAAI,EAAE,GAAG;IACT,QAAQ,EAAE,IAAI;IACd;;uDAEmD;IACnD,aAAa,EAAE,IAAI;CACX,CAAC;AAIX,mFAAmF;AACnF,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,mBAAmB,CAAC,GAAG;IAC5C,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC,MAAM;IAClD,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC,IAAI;IAC9C,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAC,QAAQ;CAC9C,CAAC;AAEX,2BAA2B;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C/B,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,YAAY;IACzB,UAAU,EAAE,WAAW;IACvB,SAAS,EAAE,WAAW;CACd,CAAC","sourcesContent":["// Admin + content-moderation business-rule constants — task priority, dispatches,\n// the moderation/feedback workflow, and admin-task lifecycle.\nimport { ACTIVE_LIMITS } from './app-mode.js';\n\n// --- Admin Task Priority System ---\n\nexport const TASK_PRIORITY = {\n CRITICAL: 4,\n HIGH: 3,\n NORMAL: 2,\n LOW: 1,\n} as const;\n\nexport type TaskPriorityLevel = (typeof TASK_PRIORITY)[keyof typeof TASK_PRIORITY];\n\nexport const TASK_PRIORITY_LABELS = {\n 4: 'CRITICAL',\n 3: 'HIGH',\n 2: 'NORMAL',\n 1: 'LOW',\n} as const;\n\n/**\n * Canonical NUMERIC priority scale for `adminTasks.priority`, shared by BOTH\n * priority systems so `checkoutNextImportantTask` (orderBy priority desc across all\n * task types) compares commensurable values. The userReport report-core score formula\n * already writes on this scale (≈40–2250); the level-based types (thresholdLibraryReview,\n * content-appeal, adminDispatch) map their TASK_PRIORITY level onto these numbers instead\n * of writing the raw 1–4.\n *\n * Resulting order: safety reports (1200–2250) > money anomalies (1100) >\n * CRITICAL (1000) > HIGH (800) > routine reports interleave below > spam-tier (~80).\n */\nexport const TASK_PRIORITY_SCORE = {\n LOW: 50,\n NORMAL: 200,\n HIGH: 800,\n CRITICAL: 1000,\n /** Money-integrity anomaly (stake-share / pledge-ledger corruption signal) — outranks\n * everything except safety-class reports. The three anomaly creators that previously\n * hardcoded `priority: 1` (LOW) all write this. */\n MONEY_ANOMALY: 1100,\n} as const;\n\nexport type TaskPriorityScore = (typeof TASK_PRIORITY_SCORE)[keyof typeof TASK_PRIORITY_SCORE];\n\n/** Maps a level-based TASK_PRIORITY value (1–4) to its canonical numeric score. */\nexport const TASK_PRIORITY_LEVEL_TO_SCORE = {\n [TASK_PRIORITY.LOW]: TASK_PRIORITY_SCORE.LOW,\n [TASK_PRIORITY.NORMAL]: TASK_PRIORITY_SCORE.NORMAL,\n [TASK_PRIORITY.HIGH]: TASK_PRIORITY_SCORE.HIGH,\n [TASK_PRIORITY.CRITICAL]: TASK_PRIORITY_SCORE.CRITICAL,\n} as const;\n\n// --- Admin Dispatches ---\n\n/** Maximum length for an admin-dispatch subject line. */\nexport const MAX_ADMIN_DISPATCH_SUBJECT_LENGTH = 100;\n\n/** Maximum length for the initial body text of an admin dispatch. */\nexport const MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH = 1000;\n\n// --- Content Moderation Workflow ---\n\n/** Maximum length for a content-violation appeal message. */\nexport const MAX_APPEAL_MESSAGE_LENGTH = 1000;\n\n/** Threshold-review reviewer notes (revision notes shown to the author). One owner for\n * the review callable schema AND the admin work-view input. */\nexport const MAX_THRESHOLD_REVIEW_NOTES_LENGTH = 2000;\n\n/** Operator-facing reason stamped on a threshold item whose publish parked terminally\n * (`publishParkedReason`). Server-authored text, bounded so a long copy-failure message\n * cannot grow the doc without limit. */\nexport const MAX_THRESHOLD_PUBLISH_PARKED_REASON_LENGTH = 2000;\n\n// --- Moderation / safety operator text caps ---\n// Each is declared ONCE here and derived by every input schema AND persisted doc schema\n// that carries the field — the numbers must never be re-hardcoded at an enforcement point.\n\n/** Operator-facing INTERNAL reason/rationale (LE-loggable; account actions, case reopens). */\nexport const MAX_INTERNAL_REASON_LENGTH = 2000;\n\n/** The generic owner-readable (user-facing) reason — deliberately short, no detail leaks. */\nexport const MAX_USER_FACING_REASON_LENGTH = 280;\n\n/** Structured close-out summary on report/safety-case resolutions. */\nexport const MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH = 2000;\n\n/** Optional operator note attached to a close-out. */\nexport const MAX_SAFETY_ADMIN_NOTE_LENGTH = 4000;\n\n// --- Report intake text caps ---\n\n/** Reporter free-text narrative/comment (segregated private doc; never on the root). */\nexport const MAX_REPORT_NARRATIVE_LENGTH = 4000;\n\n/** The report DIALOG's comment field cap (the client-side compose bound — tighter than\n * the server narrative cap above, which also absorbs upgrade concatenations). */\nexport const MAX_REPORT_COMMENT_LENGTH = 1000;\n\n/** Minimum operator rationale/reason length on safety-console staged actions. */\nexport const MIN_SAFETY_RATIONALE_LENGTH = 10;\n\n/** Operator reason on an admin chat-moderation action (adminModerateChatMessage /\n * adminReadChannelContext). ONE owner for both callables' `reason` bound. */\nexport const MAX_CHAT_MODERATION_REASON_LENGTH = 1000;\n\n/** Broadcast explicitUids selector audience cap (schema + composer both derive). */\nexport const MAX_BROADCAST_EXPLICIT_UIDS = 2000;\n\n// --- Operator step-up sentinel error codes ---\n// The two backend HttpsError messages the operator TOTP step-up throws; the frontend\n// matches them to open the step-up dialog in ENROLL vs VERIFY mode. ONE declaration —\n// both the callable (functions operatorStepUp.ts) and the frontend hook import these.\nexport const STEP_UP_ENROLL_REQUIRED = 'OPERATOR_STEP_UP_ENROLL_REQUIRED';\nexport const STEP_UP_REQUIRED = 'OPERATOR_STEP_UP_REQUIRED';\n\n/** The frozen report-time captured text snapshot (edit-to-evade guard; NO PII). */\nexport const MAX_REPORT_SNAPSHOT_TEXT_LENGTH = 4000;\n\n// --- Admin console config-content text caps ---\n// Every number the system uses lives HERE — even a field only one surface consumes\n// today, because any future client (TV / phone / admin app) reads ttt-core.\n\nexport const MAX_FUTURE_PLAN_TITLE_LENGTH = 200;\nexport const MAX_FUTURE_PLAN_DESCRIPTION_LENGTH = 4000;\nexport const MAX_PLATFORM_RULE_TITLE_LENGTH = 200;\nexport const MAX_PLATFORM_RULE_DESCRIPTION_LENGTH = 4000;\nexport const MAX_AGREEMENT_POINT_LENGTH = 2000;\nexport const MAX_CONTENT_PAGE_HEADING_LENGTH = 300;\nexport const MAX_CONTENT_PAGE_BODY_LENGTH = 20000;\n/** Sections in one long-form content page (Terms, Privacy, the DMCA policy's process text). */\nexport const MAX_CONTENT_PAGE_SECTIONS = 300;\nexport const MAX_TAKE_IT_DOWN_COPY_LENGTH = 8000;\n/** DMCA policy page: the labeled contact blocks (service provider, designated agent) and their rows. */\nexport const MAX_DMCA_CONTACT_BLOCKS = 10;\nexport const MAX_DMCA_CONTACT_ROWS = 20;\nexport const MAX_DMCA_CONTACT_LABEL_LENGTH = 100;\nexport const MAX_DMCA_CONTACT_VALUE_LENGTH = 500;\nexport const MAX_MAINTENANCE_MESSAGE_LENGTH = 2000;\n\n/** Announcement-banner copy on `_appConfig/app.announcementMessage`. Deliberately far\n * shorter than the maintenance message: the announcement renders as a one-line banner\n * on the landing page and login screen, not a full-page takeover. */\nexport const MAX_ANNOUNCEMENT_MESSAGE_LENGTH = 300;\n\n/** Admin notes on a content-appeal review (reviewContentAppeal). */\nexport const MAX_APPEAL_REVIEW_NOTES_LENGTH = 2000;\n\n/** Admin reason on a Work/Realm forced-retitle remedy. */\nexport const MAX_REQUIRE_RETITLE_REASON_LENGTH = 500;\n\n/** Optional user-facing DETAIL text on a normal-report resolution. */\nexport const MAX_USER_FACING_REASON_DETAIL_LENGTH = 2000;\n\n/** Admin broadcast / user notification message body. */\nexport const MAX_NOTIFICATION_MESSAGE_LENGTH = 2000;\n\n/** Admin user-search query input. */\nexport const MAX_USER_SEARCH_QUERY_LENGTH = 100;\n\n// --- NCII / child-safety statutory + operator text caps ---\n\n/** Operator reason on the admin \"mark as NCII linked evidence\" intake. */\nexport const MAX_NCII_EVIDENCE_REASON_LENGTH = 1000;\n\n/** Operator written rationale on a TAKE IT DOWN validity decision (immutable row). */\nexport const MAX_NCII_RATIONALE_LENGTH = 4000;\n\n/** Requester's statement of nonconsent (statutory intake — in-app and no-login). */\nexport const MAX_NCII_NONCONSENT_STATEMENT_LENGTH = 4000;\n\n/** Typed-name electronic signature on a statutory request. */\nexport const MAX_NCII_SIGNED_NAME_LENGTH = 256;\n\n/** Requester's optional supporting facts (statutory intake). */\nexport const MAX_NCII_SUPPORTING_FACTS_LENGTH = 8000;\n\n/** Bounded, non-sensitive summary on an NCII request action row. */\nexport const MAX_NCII_ACTION_SUMMARY_LENGTH = 280;\n\n/** Operator description of a registered evidence artifact (e.g. portal screenshot). */\nexport const MAX_SAFETY_ARTIFACT_DESCRIPTION_LENGTH = 500;\n\n/** Operator proof note on a manual NCMEC portal filing. */\nexport const MAX_NCMEC_PORTAL_PROOF_TEXT_LENGTH = 2000;\n\n/** Requester's typed name on the no-login TAKE IT DOWN statutory intake. */\nexport const MAX_NCII_REQUESTER_NAME_LENGTH = 256;\n\n/** Name of the depicted person a representative files on behalf of. */\nexport const MAX_NCII_REPRESENTED_PERSON_NAME_LENGTH = 256;\n\n/** Representative's stated basis of authority (parent/guardian/counsel etc.). */\nexport const MAX_NCII_AUTHORITY_BASIS_LENGTH = 2000;\n\n/** Optional pointer/reference to authority evidence supplied by a representative. */\nexport const MAX_NCII_AUTHORITY_EVIDENCE_REF_LENGTH = 512;\n\n/** Maximum length for a feedback suggestion. */\nexport const MAX_FEEDBACK_SUGGESTION_LENGTH = 100;\n\n/** Maximum number of distinct submitters tracked per feedback suggestion. Mode-varied. */\nexport const MAX_FEEDBACK_SUBMITTERS = ACTIVE_LIMITS.batches.maxFeedbackSubmitters;\n\n/**\n * Canonical list of feedback types accepted by `submitFeedback`. Used both\n * for runtime validation in the schema (`SubmitFeedbackInputSchema`) and\n * for type-safe consumer props on the frontend `<FeedbackSubmission />`\n * component. Adding a new type here is the single source of truth — no\n * mirroring in callers required.\n */\nexport const FEEDBACK_TYPES = [\n 'tradeProfessionSuggestions',\n 'craftSkillTagSuggestions',\n 'talesWorkGenreSuggestions',\n 'tunesWorkGenreSuggestions',\n 'televisionWorkGenreSuggestions',\n] as const;\n\n/** Union of canonical feedback types. */\nexport type FeedbackType = (typeof FEEDBACK_TYPES)[number];\n\n/** Maximum number of items submitted in a single hallLibrary-review submission. Mode-varied. */\nexport const MAX_HALL_LIBRARY_SUBMIT_BATCH = ACTIVE_LIMITS.hall.maxSubmitBatch;\n\n// --- Admin Tasks ---\n\n/** Admin task lifecycle statuses. */\nexport const ADMIN_TASK_STATUS = {\n PENDING: 'pending',\n CHECKED_OUT: 'checkedOut',\n WORK_LATER: 'workLater',\n COMPLETED: 'completed',\n} as const;\n"]}
1
+ {"version":3,"file":"business-admin.js","sourceRoot":"","sources":["../../src/constants/business-admin.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,8DAA8D;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,qCAAqC;AAErC,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,QAAQ,EAAE,CAAC;IACX,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,GAAG,EAAE,CAAC;CACE,CAAC;AAIX,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,KAAK;CACA,CAAC;AAEX;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,EAAE,EAAE;IACP,MAAM,EAAE,GAAG;IACX,IAAI,EAAE,GAAG;IACT,QAAQ,EAAE,IAAI;IACd;;uDAEmD;IACnD,aAAa,EAAE,IAAI;CACX,CAAC;AAIX,mFAAmF;AACnF,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,mBAAmB,CAAC,GAAG;IAC5C,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC,MAAM;IAClD,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC,IAAI;IAC9C,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAC,QAAQ;CAC9C,CAAC;AAEX,2BAA2B;AAE3B,yDAAyD;AACzD,MAAM,CAAC,MAAM,iCAAiC,GAAG,GAAG,CAAC;AAErD,qEAAqE;AACrE,MAAM,CAAC,MAAM,sCAAsC,GAAG,IAAI,CAAC;AAE3D,sCAAsC;AAEtC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,yBAAyB,G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rule constants — task priority, dispatches,\n// the moderation/feedback workflow, and admin-task lifecycle.\nimport { ACTIVE_LIMITS } from './app-mode.js';\n\n// --- Admin Task Priority System ---\n\nexport const TASK_PRIORITY = {\n CRITICAL: 4,\n HIGH: 3,\n NORMAL: 2,\n LOW: 1,\n} as const;\n\nexport type TaskPriorityLevel = (typeof TASK_PRIORITY)[keyof typeof TASK_PRIORITY];\n\nexport const TASK_PRIORITY_LABELS = {\n 4: 'CRITICAL',\n 3: 'HIGH',\n 2: 'NORMAL',\n 1: 'LOW',\n} as const;\n\n/**\n * Canonical NUMERIC priority scale for `adminTasks.priority`, shared by BOTH\n * priority systems so `checkoutNextImportantTask` (orderBy priority desc across all\n * task types) compares commensurable values. The userReport report-core score formula\n * already writes on this scale (≈40–2250); the level-based types (thresholdLibraryReview,\n * content-appeal, adminDispatch) map their TASK_PRIORITY level onto these numbers instead\n * of writing the raw 1–4.\n *\n * Resulting order: safety reports (1200–2250) > money anomalies (1100) >\n * CRITICAL (1000) > HIGH (800) > routine reports interleave below > spam-tier (~80).\n */\nexport const TASK_PRIORITY_SCORE = {\n LOW: 50,\n NORMAL: 200,\n HIGH: 800,\n CRITICAL: 1000,\n /** Money-integrity anomaly (stake-share / pledge-ledger corruption signal) — outranks\n * everything except safety-class reports. The three anomaly creators that previously\n * hardcoded `priority: 1` (LOW) all write this. */\n MONEY_ANOMALY: 1100,\n} as const;\n\nexport type TaskPriorityScore = (typeof TASK_PRIORITY_SCORE)[keyof typeof TASK_PRIORITY_SCORE];\n\n/** Maps a level-based TASK_PRIORITY value (1–4) to its canonical numeric score. */\nexport const TASK_PRIORITY_LEVEL_TO_SCORE = {\n [TASK_PRIORITY.LOW]: TASK_PRIORITY_SCORE.LOW,\n [TASK_PRIORITY.NORMAL]: TASK_PRIORITY_SCORE.NORMAL,\n [TASK_PRIORITY.HIGH]: TASK_PRIORITY_SCORE.HIGH,\n [TASK_PRIORITY.CRITICAL]: TASK_PRIORITY_SCORE.CRITICAL,\n} as const;\n\n// --- Admin Dispatches ---\n\n/** Maximum length for an admin-dispatch subject line. */\nexport const MAX_ADMIN_DISPATCH_SUBJECT_LENGTH = 100;\n\n/** Maximum length for the initial body text of an admin dispatch. */\nexport const MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH = 1000;\n\n// --- Content Moderation Workflow ---\n\n/** Maximum length for a content-violation appeal message. */\nexport const MAX_APPEAL_MESSAGE_LENGTH = 1000;\n\n/** Threshold-review reviewer notes (revision notes shown to the author). One owner for\n * the review callable schema AND the admin work-view input. */\nexport const MAX_THRESHOLD_REVIEW_NOTES_LENGTH = 2000;\n\n/** Operator-facing reason stamped on a threshold item whose publish parked terminally\n * (`publishParkedReason`). Server-authored text, bounded so a long copy-failure message\n * cannot grow the doc without limit. */\nexport const MAX_THRESHOLD_PUBLISH_PARKED_REASON_LENGTH = 2000;\n\n// --- Moderation / safety operator text caps ---\n// Each is declared ONCE here and derived by every input schema AND persisted doc schema\n// that carries the field — the numbers must never be re-hardcoded at an enforcement point.\n\n/** Operator-facing INTERNAL reason/rationale (LE-loggable; account actions, case reopens). */\nexport const MAX_INTERNAL_REASON_LENGTH = 2000;\n\n/** The generic owner-readable (user-facing) reason — deliberately short, no detail leaks. */\nexport const MAX_USER_FACING_REASON_LENGTH = 280;\n\n/** Structured close-out summary on report/safety-case resolutions. */\nexport const MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH = 2000;\n\n/** Optional operator note attached to a close-out. */\nexport const MAX_SAFETY_ADMIN_NOTE_LENGTH = 4000;\n\n// --- Report intake text caps ---\n\n/** Reporter free-text narrative/comment (segregated private doc; never on the root). */\nexport const MAX_REPORT_NARRATIVE_LENGTH = 4000;\n\n/** The report DIALOG's comment field cap (the client-side compose bound — tighter than\n * the server narrative cap above, which also absorbs upgrade concatenations). */\nexport const MAX_REPORT_COMMENT_LENGTH = 1000;\n\n/** Minimum operator rationale/reason length on safety-console staged actions. */\nexport const MIN_SAFETY_RATIONALE_LENGTH = 10;\n\n/** Operator reason on an admin chat-moderation action (adminModerateChatMessage /\n * adminReadChannelContext). ONE owner for both callables' `reason` bound. */\nexport const MAX_CHAT_MODERATION_REASON_LENGTH = 1000;\n\n/** Broadcast explicitUids selector audience cap (schema + composer both derive). */\nexport const MAX_BROADCAST_EXPLICIT_UIDS = 2000;\n\n// --- Operator step-up sentinel error codes ---\n// The two backend HttpsError messages the operator TOTP step-up throws; the frontend\n// matches them to open the step-up dialog in ENROLL vs VERIFY mode. ONE declaration —\n// both the callable (functions operatorStepUp.ts) and the frontend hook import these.\nexport const STEP_UP_ENROLL_REQUIRED = 'OPERATOR_STEP_UP_ENROLL_REQUIRED';\nexport const STEP_UP_REQUIRED = 'OPERATOR_STEP_UP_REQUIRED';\n\n/** The frozen report-time captured text snapshot (edit-to-evade guard; NO PII). */\nexport const MAX_REPORT_SNAPSHOT_TEXT_LENGTH = 4000;\n\n// --- Admin console config-content text caps ---\n// Every number the system uses lives HERE — even a field only one surface consumes\n// today, because any future client (TV / phone / admin app) reads ttt-core.\n\nexport const MAX_FUTURE_PLAN_TITLE_LENGTH = 200;\nexport const MAX_FUTURE_PLAN_DESCRIPTION_LENGTH = 4000;\nexport const MAX_PLATFORM_RULE_TITLE_LENGTH = 200;\nexport const MAX_PLATFORM_RULE_DESCRIPTION_LENGTH = 4000;\nexport const MAX_AGREEMENT_POINT_LENGTH = 2000;\nexport const MAX_CONTENT_PAGE_HEADING_LENGTH = 300;\nexport const MAX_CONTENT_PAGE_BODY_LENGTH = 20000;\n/** Sections in one long-form content page (Terms, Privacy, the DMCA policy's process text). */\nexport const MAX_CONTENT_PAGE_SECTIONS = 300;\nexport const MAX_TAKE_IT_DOWN_COPY_LENGTH = 8000;\n/** DMCA policy page: the labeled contact blocks (service provider, designated agent) and their rows. */\nexport const MAX_DMCA_CONTACT_BLOCKS = 10;\nexport const MAX_DMCA_CONTACT_ROWS = 20;\nexport const MAX_DMCA_CONTACT_LABEL_LENGTH = 100;\nexport const MAX_DMCA_CONTACT_VALUE_LENGTH = 500;\nexport const MAX_MAINTENANCE_MESSAGE_LENGTH = 2000;\n\n/** `_appConfig/app.appVersion` — the force-refresh version string VersionGate compares. */\nexport const MAX_APP_VERSION_LENGTH = 64;\n\n/** Announcement-banner copy on `_appConfig/app.announcementMessage`. Deliberately far\n * shorter than the maintenance message: the announcement renders as a one-line banner\n * on the landing page and login screen, not a full-page takeover. */\nexport const MAX_ANNOUNCEMENT_MESSAGE_LENGTH = 300;\n\n/** Admin notes on a content-appeal review (reviewContentAppeal). */\nexport const MAX_APPEAL_REVIEW_NOTES_LENGTH = 2000;\n\n/** Admin reason on a Work/Realm forced-retitle remedy. */\nexport const MAX_REQUIRE_RETITLE_REASON_LENGTH = 500;\n\n/** Optional user-facing DETAIL text on a normal-report resolution. */\nexport const MAX_USER_FACING_REASON_DETAIL_LENGTH = 2000;\n\n/** Admin broadcast / user notification message body. */\nexport const MAX_NOTIFICATION_MESSAGE_LENGTH = 2000;\n\n/** Admin user-search query input. */\nexport const MAX_USER_SEARCH_QUERY_LENGTH = 100;\n\n// --- NCII / child-safety statutory + operator text caps ---\n\n/** Operator reason on the admin \"mark as NCII linked evidence\" intake. */\nexport const MAX_NCII_EVIDENCE_REASON_LENGTH = 1000;\n\n/** Operator written rationale on a TAKE IT DOWN validity decision (immutable row). */\nexport const MAX_NCII_RATIONALE_LENGTH = 4000;\n\n/** Requester's statement of nonconsent (statutory intake — in-app and no-login). */\nexport const MAX_NCII_NONCONSENT_STATEMENT_LENGTH = 4000;\n\n/** Typed-name electronic signature on a statutory request. */\nexport const MAX_NCII_SIGNED_NAME_LENGTH = 256;\n\n/** Requester's optional supporting facts (statutory intake). */\nexport const MAX_NCII_SUPPORTING_FACTS_LENGTH = 8000;\n\n/** Bounded, non-sensitive summary on an NCII request action row. */\nexport const MAX_NCII_ACTION_SUMMARY_LENGTH = 280;\n\n/** Operator description of a registered evidence artifact (e.g. portal screenshot). */\nexport const MAX_SAFETY_ARTIFACT_DESCRIPTION_LENGTH = 500;\n\n/** Operator proof note on a manual NCMEC portal filing. */\nexport const MAX_NCMEC_PORTAL_PROOF_TEXT_LENGTH = 2000;\n\n/** Requester's typed name on the no-login TAKE IT DOWN statutory intake. */\nexport const MAX_NCII_REQUESTER_NAME_LENGTH = 256;\n\n/** Name of the depicted person a representative files on behalf of. */\nexport const MAX_NCII_REPRESENTED_PERSON_NAME_LENGTH = 256;\n\n/** Representative's stated basis of authority (parent/guardian/counsel etc.). */\nexport const MAX_NCII_AUTHORITY_BASIS_LENGTH = 2000;\n\n/** Optional pointer/reference to authority evidence supplied by a representative. */\nexport const MAX_NCII_AUTHORITY_EVIDENCE_REF_LENGTH = 512;\n\n/** Maximum length for a feedback suggestion. */\nexport const MAX_FEEDBACK_SUGGESTION_LENGTH = 100;\n\n/** Maximum number of distinct submitters tracked per feedback suggestion. Mode-varied. */\nexport const MAX_FEEDBACK_SUBMITTERS = ACTIVE_LIMITS.batches.maxFeedbackSubmitters;\n\n/**\n * Canonical list of feedback types accepted by `submitFeedback`. Used both\n * for runtime validation in the schema (`SubmitFeedbackInputSchema`) and\n * for type-safe consumer props on the frontend `<FeedbackSubmission />`\n * component. Adding a new type here is the single source of truth — no\n * mirroring in callers required.\n */\nexport const FEEDBACK_TYPES = [\n 'tradeProfessionSuggestions',\n 'craftSkillTagSuggestions',\n 'talesWorkGenreSuggestions',\n 'tunesWorkGenreSuggestions',\n 'televisionWorkGenreSuggestions',\n] as const;\n\n/** Union of canonical feedback types. */\nexport type FeedbackType = (typeof FEEDBACK_TYPES)[number];\n\n/** Maximum number of items submitted in a single hallLibrary-review submission. Mode-varied. */\nexport const MAX_HALL_LIBRARY_SUBMIT_BATCH = ACTIVE_LIMITS.hall.maxSubmitBatch;\n\n// --- Admin Tasks ---\n\n/** Admin task lifecycle statuses. */\nexport const ADMIN_TASK_STATUS = {\n PENDING: 'pending',\n CHECKED_OUT: 'checkedOut',\n WORK_LATER: 'workLater',\n COMPLETED: 'completed',\n} as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;iBAqB1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAIxD,eAAO,MAAM,eAAe;;;iBAG1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAIxD,eAAO,MAAM,mBAAmB;;;;;iBAQ9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAOhE,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAKxE,eAAO,MAAM,2BAA2B;;;iBAGtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAIhF,eAAO,MAAM,mBAAmB;;;;;;iBAG9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;iBAuB1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAIxD,eAAO,MAAM,eAAe;;;iBAG1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAIxD,eAAO,MAAM,mBAAmB;;;;;iBAQ9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAOhE,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAKxE,eAAO,MAAM,2BAA2B;;;iBAGtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAIhF,eAAO,MAAM,mBAAmB;;;;;;iBAG9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -1,12 +1,18 @@
1
1
  // System Firestore document SCHEMAS — the `_appConfig/app` runtime-config singleton.
2
2
  // Type inferred via z.infer. (Field docs live in ../types/system.ts.)
3
3
  import { z } from 'zod';
4
- import { MAX_ANNOUNCEMENT_MESSAGE_LENGTH } from '../constants/business-admin.js';
4
+ import { MAX_ANNOUNCEMENT_MESSAGE_LENGTH, MAX_APP_VERSION_LENGTH, MAX_MAINTENANCE_MESSAGE_LENGTH, } from '../constants/business-admin.js';
5
5
  import { PublicDocumentVersionBlockSchema } from './public-documents.js';
6
+ // Its write rule is `mergeAppConfigUpdate` (../utils/app-config.ts): an update over the doc as
7
+ // read, any missing field from DEFAULT_APP_CONFIG, the whole doc validated against this schema.
8
+ // Every text lever carries the same cap as its UpdateAppConfigInputSchema field, so no writer
9
+ // can store a value the update input would refuse.
6
10
  export const AppConfigSchema = z.object({
7
- appVersion: z.string(),
11
+ // '' (DEFAULT_APP_CONFIG) is valid here — no version published; only the update input
12
+ // requires a non-empty value.
13
+ appVersion: z.string().max(MAX_APP_VERSION_LENGTH),
8
14
  maintenanceMode: z.boolean(),
9
- maintenanceMessage: z.string().optional(),
15
+ maintenanceMessage: z.string().max(MAX_MAINTENANCE_MESSAGE_LENGTH).optional(),
10
16
  registrationEnabled: z.boolean(),
11
17
  // Announcement banner (the third operational lever, alongside maintenanceMode and
12
18
  // registrationEnabled). OPTIONAL, and EMPTY means no banner — there is no separate
@@ -1 +1 @@
1
- {"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,sEAAsE;AAEtE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,uBAAuB,CAAC;AAEzE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE;IAC5B,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzC,mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE;IAChC,kFAAkF;IAClF,mFAAmF;IACnF,sFAAsF;IACtF,kFAAkF;IAClF,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC,QAAQ,EAAE;IAC/E,+EAA+E;IAC/E,2EAA2E;IAC3E,8EAA8E;IAC9E,+EAA+E;IAC/E,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACvD,0FAA0F;IAC1F,wFAAwF;IACxF,4FAA4F;IAC5F,6FAA6F;IAC7F,2EAA2E;IAC3E,sBAAsB,EAAE,gCAAgC,CAAC,QAAQ,EAAE;CACpE,CAAC,CAAC;AAGH,iGAAiG;AAC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CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACpC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC","sourcesContent":["// System Firestore document SCHEMAS — the `_appConfig/app` runtime-config singleton.\n// Type inferred via z.infer. (Field docs live in ../types/system.ts.)\n\nimport { z } from 'zod';\nimport { MAX_ANNOUNCEMENT_MESSAGE_LENGTH } from '../constants/business-admin.js';\nimport { PublicDocumentVersionBlockSchema } from './public-documents.js';\n\nexport const AppConfigSchema = z.object({\n appVersion: z.string(),\n maintenanceMode: z.boolean(),\n maintenanceMessage: z.string().optional(),\n registrationEnabled: z.boolean(),\n // Announcement banner (the third operational lever, alongside maintenanceMode and\n // registrationEnabled). OPTIONAL, and EMPTY means no banner — there is no separate\n // on/off boolean, so clearing the text IS turning the banner off. Non-empty renders a\n // banner on the landing page and login screen. Set via updateAppConfig (audited).\n announcementMessage: z.string().max(MAX_ANNOUNCEMENT_MESSAGE_LENGTH).optional(),\n // Runtime abuse throttle (incident lever — NOT the charter/full mode, which is\n // a ttt-core code constant). Scales every rate limiter's maxRequests DOWN:\n // 0 < m <= 1, tighten-only. Absent = 1 (no throttle). Set via updateAppConfig\n // (audited); read by the backend limiter wrapper with a short in-memory cache.\n rateLimitMultiplier: z.number().gt(0).max(1).optional(),\n // Public-document version block — per document its current version and the latest version\n // that required acceptance, plus the one required-acceptance level. Written ONLY by the\n // release publish transaction (never updateAppConfig); every session already reads this doc\n // live, so a required release reaches open sessions without a new listener. Absent until the\n // first release: every document is then version 0 and nothing is required.\n publicDocumentVersions: PublicDocumentVersionBlockSchema.optional(),\n});\nexport type AppConfig = z.infer<typeof AppConfigSchema>;\n\n// _systemData/adminList — the admin / jrAdmin uid lists; source of truth synced to custom claims\n// by setAdminStatusClaim. (functions/src/auth/runUpdateAdminList.ts)\nexport const AdminListSchema = z.object({\n admins: z.array(z.string()),\n jrAdmins: z.array(z.string()),\n});\nexport type AdminList = z.infer<typeof AdminListSchema>;\n\n// _systemData/profanityList — the moderation word list read by the runtime text filter.\n// (functions/src/utility/seedProfanityList.ts / curateProfanityList.ts)\nexport const ProfanityListSchema = z.object({\n words: z.array(z.string()),\n updatedAt: z.number(),\n wordCount: z.number(),\n // Monotonic version for the chat-realtime word-list sync (Contract B). Bumped by each\n // curation; the chat Worker KV snapshot + the channel-DO lazy version check key on it.\n // Absent ⇒ 0.\n wordListVersion: z.number().optional(),\n});\nexport type ProfanityList = z.infer<typeof ProfanityListSchema>;\n\n// _systemData/reservedUsernames — curated brand/impersonation terms blocked at registration\n// by exact normalized (UPPERCASE) match. Distinct from the per-user `reservedDisplayNames`\n// uniqueness collection. Seeded by functions/src/utility/seedReservedUsernames.ts; consulted by\n// registerUser + checkDisplayNameAvailable. Names are stored UPPERCASE to match the\n// reservedDisplayName case-folding convention.\nexport const ReservedUsernamesSchema = z.object({\n names: z.array(z.string()),\n updatedAt: z.number(),\n});\nexport type ReservedUsernames = z.infer<typeof ReservedUsernamesSchema>;\n\n// _systemData/blockedFranchiseNames — curated famous-franchise / IP names (UPPERCASE), consulted\n// when creating/publishing a Work or Realm title and by the admin trademark-assist button. Distinct\n// from reservedUsernames (registration). Seeded by an admin seed callable. (legal-convo [BUILD].)\nexport const BlockedFranchiseNamesSchema = z.object({\n names: z.array(z.string()),\n updatedAt: z.number(),\n});\nexport type BlockedFranchiseNames = z.infer<typeof BlockedFranchiseNamesSchema>;\n\n// _systemData/appMode — the charter→full mode marker that recordAppModeFlip writes.\n// `current` mirrors the deployed `APP_MODE` constant after a flip is recorded.\nexport const AppModeMarkerSchema = z.object({\n current: z.enum(['charter', 'full']),\n updatedAt: z.number(),\n});\nexport type AppModeMarker = z.infer<typeof AppModeMarkerSchema>;\n"]}
1
+ {"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,sEAAsE;AAEtE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,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inferred via z.infer. (Field docs live in ../types/system.ts.)\n\nimport { z } from 'zod';\nimport {\n MAX_ANNOUNCEMENT_MESSAGE_LENGTH,\n MAX_APP_VERSION_LENGTH,\n MAX_MAINTENANCE_MESSAGE_LENGTH,\n} from '../constants/business-admin.js';\nimport { PublicDocumentVersionBlockSchema } from './public-documents.js';\n\n// Its write rule is `mergeAppConfigUpdate` (../utils/app-config.ts): an update over the doc as\n// read, any missing field from DEFAULT_APP_CONFIG, the whole doc validated against this schema.\n// Every text lever carries the same cap as its UpdateAppConfigInputSchema field, so no writer\n// can store a value the update input would refuse.\nexport const AppConfigSchema = z.object({\n // '' (DEFAULT_APP_CONFIG) is valid here — no version published; only the update input\n // requires a non-empty value.\n appVersion: z.string().max(MAX_APP_VERSION_LENGTH),\n maintenanceMode: z.boolean(),\n maintenanceMessage: z.string().max(MAX_MAINTENANCE_MESSAGE_LENGTH).optional(),\n registrationEnabled: z.boolean(),\n // Announcement banner (the third operational lever, alongside maintenanceMode and\n // registrationEnabled). OPTIONAL, and EMPTY means no banner — there is no separate\n // on/off boolean, so clearing the text IS turning the banner off. Non-empty renders a\n // banner on the landing page and login screen. Set via updateAppConfig (audited).\n announcementMessage: z.string().max(MAX_ANNOUNCEMENT_MESSAGE_LENGTH).optional(),\n // Runtime abuse throttle (incident lever — NOT the charter/full mode, which is\n // a ttt-core code constant). Scales every rate limiter's maxRequests DOWN:\n // 0 < m <= 1, tighten-only. Absent = 1 (no throttle). Set via updateAppConfig\n // (audited); read by the backend limiter wrapper with a short in-memory cache.\n rateLimitMultiplier: z.number().gt(0).max(1).optional(),\n // Public-document version block — per document its current version and the latest version\n // that required acceptance, plus the one required-acceptance level. Written ONLY by the\n // release publish transaction (never updateAppConfig); every session already reads this doc\n // live, so a required release reaches open sessions without a new listener. Absent until the\n // first release: every document is then version 0 and nothing is required.\n publicDocumentVersions: PublicDocumentVersionBlockSchema.optional(),\n});\nexport type AppConfig = z.infer<typeof AppConfigSchema>;\n\n// _systemData/adminList — the admin / jrAdmin uid lists; source of truth synced to custom claims\n// by setAdminStatusClaim. (functions/src/auth/runUpdateAdminList.ts)\nexport const AdminListSchema = z.object({\n admins: z.array(z.string()),\n jrAdmins: z.array(z.string()),\n});\nexport type AdminList = z.infer<typeof AdminListSchema>;\n\n// _systemData/profanityList — the moderation word list read by the runtime text filter.\n// (functions/src/utility/seedProfanityList.ts / curateProfanityList.ts)\nexport const ProfanityListSchema = z.object({\n words: z.array(z.string()),\n updatedAt: z.number(),\n wordCount: z.number(),\n // Monotonic version for the chat-realtime word-list sync (Contract B). Bumped by each\n // curation; the chat Worker KV snapshot + the channel-DO lazy version check key on it.\n // Absent ⇒ 0.\n wordListVersion: z.number().optional(),\n});\nexport type ProfanityList = z.infer<typeof ProfanityListSchema>;\n\n// _systemData/reservedUsernames — curated brand/impersonation terms blocked at registration\n// by exact normalized (UPPERCASE) match. Distinct from the per-user `reservedDisplayNames`\n// uniqueness collection. Seeded by functions/src/utility/seedReservedUsernames.ts; consulted by\n// registerUser + checkDisplayNameAvailable. Names are stored UPPERCASE to match the\n// reservedDisplayName case-folding convention.\nexport const ReservedUsernamesSchema = z.object({\n names: z.array(z.string()),\n updatedAt: z.number(),\n});\nexport type ReservedUsernames = z.infer<typeof ReservedUsernamesSchema>;\n\n// _systemData/blockedFranchiseNames — curated famous-franchise / IP names (UPPERCASE), consulted\n// when creating/publishing a Work or Realm title and by the admin trademark-assist button. Distinct\n// from reservedUsernames (registration). Seeded by an admin seed callable. (legal-convo [BUILD].)\nexport const BlockedFranchiseNamesSchema = z.object({\n names: z.array(z.string()),\n updatedAt: z.number(),\n});\nexport type BlockedFranchiseNames = z.infer<typeof BlockedFranchiseNamesSchema>;\n\n// _systemData/appMode — the charter→full mode marker that recordAppModeFlip writes.\n// `current` mirrors the deployed `APP_MODE` constant after a flip is recorded.\nexport const AppModeMarkerSchema = z.object({\n current: z.enum(['charter', 'full']),\n updatedAt: z.number(),\n});\nexport type AppModeMarker = z.infer<typeof AppModeMark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;;;;;;;;;kCAczC,CAAC;AACL,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;oBAQ1B,CAAC;AACb,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -6,7 +6,7 @@ import { ContentMediaKindSchema, MediaServingStatusSchema, } from '../doc-schema
6
6
  import { MAX_MANIFEST_NCMEC_RECEIPTS } from '../doc-schemas/safety/evidence.js';
7
7
  import { RuleGroupSchema, RuleSubgroupSchema } from '../doc-schemas/content.js';
8
8
  import { MODERATION_CLEARABLE_TEXT_FIELDS, HALL_CLEARABLE_TEXT_FIELD_NAMES, } from '../constants/business-content.js';
9
- import { MAX_WORK_PROJECT_TITLE_LENGTH, MAX_ADMIN_DISPATCH_SUBJECT_LENGTH, MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH, MAX_INTERNAL_REASON_LENGTH, MAX_USER_FACING_REASON_LENGTH, MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH, MAX_SAFETY_ADMIN_NOTE_LENGTH, MAX_FUTURE_PLAN_TITLE_LENGTH, MAX_FUTURE_PLAN_DESCRIPTION_LENGTH, MAX_PLATFORM_RULE_TITLE_LENGTH, MAX_PLATFORM_RULE_DESCRIPTION_LENGTH, MAX_AGREEMENT_POINT_LENGTH, MAX_CONTENT_PAGE_HEADING_LENGTH, MAX_CONTENT_PAGE_BODY_LENGTH, MAX_CONTENT_PAGE_SECTIONS, MAX_TAKE_IT_DOWN_COPY_LENGTH, MAX_DMCA_CONTACT_BLOCKS, MAX_DMCA_CONTACT_ROWS, MAX_DMCA_CONTACT_LABEL_LENGTH, MAX_DMCA_CONTACT_VALUE_LENGTH, MAX_MAINTENANCE_MESSAGE_LENGTH, MAX_ANNOUNCEMENT_MESSAGE_LENGTH, MAX_APPEAL_REVIEW_NOTES_LENGTH, MAX_REQUIRE_RETITLE_REASON_LENGTH, MAX_USER_FACING_REASON_DETAIL_LENGTH, } from '../constants/business.js';
9
+ import { MAX_WORK_PROJECT_TITLE_LENGTH, MAX_ADMIN_DISPATCH_SUBJECT_LENGTH, MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH, MAX_INTERNAL_REASON_LENGTH, MAX_USER_FACING_REASON_LENGTH, MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH, MAX_SAFETY_ADMIN_NOTE_LENGTH, MAX_FUTURE_PLAN_TITLE_LENGTH, MAX_FUTURE_PLAN_DESCRIPTION_LENGTH, MAX_PLATFORM_RULE_TITLE_LENGTH, MAX_PLATFORM_RULE_DESCRIPTION_LENGTH, MAX_AGREEMENT_POINT_LENGTH, MAX_CONTENT_PAGE_HEADING_LENGTH, MAX_CONTENT_PAGE_BODY_LENGTH, MAX_CONTENT_PAGE_SECTIONS, MAX_TAKE_IT_DOWN_COPY_LENGTH, MAX_DMCA_CONTACT_BLOCKS, MAX_DMCA_CONTACT_ROWS, MAX_DMCA_CONTACT_LABEL_LENGTH, MAX_DMCA_CONTACT_VALUE_LENGTH, MAX_MAINTENANCE_MESSAGE_LENGTH, MAX_ANNOUNCEMENT_MESSAGE_LENGTH, MAX_APP_VERSION_LENGTH, MAX_APPEAL_REVIEW_NOTES_LENGTH, MAX_REQUIRE_RETITLE_REASON_LENGTH, MAX_USER_FACING_REASON_DETAIL_LENGTH, } from '../constants/business.js';
10
10
  import { SAFETY_ACTIONS_CONFIRMATION, SAFETY_CASE_REOPEN_CONFIRMATION, } from '../constants/safety-confirmation-phrases.js';
11
11
  export const CheckoutNextImportantTaskInputSchema = z.object({}).strict();
12
12
  export const GetContentViolationInputSchema = z.object({
@@ -125,7 +125,7 @@ const AppConfigDocIdSchema = z.literal('app');
125
125
  export const UpdateAppConfigInputSchema = z.object({
126
126
  docId: AppConfigDocIdSchema,
127
127
  data: z.object({
128
- appVersion: z.string().min(1).max(64).optional(),
128
+ appVersion: z.string().min(1).max(MAX_APP_VERSION_LENGTH).optional(),
129
129
  maintenanceMode: z.boolean().optional(),
130
130
  maintenanceMessage: z.string().max(MAX_MAINTENANCE_MESSAGE_LENGTH).optional(),
131
131
  registrationEnabled: z.boolean().optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/schemas/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,gCAAgC,GACjC,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,iCAAiC,EACjC,mCAAmC,GAEpC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,4BAA4B,EAC5B,0CAA0C,GAC3C,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,EACL,gCAAgC,EAChC,+BAA+B,GAChC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,sCAAsC,EACtC,0BAA0B,EAC1B,6BAA6B,EAC7B,oCAAoC,EACpC,4BAA4B,EAC5B,4BAA4B,EAC5B,kCAAkC,EAClC,8BAA8B,EAC9B,oCAAoC,EACpC,0BAA0B,EAC1B,+BAA+B,EAC/B,4BAA4B,EAC5B,yBAAyB,EACzB,4BAA4B,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,6BAA6B,EAC7B,6BAA6B,EAC7B,8BAA8B,EAC9B,+BAA+B,EAC/B,8BAA8B,EAC9B,iCAAiC,EACjC,oCAAoC,GAC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;IACX,CAAC,CAAC,MAAM,CAAC;QACP,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC;QAC5C,GAAG,qCAAqC,CAAC,KAAK;QAC9C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,0BAA0B,CAAC;QACzD,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;KAC/B,CAAC,CAAC,MAAM,EAAE;CACZ,CAAC,CAAC;AAGL,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,gFAAgF;IAChF,UAAU,EAAE,8BAA8B,CAAC,QAAQ,EAAE;IACrD,0EAA0E;IAC1E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC;KACD,MAAM,EAAE;KACR,OAAO,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n violationIdSchema,\n taskIdSchema,\n workProjectIdSchema,\n hallItemIdSchema,\n workProjectTypeSchema,\n moderationClearableSurfaceSchema,\n} from './atoms.js';\nimport {\n ReportDispositionSchema,\n ReportDispositionReasonCodeSchema,\n refineReportDispositionReasonCode,\n refineReportDispositionEvidenceRefs,\n type ReportableItemType,\n} from '../doc-schemas/safety/foundation.js';\nimport {\n ChildSafetyAccountRoleSchema,\n ChildSafetyAccountSubjectDispositionSchema,\n} from '../doc-schemas/safety/case.js';\nimport {\n ContentMediaKindSchema,\n MediaServingStatusSchema,\n} from '../doc-schemas/media-assets.js';\nimport { MAX_MANIFEST_NCMEC_RECEIPTS } from '../doc-schemas/safety/evidence.js';\nimport { RuleGroupSchema, RuleSubgroupSchema } from '../doc-schemas/content.js';\nimport {\n MODERATION_CLEARABLE_TEXT_FIELDS,\n HALL_CLEARABLE_TEXT_FIELD_NAMES,\n} from '../constants/business-content.js';\nimport {\n MAX_WORK_PROJECT_TITLE_LENGTH,\n MAX_ADMIN_DISPATCH_SUBJECT_LENGTH,\n MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH,\n MAX_INTERNAL_REASON_LENGTH,\n MAX_USER_FACING_REASON_LENGTH,\n MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH,\n MAX_SAFETY_ADMIN_NOTE_LENGTH,\n MAX_FUTURE_PLAN_TITLE_LENGTH,\n MAX_FUTURE_PLAN_DESCRIPTION_LENGTH,\n MAX_PLATFORM_RULE_TITLE_LENGTH,\n MAX_PLATFORM_RULE_DESCRIPTION_LENGTH,\n MAX_AGREEMENT_POINT_LENGTH,\n MAX_CONTENT_PAGE_HEADING_LENGTH,\n MAX_CONTENT_PAGE_BODY_LENGTH,\n MAX_CONTENT_PAGE_SECTIONS,\n MAX_TAKE_IT_DOWN_COPY_LENGTH,\n MAX_DMCA_CONTACT_BLOCKS,\n MAX_DMCA_CONTACT_ROWS,\n MAX_DMCA_CONTACT_LABEL_LENGTH,\n MAX_DMCA_CONTACT_VALUE_LENGTH,\n MAX_MAINTENANCE_MESSAGE_LENGTH,\n MAX_ANNOUNCEMENT_MESSAGE_LENGTH,\n MAX_APPEAL_REVIEW_NOTES_LENGTH,\n MAX_REQUIRE_RETITLE_REASON_LENGTH,\n MAX_USER_FACING_REASON_DETAIL_LENGTH,\n} from '../constants/business.js';\nimport {\n SAFETY_ACTIONS_CONFIRMATION,\n SAFETY_CASE_REOPEN_CONFIRMATION,\n} from '../constants/safety-confirmation-phrases.js';\n\nexport const CheckoutNextImportantTaskInputSchema = z.object({}).strict();\nexport type CheckoutNextImportantTaskInput = z.infer<typeof CheckoutNextImportantTaskInputSchema>;\n\nexport const GetContentViolationInputSchema = z.object({\n violationId: violationIdSchema,\n}).strict();\nexport type GetContentViolationInput = z.infer<typeof GetContentViolationInputSchema>;\n\n// `taskType` was removed — the server derives it from the task doc; the client copy was\n// ignored (and forgeable). Callers pass only the task id + the extension window.\nexport const MarkWorkLaterInputSchema = z.object({\n taskId: taskIdSchema,\n extendHours: z.union([z.literal(24), z.literal(48)]),\n}).strict();\nexport type MarkWorkLaterInput = z.infer<typeof MarkWorkLaterInputSchema>;\n\n/** The two appeal-review decisions (ONE canonical declaration — shared by the review\n * input and its authoritative result). */\nexport const ContentAppealDecisionSchema = z.enum(['approved', 'denied']);\nexport type ContentAppealDecision = z.infer<typeof ContentAppealDecisionSchema>;\n\nexport const ReviewContentAppealInputSchema = z.object({\n violationId: violationIdSchema,\n taskId: taskIdSchema,\n decision: ContentAppealDecisionSchema,\n adminNotes: z.string().max(MAX_APPEAL_REVIEW_NOTES_LENGTH),\n}).strict();\nexport type ReviewContentAppealInput = z.infer<typeof ReviewContentAppealInputSchema>;\n\n// Authoritative result of reviewContentAppeal. Non-strict (server → client posture).\nexport const ReviewContentAppealResultSchema = z.object({\n success: z.literal(true),\n violationId: violationIdSchema,\n /** Echo of the requested decision (always known — it is the input). */\n decision: ContentAppealDecisionSchema,\n /** The appealing user's uid ('' on the orphaned-task cleanup path, where the\n * underlying violation was already gone and only the stale task was cleared). */\n userId: z.string(),\n /** Operation-receipt audit id — the `admin.contentAppealReviewed` event written in the same\n * transaction. Optional/additive so an older backend that omits it still type-checks. */\n auditEventId: z.string().min(1).optional(),\n});\nexport type ReviewContentAppealResult = z.infer<typeof ReviewContentAppealResultSchema>;\n\n// --- Public-document content inputs ---\n// The Admin editors' strict CONTENT schemas, one per public document. A working copy is saved\n// through `SavePublicDocumentDraftInputSchema` (./public-documents.ts), which pairs each\n// document id with its content schema here; the content is FULL (a version is the whole\n// document, never a partial merge). The client never sends a version — the release publish\n// assigns it.\n\nexport const FuturePlanItemInputSchema = z.object({\n id: z.string().min(1).max(128),\n title: z.string().min(1).max(MAX_FUTURE_PLAN_TITLE_LENGTH),\n description: z.string().min(1).max(MAX_FUTURE_PLAN_DESCRIPTION_LENGTH),\n order: z.number().int().min(0),\n videoUrl: z.string().url().max(2048).optional(),\n mediaType: z.enum(['video', 'image', 'audio', 'other']).optional(),\n}).strict();\n\nexport const FuturePlansContentInputSchema = z.object({\n plans: z.array(FuturePlanItemInputSchema).max(200),\n}).strict();\nexport type FuturePlansContentInput = z.infer<typeof FuturePlansContentInputSchema>;\n\nexport const PlatformRuleInputSchema = z.object({\n id: z.string().min(1).max(128),\n title: z.string().min(1).max(MAX_PLATFORM_RULE_TITLE_LENGTH),\n description: z.string().min(1).max(MAX_PLATFORM_RULE_DESCRIPTION_LENGTH),\n videoUrl: z.string().url().max(2048).optional(),\n group: RuleGroupSchema.optional(),\n subgroup: RuleSubgroupSchema.optional(),\n order: z.number().int().min(0),\n}).strict();\n\nexport const AgreementCategoryInputSchema = z.object({\n points: z.array(z.string().min(1).max(MAX_AGREEMENT_POINT_LENGTH)).max(200),\n videoUrl: z.string().url().max(2048).optional(),\n}).strict();\n\nexport const AgreementsInputSchema = z.object({\n tales: AgreementCategoryInputSchema.optional(),\n tunes: AgreementCategoryInputSchema.optional(),\n television: AgreementCategoryInputSchema.optional(),\n}).strict();\n\nexport const RulesAndAgreementsContentInputSchema = z.object({\n rules: z.array(PlatformRuleInputSchema).max(500),\n agreements: AgreementsInputSchema,\n}).strict();\nexport type RulesAndAgreementsContentInput = z.infer<typeof RulesAndAgreementsContentInputSchema>;\n\nexport const ContentPageSectionInputSchema = z.object({\n id: z.string().min(1).max(128),\n heading: z.string().min(1).max(MAX_CONTENT_PAGE_HEADING_LENGTH),\n level: z.union([z.literal(1), z.literal(2)]),\n // Empty body is LEGAL: a bare divider heading (e.g. terms \"Part 1 — Our\n // Intention\") is real content. The input schema must accept everything the\n // stored ContentPageSectionSchema accepts, or a faithfully-seeded doc becomes\n // unsaveable in the admin editor (found by adversarial review 2026-07-06).\n body: z.string().max(MAX_CONTENT_PAGE_BODY_LENGTH),\n order: z.number().int().min(0),\n}).strict();\n\n/** The Terms of Service and Privacy Policy content (the one long-form legal page shape). */\nexport const LegalPageContentInputSchema = z.object({\n sections: z.array(ContentPageSectionInputSchema).min(1).max(MAX_CONTENT_PAGE_SECTIONS),\n}).strict();\nexport type LegalPageContentInput = z.infer<typeof LegalPageContentInputSchema>;\n\nexport const TakeItDownPageCopyContentInputSchema = z.object({\n strings: z.record(z.string().min(1).max(128), z.string().min(1).max(MAX_TAKE_IT_DOWN_COPY_LENGTH)),\n}).strict().refine(\n (data) => {\n const count = Object.keys(data.strings).length;\n return count >= 1 && count <= 200;\n },\n { message: 'strings must contain between 1 and 200 entries.' },\n);\nexport type TakeItDownPageCopyContentInput = z.infer<typeof TakeItDownPageCopyContentInputSchema>;\n\nconst DmcaContactRowInputSchema = z.object({\n id: z.string().min(1).max(128),\n label: z.string().min(1).max(MAX_DMCA_CONTACT_LABEL_LENGTH),\n value: z.string().min(1).max(MAX_DMCA_CONTACT_VALUE_LENGTH),\n order: z.number().int().min(0),\n}).strict();\n\nconst DmcaContactBlockInputSchema = z.object({\n id: z.string().min(1).max(128),\n heading: z.string().min(1).max(MAX_CONTENT_PAGE_HEADING_LENGTH),\n order: z.number().int().min(0),\n rows: z.array(DmcaContactRowInputSchema).min(1).max(MAX_DMCA_CONTACT_ROWS),\n}).strict();\n\n/**\n * The DMCA policy content: the intro line, the labeled contact blocks (at least one — the page\n * exists to name the designated agent), and the long-form process sections.\n */\nexport const DmcaPolicyContentInputSchema = z.object({\n intro: z.string().max(MAX_CONTENT_PAGE_BODY_LENGTH),\n contactBlocks: z.array(DmcaContactBlockInputSchema).min(1).max(MAX_DMCA_CONTACT_BLOCKS),\n sections: z.array(ContentPageSectionInputSchema).max(MAX_CONTENT_PAGE_SECTIONS),\n}).strict();\nexport type DmcaPolicyContentInput = z.infer<typeof DmcaPolicyContentInputSchema>;\n\nconst AppConfigDocIdSchema = z.literal('app');\n\nexport const UpdateAppConfigInputSchema = z.object({\n docId: AppConfigDocIdSchema,\n data: z.object({\n appVersion: z.string().min(1).max(64).optional(),\n maintenanceMode: z.boolean().optional(),\n maintenanceMessage: z.string().max(MAX_MAINTENANCE_MESSAGE_LENGTH).optional(),\n registrationEnabled: z.boolean().optional(),\n // Announcement banner copy; '' clears the banner (empty = nothing renders).\n announcementMessage: z.string().max(MAX_ANNOUNCEMENT_MESSAGE_LENGTH).optional(),\n // Runtime abuse throttle: 0 < m <= 1 (tighten-only; 1 = no throttle).\n rateLimitMultiplier: z.number().gt(0).max(1).optional(),\n }).strict().refine(\n (d) => Object.keys(d).length > 0,\n { message: 'data must have at least one field' },\n ),\n}).strict();\nexport type UpdateAppConfigInput = z.infer<typeof UpdateAppConfigInputSchema>;\n\n// --- Admin list mutations ---\n\nconst uidSchema = z.string().min(1).max(128);\n\n/**\n * Wire input for the `updateAdminList` callable in ttt-prod.\n * Used to grant or revoke admin / jrAdmin status on `_systemData/adminList`.\n *\n * All four fields are optional arrays of UIDs. At least one must be non-empty.\n * The callable's core function rejects conflicting input (e.g. same UID in\n * both addAdmins and removeAdmins) with HttpsError invalid-argument.\n */\nexport const UpdateAdminListInputSchema = z.object({\n addAdmins: z.array(uidSchema).optional(),\n removeAdmins: z.array(uidSchema).optional(),\n addJrAdmins: z.array(uidSchema).optional(),\n removeJrAdmins: z.array(uidSchema).optional(),\n})\n .strict()\n .refine(\n (data) =>\n (data.addAdmins?.length ?? 0) +\n (data.removeAdmins?.length ?? 0) +\n (data.addJrAdmins?.length ?? 0) +\n (data.removeJrAdmins?.length ?? 0) >\n 0,\n { message: 'At least one of addAdmins/removeAdmins/addJrAdmins/removeJrAdmins must be non-empty.' },\n );\n\nexport type UpdateAdminListInput = z.infer<typeof UpdateAdminListInputSchema>;\n\n// Authoritative result of updateAdminList — the grant/revoke delta counts computed inside\n// the roster transaction (uids already in their target state are no-ops and not counted).\n// Non-strict (server → client result posture).\nexport const UpdateAdminListResultSchema = z.object({\n success: z.literal(true),\n adminsGranted: z.number().int().nonnegative(),\n adminsRevoked: z.number().int().nonnegative(),\n jrAdminsGranted: z.number().int().nonnegative(),\n jrAdminsRevoked: z.number().int().nonnegative(),\n /** Operation-receipt audit id — the `admin.systemRoleGranted` / `admin.systemRoleRevoked`\n * event(s) key off the same roster transaction. Optional/additive. (No single domain id: a\n * roster edit spans multiple uids, so only the audit id is a meaningful receipt handle.) */\n auditEventId: z.string().min(1).optional(),\n});\nexport type UpdateAdminListResult = z.infer<typeof UpdateAdminListResultSchema>;\n\n// --- Admin moderation: hide / restore / retitle content + Work/Realm objects ---\n\nexport const CheckTrademarkInputSchema = z.object({\n // Primary: the work project's title (franchise-level check).\n workTitle: z.string().min(1).max(MAX_WORK_PROJECT_TITLE_LENGTH),\n // Optional: the sub-item title (chapter, track, episode). Checked secondarily.\n // `.nullish()` (not `.optional()`): the Firebase callable client serializes an\n // undefined argument as JSON null, and the work-view caller passes\n // `subItemTitle: subItem?.title` which is undefined when the sub-item hasn't\n // loaded — that arrives here as null. A bare `.optional()` would 400 on it.\n subItemTitle: z.string().max(MAX_WORK_PROJECT_TITLE_LENGTH).nullish(),\n}).strict();\nexport type CheckTrademarkInput = z.infer<typeof CheckTrademarkInputSchema>;\n\nexport const GetReportedContentDetailInputSchema = z.object({\n reportGroupId: z.string().min(1),\n}).strict();\nexport type GetReportedContentDetailInput = z.infer<typeof GetReportedContentDetailInputSchema>;\n\n// --- getReportedContentDetail result (cross-boundary: produced by the callable in functions/,\n// consumed by the admin report work-view) ---\n\n/** One display-text field of the reported doc, labeled for the review panel. The server returns\n * EVERY configured non-empty text field for the item type (title, description, body, …) in\n * display order — never just the first non-empty one. */\nexport const ReportedTextFieldSchema = z.object({\n /** Raw doc field name (e.g. 'description', 'workingTitle'). */\n field: z.string().min(1),\n /** Human label the panel renders (e.g. 'Description', 'Title'). */\n label: z.string().min(1),\n /** Current live value, trimmed; empty fields are omitted from the array. */\n value: z.string().min(1),\n});\nexport type ReportedTextField = z.infer<typeof ReportedTextFieldSchema>;\n\n/** One media asset referenced by the reported content: id + kind + current serving state\n * (for click-to-reveal) + the server-derived variant key the reveal must request. */\nexport const ReportedMediaAssetSchema = z.object({\n mediaAssetId: z.string().min(1),\n mediaKind: ContentMediaKindSchema.nullable(),\n servingStatus: MediaServingStatusSchema.nullable(),\n /** The variant key the reveal must request for its single display render (image origins split\n * between 'full' and 'main'; video/audio are always 'main'). Null when the asset doc is\n * missing/variant-less. */\n displayVariantKey: z.string().nullable(),\n /** Human label of WHAT this asset is on the reported item (e.g. 'Square cover',\n * 'Track photo — <title>'). Null when the server cannot derive one. */\n label: z.string().nullable(),\n});\nexport type ReportedMediaAsset = z.infer<typeof ReportedMediaAssetSchema>;\n\nexport const GetReportedContentDetailResultSchema = z.object({\n itemType: z.string().min(1),\n reportedItemId: z.string().min(1),\n /** First non-empty display-text field (legacy single-field snapshot; textFields is the\n * complete labeled set). */\n textSnapshot: z.string().nullable(),\n textFields: z.array(ReportedTextFieldSchema),\n mediaAssets: z.array(ReportedMediaAssetSchema),\n /** Whether the reported doc is currently hidden (best-effort, doc-flag based). */\n isHidden: z.boolean().nullable(),\n /** The content owner / uploader uid, when derivable. */\n ownerUid: z.string().nullable(),\n /**\n * The canonical moderation-clearable SURFACE this reported doc actually IS, resolved\n * SERVER-side: `chapter` / `tuneTrack` / `televisionEpisode` for a hall sub-item (through\n * `HALL_CONTENT_SURFACES_BY_WORK_TYPE`, from the parent hall doc the callable already reads),\n * `workProject` / `workRealm` for the shells.\n *\n * Why the resolved surface and not the `workProjectType` it was resolved from: the surface is\n * what a consumer needs — `MODERATION_CLEARABLE_TEXT_FIELDS[clearableSurface]` is the exact\n * clearable field set, one canonical index with no re-derivation. Shipping the work-project type\n * instead would make every consumer redo the routing AND the detail-vs-sub-item branch, which is\n * precisely the hand-rolled duplication that map was created to end.\n *\n * What it fixes: the in-flow clear's field picker offered the hall-family UNION\n * (title/description/content) because the projection never said which surface the sub-item was —\n * so an operator could tick `description` on a Tale chapter (title/content) or `content` on a\n * Tune track (title/description), pass the wire refinement, and have the clear runner silently\n * drop it. The picker now offers only this surface's fields, and the resolve path re-checks\n * caller-supplied fields against the same set.\n *\n * `.nullish()`: absent on payloads produced before this field existed, and null when the\n * reported item is not a clearable text surface at all (a square post, a chat message, a\n * profile picture).\n */\n clearableSurface: moderationClearableSurfaceSchema.nullish(),\n /** The FROZEN report-time snapshot (captured at intake), so the operator sees what was\n * reported even if the author edited the live doc to evade. Null for older reports. */\n reportTimeSnapshot: z.object({\n capturedText: z.string().nullable(),\n capturedMediaAssetIds: z.array(z.string()),\n revision: z.number().nullable(),\n capturedAt: z.number().nullable(),\n }).nullable(),\n});\nexport type GetReportedContentDetailResult = z.infer<typeof GetReportedContentDetailResultSchema>;\n\nexport const HideHallSubItemInputSchema = z.object({\n hallItemId: hallItemIdSchema,\n workProjectType: workProjectTypeSchema,\n subItemId: z.string().min(1),\n reason: z.string().min(1),\n}).strict();\nexport type HideHallSubItemInput = z.infer<typeof HideHallSubItemInputSchema>;\n\nexport const RestoreHallSubItemInputSchema = z.object({\n hallItemId: hallItemIdSchema,\n workProjectType: workProjectTypeSchema,\n subItemId: z.string().min(1),\n}).strict();\nexport type RestoreHallSubItemInput = z.infer<typeof RestoreHallSubItemInputSchema>;\n\nexport const HideWorkProjectInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n reason: z.string().min(1),\n}).strict();\nexport type HideWorkProjectInput = z.infer<typeof HideWorkProjectInputSchema>;\n\nexport const HideWorkRealmInputSchema = z.object({\n workRealmId: z.string().min(1),\n reason: z.string().min(1),\n}).strict();\nexport type HideWorkRealmInput = z.infer<typeof HideWorkRealmInputSchema>;\n\n// `cascadeId` is OPTIONAL: the app backends derive all active cascades for the target when it is\n// omitted, and restore just that one cascade when it is supplied.\nexport const RestoreWorkProjectInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n cascadeId: z.string().min(1).optional(),\n}).strict();\nexport type RestoreWorkProjectInput = z.infer<typeof RestoreWorkProjectInputSchema>;\n\nexport const RestoreWorkRealmInputSchema = z.object({\n workRealmId: z.string().min(1),\n cascadeId: z.string().min(1).optional(),\n}).strict();\nexport type RestoreWorkRealmInput = z.infer<typeof RestoreWorkRealmInputSchema>;\n\n// The `requireWorkProjectRetitle` / `requireWorkRealmRetitle` callables share this base\n// `{ reason }` shape and each `.extend(...)` it with its own id field at parse time.\nexport const RequireRetitleInputSchema = z.object({\n reason: z.string().min(1).max(MAX_REQUIRE_RETITLE_REASON_LENGTH),\n}).strict();\nexport type RequireRetitleInput = z.infer<typeof RequireRetitleInputSchema>;\n\n// --- Page-level \"Clear text (moderation)\" callables (per-field extension of the retitle family) ---\n\n// The clearable SHELL fields (raw doc field names) for the workProject + workRealm contexts.\n// Derived from the canonical clearable-field map — the two shell surfaces share the same fields.\nconst ModerationShellClearFieldSchema = z.enum(MODERATION_CLEARABLE_TEXT_FIELDS.workProject);\nexport type ModerationShellClearField = z.infer<typeof ModerationShellClearFieldSchema>;\n\nexport const ClearWorkProjectTextInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n fields: z.array(ModerationShellClearFieldSchema).min(1),\n reason: z.string().trim().min(1).max(MAX_REQUIRE_RETITLE_REASON_LENGTH),\n}).strict();\nexport type ClearWorkProjectTextInput = z.infer<typeof ClearWorkProjectTextInputSchema>;\n\nexport const ClearWorkRealmTextInputSchema = z.object({\n workRealmId: z.string().min(1),\n fields: z.array(ModerationShellClearFieldSchema).min(1),\n reason: z.string().trim().min(1).max(MAX_REQUIRE_RETITLE_REASON_LENGTH),\n}).strict();\nexport type ClearWorkRealmTextInput = z.infer<typeof ClearWorkRealmTextInputSchema>;\n\n// The clearable TEXT fields across the whole hall content family — derived from the canonical\n// map (union of every hall surface's fields), never restated literals.\nconst HallClearFieldSchema = z.enum(HALL_CLEARABLE_TEXT_FIELD_NAMES);\nexport type HallClearField = z.infer<typeof HallClearFieldSchema>;\n\nexport const ClearHallContentTextInputSchema = z.object({\n hallItemId: hallItemIdSchema,\n workProjectType: workProjectTypeSchema,\n subItemId: z.string().min(1).optional(),\n fields: z.array(HallClearFieldSchema).min(1),\n reason: z.string().trim().min(1).max(MAX_REQUIRE_RETITLE_REASON_LENGTH),\n}).strict();\nexport type ClearHallContentTextInput = z.infer<typeof ClearHallContentTextInputSchema>;\n\n// --- getLatestHideCascade — resolve the latest hide-cascade id for a Work/Realm ---\n\nexport const GetLatestHideCascadeInputSchema = z.object({\n entityId: z.string().min(1),\n targetType: z.enum(['work-project', 'work-realm']),\n}).strict();\nexport type GetLatestHideCascadeInput = z.infer<typeof GetLatestHideCascadeInputSchema>;\n\n// --- moderateReportedContent — hide / restore / soft perma-remove an individual reported item ---\n\n// The single-item content-action target set (SUBSET of ReportableItemType — excludes the\n// close-out-only hall-library-sub-item).\nconst MODERATE_REPORTED_CONTENT_TARGET_TYPES = [\n 'square-streetz-post',\n 'audition',\n 'audition-entry',\n 'commission-listing',\n 'commission-proposal',\n 'work-asset',\n 'profile-picture',\n 'hall-library-item',\n 'craft-skill',\n // Conversation File — the hide/restore/remove action targets the file owner record +\n // its mediaAsset (the `work-asset` shape), never a chat message.\n 'conversation-file',\n] as const satisfies readonly ReportableItemType[];\n\nexport const ModerateReportedContentInputSchema = z.object({\n reportGroupId: z.string().min(1),\n targetType: z.enum(MODERATE_REPORTED_CONTENT_TARGET_TYPES),\n reportedItemId: z.string().min(1),\n parentItemId: z.string().min(1).optional(),\n action: z.enum(['hide', 'restore', 'remove']),\n // [EUAS-023] A destructive action (hide/remove) MUST carry a reason; restore is a reversal.\n reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH).optional(),\n})\n .strict()\n .superRefine((val, ctx) => {\n if ((val.action === 'hide' || val.action === 'remove') && !val.reason) {\n ctx.addIssue({\n code: 'custom',\n message: 'A reason is required to hide or remove content.',\n path: ['reason'],\n });\n }\n });\nexport type ModerateReportedContentInput = z.infer<typeof ModerateReportedContentInputSchema>;\n\n// --- resolveAdminTask — the ONE guided close-out for EVERY admin case type ---\n\n// [EUAS-005] The content-action target set ALSO accepts hall-library-sub-item (hide/restore only),\n// which routes to the dedicated `runSetHallSubItemHidden` core (not `runModerateReportedContent`).\nconst CONTENT_ACTION_TARGET_TYPES = [\n 'square-streetz-post',\n 'audition',\n 'audition-entry',\n 'commission-listing',\n 'commission-proposal',\n 'work-asset',\n 'profile-picture',\n 'hall-library-item',\n 'craft-skill',\n 'hall-library-sub-item',\n // Conversation File — same content action as `work-asset`, routed at the file record.\n 'conversation-file',\n] as const satisfies readonly ReportableItemType[];\n\nconst ContentActionSchema = z\n .object({\n button: z.enum(['hideContent', 'restoreContent', 'permaRemoveContent']),\n targetType: z.enum(CONTENT_ACTION_TARGET_TYPES),\n reportedItemId: z.string().min(1),\n parentItemId: z.string().min(1).optional(),\n })\n .strict();\n\nconst WarnUserSchema = z\n .object({\n button: z.literal('warnUser'),\n userId: z.string().min(1),\n // A warning IS an admin dispatch (resolveAdminTask → runCreateAdminDispatchToUser),\n // so it shares the dispatch subject/body caps.\n subject: z.string().trim().min(1).max(MAX_ADMIN_DISPATCH_SUBJECT_LENGTH),\n message: z.string().trim().min(1).max(MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH),\n })\n .strict();\n\nconst SuspendOrBanSchema = z\n .object({\n button: z.enum(['suspendUser', 'banUser']),\n userId: z.string().min(1),\n reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH),\n })\n .strict();\n\nconst ReinstateUserSchema = z\n .object({ button: z.literal('reinstateUser'), userId: z.string().min(1), reason: z.string().trim().max(MAX_INTERNAL_REASON_LENGTH).optional() })\n .strict();\n\nconst ForceUsernameResetSchema = z\n .object({ button: z.literal('forceUsernameReset'), userId: z.string().min(1), reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH).optional() })\n .strict();\n\n/** Whole-object Work/Realm remedies — `reportedItemId` is the workProjectId / workRealmId. */\nconst WorkObjectActionSchema = z\n .object({\n button: z.enum(['hideWorkObject', 'restoreWorkObject', 'forceRetitle']),\n targetType: z.enum(['work-project', 'work-realm']),\n reportedItemId: z.string().min(1),\n })\n .strict();\n\n// --- The in-flow clear-content disposition (staged counterpart of the page-level clear-text\n// callables) ---\n\n/** The three targets the in-flow text clear can neutralize — the Work/Realm shells plus a single\n * published hall sub-item. Compile-linked subset of the canonical reportable-item enum. */\nconst CLEAR_CONTENT_TEXT_TARGET_TYPES = [\n 'work-project',\n 'work-realm',\n 'hall-library-sub-item',\n] as const satisfies readonly ReportableItemType[];\nexport type ClearContentTextTargetType = (typeof CLEAR_CONTENT_TEXT_TARGET_TYPES)[number];\n\n/** Every field name the staged clear can carry across those three targets — the union of the two\n * canonical clearable owners (`MODERATION_CLEARABLE_TEXT_FIELDS` for the shells,\n * `HALL_CLEARABLE_TEXT_FIELD_NAMES` for the hall family), i.e. the same two sources\n * `ClearWorkProjectTextInputSchema` / `ClearHallContentTextInputSchema` derive from. No field\n * literal is restated here. */\nconst CLEAR_CONTENT_TEXT_FIELDS = [\n ...MODERATION_CLEARABLE_TEXT_FIELDS.workProject,\n ...HALL_CLEARABLE_TEXT_FIELD_NAMES,\n] as const;\nconst ClearContentTextFieldSchema = z.enum(CLEAR_CONTENT_TEXT_FIELDS);\nexport type ClearContentTextField = z.infer<typeof ClearContentTextFieldSchema>;\n\n/** Which fields each target legally accepts — projected from those same owners, so a\n * target/field mismatch is refused at the wire instead of reaching a clear runner that would\n * drop it. Enforced by the cross-field refinement on `StagedActionSchema` below. */\nconst CLEAR_CONTENT_TEXT_FIELDS_BY_TARGET = {\n 'work-project': MODERATION_CLEARABLE_TEXT_FIELDS.workProject,\n 'work-realm': MODERATION_CLEARABLE_TEXT_FIELDS.workRealm,\n 'hall-library-sub-item': HALL_CLEARABLE_TEXT_FIELD_NAMES,\n} as const satisfies Record<ClearContentTextTargetType, readonly ClearContentTextField[]>;\n\n/** Per-field text clear — the guided close-out's staged counterpart of the page-level\n * `clearWorkProjectText` / `clearWorkRealmText` / `clearHallContentText` callables (the\n * per-field extension of `forceRetitle`). `reportedItemId` is the workProjectId / workRealmId /\n * sub-item id; `parentItemId` is the parent hall item id, required only for the sub-item target.\n * `workProjectType` is deliberately NOT on the wire — the server re-reads it from the doc (the\n * hall hide-branch precedent). */\nconst ClearContentTextActionSchema = z\n .object({\n button: z.literal('clearContentText'),\n targetType: z.enum(CLEAR_CONTENT_TEXT_TARGET_TYPES),\n reportedItemId: z.string().min(1),\n parentItemId: z.string().min(1).optional(),\n fields: z.array(ClearContentTextFieldSchema).min(1),\n })\n .strict();\n\n/** Chat message tombstone — channel + seq from the report, revision from the live thread-read. */\nconst TombstoneChatSchema = z\n .object({\n button: z.literal('tombstoneChat'),\n channel: z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('channel'), workProjectId: z.string().min(1), guildChatChannelId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('invite'), guildInviteId: z.string().min(1) }).strict(),\n ]),\n messageSeq: z.number().int().nonnegative(),\n expectedMessageRevision: z.number().int().nonnegative(),\n })\n .strict();\n\nexport const StagedActionSchema = z\n .discriminatedUnion('button', [\n ContentActionSchema,\n WarnUserSchema,\n SuspendOrBanSchema,\n ReinstateUserSchema,\n ForceUsernameResetSchema,\n WorkObjectActionSchema,\n ClearContentTextActionSchema,\n TombstoneChatSchema,\n ])\n // The clearContentText arm's two cross-field rules, applied at the union (the\n // SafetyStagedActionSchema pattern below) because no other arm carries these fields:\n // every chosen field must belong to the chosen target's canonical clearable set, and the\n // hall sub-item target must name its parent hall item.\n .superRefine((value, ctx) => {\n if (value.button !== 'clearContentText') return;\n const clearable: readonly string[] = CLEAR_CONTENT_TEXT_FIELDS_BY_TARGET[value.targetType];\n value.fields.forEach((field, index) => {\n if (!clearable.includes(field)) {\n ctx.addIssue({\n code: 'custom',\n message: `Field '${field}' is not clearable on a '${value.targetType}' target.`,\n path: ['fields', index],\n });\n }\n });\n if (value.targetType === 'hall-library-sub-item' && !value.parentItemId) {\n ctx.addIssue({\n code: 'custom',\n message: 'parentItemId (the parent hall item id) is required for a hall sub-item target.',\n path: ['parentItemId'],\n });\n }\n });\nexport type StagedAction = z.infer<typeof StagedActionSchema>;\n\nexport const NormalReportInputSchema = z\n .object({\n caseType: z.literal('normalReport').default('normalReport'),\n taskId: z.string().min(1),\n outcome: z.enum(['founded', 'unfounded']),\n resolutionSummary: z.string().trim().min(1).max(MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH),\n actions: z.array(StagedActionSchema).max(16).default([]),\n userFacingReasonCode: z.string().trim().min(1).max(128).optional(),\n userFacingReasonDetail: z.string().trim().max(MAX_USER_FACING_REASON_DETAIL_LENGTH).optional(),\n adminNote: z.string().trim().max(MAX_SAFETY_ADMIN_NOTE_LENGTH).optional(),\n })\n .strict();\nexport type ResolveAdminTaskInput = z.infer<typeof NormalReportInputSchema>;\n\nconst SafetyDispositionActionSchema = z\n .object({\n button: z.literal('setReportDisposition'),\n // Derived from the ONE canonical disposition enum — 'undetermined' is the initial\n // state, never an operator-settable target, so it is excluded (not re-declared).\n disposition: ReportDispositionSchema.exclude(['undetermined']),\n dispositionReasonCode: ReportDispositionReasonCodeSchema,\n // Derived from the ONE receipts-cap constant (doc-schemas/safety/evidence.ts) — the same\n // bound the callable + the embedded SetReportDispositionInputV1Schema use. No field-level min:\n // the reportRequired⇒non-empty rule lives in the shared cross-field refinement below, so every\n // other disposition may legally stage this action with no evidence revealed.\n evidenceRefs: z.array(z.string().min(1)).max(MAX_MANIFEST_NCMEC_RECEIPTS),\n expectedRevision: z.number().int().nonnegative(),\n })\n .strict();\n\nconst QuarantineActionSchema = z.object({ button: z.literal('quarantinePreserveFile') }).strict();\n\n// [C-01/EUAS-002] No client-supplied requestId — the linked statutory request id(s) are derived\n// SERVER-SIDE from the case's `requestLinks` inside `enqueueNciiRemovalForCase`.\nconst HashRemoveActionSchema = z.object({ button: z.literal('hashRemoveFile') }).strict();\n\nconst SafetyAccountActionSchema = z\n .object({\n button: z.enum(['suspendUser', 'banUser', 'reinstateUser']),\n targetUid: z.string().min(1),\n reasonInternal: z.string().trim().min(4).max(MAX_INTERNAL_REASON_LENGTH),\n reasonUserFacing: z.string().trim().min(1).max(MAX_USER_FACING_REASON_LENGTH),\n role: ChildSafetyAccountRoleSchema,\n subjectDisposition: ChildSafetyAccountSubjectDispositionSchema,\n })\n .strict();\n\nexport const SafetyStagedActionSchema = z\n .discriminatedUnion('button', [\n SafetyDispositionActionSchema,\n QuarantineActionSchema,\n HashRemoveActionSchema,\n SafetyAccountActionSchema,\n ])\n // The setReportDisposition arm reuses the ONE canonical cross-field rules (foundation.ts) via the\n // shared refinements — never re-declaring them here: the disposition↔reason pairing AND the\n // reportRequired⇒evidence-present rule. Other arms carry no such fields.\n .superRefine((value, ctx) => {\n if (value.button === 'setReportDisposition') {\n refineReportDispositionReasonCode(value, ctx);\n refineReportDispositionEvidenceRefs(value, ctx);\n }\n });\nexport type SafetyStagedAction = z.infer<typeof SafetyStagedActionSchema>;\n\nexport const SafetyCaseInputSchema = z\n .object({\n caseType: z.enum(['csam', 'ncii']),\n caseId: z.string().min(1),\n outcome: z.enum(['founded', 'unfounded']),\n resolutionSummary: z.string().trim().min(1).max(MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH),\n actions: z.array(SafetyStagedActionSchema).max(16).default([]),\n adminNote: z.string().trim().max(MAX_SAFETY_ADMIN_NOTE_LENGTH).optional(),\n // [EUAS-017] Optimistic-concurrency token (`childSafetyCaseList.revision` / `nciiCases.revision`).\n // The close is rejected if the case changed since the operator loaded it — concurrent stale closes\n // can't silently overwrite. Optional for backward compatibility; the console always supplies it.\n expectedRevision: z.number().int().nonnegative().optional(),\n // Interim reauth: a single explicit typed confirmation for the privileged safety actions,\n // standing in for the passkey two-step until [H-17]. The callable is full-admin gated.\n confirmation: z.literal(SAFETY_ACTIONS_CONFIRMATION),\n })\n .strict();\nexport type SafetyCaseInput = z.infer<typeof SafetyCaseInputSchema>;\n\nexport const ReopenSafetyCaseInputSchema = z\n .object({\n caseType: z.enum(['csam', 'ncii']),\n caseId: z.string().min(1),\n reasonInternal: z.string().trim().min(4).max(MAX_INTERNAL_REASON_LENGTH),\n expectedRevision: z.number().int().nonnegative().optional(),\n confirmation: z.literal(SAFETY_CASE_REOPEN_CONFIRMATION),\n })\n .strict();\nexport type ReopenSafetyCaseInput = z.infer<typeof ReopenSafetyCaseInputSchema>;\n\n// ---------------------------------------------------------------------------\n// Dead-letter operations — adminReplayDeadLetter + getDeadLetters (Ops Repairs).\n// ---------------------------------------------------------------------------\n\n/** Every ledger the dead-letter replay callable supports. */\nexport const DeadLetterCollectionSchema = z.enum([\n 'chatSyncEvents',\n 'chatAdminActionCommands',\n 'notificationDeliveries',\n 'chatMessageOutbox',\n 'squareAnnouncementJobs',\n 'chatSyncFanoutJobs',\n 'mediaAssets',\n 'quarantineSagaJobs',\n 'nciiRemovalJobs',\n 'safetyEvidenceJobs',\n 'accountActionCommands',\n 'activeReportGroups',\n 'hallSubItemEdgeSync',\n]);\nexport type DeadLetterCollection = z.infer<typeof DeadLetterCollectionSchema>;\n\n/** Every replay lane whose target is a flat top-level document. */\nexport const FlatDeadLetterCollectionSchema = DeadLetterCollectionSchema.exclude(['hallSubItemEdgeSync']);\nexport type FlatDeadLetterCollection = z.infer<typeof FlatDeadLetterCollectionSchema>;\n\n/**\n * Canonical identity for a published Hall sub-item edge-sync replay target. The work type derives\n * the only valid nested collection through PATH_BUILDERS.hallItemSubItem; callers never submit a\n * Firestore path or collection segment.\n */\nexport const HallSubItemEdgeSyncReplayTargetSchema = z.object({\n hallItemId: hallItemIdSchema,\n workProjectType: workProjectTypeSchema,\n subItemId: z.string().min(1),\n}).strict();\nexport type HallSubItemEdgeSyncReplayTarget = z.infer<typeof HallSubItemEdgeSyncReplayTargetSchema>;\n\nexport const AdminReplayDeadLetterInputSchema = z\n .discriminatedUnion('collection', [\n z.object({\n collection: FlatDeadLetterCollectionSchema,\n docId: z.string().min(1).max(200),\n reason: z.string().min(1).max(MAX_INTERNAL_REASON_LENGTH),\n dryRun: z.boolean().optional(),\n }).strict(),\n z.object({\n collection: z.literal('hallSubItemEdgeSync'),\n ...HallSubItemEdgeSyncReplayTargetSchema.shape,\n reason: z.string().min(1).max(MAX_INTERNAL_REASON_LENGTH),\n dryRun: z.boolean().optional(),\n }).strict(),\n ]);\nexport type AdminReplayDeadLetterInput = z.infer<typeof AdminReplayDeadLetterInputSchema>;\n\nexport const GetDeadLettersInputSchema = z\n .object({\n /** Restrict to one listable flat ledger; absent = all listable flat ledgers. */\n collection: FlatDeadLetterCollectionSchema.optional(),\n /** Per-ledger row cap (the callable's own ceiling applies regardless). */\n limit: z.number().int().min(1).max(200).optional(),\n })\n .strict()\n .nullish();\nexport type GetDeadLettersInput = z.infer<typeof GetDeadLettersInputSchema>;\n\n\n"]}
1
+ {"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/schemas/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,gCAAgC,GACjC,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,iCAAiC,EACjC,mCAAmC,GAEpC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,4BAA4B,EAC5B,0CAA0C,GAC3C,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,EACL,gCAAgC,EAChC,+BAA+B,GAChC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,sCAAsC,EACtC,0BAA0B,EAC1B,6BAA6B,EAC7B,oCAAoC,EACpC,4BAA4B,EAC5B,4BAA4B,EAC5B,kCAAkC,EAClC,8BAA8B,EAC9B,oCAAoC,EACpC,0BAA0B,EAC1B,+BAA+B,EAC/B,4BA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,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,0BAA0B,CAAC;QACzD,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;KAC/B,CAAC,CAAC,MAAM,EAAE;IACX,CAAC,CAAC,MAAM,CAAC;QACP,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC;QAC5C,GAAG,qCAAqC,CAAC,KAAK;QAC9C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,0BAA0B,CAAC;QACzD,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;KAC/B,CAAC,CAAC,MAAM,EAAE;CACZ,CAAC,CAAC;AAGL,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,gFAAgF;IAChF,UAAU,EAAE,8BAA8B,CAAC,QAAQ,EAAE;IACrD,0EAA0E;IAC1E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC;KACD,MAAM,EAAE;KACR,OAAO,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n violationIdSchema,\n taskIdSchema,\n workProjectIdSchema,\n hallItemIdSchema,\n workProjectTypeSchema,\n moderationClearableSurfaceSchema,\n} from './atoms.js';\nimport {\n ReportDispositionSchema,\n ReportDispositionReasonCodeSchema,\n refineReportDispositionReasonCode,\n refineReportDispositionEvidenceRefs,\n type ReportableItemType,\n} from '../doc-schemas/safety/foundation.js';\nimport {\n ChildSafetyAccountRoleSchema,\n ChildSafetyAccountSubjectDispositionSchema,\n} from '../doc-schemas/safety/case.js';\nimport {\n ContentMediaKindSchema,\n MediaServingStatusSchema,\n} from '../doc-schemas/media-assets.js';\nimport { MAX_MANIFEST_NCMEC_RECEIPTS } from '../doc-schemas/safety/evidence.js';\nimport { RuleGroupSchema, RuleSubgroupSchema } from '../doc-schemas/content.js';\nimport {\n MODERATION_CLEARABLE_TEXT_FIELDS,\n HALL_CLEARABLE_TEXT_FIELD_NAMES,\n} from '../constants/business-content.js';\nimport {\n MAX_WORK_PROJECT_TITLE_LENGTH,\n MAX_ADMIN_DISPATCH_SUBJECT_LENGTH,\n MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH,\n MAX_INTERNAL_REASON_LENGTH,\n MAX_USER_FACING_REASON_LENGTH,\n MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH,\n MAX_SAFETY_ADMIN_NOTE_LENGTH,\n MAX_FUTURE_PLAN_TITLE_LENGTH,\n MAX_FUTURE_PLAN_DESCRIPTION_LENGTH,\n MAX_PLATFORM_RULE_TITLE_LENGTH,\n MAX_PLATFORM_RULE_DESCRIPTION_LENGTH,\n MAX_AGREEMENT_POINT_LENGTH,\n MAX_CONTENT_PAGE_HEADING_LENGTH,\n MAX_CONTENT_PAGE_BODY_LENGTH,\n MAX_CONTENT_PAGE_SECTIONS,\n MAX_TAKE_IT_DOWN_COPY_LENGTH,\n MAX_DMCA_CONTACT_BLOCKS,\n MAX_DMCA_CONTACT_ROWS,\n MAX_DMCA_CONTACT_LABEL_LENGTH,\n MAX_DMCA_CONTACT_VALUE_LENGTH,\n MAX_MAINTENANCE_MESSAGE_LENGTH,\n MAX_ANNOUNCEMENT_MESSAGE_LENGTH,\n MAX_APP_VERSION_LENGTH,\n MAX_APPEAL_REVIEW_NOTES_LENGTH,\n MAX_REQUIRE_RETITLE_REASON_LENGTH,\n MAX_USER_FACING_REASON_DETAIL_LENGTH,\n} from '../constants/business.js';\nimport {\n SAFETY_ACTIONS_CONFIRMATION,\n SAFETY_CASE_REOPEN_CONFIRMATION,\n} from '../constants/safety-confirmation-phrases.js';\n\nexport const CheckoutNextImportantTaskInputSchema = z.object({}).strict();\nexport type CheckoutNextImportantTaskInput = z.infer<typeof CheckoutNextImportantTaskInputSchema>;\n\nexport const GetContentViolationInputSchema = z.object({\n violationId: violationIdSchema,\n}).strict();\nexport type GetContentViolationInput = z.infer<typeof GetContentViolationInputSchema>;\n\n// `taskType` was removed — the server derives it from the task doc; the client copy was\n// ignored (and forgeable). Callers pass only the task id + the extension window.\nexport const MarkWorkLaterInputSchema = z.object({\n taskId: taskIdSchema,\n extendHours: z.union([z.literal(24), z.literal(48)]),\n}).strict();\nexport type MarkWorkLaterInput = z.infer<typeof MarkWorkLaterInputSchema>;\n\n/** The two appeal-review decisions (ONE canonical declaration — shared by the review\n * input and its authoritative result). */\nexport const ContentAppealDecisionSchema = z.enum(['approved', 'denied']);\nexport type ContentAppealDecision = z.infer<typeof ContentAppealDecisionSchema>;\n\nexport const ReviewContentAppealInputSchema = z.object({\n violationId: violationIdSchema,\n taskId: taskIdSchema,\n decision: ContentAppealDecisionSchema,\n adminNotes: z.string().max(MAX_APPEAL_REVIEW_NOTES_LENGTH),\n}).strict();\nexport type ReviewContentAppealInput = z.infer<typeof ReviewContentAppealInputSchema>;\n\n// Authoritative result of reviewContentAppeal. Non-strict (server → client posture).\nexport const ReviewContentAppealResultSchema = z.object({\n success: z.literal(true),\n violationId: violationIdSchema,\n /** Echo of the requested decision (always known — it is the input). */\n decision: ContentAppealDecisionSchema,\n /** The appealing user's uid ('' on the orphaned-task cleanup path, where the\n * underlying violation was already gone and only the stale task was cleared). */\n userId: z.string(),\n /** Operation-receipt audit id — the `admin.contentAppealReviewed` event written in the same\n * transaction. Optional/additive so an older backend that omits it still type-checks. */\n auditEventId: z.string().min(1).optional(),\n});\nexport type ReviewContentAppealResult = z.infer<typeof ReviewContentAppealResultSchema>;\n\n// --- Public-document content inputs ---\n// The Admin editors' strict CONTENT schemas, one per public document. A working copy is saved\n// through `SavePublicDocumentDraftInputSchema` (./public-documents.ts), which pairs each\n// document id with its content schema here; the content is FULL (a version is the whole\n// document, never a partial merge). The client never sends a version — the release publish\n// assigns it.\n\nexport const FuturePlanItemInputSchema = z.object({\n id: z.string().min(1).max(128),\n title: z.string().min(1).max(MAX_FUTURE_PLAN_TITLE_LENGTH),\n description: z.string().min(1).max(MAX_FUTURE_PLAN_DESCRIPTION_LENGTH),\n order: z.number().int().min(0),\n videoUrl: z.string().url().max(2048).optional(),\n mediaType: z.enum(['video', 'image', 'audio', 'other']).optional(),\n}).strict();\n\nexport const FuturePlansContentInputSchema = z.object({\n plans: z.array(FuturePlanItemInputSchema).max(200),\n}).strict();\nexport type FuturePlansContentInput = z.infer<typeof FuturePlansContentInputSchema>;\n\nexport const PlatformRuleInputSchema = z.object({\n id: z.string().min(1).max(128),\n title: z.string().min(1).max(MAX_PLATFORM_RULE_TITLE_LENGTH),\n description: z.string().min(1).max(MAX_PLATFORM_RULE_DESCRIPTION_LENGTH),\n videoUrl: z.string().url().max(2048).optional(),\n group: RuleGroupSchema.optional(),\n subgroup: RuleSubgroupSchema.optional(),\n order: z.number().int().min(0),\n}).strict();\n\nexport const AgreementCategoryInputSchema = z.object({\n points: z.array(z.string().min(1).max(MAX_AGREEMENT_POINT_LENGTH)).max(200),\n videoUrl: z.string().url().max(2048).optional(),\n}).strict();\n\nexport const AgreementsInputSchema = z.object({\n tales: AgreementCategoryInputSchema.optional(),\n tunes: AgreementCategoryInputSchema.optional(),\n television: AgreementCategoryInputSchema.optional(),\n}).strict();\n\nexport const RulesAndAgreementsContentInputSchema = z.object({\n rules: z.array(PlatformRuleInputSchema).max(500),\n agreements: AgreementsInputSchema,\n}).strict();\nexport type RulesAndAgreementsContentInput = z.infer<typeof RulesAndAgreementsContentInputSchema>;\n\nexport const ContentPageSectionInputSchema = z.object({\n id: z.string().min(1).max(128),\n heading: z.string().min(1).max(MAX_CONTENT_PAGE_HEADING_LENGTH),\n level: z.union([z.literal(1), z.literal(2)]),\n // Empty body is LEGAL: a bare divider heading (e.g. terms \"Part 1 — Our\n // Intention\") is real content. The input schema must accept everything the\n // stored ContentPageSectionSchema accepts, or a faithfully-seeded doc becomes\n // unsaveable in the admin editor (found by adversarial review 2026-07-06).\n body: z.string().max(MAX_CONTENT_PAGE_BODY_LENGTH),\n order: z.number().int().min(0),\n}).strict();\n\n/** The Terms of Service and Privacy Policy content (the one long-form legal page shape). */\nexport const LegalPageContentInputSchema = z.object({\n sections: z.array(ContentPageSectionInputSchema).min(1).max(MAX_CONTENT_PAGE_SECTIONS),\n}).strict();\nexport type LegalPageContentInput = z.infer<typeof LegalPageContentInputSchema>;\n\nexport const TakeItDownPageCopyContentInputSchema = z.object({\n strings: z.record(z.string().min(1).max(128), z.string().min(1).max(MAX_TAKE_IT_DOWN_COPY_LENGTH)),\n}).strict().refine(\n (data) => {\n const count = Object.keys(data.strings).length;\n return count >= 1 && count <= 200;\n },\n { message: 'strings must contain between 1 and 200 entries.' },\n);\nexport type TakeItDownPageCopyContentInput = z.infer<typeof TakeItDownPageCopyContentInputSchema>;\n\nconst DmcaContactRowInputSchema = z.object({\n id: z.string().min(1).max(128),\n label: z.string().min(1).max(MAX_DMCA_CONTACT_LABEL_LENGTH),\n value: z.string().min(1).max(MAX_DMCA_CONTACT_VALUE_LENGTH),\n order: z.number().int().min(0),\n}).strict();\n\nconst DmcaContactBlockInputSchema = z.object({\n id: z.string().min(1).max(128),\n heading: z.string().min(1).max(MAX_CONTENT_PAGE_HEADING_LENGTH),\n order: z.number().int().min(0),\n rows: z.array(DmcaContactRowInputSchema).min(1).max(MAX_DMCA_CONTACT_ROWS),\n}).strict();\n\n/**\n * The DMCA policy content: the intro line, the labeled contact blocks (at least one — the page\n * exists to name the designated agent), and the long-form process sections.\n */\nexport const DmcaPolicyContentInputSchema = z.object({\n intro: z.string().max(MAX_CONTENT_PAGE_BODY_LENGTH),\n contactBlocks: z.array(DmcaContactBlockInputSchema).min(1).max(MAX_DMCA_CONTACT_BLOCKS),\n sections: z.array(ContentPageSectionInputSchema).max(MAX_CONTENT_PAGE_SECTIONS),\n}).strict();\nexport type DmcaPolicyContentInput = z.infer<typeof DmcaPolicyContentInputSchema>;\n\nconst AppConfigDocIdSchema = z.literal('app');\n\nexport const UpdateAppConfigInputSchema = z.object({\n docId: AppConfigDocIdSchema,\n data: z.object({\n appVersion: z.string().min(1).max(MAX_APP_VERSION_LENGTH).optional(),\n maintenanceMode: z.boolean().optional(),\n maintenanceMessage: z.string().max(MAX_MAINTENANCE_MESSAGE_LENGTH).optional(),\n registrationEnabled: z.boolean().optional(),\n // Announcement banner copy; '' clears the banner (empty = nothing renders).\n announcementMessage: z.string().max(MAX_ANNOUNCEMENT_MESSAGE_LENGTH).optional(),\n // Runtime abuse throttle: 0 < m <= 1 (tighten-only; 1 = no throttle).\n rateLimitMultiplier: z.number().gt(0).max(1).optional(),\n }).strict().refine(\n (d) => Object.keys(d).length > 0,\n { message: 'data must have at least one field' },\n ),\n}).strict();\nexport type UpdateAppConfigInput = z.infer<typeof UpdateAppConfigInputSchema>;\n\n// --- Admin list mutations ---\n\nconst uidSchema = z.string().min(1).max(128);\n\n/**\n * Wire input for the `updateAdminList` callable in ttt-prod.\n * Used to grant or revoke admin / jrAdmin status on `_systemData/adminList`.\n *\n * All four fields are optional arrays of UIDs. At least one must be non-empty.\n * The callable's core function rejects conflicting input (e.g. same UID in\n * both addAdmins and removeAdmins) with HttpsError invalid-argument.\n */\nexport const UpdateAdminListInputSchema = z.object({\n addAdmins: z.array(uidSchema).optional(),\n removeAdmins: z.array(uidSchema).optional(),\n addJrAdmins: z.array(uidSchema).optional(),\n removeJrAdmins: z.array(uidSchema).optional(),\n})\n .strict()\n .refine(\n (data) =>\n (data.addAdmins?.length ?? 0) +\n (data.removeAdmins?.length ?? 0) +\n (data.addJrAdmins?.length ?? 0) +\n (data.removeJrAdmins?.length ?? 0) >\n 0,\n { message: 'At least one of addAdmins/removeAdmins/addJrAdmins/removeJrAdmins must be non-empty.' },\n );\n\nexport type UpdateAdminListInput = z.infer<typeof UpdateAdminListInputSchema>;\n\n// Authoritative result of updateAdminList — the grant/revoke delta counts computed inside\n// the roster transaction (uids already in their target state are no-ops and not counted).\n// Non-strict (server → client result posture).\nexport const UpdateAdminListResultSchema = z.object({\n success: z.literal(true),\n adminsGranted: z.number().int().nonnegative(),\n adminsRevoked: z.number().int().nonnegative(),\n jrAdminsGranted: z.number().int().nonnegative(),\n jrAdminsRevoked: z.number().int().nonnegative(),\n /** Operation-receipt audit id — the `admin.systemRoleGranted` / `admin.systemRoleRevoked`\n * event(s) key off the same roster transaction. Optional/additive. (No single domain id: a\n * roster edit spans multiple uids, so only the audit id is a meaningful receipt handle.) */\n auditEventId: z.string().min(1).optional(),\n});\nexport type UpdateAdminListResult = z.infer<typeof UpdateAdminListResultSchema>;\n\n// --- Admin moderation: hide / restore / retitle content + Work/Realm objects ---\n\nexport const CheckTrademarkInputSchema = z.object({\n // Primary: the work project's title (franchise-level check).\n workTitle: z.string().min(1).max(MAX_WORK_PROJECT_TITLE_LENGTH),\n // Optional: the sub-item title (chapter, track, episode). Checked secondarily.\n // `.nullish()` (not `.optional()`): the Firebase callable client serializes an\n // undefined argument as JSON null, and the work-view caller passes\n // `subItemTitle: subItem?.title` which is undefined when the sub-item hasn't\n // loaded — that arrives here as null. A bare `.optional()` would 400 on it.\n subItemTitle: z.string().max(MAX_WORK_PROJECT_TITLE_LENGTH).nullish(),\n}).strict();\nexport type CheckTrademarkInput = z.infer<typeof CheckTrademarkInputSchema>;\n\nexport const GetReportedContentDetailInputSchema = z.object({\n reportGroupId: z.string().min(1),\n}).strict();\nexport type GetReportedContentDetailInput = z.infer<typeof GetReportedContentDetailInputSchema>;\n\n// --- getReportedContentDetail result (cross-boundary: produced by the callable in functions/,\n// consumed by the admin report work-view) ---\n\n/** One display-text field of the reported doc, labeled for the review panel. The server returns\n * EVERY configured non-empty text field for the item type (title, description, body, …) in\n * display order — never just the first non-empty one. */\nexport const ReportedTextFieldSchema = z.object({\n /** Raw doc field name (e.g. 'description', 'workingTitle'). */\n field: z.string().min(1),\n /** Human label the panel renders (e.g. 'Description', 'Title'). */\n label: z.string().min(1),\n /** Current live value, trimmed; empty fields are omitted from the array. */\n value: z.string().min(1),\n});\nexport type ReportedTextField = z.infer<typeof ReportedTextFieldSchema>;\n\n/** One media asset referenced by the reported content: id + kind + current serving state\n * (for click-to-reveal) + the server-derived variant key the reveal must request. */\nexport const ReportedMediaAssetSchema = z.object({\n mediaAssetId: z.string().min(1),\n mediaKind: ContentMediaKindSchema.nullable(),\n servingStatus: MediaServingStatusSchema.nullable(),\n /** The variant key the reveal must request for its single display render (image origins split\n * between 'full' and 'main'; video/audio are always 'main'). Null when the asset doc is\n * missing/variant-less. */\n displayVariantKey: z.string().nullable(),\n /** Human label of WHAT this asset is on the reported item (e.g. 'Square cover',\n * 'Track photo — <title>'). Null when the server cannot derive one. */\n label: z.string().nullable(),\n});\nexport type ReportedMediaAsset = z.infer<typeof ReportedMediaAssetSchema>;\n\nexport const GetReportedContentDetailResultSchema = z.object({\n itemType: z.string().min(1),\n reportedItemId: z.string().min(1),\n /** First non-empty display-text field (legacy single-field snapshot; textFields is the\n * complete labeled set). */\n textSnapshot: z.string().nullable(),\n textFields: z.array(ReportedTextFieldSchema),\n mediaAssets: z.array(ReportedMediaAssetSchema),\n /** Whether the reported doc is currently hidden (best-effort, doc-flag based). */\n isHidden: z.boolean().nullable(),\n /** The content owner / uploader uid, when derivable. */\n ownerUid: z.string().nullable(),\n /**\n * The canonical moderation-clearable SURFACE this reported doc actually IS, resolved\n * SERVER-side: `chapter` / `tuneTrack` / `televisionEpisode` for a hall sub-item (through\n * `HALL_CONTENT_SURFACES_BY_WORK_TYPE`, from the parent hall doc the callable already reads),\n * `workProject` / `workRealm` for the shells.\n *\n * Why the resolved surface and not the `workProjectType` it was resolved from: the surface is\n * what a consumer needs — `MODERATION_CLEARABLE_TEXT_FIELDS[clearableSurface]` is the exact\n * clearable field set, one canonical index with no re-derivation. Shipping the work-project type\n * instead would make every consumer redo the routing AND the detail-vs-sub-item branch, which is\n * precisely the hand-rolled duplication that map was created to end.\n *\n * What it fixes: the in-flow clear's field picker offered the hall-family UNION\n * (title/description/content) because the projection never said which surface the sub-item was —\n * so an operator could tick `description` on a Tale chapter (title/content) or `content` on a\n * Tune track (title/description), pass the wire refinement, and have the clear runner silently\n * drop it. The picker now offers only this surface's fields, and the resolve path re-checks\n * caller-supplied fields against the same set.\n *\n * `.nullish()`: absent on payloads produced before this field existed, and null when the\n * reported item is not a clearable text surface at all (a square post, a chat message, a\n * profile picture).\n */\n clearableSurface: moderationClearableSurfaceSchema.nullish(),\n /** The FROZEN report-time snapshot (captured at intake), so the operator sees what was\n * reported even if the author edited the live doc to evade. Null for older reports. */\n reportTimeSnapshot: z.object({\n capturedText: z.string().nullable(),\n capturedMediaAssetIds: z.array(z.string()),\n revision: z.number().nullable(),\n capturedAt: z.number().nullable(),\n }).nullable(),\n});\nexport type GetReportedContentDetailResult = z.infer<typeof GetReportedContentDetailResultSchema>;\n\nexport const HideHallSubItemInputSchema = z.object({\n hallItemId: hallItemIdSchema,\n workProjectType: workProjectTypeSchema,\n subItemId: z.string().min(1),\n reason: z.string().min(1),\n}).strict();\nexport type HideHallSubItemInput = z.infer<typeof HideHallSubItemInputSchema>;\n\nexport const RestoreHallSubItemInputSchema = z.object({\n hallItemId: hallItemIdSchema,\n workProjectType: workProjectTypeSchema,\n subItemId: z.string().min(1),\n}).strict();\nexport type RestoreHallSubItemInput = z.infer<typeof RestoreHallSubItemInputSchema>;\n\nexport const HideWorkProjectInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n reason: z.string().min(1),\n}).strict();\nexport type HideWorkProjectInput = z.infer<typeof HideWorkProjectInputSchema>;\n\nexport const HideWorkRealmInputSchema = z.object({\n workRealmId: z.string().min(1),\n reason: z.string().min(1),\n}).strict();\nexport type HideWorkRealmInput = z.infer<typeof HideWorkRealmInputSchema>;\n\n// `cascadeId` is OPTIONAL: the app backends derive all active cascades for the target when it is\n// omitted, and restore just that one cascade when it is supplied.\nexport const RestoreWorkProjectInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n cascadeId: z.string().min(1).optional(),\n}).strict();\nexport type RestoreWorkProjectInput = z.infer<typeof RestoreWorkProjectInputSchema>;\n\nexport const RestoreWorkRealmInputSchema = z.object({\n workRealmId: z.string().min(1),\n cascadeId: z.string().min(1).optional(),\n}).strict();\nexport type RestoreWorkRealmInput = z.infer<typeof RestoreWorkRealmInputSchema>;\n\n// The `requireWorkProjectRetitle` / `requireWorkRealmRetitle` callables share this base\n// `{ reason }` shape and each `.extend(...)` it with its own id field at parse time.\nexport const RequireRetitleInputSchema = z.object({\n reason: z.string().min(1).max(MAX_REQUIRE_RETITLE_REASON_LENGTH),\n}).strict();\nexport type RequireRetitleInput = z.infer<typeof RequireRetitleInputSchema>;\n\n// --- Page-level \"Clear text (moderation)\" callables (per-field extension of the retitle family) ---\n\n// The clearable SHELL fields (raw doc field names) for the workProject + workRealm contexts.\n// Derived from the canonical clearable-field map — the two shell surfaces share the same fields.\nconst ModerationShellClearFieldSchema = z.enum(MODERATION_CLEARABLE_TEXT_FIELDS.workProject);\nexport type ModerationShellClearField = z.infer<typeof ModerationShellClearFieldSchema>;\n\nexport const ClearWorkProjectTextInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n fields: z.array(ModerationShellClearFieldSchema).min(1),\n reason: z.string().trim().min(1).max(MAX_REQUIRE_RETITLE_REASON_LENGTH),\n}).strict();\nexport type ClearWorkProjectTextInput = z.infer<typeof ClearWorkProjectTextInputSchema>;\n\nexport const ClearWorkRealmTextInputSchema = z.object({\n workRealmId: z.string().min(1),\n fields: z.array(ModerationShellClearFieldSchema).min(1),\n reason: z.string().trim().min(1).max(MAX_REQUIRE_RETITLE_REASON_LENGTH),\n}).strict();\nexport type ClearWorkRealmTextInput = z.infer<typeof ClearWorkRealmTextInputSchema>;\n\n// The clearable TEXT fields across the whole hall content family — derived from the canonical\n// map (union of every hall surface's fields), never restated literals.\nconst HallClearFieldSchema = z.enum(HALL_CLEARABLE_TEXT_FIELD_NAMES);\nexport type HallClearField = z.infer<typeof HallClearFieldSchema>;\n\nexport const ClearHallContentTextInputSchema = z.object({\n hallItemId: hallItemIdSchema,\n workProjectType: workProjectTypeSchema,\n subItemId: z.string().min(1).optional(),\n fields: z.array(HallClearFieldSchema).min(1),\n reason: z.string().trim().min(1).max(MAX_REQUIRE_RETITLE_REASON_LENGTH),\n}).strict();\nexport type ClearHallContentTextInput = z.infer<typeof ClearHallContentTextInputSchema>;\n\n// --- getLatestHideCascade — resolve the latest hide-cascade id for a Work/Realm ---\n\nexport const GetLatestHideCascadeInputSchema = z.object({\n entityId: z.string().min(1),\n targetType: z.enum(['work-project', 'work-realm']),\n}).strict();\nexport type GetLatestHideCascadeInput = z.infer<typeof GetLatestHideCascadeInputSchema>;\n\n// --- moderateReportedContent — hide / restore / soft perma-remove an individual reported item ---\n\n// The single-item content-action target set (SUBSET of ReportableItemType — excludes the\n// close-out-only hall-library-sub-item).\nconst MODERATE_REPORTED_CONTENT_TARGET_TYPES = [\n 'square-streetz-post',\n 'audition',\n 'audition-entry',\n 'commission-listing',\n 'commission-proposal',\n 'work-asset',\n 'profile-picture',\n 'hall-library-item',\n 'craft-skill',\n // Conversation File — the hide/restore/remove action targets the file owner record +\n // its mediaAsset (the `work-asset` shape), never a chat message.\n 'conversation-file',\n] as const satisfies readonly ReportableItemType[];\n\nexport const ModerateReportedContentInputSchema = z.object({\n reportGroupId: z.string().min(1),\n targetType: z.enum(MODERATE_REPORTED_CONTENT_TARGET_TYPES),\n reportedItemId: z.string().min(1),\n parentItemId: z.string().min(1).optional(),\n action: z.enum(['hide', 'restore', 'remove']),\n // [EUAS-023] A destructive action (hide/remove) MUST carry a reason; restore is a reversal.\n reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH).optional(),\n})\n .strict()\n .superRefine((val, ctx) => {\n if ((val.action === 'hide' || val.action === 'remove') && !val.reason) {\n ctx.addIssue({\n code: 'custom',\n message: 'A reason is required to hide or remove content.',\n path: ['reason'],\n });\n }\n });\nexport type ModerateReportedContentInput = z.infer<typeof ModerateReportedContentInputSchema>;\n\n// --- resolveAdminTask — the ONE guided close-out for EVERY admin case type ---\n\n// [EUAS-005] The content-action target set ALSO accepts hall-library-sub-item (hide/restore only),\n// which routes to the dedicated `runSetHallSubItemHidden` core (not `runModerateReportedContent`).\nconst CONTENT_ACTION_TARGET_TYPES = [\n 'square-streetz-post',\n 'audition',\n 'audition-entry',\n 'commission-listing',\n 'commission-proposal',\n 'work-asset',\n 'profile-picture',\n 'hall-library-item',\n 'craft-skill',\n 'hall-library-sub-item',\n // Conversation File — same content action as `work-asset`, routed at the file record.\n 'conversation-file',\n] as const satisfies readonly ReportableItemType[];\n\nconst ContentActionSchema = z\n .object({\n button: z.enum(['hideContent', 'restoreContent', 'permaRemoveContent']),\n targetType: z.enum(CONTENT_ACTION_TARGET_TYPES),\n reportedItemId: z.string().min(1),\n parentItemId: z.string().min(1).optional(),\n })\n .strict();\n\nconst WarnUserSchema = z\n .object({\n button: z.literal('warnUser'),\n userId: z.string().min(1),\n // A warning IS an admin dispatch (resolveAdminTask → runCreateAdminDispatchToUser),\n // so it shares the dispatch subject/body caps.\n subject: z.string().trim().min(1).max(MAX_ADMIN_DISPATCH_SUBJECT_LENGTH),\n message: z.string().trim().min(1).max(MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH),\n })\n .strict();\n\nconst SuspendOrBanSchema = z\n .object({\n button: z.enum(['suspendUser', 'banUser']),\n userId: z.string().min(1),\n reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH),\n })\n .strict();\n\nconst ReinstateUserSchema = z\n .object({ button: z.literal('reinstateUser'), userId: z.string().min(1), reason: z.string().trim().max(MAX_INTERNAL_REASON_LENGTH).optional() })\n .strict();\n\nconst ForceUsernameResetSchema = z\n .object({ button: z.literal('forceUsernameReset'), userId: z.string().min(1), reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH).optional() })\n .strict();\n\n/** Whole-object Work/Realm remedies — `reportedItemId` is the workProjectId / workRealmId. */\nconst WorkObjectActionSchema = z\n .object({\n button: z.enum(['hideWorkObject', 'restoreWorkObject', 'forceRetitle']),\n targetType: z.enum(['work-project', 'work-realm']),\n reportedItemId: z.string().min(1),\n })\n .strict();\n\n// --- The in-flow clear-content disposition (staged counterpart of the page-level clear-text\n// callables) ---\n\n/** The three targets the in-flow text clear can neutralize — the Work/Realm shells plus a single\n * published hall sub-item. Compile-linked subset of the canonical reportable-item enum. */\nconst CLEAR_CONTENT_TEXT_TARGET_TYPES = [\n 'work-project',\n 'work-realm',\n 'hall-library-sub-item',\n] as const satisfies readonly ReportableItemType[];\nexport type ClearContentTextTargetType = (typeof CLEAR_CONTENT_TEXT_TARGET_TYPES)[number];\n\n/** Every field name the staged clear can carry across those three targets — the union of the two\n * canonical clearable owners (`MODERATION_CLEARABLE_TEXT_FIELDS` for the shells,\n * `HALL_CLEARABLE_TEXT_FIELD_NAMES` for the hall family), i.e. the same two sources\n * `ClearWorkProjectTextInputSchema` / `ClearHallContentTextInputSchema` derive from. No field\n * literal is restated here. */\nconst CLEAR_CONTENT_TEXT_FIELDS = [\n ...MODERATION_CLEARABLE_TEXT_FIELDS.workProject,\n ...HALL_CLEARABLE_TEXT_FIELD_NAMES,\n] as const;\nconst ClearContentTextFieldSchema = z.enum(CLEAR_CONTENT_TEXT_FIELDS);\nexport type ClearContentTextField = z.infer<typeof ClearContentTextFieldSchema>;\n\n/** Which fields each target legally accepts — projected from those same owners, so a\n * target/field mismatch is refused at the wire instead of reaching a clear runner that would\n * drop it. Enforced by the cross-field refinement on `StagedActionSchema` below. */\nconst CLEAR_CONTENT_TEXT_FIELDS_BY_TARGET = {\n 'work-project': MODERATION_CLEARABLE_TEXT_FIELDS.workProject,\n 'work-realm': MODERATION_CLEARABLE_TEXT_FIELDS.workRealm,\n 'hall-library-sub-item': HALL_CLEARABLE_TEXT_FIELD_NAMES,\n} as const satisfies Record<ClearContentTextTargetType, readonly ClearContentTextField[]>;\n\n/** Per-field text clear — the guided close-out's staged counterpart of the page-level\n * `clearWorkProjectText` / `clearWorkRealmText` / `clearHallContentText` callables (the\n * per-field extension of `forceRetitle`). `reportedItemId` is the workProjectId / workRealmId /\n * sub-item id; `parentItemId` is the parent hall item id, required only for the sub-item target.\n * `workProjectType` is deliberately NOT on the wire — the server re-reads it from the doc (the\n * hall hide-branch precedent). */\nconst ClearContentTextActionSchema = z\n .object({\n button: z.literal('clearContentText'),\n targetType: z.enum(CLEAR_CONTENT_TEXT_TARGET_TYPES),\n reportedItemId: z.string().min(1),\n parentItemId: z.string().min(1).optional(),\n fields: z.array(ClearContentTextFieldSchema).min(1),\n })\n .strict();\n\n/** Chat message tombstone — channel + seq from the report, revision from the live thread-read. */\nconst TombstoneChatSchema = z\n .object({\n button: z.literal('tombstoneChat'),\n channel: z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('channel'), workProjectId: z.string().min(1), guildChatChannelId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('invite'), guildInviteId: z.string().min(1) }).strict(),\n ]),\n messageSeq: z.number().int().nonnegative(),\n expectedMessageRevision: z.number().int().nonnegative(),\n })\n .strict();\n\nexport const StagedActionSchema = z\n .discriminatedUnion('button', [\n ContentActionSchema,\n WarnUserSchema,\n SuspendOrBanSchema,\n ReinstateUserSchema,\n ForceUsernameResetSchema,\n WorkObjectActionSchema,\n ClearContentTextActionSchema,\n TombstoneChatSchema,\n ])\n // The clearContentText arm's two cross-field rules, applied at the union (the\n // SafetyStagedActionSchema pattern below) because no other arm carries these fields:\n // every chosen field must belong to the chosen target's canonical clearable set, and the\n // hall sub-item target must name its parent hall item.\n .superRefine((value, ctx) => {\n if (value.button !== 'clearContentText') return;\n const clearable: readonly string[] = CLEAR_CONTENT_TEXT_FIELDS_BY_TARGET[value.targetType];\n value.fields.forEach((field, index) => {\n if (!clearable.includes(field)) {\n ctx.addIssue({\n code: 'custom',\n message: `Field '${field}' is not clearable on a '${value.targetType}' target.`,\n path: ['fields', index],\n });\n }\n });\n if (value.targetType === 'hall-library-sub-item' && !value.parentItemId) {\n ctx.addIssue({\n code: 'custom',\n message: 'parentItemId (the parent hall item id) is required for a hall sub-item target.',\n path: ['parentItemId'],\n });\n }\n });\nexport type StagedAction = z.infer<typeof StagedActionSchema>;\n\nexport const NormalReportInputSchema = z\n .object({\n caseType: z.literal('normalReport').default('normalReport'),\n taskId: z.string().min(1),\n outcome: z.enum(['founded', 'unfounded']),\n resolutionSummary: z.string().trim().min(1).max(MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH),\n actions: z.array(StagedActionSchema).max(16).default([]),\n userFacingReasonCode: z.string().trim().min(1).max(128).optional(),\n userFacingReasonDetail: z.string().trim().max(MAX_USER_FACING_REASON_DETAIL_LENGTH).optional(),\n adminNote: z.string().trim().max(MAX_SAFETY_ADMIN_NOTE_LENGTH).optional(),\n })\n .strict();\nexport type ResolveAdminTaskInput = z.infer<typeof NormalReportInputSchema>;\n\nconst SafetyDispositionActionSchema = z\n .object({\n button: z.literal('setReportDisposition'),\n // Derived from the ONE canonical disposition enum — 'undetermined' is the initial\n // state, never an operator-settable target, so it is excluded (not re-declared).\n disposition: ReportDispositionSchema.exclude(['undetermined']),\n dispositionReasonCode: ReportDispositionReasonCodeSchema,\n // Derived from the ONE receipts-cap constant (doc-schemas/safety/evidence.ts) — the same\n // bound the callable + the embedded SetReportDispositionInputV1Schema use. No field-level min:\n // the reportRequired⇒non-empty rule lives in the shared cross-field refinement below, so every\n // other disposition may legally stage this action with no evidence revealed.\n evidenceRefs: z.array(z.string().min(1)).max(MAX_MANIFEST_NCMEC_RECEIPTS),\n expectedRevision: z.number().int().nonnegative(),\n })\n .strict();\n\nconst QuarantineActionSchema = z.object({ button: z.literal('quarantinePreserveFile') }).strict();\n\n// [C-01/EUAS-002] No client-supplied requestId — the linked statutory request id(s) are derived\n// SERVER-SIDE from the case's `requestLinks` inside `enqueueNciiRemovalForCase`.\nconst HashRemoveActionSchema = z.object({ button: z.literal('hashRemoveFile') }).strict();\n\nconst SafetyAccountActionSchema = z\n .object({\n button: z.enum(['suspendUser', 'banUser', 'reinstateUser']),\n targetUid: z.string().min(1),\n reasonInternal: z.string().trim().min(4).max(MAX_INTERNAL_REASON_LENGTH),\n reasonUserFacing: z.string().trim().min(1).max(MAX_USER_FACING_REASON_LENGTH),\n role: ChildSafetyAccountRoleSchema,\n subjectDisposition: ChildSafetyAccountSubjectDispositionSchema,\n })\n .strict();\n\nexport const SafetyStagedActionSchema = z\n .discriminatedUnion('button', [\n SafetyDispositionActionSchema,\n QuarantineActionSchema,\n HashRemoveActionSchema,\n SafetyAccountActionSchema,\n ])\n // The setReportDisposition arm reuses the ONE canonical cross-field rules (foundation.ts) via the\n // shared refinements — never re-declaring them here: the disposition↔reason pairing AND the\n // reportRequired⇒evidence-present rule. Other arms carry no such fields.\n .superRefine((value, ctx) => {\n if (value.button === 'setReportDisposition') {\n refineReportDispositionReasonCode(value, ctx);\n refineReportDispositionEvidenceRefs(value, ctx);\n }\n });\nexport type SafetyStagedAction = z.infer<typeof SafetyStagedActionSchema>;\n\nexport const SafetyCaseInputSchema = z\n .object({\n caseType: z.enum(['csam', 'ncii']),\n caseId: z.string().min(1),\n outcome: z.enum(['founded', 'unfounded']),\n resolutionSummary: z.string().trim().min(1).max(MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH),\n actions: z.array(SafetyStagedActionSchema).max(16).default([]),\n adminNote: z.string().trim().max(MAX_SAFETY_ADMIN_NOTE_LENGTH).optional(),\n // [EUAS-017] Optimistic-concurrency token (`childSafetyCaseList.revision` / `nciiCases.revision`).\n // The close is rejected if the case changed since the operator loaded it — concurrent stale closes\n // can't silently overwrite. Optional for backward compatibility; the console always supplies it.\n expectedRevision: z.number().int().nonnegative().optional(),\n // Interim reauth: a single explicit typed confirmation for the privileged safety actions,\n // standing in for the passkey two-step until [H-17]. The callable is full-admin gated.\n confirmation: z.literal(SAFETY_ACTIONS_CONFIRMATION),\n })\n .strict();\nexport type SafetyCaseInput = z.infer<typeof SafetyCaseInputSchema>;\n\nexport const ReopenSafetyCaseInputSchema = z\n .object({\n caseType: z.enum(['csam', 'ncii']),\n caseId: z.string().min(1),\n reasonInternal: z.string().trim().min(4).max(MAX_INTERNAL_REASON_LENGTH),\n expectedRevision: z.number().int().nonnegative().optional(),\n confirmation: z.literal(SAFETY_CASE_REOPEN_CONFIRMATION),\n })\n .strict();\nexport type ReopenSafetyCaseInput = z.infer<typeof ReopenSafetyCaseInputSchema>;\n\n// ---------------------------------------------------------------------------\n// Dead-letter operations — adminReplayDeadLetter + getDeadLetters (Ops Repairs).\n// ---------------------------------------------------------------------------\n\n/** Every ledger the dead-letter replay callable supports. */\nexport const DeadLetterCollectionSchema = z.enum([\n 'chatSyncEvents',\n 'chatAdminActionCommands',\n 'notificationDeliveries',\n 'chatMessageOutbox',\n 'squareAnnouncementJobs',\n 'chatSyncFanoutJobs',\n 'mediaAssets',\n 'quarantineSagaJobs',\n 'nciiRemovalJobs',\n 'safetyEvidenceJobs',\n 'accountActionCommands',\n 'activeReportGroups',\n 'hallSubItemEdgeSync',\n]);\nexport type DeadLetterCollection = z.infer<typeof DeadLetterCollectionSchema>;\n\n/** Every replay lane whose target is a flat top-level document. */\nexport const FlatDeadLetterCollectionSchema = DeadLetterCollectionSchema.exclude(['hallSubItemEdgeSync']);\nexport type FlatDeadLetterCollection = z.infer<typeof FlatDeadLetterCollectionSchema>;\n\n/**\n * Canonical identity for a published Hall sub-item edge-sync replay target. The work type derives\n * the only valid nested collection through PATH_BUILDERS.hallItemSubItem; callers never submit a\n * Firestore path or collection segment.\n */\nexport const HallSubItemEdgeSyncReplayTargetSchema = z.object({\n hallItemId: hallItemIdSchema,\n workProjectType: workProjectTypeSchema,\n subItemId: z.string().min(1),\n}).strict();\nexport type HallSubItemEdgeSyncReplayTarget = z.infer<typeof HallSubItemEdgeSyncReplayTargetSchema>;\n\nexport const AdminReplayDeadLetterInputSchema = z\n .discriminatedUnion('collection', [\n z.object({\n collection: FlatDeadLetterCollectionSchema,\n docId: z.string().min(1).max(200),\n reason: z.string().min(1).max(MAX_INTERNAL_REASON_LENGTH),\n dryRun: z.boolean().optional(),\n }).strict(),\n z.object({\n collection: z.literal('hallSubItemEdgeSync'),\n ...HallSubItemEdgeSyncReplayTargetSchema.shape,\n reason: z.string().min(1).max(MAX_INTERNAL_REASON_LENGTH),\n dryRun: z.boolean().optional(),\n }).strict(),\n ]);\nexport type AdminReplayDeadLetterInput = z.infer<typeof AdminReplayDeadLetterInputSchema>;\n\nexport const GetDeadLettersInputSchema = z\n .object({\n /** Restrict to one listable flat ledger; absent = all listable flat ledgers. */\n collection: FlatDeadLetterCollectionSchema.optional(),\n /** Per-ledger row cap (the callable's own ceiling applies regardless). */\n limit: z.number().int().min(1).max(200).optional(),\n })\n .strict()\n .nullish();\nexport type GetDeadLettersInput = z.infer<typeof GetDeadLettersInputSchema>;\n\n\n"]}
@@ -1,4 +1,29 @@
1
1
  import { z } from 'zod';
2
+ /**
3
+ * The document/version pairs a surface SHOWED before the person agreed — the acceptance prompt
4
+ * (`acceptPublicDocuments`) and the signup page (`registerUser`). Each document at most once. It
5
+ * is never authority: the server re-reads the version block in its transaction and compares this
6
+ * with what is current now (`samePublicDocumentVersions`); a difference means a publish raced
7
+ * what was shown.
8
+ */
9
+ export declare const ShownPublicDocumentVersionsSchema: z.ZodArray<z.ZodObject<{
10
+ documentId: z.ZodEnum<{
11
+ futurePlans: "futurePlans";
12
+ rulesAndAgreements: "rulesAndAgreements";
13
+ termsOfService: "termsOfService";
14
+ privacyPolicy: "privacyPolicy";
15
+ takeItDownPageCopy: "takeItDownPageCopy";
16
+ dmcaPolicy: "dmcaPolicy";
17
+ }>;
18
+ version: z.ZodNumber;
19
+ }, z.core.$strict>>;
20
+ /**
21
+ * The answer when a publish raced what the surface showed: nothing was written. The surface
22
+ * reads the version block live, so it shows the current versions and asks again.
23
+ */
24
+ export declare const PublicDocumentsRefreshRequiredResultSchema: z.ZodObject<{
25
+ status: z.ZodLiteral<"refreshRequired">;
26
+ }, z.core.$strip>;
2
27
  /**
3
28
  * `savePublicDocumentDraft` — replace a document's one private working copy with the editor's
4
29
  * FULL content. `baseVersion` is the published version the edit started from (the prior version
@@ -1 +1 @@
1
- {"version":3,"file":"public-documents.d.ts","sourceRoot":"","sources":["../../src/schemas/public-documents.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA+BxB;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCA+B7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,eAAO,MAAM,mCAAmC;;;;;;;;;;;iBAI9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAIhG;;;;;;;GAOG;AACH,eAAO,MAAM,uCAAuC;;;;;;;;;;;kBAQzC,CAAC;AACZ,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAC;AAExG,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;iBAKnD,CAAC;AACH,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC;AAI1G;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;kBAKlC,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,eAAO,MAAM,iCAAiC;;;;;6BAU5C,CAAC;AACH,MAAM,MAAM,2B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AAO,qCAAqC,CAAC,CAAC;AAMpG,2FAA2F;AAC3F,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;kBAK3C,CAAC;AACZ,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC;AAE5G;;;;GAIG;AACH,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;kBAM3C,CAAC;AACZ,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC"}
@@ -13,6 +13,24 @@ import { LegalPageContentInputSchema, RulesAndAgreementsContentInputSchema, Futu
13
13
  const baseVersionSchema = z.number().int().nonnegative();
14
14
  /** A document/version list that names each document at most once. */
15
15
  const distinctVersionRefs = (refs) => new Set(refs.map((ref) => ref.documentId)).size === refs.length;
16
+ /**
17
+ * The document/version pairs a surface SHOWED before the person agreed — the acceptance prompt
18
+ * (`acceptPublicDocuments`) and the signup page (`registerUser`). Each document at most once. It
19
+ * is never authority: the server re-reads the version block in its transaction and compares this
20
+ * with what is current now (`samePublicDocumentVersions`); a difference means a publish raced
21
+ * what was shown.
22
+ */
23
+ export const ShownPublicDocumentVersionsSchema = z
24
+ .array(PublicDocumentVersionRefSchema)
25
+ .max(PUBLIC_DOCUMENT_IDS.length)
26
+ .refine(distinctVersionRefs, { message: 'List each document once.' });
27
+ /**
28
+ * The answer when a publish raced what the surface showed: nothing was written. The surface
29
+ * reads the version block live, so it shows the current versions and asks again.
30
+ */
31
+ export const PublicDocumentsRefreshRequiredResultSchema = z.object({
32
+ status: z.literal('refreshRequired'),
33
+ });
16
34
  // ── Save a working copy ──────────────────────────────────────────────────────
17
35
  /**
18
36
  * `savePublicDocumentDraft` — replace a document's one private working copy with the editor's
@@ -90,10 +108,7 @@ export const PublishPublicDocumentReleaseResultSchema = z.object({
90
108
  * the prompt asks again. Idempotent.
91
109
  */
92
110
  export const AcceptPublicDocumentsInputSchema = z.object({
93
- documents: z
94
- .array(PublicDocumentVersionRefSchema)
95
- .max(PUBLIC_DOCUMENT_IDS.length)
96
- .refine(distinctVersionRefs, { message: 'List each document once.' }),
111
+ documents: ShownPublicDocumentVersionsSchema,
97
112
  }).strict();
98
113
  export const AcceptPublicDocumentsResultSchema = z.discriminatedUnion('status', [
99
114
  z.object({
@@ -101,10 +116,7 @@ export const AcceptPublicDocumentsResultSchema = z.discriminatedUnion('status',
101
116
  /** The level now on the private summary and the `docsAccepted` claim (refresh the token). */
102
117
  acceptedLevel: PublicDocumentAcceptanceLevelSchema,
103
118
  }),
104
- z.object({
105
- /** A publish raced the prompt: what it showed is no longer current. Nothing was written. */
106
- status: z.literal('refreshRequired'),
107
- }),
119
+ PublicDocumentsRefreshRequiredResultSchema,
108
120
  ]);
109
121
  // ── History ──────────────────────────────────────────────────────────────────
110
122
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"public-documents.js","sourceRoot":"","sources":["../../src/schemas/public-documents.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,0FAA0F;AAC1F,EAAE;AACF,8FAA8F;AAC9F,6FAA6F;AAC7F,mFAAmF;AAEnF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,kCAAkC,GACnC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,sBAAsB,EACtB,iCAAiC,EACjC,mCAAmC,EACnC,8BAA8B,EAC9B,2BAA2B,GAE5B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EACL,2BAA2B,EAC3B,oCAAoC,EACpC,6BAA6B,EAC7B,4BAA4B,EAC5B,oCAAoC,GACrC,MAAM,YAAY,CAAC;AAEpB,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EA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AE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE;IAC9B,uBAAuB,EAAE,mCAAmC;CAC7D,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ;;;;GAIG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChE,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,kCAAkC,CAAC;IACvD,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC;IAClD,aAAa,EAAE,mCAAmC;IAClD,yBAAyB,EAAE,+BAA+B,CAAC,QAAQ,EAAE;IACrE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["// Callable wire contracts of the versioned public-document system, plus the payloads of its two\n// audit events. The Firestore document shapes live in ../doc-schemas/public-documents.ts.\n//\n// The client never supplies an authoritative version, identity, or time: a working copy names\n// only the version its edit STARTED from; the publish assigns versions; the acceptance names\n// only the versions it SHOWED, which the server compares with what is current now.\n\nimport { z } from 'zod';\nimport { SPECIAL_DOCS } from '../paths/collections.js';\nimport {\n PUBLIC_DOCUMENT_IDS,\n PUBLIC_DOCUMENT_ACCEPTANCE_SOURCES,\n} from '../constants/public-documents.js';\nimport {\n PublicDocumentIdSchema,\n PublicDocumentVersionNumberSchema,\n PublicDocumentAcceptanceLevelSchema,\n PublicDocumentVersionRefSchema,\n PublicDocumentVersionSchema,\n type PublicDocumentVersionRef,\n} from '../doc-schemas/public-documents.js';\nimport { LegalReviewNoticeRevisionSchema } from '../doc-schemas/legal-review-notice.js';\nimport {\n LegalPageContentInputSchema,\n RulesAndAgreementsContentInputSchema,\n FuturePlansContentInputSchema,\n DmcaPolicyContentInputSchema,\n TakeItDownPageCopyContentInputSchema,\n} from './admin.js';\n\nconst baseVersionSchema = z.number().int().nonnegative();\n\n/** A document/version list that names each document at most once. */\nconst distinctVersionRefs = (refs: readonly PublicDocumentVersionRef[]) =>\n new Set(refs.map((ref) => ref.documentId)).size === refs.length;\n\n// ── Save a working copy ──────────────────────────────────────────────────────\n\n/**\n * `savePublicDocumentDraft` — replace a document's one private working copy with the editor's\n * FULL content. `baseVersion` is the published version the edit started from (the prior version\n * the editor showed for reference; 0 for a never-published document). The server refuses a base\n * that is no longer current. Discriminated on `documentId`, so each document's content is\n * validated by its own schema.\n */\nexport const SavePublicDocumentDraftInputSchema = z.discriminatedUnion('documentId', [\n z.object({\n documentId: z.literal(SPECIAL_DOCS.TERMS_PAGE),\n baseVersion: baseVersionSchema,\n content: LegalPageContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.PRIVACY_PAGE),\n baseVersion: baseVersionSchema,\n content: LegalPageContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.RULES_AND_AGREEMENTS),\n baseVersion: baseVersionSchema,\n content: RulesAndAgreementsContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.FUTURE_PLANS),\n baseVersion: baseVersionSchema,\n content: FuturePlansContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.DMCA_POLICY),\n baseVersion: baseVersionSchema,\n content: DmcaPolicyContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.TAKE_IT_DOWN_PAGE_COPY),\n baseVersion: baseVersionSchema,\n content: TakeItDownPageCopyContentInputSchema,\n }).strict(),\n]);\nexport type SavePublicDocumentDraftInput = z.infer<typeof SavePublicDocumentDraftInputSchema>;\n\nexport const SavePublicDocumentDraftResultSchema = z.object({\n documentId: PublicDocumentIdSchema,\n baseVersion: baseVersionSchema,\n savedAt: z.number(),\n});\nexport type SavePublicDocumentDraftResult = z.infer<typeof SavePublicDocumentDraftResultSchema>;\n\n// ── Publish a release ────────────────────────────────────────────────────────\n\n/**\n * `publishPublicDocumentRelease` — publish the saved working copies of the listed documents as\n * ONE all-or-nothing release. `releaseId` is minted by the client once per release attempt and\n * reused on retry, so a repeated call finds the release it already committed instead of\n * publishing twice. `requireAcceptance` is the release's one choice (the form defaults it to yes).\n * Every listed document must have a saved working copy whose base is still current and whose\n * content differs from the current version.\n */\nexport const PublishPublicDocumentReleaseInputSchema = z.object({\n releaseId: z.string().uuid(),\n documentIds: z\n .array(PublicDocumentIdSchema)\n .min(1)\n .max(PUBLIC_DOCUMENT_IDS.length)\n .refine((ids) => new Set(ids).size === ids.length, { message: 'List each document once.' }),\n requireAcceptance: z.boolean(),\n}).strict();\nexport type PublishPublicDocumentReleaseInput = z.infer<typeof PublishPublicDocumentReleaseInputSchema>;\n\nexport const PublishPublicDocumentReleaseResultSchema = z.object({\n releaseId: z.string().min(1),\n documents: z.array(PublicDocumentVersionRefSchema).min(1),\n requireAcceptance: z.boolean(),\n requiredAcceptanceLevel: PublicDocumentAcceptanceLevelSchema,\n});\nexport type PublishPublicDocumentReleaseResult = z.infer<typeof PublishPublicDocumentReleaseResultSchema>;\n\n// ── Accept ───────────────────────────────────────────────────────────────────\n\n/**\n * `acceptPublicDocuments` — the acceptance prompt's Accept. `documents` is exactly the list the\n * prompt SHOWED (`changedPublicDocuments` for this person, at the versions shown). The server\n * accepts only when that equals what is current now; otherwise it answers `refreshRequired` and\n * the prompt asks again. Idempotent.\n */\nexport const AcceptPublicDocumentsInputSchema = z.object({\n documents: z\n .array(PublicDocumentVersionRefSchema)\n .max(PUBLIC_DOCUMENT_IDS.length)\n .refine(distinctVersionRefs, { message: 'List each document once.' }),\n}).strict();\nexport type AcceptPublicDocumentsInput = z.infer<typeof AcceptPublicDocumentsInputSchema>;\n\nexport const AcceptPublicDocumentsResultSchema = z.discriminatedUnion('status', [\n z.object({\n status: z.literal('accepted'),\n /** The level now on the private summary and the `docsAccepted` claim (refresh the token). */\n acceptedLevel: PublicDocumentAcceptanceLevelSchema,\n }),\n z.object({\n /** A publish raced the prompt: what it showed is no longer current. Nothing was written. */\n status: z.literal('refreshRequired'),\n }),\n]);\nexport type AcceptPublicDocumentsResult = z.infer<typeof AcceptPublicDocumentsResultSchema>;\n\n// ── History ──────────────────────────────────────────────────────────────────\n\n/**\n * `readPublicDocumentHistory` — Admin's read-only history of one document, newest first, a page\n * of PUBLIC_DOCUMENT_HISTORY_PAGE_LIMIT at a time. `beforeVersion` continues from the previous\n * page's `nextBeforeVersion`.\n */\nexport const ReadPublicDocumentHistoryInputSchema = z.object({\n documentId: PublicDocumentIdSchema,\n beforeVersion: PublicDocumentVersionNumberSchema.nullish(),\n}).strict();\nexport type ReadPublicDocumentHistoryInput = z.infer<typeof ReadPublicDocumentHistoryInputSchema>;\n\nexport const ReadPublicDocumentHistoryResultSchema = z.object({\n /** Full immutable versions — content, version, release, publisher uid, and time. */\n versions: z.array(PublicDocumentVersionSchema),\n /** Pass as `beforeVersion` for the next page; null when this page reached v1. */\n nextBeforeVersion: PublicDocumentVersionNumberSchema.nullable(),\n});\nexport type ReadPublicDocumentHistoryResult = z.infer<typeof ReadPublicDocumentHistoryResultSchema>;\n\n// ── Audit payloads ───────────────────────────────────────────────────────────\n// The `metadata` of the two audit events. The actor, target, and server timestamp ride the\n// event envelope; these carry what the release or acceptance was.\n\n/** `publicDocuments.released` — written in the publish transaction (adminReview actor). */\nexport const PublicDocumentsReleasedAuditPayloadSchema = z.object({\n releaseId: z.string().min(1),\n documents: z.array(PublicDocumentVersionRefSchema).min(1),\n requireAcceptance: z.boolean(),\n requiredAcceptanceLevel: PublicDocumentAcceptanceLevelSchema,\n}).strict();\nexport type PublicDocumentsReleasedAuditPayload = z.infer<typeof PublicDocumentsReleasedAuditPayloadSchema>;\n\n/**\n * `publicDocuments.accepted` — written in the same commit as the private summary, by the\n * acceptance callable (the pairs the prompt showed) and by registration (every current document).\n * `legalReviewNoticeRevision` is null when the notice was off. `acceptedAt` is server time.\n */\nexport const PublicDocumentsAcceptedAuditPayloadSchema = z.object({\n acceptedVia: z.enum(PUBLIC_DOCUMENT_ACCEPTANCE_SOURCES),\n documents: z.array(PublicDocumentVersionRefSchema),\n acceptedLevel: PublicDocumentAcceptanceLevelSchema,\n legalReviewNoticeRevision: LegalReviewNoticeRevisionSchema.nullable(),\n acceptedAt: z.number(),\n}).strict();\nexport type PublicDocumentsAcceptedAuditPayload = z.infer<typeof PublicDocumentsAcceptedAuditPayloadSchema>;\n"]}
1
+ {"version":3,"file":"public-documents.js","sourceRoot":"","sources":["../../src/schemas/public-documents.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,0FAA0F;AAC1F,EAAE;AACF,8FAA8F;AAC9F,6FAA6F;AAC7F,mFAAmF;AAEnF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,kCAAkC,GACnC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,sBAAsB,EACtB,iCAAiC,EACjC,mCAAmC,EACnC,8BAA8B,EAC9B,2BAA2B,GAE5B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EACL,2BAA2B,EAC3B,oCAAoC,EACpC,6BAA6B,EAC7B,4BAA4B,EAC5B,oCAAoC,GACrC,MAAM,YAAY,CAAC;AAEpB,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;AAEzD,qEAAqE;AACrE,MAAM,mBAAmB,GAAG,CAAC,IAAyC,EAAE,EAAE,CACxE,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC;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AG,CAAC,CAAC,CAAC;IACzD,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE;IAC9B,uBAAuB,EAAE,mCAAmC;CAC7D,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ;;;;GAIG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChE,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,kCAAkC,CAAC;IACvD,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC;IAClD,aAAa,EAAE,mCAAmC;IAClD,yBAAyB,EAAE,+BAA+B,CAAC,QAAQ,EAAE;IACrE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["// Callable wire contracts of the versioned public-document system, plus the payloads of its two\n// audit events. The Firestore document shapes live in ../doc-schemas/public-documents.ts.\n//\n// The client never supplies an authoritative version, identity, or time: a working copy names\n// only the version its edit STARTED from; the publish assigns versions; the acceptance names\n// only the versions it SHOWED, which the server compares with what is current now.\n\nimport { z } from 'zod';\nimport { SPECIAL_DOCS } from '../paths/collections.js';\nimport {\n PUBLIC_DOCUMENT_IDS,\n PUBLIC_DOCUMENT_ACCEPTANCE_SOURCES,\n} from '../constants/public-documents.js';\nimport {\n PublicDocumentIdSchema,\n PublicDocumentVersionNumberSchema,\n PublicDocumentAcceptanceLevelSchema,\n PublicDocumentVersionRefSchema,\n PublicDocumentVersionSchema,\n type PublicDocumentVersionRef,\n} from '../doc-schemas/public-documents.js';\nimport { LegalReviewNoticeRevisionSchema } from '../doc-schemas/legal-review-notice.js';\nimport {\n LegalPageContentInputSchema,\n RulesAndAgreementsContentInputSchema,\n FuturePlansContentInputSchema,\n DmcaPolicyContentInputSchema,\n TakeItDownPageCopyContentInputSchema,\n} from './admin.js';\n\nconst baseVersionSchema = z.number().int().nonnegative();\n\n/** A document/version list that names each document at most once. */\nconst distinctVersionRefs = (refs: readonly PublicDocumentVersionRef[]) =>\n new Set(refs.map((ref) => ref.documentId)).size === refs.length;\n\n/**\n * The document/version pairs a surface SHOWED before the person agreed — the acceptance prompt\n * (`acceptPublicDocuments`) and the signup page (`registerUser`). Each document at most once. It\n * is never authority: the server re-reads the version block in its transaction and compares this\n * with what is current now (`samePublicDocumentVersions`); a difference means a publish raced\n * what was shown.\n */\nexport const ShownPublicDocumentVersionsSchema = z\n .array(PublicDocumentVersionRefSchema)\n .max(PUBLIC_DOCUMENT_IDS.length)\n .refine(distinctVersionRefs, { message: 'List each document once.' });\n\n/**\n * The answer when a publish raced what the surface showed: nothing was written. The surface\n * reads the version block live, so it shows the current versions and asks again.\n */\nexport const PublicDocumentsRefreshRequiredResultSchema = z.object({\n status: z.literal('refreshRequired'),\n});\n\n// ── Save a working copy ──────────────────────────────────────────────────────\n\n/**\n * `savePublicDocumentDraft` — replace a document's one private working copy with the editor's\n * FULL content. `baseVersion` is the published version the edit started from (the prior version\n * the editor showed for reference; 0 for a never-published document). The server refuses a base\n * that is no longer current. Discriminated on `documentId`, so each document's content is\n * validated by its own schema.\n */\nexport const SavePublicDocumentDraftInputSchema = z.discriminatedUnion('documentId', [\n z.object({\n documentId: z.literal(SPECIAL_DOCS.TERMS_PAGE),\n baseVersion: baseVersionSchema,\n content: LegalPageContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.PRIVACY_PAGE),\n baseVersion: baseVersionSchema,\n content: LegalPageContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.RULES_AND_AGREEMENTS),\n baseVersion: baseVersionSchema,\n content: RulesAndAgreementsContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.FUTURE_PLANS),\n baseVersion: baseVersionSchema,\n content: FuturePlansContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.DMCA_POLICY),\n baseVersion: baseVersionSchema,\n content: DmcaPolicyContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.TAKE_IT_DOWN_PAGE_COPY),\n baseVersion: baseVersionSchema,\n content: TakeItDownPageCopyContentInputSchema,\n }).strict(),\n]);\nexport type SavePublicDocumentDraftInput = z.infer<typeof SavePublicDocumentDraftInputSchema>;\n\nexport const SavePublicDocumentDraftResultSchema = z.object({\n documentId: PublicDocumentIdSchema,\n baseVersion: baseVersionSchema,\n savedAt: z.number(),\n});\nexport type SavePublicDocumentDraftResult = z.infer<typeof SavePublicDocumentDraftResultSchema>;\n\n// ── Publish a release ────────────────────────────────────────────────────────\n\n/**\n * `publishPublicDocumentRelease` — publish the saved working copies of the listed documents as\n * ONE all-or-nothing release. `releaseId` is minted by the client once per release attempt and\n * reused on retry, so a repeated call finds the release it already committed instead of\n * publishing twice. `requireAcceptance` is the release's one choice (the form defaults it to yes).\n * Every listed document must have a saved working copy whose base is still current and whose\n * content differs from the current version.\n */\nexport const PublishPublicDocumentReleaseInputSchema = z.object({\n releaseId: z.string().uuid(),\n documentIds: z\n .array(PublicDocumentIdSchema)\n .min(1)\n .max(PUBLIC_DOCUMENT_IDS.length)\n .refine((ids) => new Set(ids).size === ids.length, { message: 'List each document once.' }),\n requireAcceptance: z.boolean(),\n}).strict();\nexport type PublishPublicDocumentReleaseInput = z.infer<typeof PublishPublicDocumentReleaseInputSchema>;\n\nexport const PublishPublicDocumentReleaseResultSchema = z.object({\n releaseId: z.string().min(1),\n documents: z.array(PublicDocumentVersionRefSchema).min(1),\n requireAcceptance: z.boolean(),\n requiredAcceptanceLevel: PublicDocumentAcceptanceLevelSchema,\n});\nexport type PublishPublicDocumentReleaseResult = z.infer<typeof PublishPublicDocumentReleaseResultSchema>;\n\n// ── Accept ───────────────────────────────────────────────────────────────────\n\n/**\n * `acceptPublicDocuments` — the acceptance prompt's Accept. `documents` is exactly the list the\n * prompt SHOWED (`changedPublicDocuments` for this person, at the versions shown). The server\n * accepts only when that equals what is current now; otherwise it answers `refreshRequired` and\n * the prompt asks again. Idempotent.\n */\nexport const AcceptPublicDocumentsInputSchema = z.object({\n documents: ShownPublicDocumentVersionsSchema,\n}).strict();\nexport type AcceptPublicDocumentsInput = z.infer<typeof AcceptPublicDocumentsInputSchema>;\n\nexport const AcceptPublicDocumentsResultSchema = z.discriminatedUnion('status', [\n z.object({\n status: z.literal('accepted'),\n /** The level now on the private summary and the `docsAccepted` claim (refresh the token). */\n acceptedLevel: PublicDocumentAcceptanceLevelSchema,\n }),\n PublicDocumentsRefreshRequiredResultSchema,\n]);\nexport type AcceptPublicDocumentsResult = z.infer<typeof AcceptPublicDocumentsResultSchema>;\n\n// ── History ──────────────────────────────────────────────────────────────────\n\n/**\n * `readPublicDocumentHistory` — Admin's read-only history of one document, newest first, a page\n * of PUBLIC_DOCUMENT_HISTORY_PAGE_LIMIT at a time. `beforeVersion` continues from the previous\n * page's `nextBeforeVersion`.\n */\nexport const ReadPublicDocumentHistoryInputSchema = z.object({\n documentId: PublicDocumentIdSchema,\n beforeVersion: PublicDocumentVersionNumberSchema.nullish(),\n}).strict();\nexport type ReadPublicDocumentHistoryInput = z.infer<typeof ReadPublicDocumentHistoryInputSchema>;\n\nexport const ReadPublicDocumentHistoryResultSchema = z.object({\n /** Full immutable versions — content, version, release, publisher uid, and time. */\n versions: z.array(PublicDocumentVersionSchema),\n /** Pass as `beforeVersion` for the next page; null when this page reached v1. */\n nextBeforeVersion: PublicDocumentVersionNumberSchema.nullable(),\n});\nexport type ReadPublicDocumentHistoryResult = z.infer<typeof ReadPublicDocumentHistoryResultSchema>;\n\n// ── Audit payloads ───────────────────────────────────────────────────────────\n// The `metadata` of the two audit events. The actor, target, and server timestamp ride the\n// event envelope; these carry what the release or acceptance was.\n\n/** `publicDocuments.released` — written in the publish transaction (adminReview actor). */\nexport const PublicDocumentsReleasedAuditPayloadSchema = z.object({\n releaseId: z.string().min(1),\n documents: z.array(PublicDocumentVersionRefSchema).min(1),\n requireAcceptance: z.boolean(),\n requiredAcceptanceLevel: PublicDocumentAcceptanceLevelSchema,\n}).strict();\nexport type PublicDocumentsReleasedAuditPayload = z.infer<typeof PublicDocumentsReleasedAuditPayloadSchema>;\n\n/**\n * `publicDocuments.accepted` — written in the same commit as the private summary, by the\n * acceptance callable (the pairs the prompt showed) and by registration (every current document).\n * `legalReviewNoticeRevision` is null when the notice was off. `acceptedAt` is server time.\n */\nexport const PublicDocumentsAcceptedAuditPayloadSchema = z.object({\n acceptedVia: z.enum(PUBLIC_DOCUMENT_ACCEPTANCE_SOURCES),\n documents: z.array(PublicDocumentVersionRefSchema),\n acceptedLevel: PublicDocumentAcceptanceLevelSchema,\n legalReviewNoticeRevision: LegalReviewNoticeRevisionSchema.nullable(),\n acceptedAt: z.number(),\n}).strict();\nexport type PublicDocumentsAcceptedAuditPayload = z.infer<typeof PublicDocumentsAcceptedAuditPayloadSchema>;\n"]}
@@ -63,8 +63,25 @@ export declare const RegisterUserInputSchema: z.ZodObject<{
63
63
  cookies: z.ZodLiteral<true>;
64
64
  terms: z.ZodLiteral<true>;
65
65
  }, z.core.$strict>;
66
+ publicDocuments: z.ZodArray<z.ZodObject<{
67
+ documentId: z.ZodEnum<{
68
+ futurePlans: "futurePlans";
69
+ rulesAndAgreements: "rulesAndAgreements";
70
+ termsOfService: "termsOfService";
71
+ privacyPolicy: "privacyPolicy";
72
+ takeItDownPageCopy: "takeItDownPageCopy";
73
+ dmcaPolicy: "dmcaPolicy";
74
+ }>;
75
+ version: z.ZodNumber;
76
+ }, z.core.$strict>>;
66
77
  }, z.core.$strict>;
67
78
  export type RegisterUserInput = z.infer<typeof RegisterUserInputSchema>;
79
+ export declare const RegisterUserResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
80
+ status: z.ZodLiteral<"registered">;
81
+ }, z.core.$strip>, z.ZodObject<{
82
+ status: z.ZodLiteral<"refreshRequired">;
83
+ }, z.core.$strip>], "status">;
84
+ export type RegisterUserResult = z.infer<typeof RegisterUserResultSchema>;
68
85
  export declare const SetUserStatusInputSchema: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AC,OAAO,iCAAiC,CAAC,CAAC"}
@@ -2,6 +2,7 @@ import { z } from 'zod';
2
2
  import { userIdSchema, calendarDateSchema } from './atoms.js';
3
3
  import { USERNAME_MIN_LENGTH, USERNAME_MAX_LENGTH, USERNAME_REGEX, MAX_ARTISAN_LOCATION_LENGTH, MAX_INTERNAL_REASON_LENGTH, MAX_USER_SEARCH_QUERY_LENGTH, } from '../constants/business.js';
4
4
  import { UserAccountStatusSchema } from '../doc-schemas/user.js';
5
+ import { ShownPublicDocumentVersionsSchema, PublicDocumentsRefreshRequiredResultSchema, } from './public-documents.js';
5
6
  /** The ONE composed display-name field validator (length bounds + charset). Every
6
7
  * callable accepting a display name spreads this — never a re-composed copy. */
7
8
  export const displayNameSchema = z
@@ -128,7 +129,19 @@ export const RegisterUserInputSchema = z.object({
128
129
  cookies: z.literal(true),
129
130
  terms: z.literal(true),
130
131
  }).strict(),
132
+ // The public-document versions the signup page SHOWED when the person agreed: every published
133
+ // document at its current version, `changedPublicDocuments(block, undefined)` off the live
134
+ // `_appConfig/app` version block. Empty before the first release (the first-admin bootstrap).
135
+ // Registration re-reads the block in its transaction and answers `refreshRequired`, writing
136
+ // nothing, when a publish raced the page — the same comparison the acceptance prompt's Accept makes.
137
+ publicDocuments: ShownPublicDocumentVersionsSchema,
131
138
  }).strict();
139
+ export const RegisterUserResultSchema = z.discriminatedUnion('status', [
140
+ // The account is registered with the documents shown accepted (or already was — an idempotent
141
+ // replay). Refresh the token: the `docsAccepted` claim was set after the commit.
142
+ z.object({ status: z.literal('registered') }),
143
+ PublicDocumentsRefreshRequiredResultSchema,
144
+ ]);
132
145
  export const SetUserStatusInputSchema = z.object({
133
146
  userId: userIdSchema,
134
147
  status: UserAccountStatusSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/schemas/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAA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AAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,4BAA4B,CAAC;CAClE,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,yFAAyF;AACzF,uFAAuF;AACvF,0FAA0F;AAC1F,0FAA0F;AAC1F,4DAA4D;AAC5D,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,4BAA4B,CAAC;CAClE,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,2FAA2F;AAC3F,6FAA6F;AAC7F,kEAAkE;AAClE,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACxB,oFAAoF;IACpF,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,oFAAoF;IACpF,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE;CAC5B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACxB,2EAA2E;IAC3E,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;CACvB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { userIdSchema, calendarDateSchema } from './atoms.js';\nimport {\n USERNAME_MIN_LENGTH,\n USERNAME_MAX_LENGTH,\n USERNAME_REGEX,\n MAX_ARTISAN_LOCATION_LENGTH,\n MAX_INTERNAL_REASON_LENGTH,\n MAX_USER_SEARCH_QUERY_LENGTH,\n} from '../constants/business.js';\nimport { UserAccountStatusSchema } from '../doc-schemas/user.js';\n\n/** The ONE composed display-name field validator (length bounds + charset). Every\n * callable accepting a display name spreads this — never a re-composed copy. */\nexport const displayNameSchema = z\n .string()\n .min(USERNAME_MIN_LENGTH)\n .max(USERNAME_MAX_LENGTH)\n .regex(USERNAME_REGEX);\n\nexport const AcceptSquareStreetzAgreementsInputSchema = z.object({}).strict();\nexport type AcceptSquareStreetzAgreementsInput = z.infer<typeof AcceptSquareStreetzAgreementsInputSchema>;\n\n// One-time acknowledgement gate before a user may download Hall content for personal\n// offline use (final wording owned by the legal-and-content step). No payload — the\n// callable records the timestamp in the caller's privateData. See\n// docs/design/media-assets-and-protected-serving.md (Hall/Library downloads).\nexport const AcceptHallDownloadAcknowledgementInputSchema = z.object({}).strict();\nexport type AcceptHallDownloadAcknowledgementInput = z.infer<typeof AcceptHallDownloadAcknowledgementInputSchema>;\n\n// The become-creator dialog's \"I confirm I am 18 years of age or older\" checkbox must reach the\n// server: the callable rejects when absent and records the attestation on the\n// artisanCreator.grantedToUser audit event (immutable, timestamped, with IP/UA) so it is provable.\nexport const BecomeArtisanCreatorInputSchema = z.object({\n ageAttested: z.literal(true),\n // \"I confirm I am a person located in the United States\" — required for now (only U.S. persons\n // may become artisans). Mirrors ageAttested: the callable rejects when absent and records the\n // attestation timestamp (privateData.usPersonAttestedAt) + the grant audit event.\n usPersonAttested: z.literal(true),\n // [Q21.5 REVISED — DJ 2026-07-06] The artisan's date of birth — the ONLY point in the system\n // where a DOB is collected for persistence (registration/upgrade derive the bracket and store\n // nothing). The dialog copy tells the user this must be THEIR birthday: when the payout system\n // ships, it has to match their payout (KYC) identity. The callable re-derives 18+ server-side\n // from this value; an under-18 derivation rejects (failure audit, nothing stored). Stored as\n // privateData attestedDateOfBirth + attestedDobSource 'artisanOnboarding'.\n dob: z.object({\n year: z.number().int(),\n month: z.number().int().min(1).max(12),\n day: z.number().int().min(1).max(31),\n }).strict(),\n}).strict();\nexport type BecomeArtisanCreatorInput = z.infer<typeof BecomeArtisanCreatorInputSchema>;\n\nexport const MarkWaitingForNewsApprovalInputSchema = z.object({}).strict();\nexport type MarkWaitingForNewsApprovalInput = z.infer<typeof MarkWaitingForNewsApprovalInputSchema>;\n\n// First-visit site-tour preference writer (updateSiteTourPreference). This is the ONE\n// server writer for `privateData/{uid}.siteTour`; the client never writes tour state\n// directly. Discriminated on `action`:\n// - deferToday: records the member's LOCAL calendar `date` (\"Not today\"); the automatic\n// invitation is suppressed for exactly that date.\n// - dismissAutomaticInvites: records the permanent \"Don't show this again\" time; no payload.\n// - completeTour: records completion; the callable stamps SITE_TOUR_CURRENT_VERSION and\n// completedAt server-side, so no version is accepted from the client (mirrors the\n// acknowledgement callables that record the authoritative value server-side rather than\n// trusting a client-supplied one). Bump SITE_TOUR_CURRENT_VERSION to re-invite everyone.\n// `date` uses the same strict YYYY-MM-DD convention as the age cluster's attestedDateOfBirth.\nexport const UpdateSiteTourPreferenceInputSchema = z.discriminatedUnion('action', [\n z.object({\n action: z.literal('deferToday'),\n date: calendarDateSchema, // 'YYYY-MM-DD' (member's LOCAL calendar date)\n }).strict(),\n z.object({\n action: z.literal('dismissAutomaticInvites'),\n }).strict(),\n z.object({\n action: z.literal('completeTour'),\n }).strict(),\n]);\nexport type UpdateSiteTourPreferenceInput = z.infer<typeof UpdateSiteTourPreferenceInputSchema>;\n\n// The device-local shape behind the ONE sanctioned optimistic-hide exception: a site-tour choice\n// the member has already made, persisted at `siteTourPendingStorageKey(uid)`\n// (constants/storage-keys.ts) while its `updateSiteTourPreference` write is unconfirmed. It exists\n// so the overlay can close on the click instead of after a callable round-trip, and so a failed\n// write is replayed on the next boot rather than silently lost.\n//\n// It is NOT a cache, mirror, or second authority: `privateData/{uid}.siteTour` remains the sole\n// source of tour eligibility, and this entry only OVERLAYS it (suppressing an invitation the member\n// has already dismissed) until the server state converges.\n//\n// Every field is load-bearing against a specific failure:\n// - `schemaVersion` lets a future shape change be recognized instead of silently mis-parsed.\n// - `id` is the compare-and-remove token: on callable success the owner removes the entry ONLY if\n// the stored id still matches the one it sent, so a slow response in tab A can never erase a\n// newer choice made in tab B.\n// - `uid` must equal the authenticated key owner before the entry may affect eligibility or be\n// replayed — defence in depth behind the uid-scoped key itself.\n// - `createdAt` is epoch ms, for ordering/diagnostics only; it is never an expiry.\n// - `completeTour` carries the `tourVersion` the member actually completed. On reconciliation an\n// entry whose version differs from SITE_TOUR_CURRENT_VERSION is STALE and is discarded, so an\n// old pending completion can never complete a newer tour. The callable payload stays\n// version-free (the server stamps the authoritative version) — this is a replay guard, not\n// server authority.\n//\n// STRICT and fully validated on read: malformed or unknown persisted data is removed and\n// eligibility falls back to the server. Invalid storage must never hide the tour forever.\nexport const SiteTourPendingPreferenceSchema = z.discriminatedUnion('action', [\n z.object({\n schemaVersion: z.literal(1),\n id: z.string().min(1),\n uid: userIdSchema,\n createdAt: z.number(),\n action: z.literal('deferToday'),\n date: calendarDateSchema, // 'YYYY-MM-DD' (member's LOCAL calendar date)\n }).strict(),\n z.object({\n schemaVersion: z.literal(1),\n id: z.string().min(1),\n uid: userIdSchema,\n createdAt: z.number(),\n action: z.literal('dismissAutomaticInvites'),\n }).strict(),\n z.object({\n schemaVersion: z.literal(1),\n id: z.string().min(1),\n uid: userIdSchema,\n createdAt: z.number(),\n action: z.literal('completeTour'),\n tourVersion: z.number().int().positive(),\n }).strict(),\n]);\nexport type SiteTourPendingPreference = z.infer<typeof SiteTourPendingPreferenceSchema>;\n\n// Non-U.S. artisan-interest signup (the FCFS \"waitlist\" fields on privateData). Mirrors\n// MarkWaitingForNewsApproval but carries the applicant's country (+ optional region) so signups\n// can be opened by jurisdiction as each region's laws clear. The callable records it ONLY for\n// adult accounts (never a minor's location).\nexport const MarkNonUsArtisanInterestInputSchema = z.object({\n country: z.string().min(1).max(MAX_ARTISAN_LOCATION_LENGTH),\n region: z.string().max(MAX_ARTISAN_LOCATION_LENGTH).optional(),\n}).strict();\nexport type MarkNonUsArtisanInterestInput = z.infer<typeof MarkNonUsArtisanInterestInputSchema>;\n\nexport const RegisterUserInputSchema = z.object({\n displayName: displayNameSchema,\n agreements: z.object({\n age: z.literal(true),\n nudity: z.literal(true),\n meet: z.literal(true),\n cookies: z.literal(true),\n terms: z.literal(true),\n }).strict(),\n}).strict();\nexport type RegisterUserInput = z.infer<typeof RegisterUserInputSchema>;\n\nexport const SetUserStatusInputSchema = z.object({\n userId: userIdSchema,\n status: UserAccountStatusSchema,\n // Required by the callable when status is 'suspended' or 'banned' (shown to the\n // user in their restricted view and recorded on the audit event). Optional here\n // so reinstating to 'active' can omit it; the callable enforces presence.\n reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH).optional(),\n}).strict();\nexport type SetUserStatusInput = z.infer<typeof SetUserStatusInputSchema>;\n\n// Admin forces an abusive display name off a user: the name is swapped to a neutral\n// placeholder, the old name is blocked from reuse, and the user must pick a new one.\nexport const ForceDisplayNameResetInputSchema = z.object({\n userId: userIdSchema,\n // Optional admin note recorded on the audit event.\n reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH).optional(),\n}).strict();\nexport type ForceDisplayNameResetInput = z.infer<typeof ForceDisplayNameResetInputSchema>;\n\n// User completes a forced display-name reset by choosing a new name. Only honored while\n// the caller's userProfiles doc has `displayNameResetRequired === true`.\nexport const SetMyDisplayNameInputSchema = z.object({\n displayName: displayNameSchema,\n}).strict();\nexport type SetMyDisplayNameInput = z.infer<typeof SetMyDisplayNameInputSchema>;\n\n// Unauthenticated soft-check the register page runs BEFORE creating the Auth user so a\n// taken name never orphans an auth account. Mirrors the RegisterUser displayName contract\n// (same length + regex). The authoritative claim still happens inside registerUser.\nexport const CheckDisplayNameAvailableInputSchema = z.object({\n displayName: displayNameSchema,\n}).strict();\nexport type CheckDisplayNameAvailableInput = z.infer<typeof CheckDisplayNameAvailableInputSchema>;\n\n// Teen→adult upgrade: a transient DOB (never persisted) the callable re-derives adult\n// eligibility from server-side against a fresh attestation. Only the shape is validated\n// here; the age math + attestation binding live in the callable.\nexport const UpgradeAccountToAdultInputSchema = z.object({\n dob: z.object({\n year: z.number().int(),\n month: z.number().int().min(1).max(12),\n day: z.number().int().min(1).max(31),\n }).strict(),\n}).strict();\nexport type UpgradeAccountToAdultInput = z.infer<typeof UpgradeAccountToAdultInputSchema>;\n\n// Admin-only user lookup for the User Management view (prefix search on publicUsers by\n// displayName). Only the trimmed query string is validated here; authz (admin/jr-admin)\n// lives in the callable.\nexport const SearchPublicUsersInputSchema = z.object({\n query: z.string().trim().min(1).max(MAX_USER_SEARCH_QUERY_LENGTH),\n}).strict();\nexport type SearchPublicUsersInput = z.infer<typeof SearchPublicUsersInputSchema>;\n\n// Admin exact-account lookup (\"look up by email or uid\" in User Management): a solo full\n// admin resolves ONE account by its exact email, uid, or display name. The app detects\n// email-vs-uid-vs-name both client- and server-side, so there is ONE query field (mirrors\n// SearchPublicUsersInput's single trimmed-query shape + bound). Only the trimmed query is\n// validated here; authz (full admin) lives in the callable.\nexport const LookupUserByEmailOrUidInputSchema = z.object({\n query: z.string().trim().min(1).max(MAX_USER_SEARCH_QUERY_LENGTH),\n}).strict();\nexport type LookupUserByEmailOrUidInput = z.infer<typeof LookupUserByEmailOrUidInputSchema>;\n\n// N3 account deletion — wire result contracts for the two user-facing callables (both take\n// no input). Previously declared independently in functions/src and src/hooks — one drifting\n// pair per callable. Non-strict (server → client result posture).\nexport const RequestAccountDeletionResultSchema = z.object({\n success: z.literal(true),\n /** When the scheduled scrub will run (requestedAt + the grace window), epoch ms. */\n scheduledScrubAt: z.number(),\n /** True when an ACTIVE request already existed and its schedule was re-returned. */\n alreadyPending: z.boolean(),\n});\nexport type RequestAccountDeletionResult = z.infer<typeof RequestAccountDeletionResultSchema>;\n\nexport const CancelAccountDeletionResultSchema = z.object({\n success: z.literal(true),\n /** False when there was no active request to cancel (idempotent no-op). */\n cancelled: z.boolean(),\n});\nexport type CancelAccountDeletionResult = z.infer<typeof CancelAccountDeletionResultSchema>;\n\n"]}
1
+ {"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/schemas/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,C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AC,CAAC,OAAO,CAAC,IAAI,CAAC;IACxB,2EAA2E;IAC3E,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;CACvB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { userIdSchema, calendarDateSchema } from './atoms.js';\nimport {\n USERNAME_MIN_LENGTH,\n USERNAME_MAX_LENGTH,\n USERNAME_REGEX,\n MAX_ARTISAN_LOCATION_LENGTH,\n MAX_INTERNAL_REASON_LENGTH,\n MAX_USER_SEARCH_QUERY_LENGTH,\n} from '../constants/business.js';\nimport { UserAccountStatusSchema } from '../doc-schemas/user.js';\nimport {\n ShownPublicDocumentVersionsSchema,\n PublicDocumentsRefreshRequiredResultSchema,\n} from './public-documents.js';\n\n/** The ONE composed display-name field validator (length bounds + charset). Every\n * callable accepting a display name spreads this — never a re-composed copy. */\nexport const displayNameSchema = z\n .string()\n .min(USERNAME_MIN_LENGTH)\n .max(USERNAME_MAX_LENGTH)\n .regex(USERNAME_REGEX);\n\nexport const AcceptSquareStreetzAgreementsInputSchema = z.object({}).strict();\nexport type AcceptSquareStreetzAgreementsInput = z.infer<typeof AcceptSquareStreetzAgreementsInputSchema>;\n\n// One-time acknowledgement gate before a user may download Hall content for personal\n// offline use (final wording owned by the legal-and-content step). No payload — the\n// callable records the timestamp in the caller's privateData. See\n// docs/design/media-assets-and-protected-serving.md (Hall/Library downloads).\nexport const AcceptHallDownloadAcknowledgementInputSchema = z.object({}).strict();\nexport type AcceptHallDownloadAcknowledgementInput = z.infer<typeof AcceptHallDownloadAcknowledgementInputSchema>;\n\n// The become-creator dialog's \"I confirm I am 18 years of age or older\" checkbox must reach the\n// server: the callable rejects when absent and records the attestation on the\n// artisanCreator.grantedToUser audit event (immutable, timestamped, with IP/UA) so it is provable.\nexport const BecomeArtisanCreatorInputSchema = z.object({\n ageAttested: z.literal(true),\n // \"I confirm I am a person located in the United States\" — required for now (only U.S. persons\n // may become artisans). Mirrors ageAttested: the callable rejects when absent and records the\n // attestation timestamp (privateData.usPersonAttestedAt) + the grant audit event.\n usPersonAttested: z.literal(true),\n // [Q21.5 REVISED — DJ 2026-07-06] The artisan's date of birth — the ONLY point in the system\n // where a DOB is collected for persistence (registration/upgrade derive the bracket and store\n // nothing). The dialog copy tells the user this must be THEIR birthday: when the payout system\n // ships, it has to match their payout (KYC) identity. The callable re-derives 18+ server-side\n // from this value; an under-18 derivation rejects (failure audit, nothing stored). Stored as\n // privateData attestedDateOfBirth + attestedDobSource 'artisanOnboarding'.\n dob: z.object({\n year: z.number().int(),\n month: z.number().int().min(1).max(12),\n day: z.number().int().min(1).max(31),\n }).strict(),\n}).strict();\nexport type BecomeArtisanCreatorInput = z.infer<typeof BecomeArtisanCreatorInputSchema>;\n\nexport const MarkWaitingForNewsApprovalInputSchema = z.object({}).strict();\nexport type MarkWaitingForNewsApprovalInput = z.infer<typeof MarkWaitingForNewsApprovalInputSchema>;\n\n// First-visit site-tour preference writer (updateSiteTourPreference). This is the ONE\n// server writer for `privateData/{uid}.siteTour`; the client never writes tour state\n// directly. Discriminated on `action`:\n// - deferToday: records the member's LOCAL calendar `date` (\"Not today\"); the automatic\n// invitation is suppressed for exactly that date.\n// - dismissAutomaticInvites: records the permanent \"Don't show this again\" time; no payload.\n// - completeTour: records completion; the callable stamps SITE_TOUR_CURRENT_VERSION and\n// completedAt server-side, so no version is accepted from the client (mirrors the\n// acknowledgement callables that record the authoritative value server-side rather than\n// trusting a client-supplied one). Bump SITE_TOUR_CURRENT_VERSION to re-invite everyone.\n// `date` uses the same strict YYYY-MM-DD convention as the age cluster's attestedDateOfBirth.\nexport const UpdateSiteTourPreferenceInputSchema = z.discriminatedUnion('action', [\n z.object({\n action: z.literal('deferToday'),\n date: calendarDateSchema, // 'YYYY-MM-DD' (member's LOCAL calendar date)\n }).strict(),\n z.object({\n action: z.literal('dismissAutomaticInvites'),\n }).strict(),\n z.object({\n action: z.literal('completeTour'),\n }).strict(),\n]);\nexport type UpdateSiteTourPreferenceInput = z.infer<typeof UpdateSiteTourPreferenceInputSchema>;\n\n// The device-local shape behind the ONE sanctioned optimistic-hide exception: a site-tour choice\n// the member has already made, persisted at `siteTourPendingStorageKey(uid)`\n// (constants/storage-keys.ts) while its `updateSiteTourPreference` write is unconfirmed. It exists\n// so the overlay can close on the click instead of after a callable round-trip, and so a failed\n// write is replayed on the next boot rather than silently lost.\n//\n// It is NOT a cache, mirror, or second authority: `privateData/{uid}.siteTour` remains the sole\n// source of tour eligibility, and this entry only OVERLAYS it (suppressing an invitation the member\n// has already dismissed) until the server state converges.\n//\n// Every field is load-bearing against a specific failure:\n// - `schemaVersion` lets a future shape change be recognized instead of silently mis-parsed.\n// - `id` is the compare-and-remove token: on callable success the owner removes the entry ONLY if\n// the stored id still matches the one it sent, so a slow response in tab A can never erase a\n// newer choice made in tab B.\n// - `uid` must equal the authenticated key owner before the entry may affect eligibility or be\n// replayed — defence in depth behind the uid-scoped key itself.\n// - `createdAt` is epoch ms, for ordering/diagnostics only; it is never an expiry.\n// - `completeTour` carries the `tourVersion` the member actually completed. On reconciliation an\n// entry whose version differs from SITE_TOUR_CURRENT_VERSION is STALE and is discarded, so an\n// old pending completion can never complete a newer tour. The callable payload stays\n// version-free (the server stamps the authoritative version) — this is a replay guard, not\n// server authority.\n//\n// STRICT and fully validated on read: malformed or unknown persisted data is removed and\n// eligibility falls back to the server. Invalid storage must never hide the tour forever.\nexport const SiteTourPendingPreferenceSchema = z.discriminatedUnion('action', [\n z.object({\n schemaVersion: z.literal(1),\n id: z.string().min(1),\n uid: userIdSchema,\n createdAt: z.number(),\n action: z.literal('deferToday'),\n date: calendarDateSchema, // 'YYYY-MM-DD' (member's LOCAL calendar date)\n }).strict(),\n z.object({\n schemaVersion: z.literal(1),\n id: z.string().min(1),\n uid: userIdSchema,\n createdAt: z.number(),\n action: z.literal('dismissAutomaticInvites'),\n }).strict(),\n z.object({\n schemaVersion: z.literal(1),\n id: z.string().min(1),\n uid: userIdSchema,\n createdAt: z.number(),\n action: z.literal('completeTour'),\n tourVersion: z.number().int().positive(),\n }).strict(),\n]);\nexport type SiteTourPendingPreference = z.infer<typeof SiteTourPendingPreferenceSchema>;\n\n// Non-U.S. artisan-interest signup (the FCFS \"waitlist\" fields on privateData). Mirrors\n// MarkWaitingForNewsApproval but carries the applicant's country (+ optional region) so signups\n// can be opened by jurisdiction as each region's laws clear. The callable records it ONLY for\n// adult accounts (never a minor's location).\nexport const MarkNonUsArtisanInterestInputSchema = z.object({\n country: z.string().min(1).max(MAX_ARTISAN_LOCATION_LENGTH),\n region: z.string().max(MAX_ARTISAN_LOCATION_LENGTH).optional(),\n}).strict();\nexport type MarkNonUsArtisanInterestInput = z.infer<typeof MarkNonUsArtisanInterestInputSchema>;\n\nexport const RegisterUserInputSchema = z.object({\n displayName: displayNameSchema,\n agreements: z.object({\n age: z.literal(true),\n nudity: z.literal(true),\n meet: z.literal(true),\n cookies: z.literal(true),\n terms: z.literal(true),\n }).strict(),\n // The public-document versions the signup page SHOWED when the person agreed: every published\n // document at its current version, `changedPublicDocuments(block, undefined)` off the live\n // `_appConfig/app` version block. Empty before the first release (the first-admin bootstrap).\n // Registration re-reads the block in its transaction and answers `refreshRequired`, writing\n // nothing, when a publish raced the page — the same comparison the acceptance prompt's Accept makes.\n publicDocuments: ShownPublicDocumentVersionsSchema,\n}).strict();\nexport type RegisterUserInput = z.infer<typeof RegisterUserInputSchema>;\n\nexport const RegisterUserResultSchema = z.discriminatedUnion('status', [\n // The account is registered with the documents shown accepted (or already was — an idempotent\n // replay). Refresh the token: the `docsAccepted` claim was set after the commit.\n z.object({ status: z.literal('registered') }),\n PublicDocumentsRefreshRequiredResultSchema,\n]);\nexport type RegisterUserResult = z.infer<typeof RegisterUserResultSchema>;\n\nexport const SetUserStatusInputSchema = z.object({\n userId: userIdSchema,\n status: UserAccountStatusSchema,\n // Required by the callable when status is 'suspended' or 'banned' (shown to the\n // user in their restricted view and recorded on the audit event). Optional here\n // so reinstating to 'active' can omit it; the callable enforces presence.\n reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH).optional(),\n}).strict();\nexport type SetUserStatusInput = z.infer<typeof SetUserStatusInputSchema>;\n\n// Admin forces an abusive display name off a user: the name is swapped to a neutral\n// placeholder, the old name is blocked from reuse, and the user must pick a new one.\nexport const ForceDisplayNameResetInputSchema = z.object({\n userId: userIdSchema,\n // Optional admin note recorded on the audit event.\n reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH).optional(),\n}).strict();\nexport type ForceDisplayNameResetInput = z.infer<typeof ForceDisplayNameResetInputSchema>;\n\n// User completes a forced display-name reset by choosing a new name. Only honored while\n// the caller's userProfiles doc has `displayNameResetRequired === true`.\nexport const SetMyDisplayNameInputSchema = z.object({\n displayName: displayNameSchema,\n}).strict();\nexport type SetMyDisplayNameInput = z.infer<typeof SetMyDisplayNameInputSchema>;\n\n// Unauthenticated soft-check the register page runs BEFORE creating the Auth user so a\n// taken name never orphans an auth account. Mirrors the RegisterUser displayName contract\n// (same length + regex). The authoritative claim still happens inside registerUser.\nexport const CheckDisplayNameAvailableInputSchema = z.object({\n displayName: displayNameSchema,\n}).strict();\nexport type CheckDisplayNameAvailableInput = z.infer<typeof CheckDisplayNameAvailableInputSchema>;\n\n// Teen→adult upgrade: a transient DOB (never persisted) the callable re-derives adult\n// eligibility from server-side against a fresh attestation. Only the shape is validated\n// here; the age math + attestation binding live in the callable.\nexport const UpgradeAccountToAdultInputSchema = z.object({\n dob: z.object({\n year: z.number().int(),\n month: z.number().int().min(1).max(12),\n day: z.number().int().min(1).max(31),\n }).strict(),\n}).strict();\nexport type UpgradeAccountToAdultInput = z.infer<typeof UpgradeAccountToAdultInputSchema>;\n\n// Admin-only user lookup for the User Management view (prefix search on publicUsers by\n// displayName). Only the trimmed query string is validated here; authz (admin/jr-admin)\n// lives in the callable.\nexport const SearchPublicUsersInputSchema = z.object({\n query: z.string().trim().min(1).max(MAX_USER_SEARCH_QUERY_LENGTH),\n}).strict();\nexport type SearchPublicUsersInput = z.infer<typeof SearchPublicUsersInputSchema>;\n\n// Admin exact-account lookup (\"look up by email or uid\" in User Management): a solo full\n// admin resolves ONE account by its exact email, uid, or display name. The app detects\n// email-vs-uid-vs-name both client- and server-side, so there is ONE query field (mirrors\n// SearchPublicUsersInput's single trimmed-query shape + bound). Only the trimmed query is\n// validated here; authz (full admin) lives in the callable.\nexport const LookupUserByEmailOrUidInputSchema = z.object({\n query: z.string().trim().min(1).max(MAX_USER_SEARCH_QUERY_LENGTH),\n}).strict();\nexport type LookupUserByEmailOrUidInput = z.infer<typeof LookupUserByEmailOrUidInputSchema>;\n\n// N3 account deletion — wire result contracts for the two user-facing callables (both take\n// no input). Previously declared independently in functions/src and src/hooks — one drifting\n// pair per callable. Non-strict (server → client result posture).\nexport const RequestAccountDeletionResultSchema = z.object({\n success: z.literal(true),\n /** When the scheduled scrub will run (requestedAt + the grace window), epoch ms. */\n scheduledScrubAt: z.number(),\n /** True when an ACTIVE request already existed and its schedule was re-returned. */\n alreadyPending: z.boolean(),\n});\nexport type RequestAccountDeletionResult = z.infer<typeof RequestAccountDeletionResultSchema>;\n\nexport const CancelAccountDeletionResultSchema = z.object({\n success: z.literal(true),\n /** False when there was no active request to cancel (idempotent no-op). */\n cancelled: z.boolean(),\n});\nexport type CancelAccountDeletionResult = z.infer<typeof CancelAccountDeletionResultSchema>;\n\n"]}
@@ -8,8 +8,10 @@
8
8
  * IMPORTANT: This doc is for runtime-mutable config only — things you might
9
9
  * want to change on a Saturday afternoon without a deploy. Compile-time
10
10
  * constants (field length limits, file size caps, pagination sizes, etc.)
11
- * belong in app-level constants, NOT here. Putting validation limits in
12
- * Firestore creates security risks (admin typos can't bypass client-side
11
+ * are ONE named declaration each in this package's `constants/` (ARCH-102),
12
+ * and every enforcement point — zod `.max(MAX_X)`, `maxLength`, backend
13
+ * guards — derives from it; they are NOT fields on this doc. Putting validation
14
+ * limits in Firestore creates security risks (admin typos can't bypass client-side
13
15
  * guards) and doubles the surface area since server-side validation is still
14
16
  * required.
15
17
  *
@@ -1 +1 @@
1
- {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/types/system.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAG1D,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/types/system.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAG1D,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/types/system.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Shape of the `_appConfig/app` Firestore doc.\n *\n * Single source of truth for app-wide runtime configuration. The doc is\n * subscribed to once by `AppConfigProvider` (in ttt-prod) and exposed to the\n * app via `useAppConfig()`.\n *\n * IMPORTANT: This doc is for runtime-mutable config only — things you might\n * want to change on a Saturday afternoon without a deploy. Compile-time\n * constants (field length limits, file size caps, pagination sizes, etc.)\n * belong in app-level constants, NOT here. Putting validation limits in\n * Firestore creates security risks (admin typos can't bypass client-side\n * guards) and doubles the surface area since server-side validation is still\n * required.\n *\n * The one exception to \"operator-editable\" is `publicDocumentVersions`: the\n * public-document version block, written only by the release publish, which\n * rides this doc so every session's existing live read sees a new release.\n */\n// Shape is defined as a Zod schema in ../doc-schemas/system.ts; type inferred there.\nexport type { AppConfig } from '../doc-schemas/system.js';\n\n// _systemData/reservedUsernames — curated reserved/impersonation usernames (UPPERCASE).\nexport type { ReservedUsernames } from '../doc-schemas/system.js';\n"]}
1
+ {"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/types/system.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Shape of the `_appConfig/app` Firestore doc.\n *\n * Single source of truth for app-wide runtime configuration. The doc is\n * subscribed to once by `AppConfigProvider` (in ttt-prod) and exposed to the\n * app via `useAppConfig()`.\n *\n * IMPORTANT: This doc is for runtime-mutable config only — things you might\n * want to change on a Saturday afternoon without a deploy. Compile-time\n * constants (field length limits, file size caps, pagination sizes, etc.)\n * are ONE named declaration each in this package's `constants/` (ARCH-102),\n * and every enforcement point — zod `.max(MAX_X)`, `maxLength`, backend\n * guards — derives from it; they are NOT fields on this doc. Putting validation\n * limits in Firestore creates security risks (admin typos can't bypass client-side\n * guards) and doubles the surface area since server-side validation is still\n * required.\n *\n * The one exception to \"operator-editable\" is `publicDocumentVersions`: the\n * public-document version block, written only by the release publish, which\n * rides this doc so every session's existing live read sees a new release.\n */\n// Shape is defined as a Zod schema in ../doc-schemas/system.ts; type inferred there.\nexport type { AppConfig } from '../doc-schemas/system.js';\n\n// _systemData/reservedUsernames — curated reserved/impersonation usernames (UPPERCASE).\nexport type { ReservedUsernames } from '../doc-schemas/system.js';\n"]}
@@ -0,0 +1,26 @@
1
+ import { type AppConfig } from '../doc-schemas/system.js';
2
+ /**
3
+ * Every operator lever of `_appConfig/app` at rest — the doc a fresh environment behaves as if
4
+ * it held, and the default each reader falls back to for a missing field. The OPEN posture:
5
+ * maintenance off, registration open, no banner, no throttle.
6
+ *
7
+ * `appVersion` is `''`: no version has been published. VersionGate skips a falsy version, so it
8
+ * stays dormant — no reload for any browser, whatever version it stored before — until an
9
+ * operator sets a real one through updateAppConfig (whose input refuses `''`). From then on the
10
+ * gate compares as usual.
11
+ *
12
+ * The release-owned `publicDocumentVersions` block is not a lever and has no default: it is
13
+ * absent until the first release.
14
+ */
15
+ export declare const DEFAULT_APP_CONFIG: Readonly<Required<Omit<AppConfig, 'publicDocumentVersions'>>>;
16
+ /**
17
+ * The complete `_appConfig/app` doc to write after applying `update` to `existing` (the doc as
18
+ * read in the writer's transaction; `undefined` or `null` when it does not exist). The update's
19
+ * fields win; `existing` supplies the rest; any field still missing comes from
20
+ * DEFAULT_APP_CONFIG. An `undefined` update field changes nothing. Pure.
21
+ *
22
+ * Throws when the result would not parse under AppConfigSchema — an invalid update, or an
23
+ * invalid field already on the doc — so nothing invalid is ever written over it.
24
+ */
25
+ export declare function mergeAppConfigUpdate(existing: Readonly<Record<string, unknown>> | null | undefined, update: Readonly<Partial<AppConfig>>): AppConfig;
26
+ //# sourceMappingURL=app-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-config.d.ts","sourceRoot":"","sources":["../../src/utils/app-config.ts"],"names":[],"mappings":"AAWA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAE3E;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,wBAAwB,CAAC,CAAC,CAQzF,CAAC;AAML;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,EAC9D,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,GACnC,SAAS,CAcX"}
@@ -0,0 +1,58 @@
1
+ // The `_appConfig/app` singleton at rest, and the ONE rule for writing to it.
2
+ //
3
+ // Several backend writers touch this doc (the admin App configuration card through
4
+ // updateAppConfig, the public-document release publish, a seed), and each sends only the fields
5
+ // it owns. Written as a bare merge, the first of them to run after the doc is gone (a fresh or
6
+ // wiped environment) creates a doc WITHOUT the fields AppConfigSchema requires. The write rule
7
+ // is `mergeAppConfigUpdate(existing, update)`: the writer's update on top of the doc it read,
8
+ // with any field that doc lacks taken from DEFAULT_APP_CONFIG, validated as a whole.
9
+ //
10
+ // See docs/design/ttt-productions-version-gate.md (ttt-prod) § The `_appConfig/app` document.
11
+ import { AppConfigSchema } from '../doc-schemas/system.js';
12
+ /**
13
+ * Every operator lever of `_appConfig/app` at rest — the doc a fresh environment behaves as if
14
+ * it held, and the default each reader falls back to for a missing field. The OPEN posture:
15
+ * maintenance off, registration open, no banner, no throttle.
16
+ *
17
+ * `appVersion` is `''`: no version has been published. VersionGate skips a falsy version, so it
18
+ * stays dormant — no reload for any browser, whatever version it stored before — until an
19
+ * operator sets a real one through updateAppConfig (whose input refuses `''`). From then on the
20
+ * gate compares as usual.
21
+ *
22
+ * The release-owned `publicDocumentVersions` block is not a lever and has no default: it is
23
+ * absent until the first release.
24
+ */
25
+ export const DEFAULT_APP_CONFIG = Object.freeze({
26
+ appVersion: '',
27
+ maintenanceMode: false,
28
+ maintenanceMessage: '',
29
+ registrationEnabled: true,
30
+ announcementMessage: '',
31
+ rateLimitMultiplier: 1,
32
+ });
33
+ function definedFields(fields) {
34
+ return Object.fromEntries(Object.entries(fields).filter(([, value]) => value !== undefined));
35
+ }
36
+ /**
37
+ * The complete `_appConfig/app` doc to write after applying `update` to `existing` (the doc as
38
+ * read in the writer's transaction; `undefined` or `null` when it does not exist). The update's
39
+ * fields win; `existing` supplies the rest; any field still missing comes from
40
+ * DEFAULT_APP_CONFIG. An `undefined` update field changes nothing. Pure.
41
+ *
42
+ * Throws when the result would not parse under AppConfigSchema — an invalid update, or an
43
+ * invalid field already on the doc — so nothing invalid is ever written over it.
44
+ */
45
+ export function mergeAppConfigUpdate(existing, update) {
46
+ const parsed = AppConfigSchema.safeParse({
47
+ ...DEFAULT_APP_CONFIG,
48
+ ...definedFields(existing ?? {}),
49
+ ...definedFields(update),
50
+ });
51
+ if (!parsed.success) {
52
+ const issue = parsed.error.issues[0];
53
+ const field = issue?.path.join('.') || 'document';
54
+ throw new Error(`_appConfig/app would not match AppConfigSchema after this update (${field}: ${issue?.message ?? 'invalid'}). Nothing should be written.`);
55
+ }
56
+ return parsed.data;
57
+ }
58
+ //# sourceMappingURL=app-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-config.js","sourceRoot":"","sources":["../../src/utils/app-config.ts"],"names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B,CAC1I,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC","sourcesContent":["// The `_appConfig/app` singleton at rest, and the ONE rule for writing to it.\n//\n// Several backend writers touch this doc (the admin App configuration card through\n// updateAppConfig, the public-document release publish, a seed), and each sends only the fields\n// it owns. Written as a bare merge, the first of them to run after the doc is gone (a fresh or\n// wiped environment) creates a doc WITHOUT the fields AppConfigSchema requires. The write rule\n// is `mergeAppConfigUpdate(existing, update)`: the writer's update on top of the doc it read,\n// with any field that doc lacks taken from DEFAULT_APP_CONFIG, validated as a whole.\n//\n// See docs/design/ttt-productions-version-gate.md (ttt-prod) § The `_appConfig/app` document.\n\nimport { AppConfigSchema, type AppConfig } from '../doc-schemas/system.js';\n\n/**\n * Every operator lever of `_appConfig/app` at rest — the doc a fresh environment behaves as if\n * it held, and the default each reader falls back to for a missing field. The OPEN posture:\n * maintenance off, registration open, no banner, no throttle.\n *\n * `appVersion` is `''`: no version has been published. VersionGate skips a falsy version, so it\n * stays dormant — no reload for any browser, whatever version it stored before — until an\n * operator sets a real one through updateAppConfig (whose input refuses `''`). From then on the\n * gate compares as usual.\n *\n * The release-owned `publicDocumentVersions` block is not a lever and has no default: it is\n * absent until the first release.\n */\nexport const DEFAULT_APP_CONFIG: Readonly<Required<Omit<AppConfig, 'publicDocumentVersions'>>> =\n Object.freeze({\n appVersion: '',\n maintenanceMode: false,\n maintenanceMessage: '',\n registrationEnabled: true,\n announcementMessage: '',\n rateLimitMultiplier: 1,\n });\n\nfunction definedFields(fields: Readonly<Record<string, unknown>>): Record<string, unknown> {\n return Object.fromEntries(Object.entries(fields).filter(([, value]) => value !== undefined));\n}\n\n/**\n * The complete `_appConfig/app` doc to write after applying `update` to `existing` (the doc as\n * read in the writer's transaction; `undefined` or `null` when it does not exist). The update's\n * fields win; `existing` supplies the rest; any field still missing comes from\n * DEFAULT_APP_CONFIG. An `undefined` update field changes nothing. Pure.\n *\n * Throws when the result would not parse under AppConfigSchema — an invalid update, or an\n * invalid field already on the doc — so nothing invalid is ever written over it.\n */\nexport function mergeAppConfigUpdate(\n existing: Readonly<Record<string, unknown>> | null | undefined,\n update: Readonly<Partial<AppConfig>>,\n): AppConfig {\n const parsed = AppConfigSchema.safeParse({\n ...DEFAULT_APP_CONFIG,\n ...definedFields(existing ?? {}),\n ...definedFields(update),\n });\n if (!parsed.success) {\n const issue = parsed.error.issues[0];\n const field = issue?.path.join('.') || 'document';\n throw new Error(\n `_appConfig/app would not match AppConfigSchema after this update (${field}: ${issue?.message ?? 'invalid'}). Nothing should be written.`,\n );\n }\n return parsed.data;\n}\n"]}
@@ -1,3 +1,4 @@
1
+ export * from './app-config.js';
1
2
  export * from './format.js';
2
3
  export * from './hall-content.js';
3
4
  export * from './password.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC"}
@@ -1,3 +1,4 @@
1
+ export * from './app-config.js';
1
2
  export * from './format.js';
2
3
  export * from './hall-content.js';
3
4
  export * from './password.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './format.js';\nexport * from './hall-content.js';\nexport * from './password.js';\nexport * from './public-documents.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './app-config.js';\nexport * from './format.js';\nexport * from './hall-content.js';\nexport * from './password.js';\nexport * from './public-documents.js';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttt-productions/ttt-core",
3
- "version": "0.79.50",
3
+ "version": "0.79.52",
4
4
  "description": "Core types, Firestore path constants, and shared constants for TTT Productions",
5
5
  "repository": {
6
6
  "type": "git",