@ttt-productions/ttt-core 0.79.52 → 0.79.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/constants/index.d.ts +1 -0
  2. package/dist/constants/index.d.ts.map +1 -1
  3. package/dist/constants/index.js +1 -0
  4. package/dist/constants/index.js.map +1 -1
  5. package/dist/constants/pledge-and-bouquet-copy.d.ts +13 -0
  6. package/dist/constants/pledge-and-bouquet-copy.d.ts.map +1 -0
  7. package/dist/constants/pledge-and-bouquet-copy.js +19 -0
  8. package/dist/constants/pledge-and-bouquet-copy.js.map +1 -0
  9. package/dist/doc-schemas/ncii/requests.d.ts +4 -4
  10. package/dist/doc-schemas/public-documents.d.ts +5 -0
  11. package/dist/doc-schemas/public-documents.d.ts.map +1 -1
  12. package/dist/doc-schemas/public-documents.js +8 -5
  13. package/dist/doc-schemas/public-documents.js.map +1 -1
  14. package/dist/doc-schemas/registry.d.ts +1 -1
  15. package/dist/doc-schemas/system.d.ts.map +1 -1
  16. package/dist/doc-schemas/system.js +3 -2
  17. package/dist/doc-schemas/system.js.map +1 -1
  18. package/dist/doc-schemas/user.js +3 -3
  19. package/dist/doc-schemas/user.js.map +1 -1
  20. package/dist/schemas/users.d.ts +13 -0
  21. package/dist/schemas/users.d.ts.map +1 -1
  22. package/dist/schemas/users.js +13 -0
  23. package/dist/schemas/users.js.map +1 -1
  24. package/dist/types/audit.d.ts +1 -1
  25. package/dist/types/audit.d.ts.map +1 -1
  26. package/dist/types/audit.js.map +1 -1
  27. package/dist/utils/app-config.d.ts +77 -3
  28. package/dist/utils/app-config.d.ts.map +1 -1
  29. package/dist/utils/app-config.js +98 -5
  30. package/dist/utils/app-config.js.map +1 -1
  31. package/dist/utils/public-documents.d.ts +7 -0
  32. package/dist/utils/public-documents.d.ts.map +1 -1
  33. package/dist/utils/public-documents.js +8 -0
  34. package/dist/utils/public-documents.js.map +1 -1
  35. package/package.json +1 -1
@@ -7,6 +7,7 @@ export * from './options.js';
7
7
  export * from './admin-labels.js';
8
8
  export * from './craft-skill-statements.js';
9
9
  export * from './publish-attestations.js';
10
+ export * from './pledge-and-bouquet-copy.js';
10
11
  export * from './public-documents.js';
11
12
  export * from './legal-review-notice-state.js';
12
13
  export * from './legal-review-notice.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC"}
@@ -7,6 +7,7 @@ export * from './options.js';
7
7
  export * from './admin-labels.js';
8
8
  export * from './craft-skill-statements.js';
9
9
  export * from './publish-attestations.js';
10
+ export * from './pledge-and-bouquet-copy.js';
10
11
  export * from './public-documents.js';
11
12
  export * from './legal-review-notice-state.js';
12
13
  export * from './legal-review-notice.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './app-mode.js';\nexport * from './business.js';\nexport * from './chat.js';\nexport * from './conversation-files.js';\nexport * from './moderation.js';\nexport * from './options.js';\nexport * from './admin-labels.js';\nexport * from './craft-skill-statements.js';\nexport * from './publish-attestations.js';\nexport * from './public-documents.js';\nexport * from './legal-review-notice-state.js';\nexport * from './legal-review-notice.js';\nexport * from './safety-confirmation-phrases.js';\nexport * from './safety-telemetry-patterns.js';\nexport * from './pagination.js';\nexport * from './release-flags.js';\nexport * from './retention.js';\nexport * from './scheduled-jobs.js';\nexport * from './media-download.js';\nexport * from './media-processing.js';\nexport * from './storage-keys.js';\nexport * from './company-mascots.js';\nexport * from './center-stage-rooms.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './app-mode.js';\nexport * from './business.js';\nexport * from './chat.js';\nexport * from './conversation-files.js';\nexport * from './moderation.js';\nexport * from './options.js';\nexport * from './admin-labels.js';\nexport * from './craft-skill-statements.js';\nexport * from './publish-attestations.js';\nexport * from './pledge-and-bouquet-copy.js';\nexport * from './public-documents.js';\nexport * from './legal-review-notice-state.js';\nexport * from './legal-review-notice.js';\nexport * from './safety-confirmation-phrases.js';\nexport * from './safety-telemetry-patterns.js';\nexport * from './pagination.js';\nexport * from './release-flags.js';\nexport * from './retention.js';\nexport * from './scheduled-jobs.js';\nexport * from './media-download.js';\nexport * from './media-processing.js';\nexport * from './storage-keys.js';\nexport * from './company-mascots.js';\nexport * from './center-stage-rooms.js';\n"]}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * How a pledge relates to badges and other Charter honors, said the same way on every pledge
3
+ * surface: a badge comes when your pledges reach a certain total, and every honor is thank-you
4
+ * recognition, never something a pledge buys.
5
+ */
6
+ export declare const PLEDGE_BADGE_RECOGNITION_COPY = "When your pledges reach a certain total, you earn a badge on your profile. Badges and other Charter honors are thank-you recognition, never something a pledge buys.";
7
+ /**
8
+ * Where Bouquets and artisan payouts stand. True only while neither Bouquet purchasing
9
+ * (BOUQUET_STAGE_1_LIVE) nor payouts (BOUQUET_STAGE_3_LIVE) is live, so flipping either flag
10
+ * means changing this sentence in the same release.
11
+ */
12
+ export declare const BOUQUET_APPRECIATION_AND_PAYOUTS_PLANNED_COPY = "Bouquets and artisan payouts are planned, not built yet.";
13
+ //# sourceMappingURL=pledge-and-bouquet-copy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pledge-and-bouquet-copy.d.ts","sourceRoot":"","sources":["../../src/constants/pledge-and-bouquet-copy.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,yKAC8H,CAAC;AAEzK;;;;GAIG;AACH,eAAO,MAAM,6CAA6C,6DAA6D,CAAC"}
@@ -0,0 +1,19 @@
1
+ // ============================================================================
2
+ // PLEDGE AND BOUQUET COPY — user-facing truths about pledges and the Bouquet
3
+ // system, each ONE declaration that every surface stating it renders verbatim.
4
+ // Settled wording: never reword a constant in place to fit one surface; a
5
+ // surface that needs to say something different says it with its own words.
6
+ // ============================================================================
7
+ /**
8
+ * How a pledge relates to badges and other Charter honors, said the same way on every pledge
9
+ * surface: a badge comes when your pledges reach a certain total, and every honor is thank-you
10
+ * recognition, never something a pledge buys.
11
+ */
12
+ export const PLEDGE_BADGE_RECOGNITION_COPY = 'When your pledges reach a certain total, you earn a badge on your profile. Badges and other Charter honors are thank-you recognition, never something a pledge buys.';
13
+ /**
14
+ * Where Bouquets and artisan payouts stand. True only while neither Bouquet purchasing
15
+ * (BOUQUET_STAGE_1_LIVE) nor payouts (BOUQUET_STAGE_3_LIVE) is live, so flipping either flag
16
+ * means changing this sentence in the same release.
17
+ */
18
+ export const BOUQUET_APPRECIATION_AND_PAYOUTS_PLANNED_COPY = 'Bouquets and artisan payouts are planned, not built yet.';
19
+ //# sourceMappingURL=pledge-and-bouquet-copy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pledge-and-bouquet-copy.js","sourceRoot":"","sources":["../../src/constants/pledge-and-bouquet-copy.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,6EAA6E;AAC7E,+EAA+E;AAC/E,0EAA0E;AAC1E,4EAA4E;AAC5E,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GACxC,sKAAsK,CAAC;AAEzK;;;;GAIG;AACH,MAAM,CAAC,MAAM,6CAA6C,GAAG,0DAA0D,CAAC","sourcesContent":["// ============================================================================\n// PLEDGE AND BOUQUET COPY — user-facing truths about pledges and the Bouquet\n// system, each ONE declaration that every surface stating it renders verbatim.\n// Settled wording: never reword a constant in place to fit one surface; a\n// surface that needs to say something different says it with its own words.\n// ============================================================================\n\n/**\n * How a pledge relates to badges and other Charter honors, said the same way on every pledge\n * surface: a badge comes when your pledges reach a certain total, and every honor is thank-you\n * recognition, never something a pledge buys.\n */\nexport const PLEDGE_BADGE_RECOGNITION_COPY =\n 'When your pledges reach a certain total, you earn a badge on your profile. Badges and other Charter honors are thank-you recognition, never something a pledge buys.';\n\n/**\n * Where Bouquets and artisan payouts stand. True only while neither Bouquet purchasing\n * (BOUQUET_STAGE_1_LIVE) nor payouts (BOUQUET_STAGE_3_LIVE) is live, so flipping either flag\n * means changing this sentence in the same release.\n */\nexport const BOUQUET_APPRECIATION_AND_PAYOUTS_PLANNED_COPY = 'Bouquets and artisan payouts are planned, not built yet.';\n"]}
@@ -108,9 +108,9 @@ export type TakeItDownElectronicSignatureV1 = z.infer<typeof TakeItDownElectroni
108
108
  export declare const AuthorityProofScanStatusSchema: z.ZodEnum<{
109
109
  pending: "pending";
110
110
  rejected: "rejected";
111
+ unavailable: "unavailable";
111
112
  clean: "clean";
112
113
  matched: "matched";
113
- unavailable: "unavailable";
114
114
  }>;
115
115
  export type AuthorityProofScanStatus = z.infer<typeof AuthorityProofScanStatusSchema>;
116
116
  /** [H-02] Server-owned authority-proof scan state. Embedded on the authorized-
@@ -120,9 +120,9 @@ export declare const AuthorityProofScanStateV1Schema: z.ZodObject<{
120
120
  scanStatus: z.ZodEnum<{
121
121
  pending: "pending";
122
122
  rejected: "rejected";
123
+ unavailable: "unavailable";
123
124
  clean: "clean";
124
125
  matched: "matched";
125
- unavailable: "unavailable";
126
126
  }>;
127
127
  objectGeneration: z.ZodString;
128
128
  objectHash: z.ZodString;
@@ -144,9 +144,9 @@ export declare const TakeItDownAuthorizedRepresentativeV1Schema: z.ZodObject<{
144
144
  scanStatus: z.ZodEnum<{
145
145
  pending: "pending";
146
146
  rejected: "rejected";
147
+ unavailable: "unavailable";
147
148
  clean: "clean";
148
149
  matched: "matched";
149
- unavailable: "unavailable";
150
150
  }>;
151
151
  objectGeneration: z.ZodString;
152
152
  objectHash: z.ZodString;
@@ -179,9 +179,9 @@ export declare const TakeItDownRequesterPrivateV1Schema: z.ZodObject<{
179
179
  scanStatus: z.ZodEnum<{
180
180
  pending: "pending";
181
181
  rejected: "rejected";
182
+ unavailable: "unavailable";
182
183
  clean: "clean";
183
184
  matched: "matched";
184
- unavailable: "unavailable";
185
185
  }>;
186
186
  objectGeneration: z.ZodString;
187
187
  objectHash: z.ZodString;
@@ -10,6 +10,11 @@ export declare const PublicDocumentIdSchema: z.ZodEnum<{
10
10
  }>;
11
11
  /** A published version number: v1 is the first. */
12
12
  export declare const PublicDocumentVersionNumberSchema: z.ZodNumber;
13
+ /**
14
+ * A version reference where 0 means "none yet" (never accepted / never required / no base / never
15
+ * published). Every recorded "which version was accepted" field derives from it.
16
+ */
17
+ export declare const PublicDocumentVersionOrNoneSchema: z.ZodNumber;
13
18
  /** An acceptance level: 0 = nothing required / nothing accepted; each requiring release adds 1. */
14
19
  export declare const PublicDocumentAcceptanceLevelSchema: z.ZodNumber;
15
20
  /** A document paired with one of its published versions. */
@@ -1 +1 @@
1
- {"version":3,"file":"public-documents.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/public-documents.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAU9F,eAAO,MAAM,sBAAsB;;;;;;;EAA8B,CAAC;AAElE,mDAAmD;AACnD,eAAO,MAAM,iCAAiC,aAA8B,CAAC;AAK7E,mGAAmG;AACnG,eAAO,MAAM,mCAAmC,aAAiC,CAAC;AAElF,4DAA4D;AAC5D,eAAO,MAAM,8BAA8B;;;;;;;;;;kBAKhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAMtF,eAAO,MAAM,sBAAsB;;;;;;;;iBAAmD,CAAC;AACvF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAmE,CAAC;AAChH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;iBAAkD,CAAC;AACxF,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAKtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAIhF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAIpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAI5E;;;;GAIG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;iBAOtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAIhF;;;GAGG;AACH,eAAO,MAAM,gCAAgC;;;kBAQzC,CAAC;AACL,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F;;;;GAIG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;kBAKlC,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAI1F;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;kBAOhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
@@ -22,8 +22,11 @@ import { LegalReviewNoticeRevisionSchema } from './legal-review-notice.js';
22
22
  export const PublicDocumentIdSchema = z.enum(PUBLIC_DOCUMENT_IDS);
23
23
  /** A published version number: v1 is the first. */
24
24
  export const PublicDocumentVersionNumberSchema = z.number().int().positive();
25
- /** A version reference where 0 means "none yet" (never accepted / never required / no base). */
26
- const versionOrNoneSchema = z.number().int().nonnegative();
25
+ /**
26
+ * A version reference where 0 means "none yet" (never accepted / never required / no base / never
27
+ * published). Every recorded "which version was accepted" field derives from it.
28
+ */
29
+ export const PublicDocumentVersionOrNoneSchema = z.number().int().nonnegative();
27
30
  /** An acceptance level: 0 = nothing required / nothing accepted; each requiring release adds 1. */
28
31
  export const PublicDocumentAcceptanceLevelSchema = z.number().int().nonnegative();
29
32
  /** A document paired with one of its published versions. */
@@ -96,7 +99,7 @@ export const PublicDocumentVersionSchema = perDocument({
96
99
  * current version, and one whose content equals the current version.
97
100
  */
98
101
  export const PublicDocumentDraftSchema = perDocument({
99
- baseVersion: versionOrNoneSchema,
102
+ baseVersion: PublicDocumentVersionOrNoneSchema,
100
103
  savedBy: z.string().min(1),
101
104
  savedAt: z.number(),
102
105
  });
@@ -122,7 +125,7 @@ export const PublicDocumentReleaseSchema = z.object({
122
125
  export const PublicDocumentVersionStateSchema = z
123
126
  .object({
124
127
  currentVersion: PublicDocumentVersionNumberSchema,
125
- requiredVersion: versionOrNoneSchema,
128
+ requiredVersion: PublicDocumentVersionOrNoneSchema,
126
129
  })
127
130
  .strict()
128
131
  .refine((state) => state.requiredVersion <= state.currentVersion, {
@@ -149,7 +152,7 @@ export const PublicDocumentVersionBlockSchema = z
149
152
  */
150
153
  export const PublicDocumentAcceptanceSchema = z
151
154
  .object({
152
- documentVersions: z.partialRecord(PublicDocumentIdSchema, versionOrNoneSchema),
155
+ documentVersions: z.partialRecord(PublicDocumentIdSchema, PublicDocumentVersionOrNoneSchema),
153
156
  acceptedLevel: PublicDocumentAcceptanceLevelSchema,
154
157
  legalReviewNoticeRevision: LegalReviewNoticeRevisionSchema.optional(),
155
158
  acceptedAt: z.number(),
@@ -1 +1 @@
1
- {"version":3,"file":"public-documents.js","sourceRoot":"","sources":["../../src/doc-schemas/public-documents.ts"],"names":[],"mappings":"AAAA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E,+BAA+B,CAAC,QAAQ,EAAE;IACrE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Versioned public documents — the Firestore contracts of the release system.\n//\n// _appConfig/{documentId} current projection (public; the\n// existing page readers read it)\n// publicDocuments/{documentId}/publicDocumentVersions/v{n} immutable published version\n// publicDocumentDrafts/{documentId} the private working copy\n// publicDocumentReleases/{releaseId} one release record per publish\n// _appConfig/app.publicDocumentVersions the version block every session\n// already reads live\n// userProfiles/{uid}/privateData/{uid}.publicDocumentAcceptance\n// what the person last accepted\n//\n// All are backend-written. Versions are whole numbers v1, v2, … per document, assigned by the\n// one publish transaction; a correction is a new version, never an edit. \"Require acceptance\"\n// is recorded on the release and in the version block — never as a second version number.\n// Acceptance HISTORY lives only in the append-only `publicDocuments.accepted` audit events.\n\nimport { z } from 'zod';\nimport { SPECIAL_DOCS } from '../paths/collections.js';\nimport { PUBLIC_DOCUMENT_IDS, type PublicDocumentId } from '../constants/public-documents.js';\nimport {\n LegalPageDocumentSchema,\n RulesAndAgreementsSchema,\n FuturePlansDocumentSchema,\n TakeItDownPageCopySchema,\n DmcaPolicyDocumentSchema,\n} from './content.js';\nimport { LegalReviewNoticeRevisionSchema } from './legal-review-notice.js';\n\nexport const PublicDocumentIdSchema = z.enum(PUBLIC_DOCUMENT_IDS);\n\n/** A published version number: v1 is the first. */\nexport const PublicDocumentVersionNumberSchema = z.number().int().positive();\n\n/** A version reference where 0 means \"none yet\" (never accepted / never required / no base). */\nconst versionOrNoneSchema = z.number().int().nonnegative();\n\n/** An acceptance level: 0 = nothing required / nothing accepted; each requiring release adds 1. */\nexport const PublicDocumentAcceptanceLevelSchema = z.number().int().nonnegative();\n\n/** A document paired with one of its published versions. */\nexport const PublicDocumentVersionRefSchema = z\n .object({\n documentId: PublicDocumentIdSchema,\n version: PublicDocumentVersionNumberSchema,\n })\n .strict();\nexport type PublicDocumentVersionRef = z.infer<typeof PublicDocumentVersionRefSchema>;\n\n// ── Content ──────────────────────────────────────────────────────────────────\n// A document's CONTENT is its current-projection shape minus `version` / `lastUpdated`, so the\n// existing page readers, the working copy, and the immutable version all share one shape.\n\nexport const LegalPageContentSchema = LegalPageDocumentSchema.pick({ sections: true });\nexport const RulesAndAgreementsContentSchema = RulesAndAgreementsSchema.pick({ rules: true, agreements: true });\nexport const FuturePlansContentSchema = FuturePlansDocumentSchema.pick({ plans: true });\nexport const TakeItDownPageCopyContentSchema = TakeItDownPageCopySchema.pick({ strings: true });\nexport const DmcaPolicyContentSchema = DmcaPolicyDocumentSchema.pick({\n intro: true,\n contactBlocks: true,\n sections: true,\n});\n\n/** Each document's stored content schema. */\nexport const PUBLIC_DOCUMENT_CONTENT_SCHEMAS = {\n [SPECIAL_DOCS.TERMS_PAGE]: LegalPageContentSchema,\n [SPECIAL_DOCS.PRIVACY_PAGE]: LegalPageContentSchema,\n [SPECIAL_DOCS.RULES_AND_AGREEMENTS]: RulesAndAgreementsContentSchema,\n [SPECIAL_DOCS.FUTURE_PLANS]: FuturePlansContentSchema,\n [SPECIAL_DOCS.DMCA_POLICY]: DmcaPolicyContentSchema,\n [SPECIAL_DOCS.TAKE_IT_DOWN_PAGE_COPY]: TakeItDownPageCopyContentSchema,\n} as const satisfies Record<PublicDocumentId, z.ZodType>;\n\n/** The content of document `D`. */\nexport type PublicDocumentContent<D extends PublicDocumentId = PublicDocumentId> = z.infer<\n (typeof PUBLIC_DOCUMENT_CONTENT_SCHEMAS)[D]\n>;\n\n/** Each document's current-projection schema (`_appConfig/{documentId}`). */\nexport const PUBLIC_DOCUMENT_PROJECTION_SCHEMAS = {\n [SPECIAL_DOCS.TERMS_PAGE]: LegalPageDocumentSchema,\n [SPECIAL_DOCS.PRIVACY_PAGE]: LegalPageDocumentSchema,\n [SPECIAL_DOCS.RULES_AND_AGREEMENTS]: RulesAndAgreementsSchema,\n [SPECIAL_DOCS.FUTURE_PLANS]: FuturePlansDocumentSchema,\n [SPECIAL_DOCS.DMCA_POLICY]: DmcaPolicyDocumentSchema,\n [SPECIAL_DOCS.TAKE_IT_DOWN_PAGE_COPY]: TakeItDownPageCopySchema,\n} as const satisfies Record<PublicDocumentId, z.ZodType>;\n\n/**\n * The current projection the publish writes for document `D`: its content plus the version and\n * the publish time. Assignable to the page's existing document type.\n */\nexport type PublicDocumentProjection<D extends PublicDocumentId = PublicDocumentId> =\n PublicDocumentContent<D> & { version: number; lastUpdated: number };\n\n// One discriminated branch per document, so a version or draft's `content` is typed by its\n// `documentId`.\nfunction perDocument<const S extends z.ZodRawShape>(shape: S) {\n const branch = <const D extends PublicDocumentId>(documentId: D) =>\n z.object({ documentId: z.literal(documentId), content: PUBLIC_DOCUMENT_CONTENT_SCHEMAS[documentId], ...shape });\n return z.discriminatedUnion('documentId', [\n branch(SPECIAL_DOCS.TERMS_PAGE),\n branch(SPECIAL_DOCS.PRIVACY_PAGE),\n branch(SPECIAL_DOCS.RULES_AND_AGREEMENTS),\n branch(SPECIAL_DOCS.FUTURE_PLANS),\n branch(SPECIAL_DOCS.DMCA_POLICY),\n branch(SPECIAL_DOCS.TAKE_IT_DOWN_PAGE_COPY),\n ]);\n}\n\n// ── Immutable version ────────────────────────────────────────────────────────\n\n/**\n * `publicDocuments/{documentId}/publicDocumentVersions/v{version}` — one published version,\n * written once by the publish transaction and never edited: the full content, the version,\n * the release that published it, the publisher's uid, and the server time.\n */\nexport const PublicDocumentVersionSchema = perDocument({\n version: PublicDocumentVersionNumberSchema,\n releaseId: z.string().min(1),\n publishedBy: z.string().min(1),\n publishedAt: z.number(),\n});\nexport type PublicDocumentVersion = z.infer<typeof PublicDocumentVersionSchema>;\n\n// ── Working copy ─────────────────────────────────────────────────────────────\n\n/**\n * `publicDocumentDrafts/{documentId}` — the one private working copy of a document, saved from\n * its Admin editor. `baseVersion` is the published version the edit started from (0 when the\n * document has never been published): the publish rejects a draft whose base is no longer the\n * current version, and one whose content equals the current version.\n */\nexport const PublicDocumentDraftSchema = perDocument({\n baseVersion: versionOrNoneSchema,\n savedBy: z.string().min(1),\n savedAt: z.number(),\n});\nexport type PublicDocumentDraft = z.infer<typeof PublicDocumentDraftSchema>;\n\n// ── Release record ───────────────────────────────────────────────────────────\n\n/**\n * `publicDocumentReleases/{releaseId}` — one record per publish: which documents moved to\n * which versions, whether the release requires acceptance, the required-acceptance level in\n * force after it (raised by one only when it requires acceptance), and who published it when.\n */\nexport const PublicDocumentReleaseSchema = z.object({\n releaseId: z.string().min(1),\n documents: z.array(PublicDocumentVersionRefSchema).min(1),\n requireAcceptance: z.boolean(),\n requiredAcceptanceLevel: PublicDocumentAcceptanceLevelSchema,\n publishedBy: z.string().min(1),\n publishedAt: z.number(),\n});\nexport type PublicDocumentRelease = z.infer<typeof PublicDocumentReleaseSchema>;\n\n// ── Version block on _appConfig/app ──────────────────────────────────────────\n\n/**\n * One document's entry in the version block: its current published version and the latest\n * version a release REQUIRED acceptance of (0 when none has).\n */\nexport const PublicDocumentVersionStateSchema = z\n .object({\n currentVersion: PublicDocumentVersionNumberSchema,\n requiredVersion: versionOrNoneSchema,\n })\n .strict()\n .refine((state) => state.requiredVersion <= state.currentVersion, {\n message: 'requiredVersion cannot exceed currentVersion',\n });\nexport type PublicDocumentVersionState = z.infer<typeof PublicDocumentVersionStateSchema>;\n\n/**\n * `_appConfig/app.publicDocumentVersions` — written only by the publish transaction. A document\n * never published has no entry. `requiredAcceptanceLevel` rises by one with every release that\n * requires acceptance; a session whose accepted level is below it is asked to accept.\n */\nexport const PublicDocumentVersionBlockSchema = z\n .object({\n documents: z.partialRecord(PublicDocumentIdSchema, PublicDocumentVersionStateSchema),\n requiredAcceptanceLevel: PublicDocumentAcceptanceLevelSchema,\n })\n .strict();\nexport type PublicDocumentVersionBlock = z.infer<typeof PublicDocumentVersionBlockSchema>;\n\n// ── The person's acceptance summary (private doc) ────────────────────────────\n\n/**\n * `privateData/{uid}.publicDocumentAcceptance` — the LATEST accepted version of each document\n * and the accepted level, replaced whole on every acceptance (registration or the re-acceptance\n * prompt). A document absent from `documentVersions` counts as version 0. The notice revision in\n * force at that acceptance is recorded when the notice was active. History is not kept here — it\n * is the `publicDocuments.accepted` audit events.\n */\nexport const PublicDocumentAcceptanceSchema = z\n .object({\n documentVersions: z.partialRecord(PublicDocumentIdSchema, versionOrNoneSchema),\n acceptedLevel: PublicDocumentAcceptanceLevelSchema,\n legalReviewNoticeRevision: LegalReviewNoticeRevisionSchema.optional(),\n acceptedAt: z.number(),\n })\n .strict();\nexport type PublicDocumentAcceptance = z.infer<typeof PublicDocumentAcceptanceSchema>;\n"]}
1
+ {"version":3,"file":"public-documents.js","sourceRoot":"","sources":["../../src/doc-schemas/public-documents.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,EAAE;AACF,8FAA8F;AAC9F,6FAA6F;AAC7F,0FAA0F;AAC1F,uFAAuF;AACvF,6FAA6F;AAC7F,8FAA8F;AAC9F,iFAAiF;AACjF,kEAAkE;AAClE,4FAA4F;AAC5F,EAAE;AACF,8FAA8F;AAC9F,8FAA8F;AAC9F,0FAA0F;AAC1F,4FAA4F;AAE5F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAyB,MAAM,kCAAkC,CAAC;AAC9F,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAE3E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;AAElE,mDAAmD;AACnD,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;AAE7E;;;GAGG;AACH,MAAM,CAAC,MA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AE,8CAA8C;CACxD,CAAC,CAAC;AAGL;;;;GAIG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,SAAS,EAAE,CAAC,CAAC,aAAa,CAAC,sBAAsB,EAAE,gCAAgC,CAAC;IACpF,uBAAuB,EAAE,mCAAmC;CAC7D,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,gFAAgF;AAEhF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC;KAC5C,MAAM,CAAC;IACN,gBAAgB,EAAE,CAAC,CAAC,aAAa,CAAC,sBAAsB,EAAE,iCAAiC,CAAC;IAC5F,aAAa,EAAE,mCAAmC;IAClD,yBAAyB,EAAE,+BAA+B,CAAC,QAAQ,EAAE;IACrE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Versioned public documents — the Firestore contracts of the release system.\n//\n// _appConfig/{documentId} current projection (public; the\n// existing page readers read it)\n// publicDocuments/{documentId}/publicDocumentVersions/v{n} immutable published version\n// publicDocumentDrafts/{documentId} the private working copy\n// publicDocumentReleases/{releaseId} one release record per publish\n// _appConfig/app.publicDocumentVersions the version block every session\n// already reads live\n// userProfiles/{uid}/privateData/{uid}.publicDocumentAcceptance\n// what the person last accepted\n//\n// All are backend-written. Versions are whole numbers v1, v2, … per document, assigned by the\n// one publish transaction; a correction is a new version, never an edit. \"Require acceptance\"\n// is recorded on the release and in the version block — never as a second version number.\n// Acceptance HISTORY lives only in the append-only `publicDocuments.accepted` audit events.\n\nimport { z } from 'zod';\nimport { SPECIAL_DOCS } from '../paths/collections.js';\nimport { PUBLIC_DOCUMENT_IDS, type PublicDocumentId } from '../constants/public-documents.js';\nimport {\n LegalPageDocumentSchema,\n RulesAndAgreementsSchema,\n FuturePlansDocumentSchema,\n TakeItDownPageCopySchema,\n DmcaPolicyDocumentSchema,\n} from './content.js';\nimport { LegalReviewNoticeRevisionSchema } from './legal-review-notice.js';\n\nexport const PublicDocumentIdSchema = z.enum(PUBLIC_DOCUMENT_IDS);\n\n/** A published version number: v1 is the first. */\nexport const PublicDocumentVersionNumberSchema = z.number().int().positive();\n\n/**\n * A version reference where 0 means \"none yet\" (never accepted / never required / no base / never\n * published). Every recorded \"which version was accepted\" field derives from it.\n */\nexport const PublicDocumentVersionOrNoneSchema = z.number().int().nonnegative();\n\n/** An acceptance level: 0 = nothing required / nothing accepted; each requiring release adds 1. */\nexport const PublicDocumentAcceptanceLevelSchema = z.number().int().nonnegative();\n\n/** A document paired with one of its published versions. */\nexport const PublicDocumentVersionRefSchema = z\n .object({\n documentId: PublicDocumentIdSchema,\n version: PublicDocumentVersionNumberSchema,\n })\n .strict();\nexport type PublicDocumentVersionRef = z.infer<typeof PublicDocumentVersionRefSchema>;\n\n// ── Content ──────────────────────────────────────────────────────────────────\n// A document's CONTENT is its current-projection shape minus `version` / `lastUpdated`, so the\n// existing page readers, the working copy, and the immutable version all share one shape.\n\nexport const LegalPageContentSchema = LegalPageDocumentSchema.pick({ sections: true });\nexport const RulesAndAgreementsContentSchema = RulesAndAgreementsSchema.pick({ rules: true, agreements: true });\nexport const FuturePlansContentSchema = FuturePlansDocumentSchema.pick({ plans: true });\nexport const TakeItDownPageCopyContentSchema = TakeItDownPageCopySchema.pick({ strings: true });\nexport const DmcaPolicyContentSchema = DmcaPolicyDocumentSchema.pick({\n intro: true,\n contactBlocks: true,\n sections: true,\n});\n\n/** Each document's stored content schema. */\nexport const PUBLIC_DOCUMENT_CONTENT_SCHEMAS = {\n [SPECIAL_DOCS.TERMS_PAGE]: LegalPageContentSchema,\n [SPECIAL_DOCS.PRIVACY_PAGE]: LegalPageContentSchema,\n [SPECIAL_DOCS.RULES_AND_AGREEMENTS]: RulesAndAgreementsContentSchema,\n [SPECIAL_DOCS.FUTURE_PLANS]: FuturePlansContentSchema,\n [SPECIAL_DOCS.DMCA_POLICY]: DmcaPolicyContentSchema,\n [SPECIAL_DOCS.TAKE_IT_DOWN_PAGE_COPY]: TakeItDownPageCopyContentSchema,\n} as const satisfies Record<PublicDocumentId, z.ZodType>;\n\n/** The content of document `D`. */\nexport type PublicDocumentContent<D extends PublicDocumentId = PublicDocumentId> = z.infer<\n (typeof PUBLIC_DOCUMENT_CONTENT_SCHEMAS)[D]\n>;\n\n/** Each document's current-projection schema (`_appConfig/{documentId}`). */\nexport const PUBLIC_DOCUMENT_PROJECTION_SCHEMAS = {\n [SPECIAL_DOCS.TERMS_PAGE]: LegalPageDocumentSchema,\n [SPECIAL_DOCS.PRIVACY_PAGE]: LegalPageDocumentSchema,\n [SPECIAL_DOCS.RULES_AND_AGREEMENTS]: RulesAndAgreementsSchema,\n [SPECIAL_DOCS.FUTURE_PLANS]: FuturePlansDocumentSchema,\n [SPECIAL_DOCS.DMCA_POLICY]: DmcaPolicyDocumentSchema,\n [SPECIAL_DOCS.TAKE_IT_DOWN_PAGE_COPY]: TakeItDownPageCopySchema,\n} as const satisfies Record<PublicDocumentId, z.ZodType>;\n\n/**\n * The current projection the publish writes for document `D`: its content plus the version and\n * the publish time. Assignable to the page's existing document type.\n */\nexport type PublicDocumentProjection<D extends PublicDocumentId = PublicDocumentId> =\n PublicDocumentContent<D> & { version: number; lastUpdated: number };\n\n// One discriminated branch per document, so a version or draft's `content` is typed by its\n// `documentId`.\nfunction perDocument<const S extends z.ZodRawShape>(shape: S) {\n const branch = <const D extends PublicDocumentId>(documentId: D) =>\n z.object({ documentId: z.literal(documentId), content: PUBLIC_DOCUMENT_CONTENT_SCHEMAS[documentId], ...shape });\n return z.discriminatedUnion('documentId', [\n branch(SPECIAL_DOCS.TERMS_PAGE),\n branch(SPECIAL_DOCS.PRIVACY_PAGE),\n branch(SPECIAL_DOCS.RULES_AND_AGREEMENTS),\n branch(SPECIAL_DOCS.FUTURE_PLANS),\n branch(SPECIAL_DOCS.DMCA_POLICY),\n branch(SPECIAL_DOCS.TAKE_IT_DOWN_PAGE_COPY),\n ]);\n}\n\n// ── Immutable version ────────────────────────────────────────────────────────\n\n/**\n * `publicDocuments/{documentId}/publicDocumentVersions/v{version}` — one published version,\n * written once by the publish transaction and never edited: the full content, the version,\n * the release that published it, the publisher's uid, and the server time.\n */\nexport const PublicDocumentVersionSchema = perDocument({\n version: PublicDocumentVersionNumberSchema,\n releaseId: z.string().min(1),\n publishedBy: z.string().min(1),\n publishedAt: z.number(),\n});\nexport type PublicDocumentVersion = z.infer<typeof PublicDocumentVersionSchema>;\n\n// ── Working copy ─────────────────────────────────────────────────────────────\n\n/**\n * `publicDocumentDrafts/{documentId}` — the one private working copy of a document, saved from\n * its Admin editor. `baseVersion` is the published version the edit started from (0 when the\n * document has never been published): the publish rejects a draft whose base is no longer the\n * current version, and one whose content equals the current version.\n */\nexport const PublicDocumentDraftSchema = perDocument({\n baseVersion: PublicDocumentVersionOrNoneSchema,\n savedBy: z.string().min(1),\n savedAt: z.number(),\n});\nexport type PublicDocumentDraft = z.infer<typeof PublicDocumentDraftSchema>;\n\n// ── Release record ───────────────────────────────────────────────────────────\n\n/**\n * `publicDocumentReleases/{releaseId}` — one record per publish: which documents moved to\n * which versions, whether the release requires acceptance, the required-acceptance level in\n * force after it (raised by one only when it requires acceptance), and who published it when.\n */\nexport const PublicDocumentReleaseSchema = z.object({\n releaseId: z.string().min(1),\n documents: z.array(PublicDocumentVersionRefSchema).min(1),\n requireAcceptance: z.boolean(),\n requiredAcceptanceLevel: PublicDocumentAcceptanceLevelSchema,\n publishedBy: z.string().min(1),\n publishedAt: z.number(),\n});\nexport type PublicDocumentRelease = z.infer<typeof PublicDocumentReleaseSchema>;\n\n// ── Version block on _appConfig/app ──────────────────────────────────────────\n\n/**\n * One document's entry in the version block: its current published version and the latest\n * version a release REQUIRED acceptance of (0 when none has).\n */\nexport const PublicDocumentVersionStateSchema = z\n .object({\n currentVersion: PublicDocumentVersionNumberSchema,\n requiredVersion: PublicDocumentVersionOrNoneSchema,\n })\n .strict()\n .refine((state) => state.requiredVersion <= state.currentVersion, {\n message: 'requiredVersion cannot exceed currentVersion',\n });\nexport type PublicDocumentVersionState = z.infer<typeof PublicDocumentVersionStateSchema>;\n\n/**\n * `_appConfig/app.publicDocumentVersions` — written only by the publish transaction. A document\n * never published has no entry. `requiredAcceptanceLevel` rises by one with every release that\n * requires acceptance; a session whose accepted level is below it is asked to accept.\n */\nexport const PublicDocumentVersionBlockSchema = z\n .object({\n documents: z.partialRecord(PublicDocumentIdSchema, PublicDocumentVersionStateSchema),\n requiredAcceptanceLevel: PublicDocumentAcceptanceLevelSchema,\n })\n .strict();\nexport type PublicDocumentVersionBlock = z.infer<typeof PublicDocumentVersionBlockSchema>;\n\n// ── The person's acceptance summary (private doc) ────────────────────────────\n\n/**\n * `privateData/{uid}.publicDocumentAcceptance` — the LATEST accepted version of each document\n * and the accepted level, replaced whole on every acceptance (registration or the re-acceptance\n * prompt). A document absent from `documentVersions` counts as version 0. The notice revision in\n * force at that acceptance is recorded when the notice was active. History is not kept here — it\n * is the `publicDocuments.accepted` audit events.\n */\nexport const PublicDocumentAcceptanceSchema = z\n .object({\n documentVersions: z.partialRecord(PublicDocumentIdSchema, PublicDocumentVersionOrNoneSchema),\n acceptedLevel: PublicDocumentAcceptanceLevelSchema,\n legalReviewNoticeRevision: LegalReviewNoticeRevisionSchema.optional(),\n acceptedAt: z.number(),\n })\n .strict();\nexport type PublicDocumentAcceptance = z.infer<typeof PublicDocumentAcceptanceSchema>;\n"]}
@@ -6272,9 +6272,9 @@ export declare const COLLECTION_SCHEMAS: {
6272
6272
  scanStatus: z.ZodEnum<{
6273
6273
  pending: "pending";
6274
6274
  rejected: "rejected";
6275
+ unavailable: "unavailable";
6275
6276
  clean: "clean";
6276
6277
  matched: "matched";
6277
- unavailable: "unavailable";
6278
6278
  }>;
6279
6279
  objectGeneration: z.ZodString;
6280
6280
  objectHash: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],"names":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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"}
@@ -5,8 +5,9 @@ import { MAX_ANNOUNCEMENT_MESSAGE_LENGTH, MAX_APP_VERSION_LENGTH, MAX_MAINTENANC
5
5
  import { PublicDocumentVersionBlockSchema } from './public-documents.js';
6
6
  // Its write rule is `mergeAppConfigUpdate` (../utils/app-config.ts): an update over the doc as
7
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.
8
+ // Its read rule is `readAppConfigLever` (same file): a lever this schema's field refuses reads as
9
+ // its DEFAULT_APP_CONFIG value. Every text lever carries the same cap as its
10
+ // UpdateAppConfigInputSchema field, so no writer can store a value the update input would refuse.
10
11
  export const AppConfigSchema = z.object({
11
12
  // '' (DEFAULT_APP_CONFIG) is valid here — no version published; only the update input
12
13
  // requires a non-empty value.
@@ -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,EACL,+BAA+B,EAC/B,sBAAsB,EAC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CAAC,CAAC;AAGH,wFAAwF;AACxF,wEAAwE;AACxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC1B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,sFAAsF;IACtF,uFAAuF;IACvF,cAAc;IACd,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAGH,4FAA4F;AAC5F,2FAA2F;AAC3F,gGAAgG;AAChG,oFAAoF;AACpF,+CAA+C;AAC/C,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC1B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAGH,iGAAiG;AACjG,oGAAoG;AACpG,kGAAkG;AAClG,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC1B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAGH,oFAAoF;AACpF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,OAAO,EAAE,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 {\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 AppModeMarkerSchema>;\n"]}
1
+ {"version":3,"file":"system.js","sourceRoot":"","sources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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 {\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// Its read rule is `readAppConfigLever` (same file): a lever this schema's field refuses reads as\n// its DEFAULT_APP_CONFIG value. Every text lever carries the same cap as its\n// UpdateAppConfigInputSchema field, so no writer 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 AppModeMarkerSchema>;\n"]}
@@ -10,7 +10,7 @@ import { CRAFT_SKILL_TAG_VALUES } from '../constants/options.js';
10
10
  import { userPrivateDataAgeFieldsShape } from './safety/age.js';
11
11
  import { ContentMediaKindSchema } from './media-assets.js';
12
12
  import { calendarDateSchema } from '../schemas/atoms.js';
13
- import { PublicDocumentAcceptanceSchema } from './public-documents.js';
13
+ import { PublicDocumentAcceptanceSchema, PublicDocumentVersionOrNoneSchema } from './public-documents.js';
14
14
  // The canonical stored media kind — declared once in doc-schemas/media-assets.ts.
15
15
  const mediaKindSchema = ContentMediaKindSchema;
16
16
  /** The ONE canonical application account status (userProfiles.status is the
@@ -241,11 +241,11 @@ export const UserPrivateDataSchema = z.object({
241
241
  squareStreetzAgreementsDate: z.number().optional(),
242
242
  // The rules-and-agreements `version` in force when the user accepted; 0 when no versioned
243
243
  // rules doc existed yet, so a later real version 1 still re-prompts.
244
- squareStreetzAgreementsVersion: z.number().optional(),
244
+ squareStreetzAgreementsVersion: PublicDocumentVersionOrNoneSchema.optional(),
245
245
  // The rules-and-agreements version in force when the user accepted the Artisan upgrade's
246
246
  // agreement, read server-side in the grant transaction (the grant time is the profile's
247
247
  // `artisanCreator` stamp). Same 0 sentinel as `squareStreetzAgreementsVersion`.
248
- artisanCreatorAgreementsVersion: z.number().int().nonnegative().optional(),
248
+ artisanCreatorAgreementsVersion: PublicDocumentVersionOrNoneSchema.optional(),
249
249
  // Epoch ms when the user accepted the one-time Hall download acknowledgement
250
250
  // (personal offline use only, no redistribution). Written server-side by the
251
251
  // acceptHallDownloadAcknowledgement callable; gates the Hall download button.
@@ -1 +1 @@
1
- {"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/doc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,2BAA2B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClD,0FAA0F;IAC1F,qEAAqE;IACrE,8BAA8B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrD,yFAAyF;IACzF,wFAAwF;IACxF,gFAAgF;IAChF,+BAA+B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAC1E,6EAA6E;IAC7E,6EAA6E;IAC7E,8EAA8E;IAC9E,0BAA0B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjD,UAAU,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC3C,kFAAkF;IAClF,6FAA6F;IAC7F,yFAAyF;IACzF,wBAAwB,EAAE,8BAA8B,CAAC,QAAQ,EAAE;IACnE,4EAA4E;IAC5E,qFAAqF;IACrF,+EAA+E;IAC/E,QAAQ,EAAE,uBAAuB,CAAC,QAAQ,EAAE;IAC5C,gFAAgF;IAChF,+EAA+E;IAC/E,0EAA0E;IAC1E,sDAAsD;IACtD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,gFAAgF;IAChF,+EAA+E;IAC/E,mEAAmE;IACnE,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpC,mFAAmF;IACnF,iFAAiF;IACjF,4BAA4B;IAC5B,GAAG,6BAA6B;CACjC,CAAC,CAAC","sourcesContent":["// User-related Firestore document SCHEMAS — the single source of truth for the\n// `userProfiles/{uid}` doc, its `privateData/{uid}` subdoc, and craft-skill shapes.\n// (The `publicUsers/{uid}` mirror lives in ./publicUser.) TypeScript types are\n// inferred from these schemas via `z.infer`, so a document's shape and its type\n// cannot drift apart. See docs/design/firestore-schema-registry.md (ttt-prod).\n\nimport { z } from 'zod';\nimport { HALL_WING_TYPE_KEYS } from '../types/content.js';\nimport { MAX_ARTISAN_LOCATION_LENGTH } from '../constants/business.js';\nimport { CRAFT_SKILL_TAG_VALUES } from '../constants/options.js';\nimport { userPrivateDataAgeFieldsShape } from './safety/age.js';\nimport { ContentMediaKindSchema } from './media-assets.js';\nimport { calendarDateSchema } from '../schemas/atoms.js';\nimport { PublicDocumentAcceptanceSchema } from './public-documents.js';\n\n// The canonical stored media kind — declared once in doc-schemas/media-assets.ts.\nconst mediaKindSchema = ContentMediaKindSchema;\n\n/** The ONE canonical application account status (userProfiles.status is the\n * authoritative value; the chat access projection and the status-reconcile queue\n * derive from the same set). Never re-declare inline. */\nexport const UserAccountStatusSchema = z.enum(['active', 'suspended', 'banned']);\nexport type UserAccountStatus = z.infer<typeof UserAccountStatusSchema>;\n\n// Craft-skill kind — mandatory choice at upload, no default (see ttt-prod\n// docs/design/profile-and-craft-skills.md). 'original' = the artisan's own original creation;\n// 'mimicOnTtt' = a performance/recreation of work that originated in the TTT community\n// (requires a source reference); 'mimicOffTtt' = a performance/recreation of work from\n// outside TTT (covers covers + public-domain works, no source reference).\nexport const CraftSkillKindSchema = z.enum(['original', 'mimicOnTtt', 'mimicOffTtt']);\nexport type CraftSkillKind = z.infer<typeof CraftSkillKindSchema>;\n\n/** The ONE craft-skill kind that carries a `source` reference. The discriminated\n * CraftSkillSchema arm below and every upload-time validator derive from this named\n * declaration rather than re-quoting the member (ENG-005 / ARCH-102). */\nexport const CRAFT_SKILL_KIND_REQUIRING_SOURCE: CraftSkillKind = 'mimicOnTtt';\n\n// Source reference for a 'mimicOnTtt' skill — the original artisan OR the original work,\n// linked mention-style (id only, no name snapshots, resolved at render per the Display\n// Identity Invariant). 'workProject' is the safe framing today; linking a specific hall\n// item is optional future scope.\nexport const CraftSkillSourceReferenceSchema = z\n .object({\n type: z.enum(['user', 'workProject']),\n id: z.string().min(1),\n })\n .strict();\nexport type CraftSkillSourceReference = z.infer<typeof CraftSkillSourceReferenceSchema>;\n\n// The agreed attestation recorded on the doc: which statement (keyed by kind) the\n// uploader agreed to, its version, and when (epoch ms, always a number — never a\n// Firestore Timestamp).\nexport const CraftSkillAttestationSchema = z\n .object({\n statementKind: CraftSkillKindSchema,\n statementVersion: z.number().int().min(1),\n agreedAt: z.number(),\n })\n .strict();\nexport type CraftSkillAttestation = z.infer<typeof CraftSkillAttestationSchema>;\n\n// Base craft-skill fields shared across all kinds. The `kind` + `source` relationship is\n// layered on top as a discriminated union so an invalid combination (e.g. a source on an\n// 'original', or a missing source on a 'mimicOnTtt') fails schema validation.\nconst craftSkillBaseShape = {\n id: z.string(),\n name: z.string(),\n mediaAssetId: z.string(),\n // Canonical discipline-tag allowlist — never open strings (DJ ruling 2026-07-13).\n tags: z.array(z.enum(CRAFT_SKILL_TAG_VALUES)),\n createdAt: z.number(),\n type: mediaKindSchema,\n // Moderation visibility flag. Absent/false = visible; true = hidden by the\n // craft-skill hide cascade (report auto-hide or admin action). Mirrored onto\n // every taggedCraftSkills index doc so discovery surfaces can filter it.\n hidden: z.boolean(),\n attestation: CraftSkillAttestationSchema,\n};\n\nexport const CraftSkillSchema = z.discriminatedUnion('kind', [\n z.object({\n ...craftSkillBaseShape,\n kind: z.literal('original'),\n }),\n z.object({\n ...craftSkillBaseShape,\n kind: z.literal('mimicOnTtt'),\n // REQUIRED for the on-TTT mimic kind: the linked original artisan or work.\n source: CraftSkillSourceReferenceSchema,\n }),\n z.object({\n ...craftSkillBaseShape,\n kind: z.literal('mimicOffTtt'),\n }),\n]);\nexport type CraftSkill = z.infer<typeof CraftSkillSchema>;\n\nexport const CraftSkillReferenceSchema = z.object({\n craftSkillId: z.string(),\n compositeId: z.string(),\n userId: z.string(),\n craftSkillName: z.string(),\n craftSkillAssetId: z.string(),\n craftSkillType: mediaKindSchema,\n tags: z.array(z.enum(CRAFT_SKILL_TAG_VALUES)),\n createdAt: z.number(),\n // Mirror of CraftSkill.hidden; lets the tag-browse filter hidden skills out.\n hidden: z.boolean(),\n // Mirror of CraftSkill.kind so the tag-browse card can render the kind badge without a\n // second read.\n kind: CraftSkillKindSchema,\n // Mirror of CraftSkill.source — present ONLY when kind === 'mimicOnTtt' (the source-doc\n // discriminated union guarantees that invariant on the authoritative side). Lets the\n // browse card render the clickable \"someone performed my work\" source link.\n source: CraftSkillSourceReferenceSchema.optional(),\n});\nexport type CraftSkillReference = z.infer<typeof CraftSkillReferenceSchema>;\n\nexport const MinimalCraftSkillSchema = z.object({\n id: z.string(),\n name: z.string(),\n mediaAssetId: z.string(),\n type: mediaKindSchema,\n});\nexport type MinimalCraftSkill = z.infer<typeof MinimalCraftSkillSchema>;\n\nexport const OwnedWorkProjectSchema = z.object({\n workProjectId: z.string(),\n workingTitle: z.string(),\n workingDescription: z.string(),\n type: z.string(),\n createdOn: z.number(),\n hallWingType: z.enum(HALL_WING_TYPE_KEYS),\n});\nexport type OwnedWorkProject = z.infer<typeof OwnedWorkProjectSchema>;\n\nexport const AssociatedWorkProjectSchema = z.object({\n workProjectId: z.string(),\n workingTitle: z.string(),\n workingDescription: z.string(),\n type: z.string(),\n joinedOn: z.number(),\n});\nexport type AssociatedWorkProject = z.infer<typeof AssociatedWorkProjectSchema>;\n\nexport const FullUserSchema = z.object({\n uid: z.string(),\n displayName: z.string(),\n displayName_lowercase: z.string(),\n // One asset, variants full/medium/small in the mediaAssets registry; URLs\n // are built at render time (media-assets-and-protected-serving.md).\n profilePictureAssetId: z.string().nullable().optional(),\n artisanCreator: z.number().optional(),\n // Cosmetic supporter badge. Set true via the Admin SDK inside the Stripe webhook's\n // pledge-record transaction once the user completes a pledge; rendered on the profile\n // page. Lives here (not publicUsers) because userProfiles/{uid} is already readable by\n // any authenticated user, so other viewers see the badge with no mirror. Not PII.\n // Revoked (→ false) on refund once refunds ship.\n hasPledged: z.boolean().optional(),\n status: UserAccountStatusSchema.optional(),\n // Stamped by the one status writer on every status change: when, and the acting admin/operator\n // uid (a system actor writes its own id). Absent on an account whose status never changed.\n statusUpdatedAt: z.number().optional(),\n // Either the authenticated actor's uid or a stable namespaced system actor\n // identifier (for example `system:autoHashLock`); never null.\n statusUpdatedBy: z.string().min(1).optional(),\n // Chat-edge-rebuild account-access domain (Contract B / round-10 blocker 1): the\n // single ban/unban ordering version + state the chat `accountAccess` sync events key\n // on. Backend-only-writable. Deliberate defaults when ABSENT: a never-touched account\n // is `{ accountAccessVersion: 0, accountAccessState: 'active' }` (NOT banned) — bumped\n // atomically on suspend/ban/unban, which enqueue the accountAccessChanged fanout.\n accountAccessVersion: z.number().optional(),\n accountAccessState: UserAccountStatusSchema.optional(),\n // Moderation: set true by the forceDisplayNameReset callable when an admin resets an\n // abusive display name. The app gates the user into a forced \"pick a new name\" flow until\n // they complete it via setMyDisplayName (which clears this). Backend-only-writable (like `status`).\n displayNameResetRequired: z.boolean().optional(),\n ownedWorkProjects: z.array(OwnedWorkProjectSchema).optional(),\n associatedWorkProjects: z.array(AssociatedWorkProjectSchema).optional(),\n createdAt: z.number(),\n // N3 data-deletion / GDPR erasure: epoch ms when the account-deletion scrub\n // anonymized this profile in place. When set, the identity fields have been\n // scrubbed (displayName → the FORMER_MEMBER_DISPLAY_NAME sentinel) and the\n // account is a tombstone. Backend-only-writable.\n anonymizedAt: z.number().optional(),\n});\nexport type FullUser = z.infer<typeof FullUserSchema>;\n\nexport const UserAgreementsSchema = z.object({\n age: z.boolean().optional(),\n nudity: z.boolean().optional(),\n meet: z.boolean().optional(),\n cookies: z.boolean().optional(),\n terms: z.boolean().optional(),\n agreedOn: z.number().optional(),\n /**\n * The Terms / Privacy versions accepted at registration, read server-side from the live\n * docs at acceptance time — never client-supplied, never a hardcoded constant. Kept for the\n * accounts that recorded them; the current per-document record is\n * `privateData.publicDocumentAcceptance`.\n *\n * `0` is the sentinel for \"registered while no legal document was published\" (a fresh\n * environment's first account). Published versions start at 1, so 0 can never equal a live\n * version — which is deliberate: it keeps the record from claiming consent that never\n * happened, and leaves the version-bump re-acceptance path free to catch the account once\n * real legal content ships.\n */\n termsVersion: z.number().int().nonnegative().optional(),\n privacyVersion: z.number().int().nonnegative().optional(),\n});\nexport type UserAgreements = z.infer<typeof UserAgreementsSchema>;\n\n/**\n * First-visit site-tour state (account-durable, server-written) stored on\n * `privateData/{uid}.siteTour`. A missing `siteTour` field means the member has never\n * handled the tour. Automatic-invitation eligibility is evaluated in this order:\n * 1. `automaticInvitesDisabledAt` present → never invite automatically (\"Don't show\n * this again\");\n * 2. `notTodayDate` equals the member's current LOCAL calendar date → do not invite\n * that day (\"Not today\");\n * 3. `completedVersion` equals `SITE_TOUR_CURRENT_VERSION` → already handled;\n * 4. otherwise → offer the tour.\n * Written ONLY by the `updateSiteTourPreference` callable via the Admin SDK; never\n * client-written. `notTodayDate` is a strict `YYYY-MM-DD` local-date string (same\n * date-string convention as the age cluster's `attestedDateOfBirth`). See\n * docs/design/landing-backstage-guide-and-first-visit-plan.md §10.\n */\nexport const UserSiteTourStateSchema = z.object({\n // The tour version the member completed. The callable stamps SITE_TOUR_CURRENT_VERSION\n // server-side at completion (the version is server-owned, never client-supplied);\n // absent until a completion is recorded.\n completedVersion: z.number().int().optional(),\n // Epoch ms when the tour was completed.\n completedAt: z.number().optional(),\n // The member's LOCAL calendar date (YYYY-MM-DD) recorded by \"Not today\"; the automatic\n // invitation is suppressed for exactly that date, then offered again on a later date.\n notTodayDate: calendarDateSchema.optional(), // 'YYYY-MM-DD'\n // Epoch ms when the member chose \"Don't show this again\" (permanent automatic-invite\n // dismissal). Manual replay from Help ignores this without clearing it.\n automaticInvitesDisabledAt: z.number().optional(),\n});\nexport type UserSiteTourState = z.infer<typeof UserSiteTourStateSchema>;\n\n/**\n * Owner-only account state at `userProfiles/{uid}/privateData/{uid}` (readable\n * only by the owner; never mirrored to publicUsers).\n */\nexport const UserPrivateDataSchema = z.object({\n email: z.string(),\n // Epoch ms when the user applied for news/political posting (not a boolean) so the\n // applicant queue can be ordered/triaged by application date. Mirrors the\n // `artisanCreator?: number` grant-timestamp pattern. Truthy when set, so existing\n // truthiness reads keep working; absent until the user applies.\n isWaitingForNewsApproval: z.number().optional(),\n // Epoch ms when the user attested they are a U.S.-based person while becoming an artisan\n // (required at artisan signup for now). Mirrors the ageAttested attestation pattern; written\n // server-side by becomeArtisanCreator.\n usPersonAttestedAt: z.number().optional(),\n // Non-U.S. artisan-interest \"waitlist\" recorded ONLY for adult accounts when a non-U.S. person\n // asks to be notified once creator signups open in their region. Owner-only, backend-written.\n // `requestedAt` is the immutable first-come-first-serve timestamp; `country`/`region` let signups\n // be opened by jurisdiction as each region's laws clear. Mirrors isWaitingForNewsApproval.\n nonUsArtisanInterest: z\n .object({\n country: z.string().min(1).max(MAX_ARTISAN_LOCATION_LENGTH),\n region: z.string().max(MAX_ARTISAN_LOCATION_LENGTH).optional(),\n requestedAt: z.number(),\n })\n .optional(),\n squareStreetzAgreementsDate: z.number().optional(),\n // The rules-and-agreements `version` in force when the user accepted; 0 when no versioned\n // rules doc existed yet, so a later real version 1 still re-prompts.\n squareStreetzAgreementsVersion: z.number().optional(),\n // The rules-and-agreements version in force when the user accepted the Artisan upgrade's\n // agreement, read server-side in the grant transaction (the grant time is the profile's\n // `artisanCreator` stamp). Same 0 sentinel as `squareStreetzAgreementsVersion`.\n artisanCreatorAgreementsVersion: z.number().int().nonnegative().optional(),\n // Epoch ms when the user accepted the one-time Hall download acknowledgement\n // (personal offline use only, no redistribution). Written server-side by the\n // acceptHallDownloadAcknowledgement callable; gates the Hall download button.\n hallDownloadAcknowledgedAt: z.number().optional(),\n agreements: UserAgreementsSchema.optional(),\n // The latest accepted version of each public document and the accepted level (see\n // PublicDocumentAcceptanceSchema). Written by registration and the acceptance callable only;\n // the `docsAccepted` claim mirrors `acceptedLevel`. Absent = nothing accepted (level 0).\n publicDocumentAcceptance: PublicDocumentAcceptanceSchema.optional(),\n // First-visit site-tour state (account-durable; the SOLE authority for tour\n // eligibility — no local-storage cache/mirror). Absent = never handled. Written only\n // by the updateSiteTourPreference callable. See UserSiteTourStateSchema above.\n siteTour: UserSiteTourStateSchema.optional(),\n // Moderation: human-readable reason for the current account status (set when an\n // admin suspends/bans the user). Written by the setUserStatus callable via the\n // Admin SDK; readable only by the owner (shown in their restricted view).\n // Cleared when the account is reinstated to 'active'.\n statusReason: z.string().optional(),\n statusReasonAt: z.number().optional(),\n // Trust & Safety (§A8): silent interim safety-lock flag. Backend-only-writable,\n // restricted to the owner's view. Set true while a child-safety/NCII action is\n // pending against the account; the app gates the user accordingly.\n safetyLocked: z.boolean().optional(),\n // Trust & Safety (§A7): server-write-only age/registration fields, merged from the\n // standalone age cluster shape (./safety/age.js) so the canonical schema and the\n // age cluster cannot drift.\n ...userPrivateDataAgeFieldsShape,\n});\nexport type UserPrivateData = z.infer<typeof UserPrivateDataSchema>;\n"]}
1
+ {"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/doc-schemas/user.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,oFAAoF;AACpF,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAE/E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,8BAA8B,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAE1G,kFAAkF;AAClF,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAE/C;;yDAEyD;AACzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,WAAW,EA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AAQ,EAAE;IACnC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,gFAAgF;IAChF,+EAA+E;IAC/E,mEAAmE;IACnE,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpC,mFAAmF;IACnF,iFAAiF;IACjF,4BAA4B;IAC5B,GAAG,6BAA6B;CACjC,CAAC,CAAC","sourcesContent":["// User-related Firestore document SCHEMAS — the single source of truth for the\n// `userProfiles/{uid}` doc, its `privateData/{uid}` subdoc, and craft-skill shapes.\n// (The `publicUsers/{uid}` mirror lives in ./publicUser.) TypeScript types are\n// inferred from these schemas via `z.infer`, so a document's shape and its type\n// cannot drift apart. See docs/design/firestore-schema-registry.md (ttt-prod).\n\nimport { z } from 'zod';\nimport { HALL_WING_TYPE_KEYS } from '../types/content.js';\nimport { MAX_ARTISAN_LOCATION_LENGTH } from '../constants/business.js';\nimport { CRAFT_SKILL_TAG_VALUES } from '../constants/options.js';\nimport { userPrivateDataAgeFieldsShape } from './safety/age.js';\nimport { ContentMediaKindSchema } from './media-assets.js';\nimport { calendarDateSchema } from '../schemas/atoms.js';\nimport { PublicDocumentAcceptanceSchema, PublicDocumentVersionOrNoneSchema } from './public-documents.js';\n\n// The canonical stored media kind — declared once in doc-schemas/media-assets.ts.\nconst mediaKindSchema = ContentMediaKindSchema;\n\n/** The ONE canonical application account status (userProfiles.status is the\n * authoritative value; the chat access projection and the status-reconcile queue\n * derive from the same set). Never re-declare inline. */\nexport const UserAccountStatusSchema = z.enum(['active', 'suspended', 'banned']);\nexport type UserAccountStatus = z.infer<typeof UserAccountStatusSchema>;\n\n// Craft-skill kind — mandatory choice at upload, no default (see ttt-prod\n// docs/design/profile-and-craft-skills.md). 'original' = the artisan's own original creation;\n// 'mimicOnTtt' = a performance/recreation of work that originated in the TTT community\n// (requires a source reference); 'mimicOffTtt' = a performance/recreation of work from\n// outside TTT (covers covers + public-domain works, no source reference).\nexport const CraftSkillKindSchema = z.enum(['original', 'mimicOnTtt', 'mimicOffTtt']);\nexport type CraftSkillKind = z.infer<typeof CraftSkillKindSchema>;\n\n/** The ONE craft-skill kind that carries a `source` reference. The discriminated\n * CraftSkillSchema arm below and every upload-time validator derive from this named\n * declaration rather than re-quoting the member (ENG-005 / ARCH-102). */\nexport const CRAFT_SKILL_KIND_REQUIRING_SOURCE: CraftSkillKind = 'mimicOnTtt';\n\n// Source reference for a 'mimicOnTtt' skill — the original artisan OR the original work,\n// linked mention-style (id only, no name snapshots, resolved at render per the Display\n// Identity Invariant). 'workProject' is the safe framing today; linking a specific hall\n// item is optional future scope.\nexport const CraftSkillSourceReferenceSchema = z\n .object({\n type: z.enum(['user', 'workProject']),\n id: z.string().min(1),\n })\n .strict();\nexport type CraftSkillSourceReference = z.infer<typeof CraftSkillSourceReferenceSchema>;\n\n// The agreed attestation recorded on the doc: which statement (keyed by kind) the\n// uploader agreed to, its version, and when (epoch ms, always a number — never a\n// Firestore Timestamp).\nexport const CraftSkillAttestationSchema = z\n .object({\n statementKind: CraftSkillKindSchema,\n statementVersion: z.number().int().min(1),\n agreedAt: z.number(),\n })\n .strict();\nexport type CraftSkillAttestation = z.infer<typeof CraftSkillAttestationSchema>;\n\n// Base craft-skill fields shared across all kinds. The `kind` + `source` relationship is\n// layered on top as a discriminated union so an invalid combination (e.g. a source on an\n// 'original', or a missing source on a 'mimicOnTtt') fails schema validation.\nconst craftSkillBaseShape = {\n id: z.string(),\n name: z.string(),\n mediaAssetId: z.string(),\n // Canonical discipline-tag allowlist — never open strings (DJ ruling 2026-07-13).\n tags: z.array(z.enum(CRAFT_SKILL_TAG_VALUES)),\n createdAt: z.number(),\n type: mediaKindSchema,\n // Moderation visibility flag. Absent/false = visible; true = hidden by the\n // craft-skill hide cascade (report auto-hide or admin action). Mirrored onto\n // every taggedCraftSkills index doc so discovery surfaces can filter it.\n hidden: z.boolean(),\n attestation: CraftSkillAttestationSchema,\n};\n\nexport const CraftSkillSchema = z.discriminatedUnion('kind', [\n z.object({\n ...craftSkillBaseShape,\n kind: z.literal('original'),\n }),\n z.object({\n ...craftSkillBaseShape,\n kind: z.literal('mimicOnTtt'),\n // REQUIRED for the on-TTT mimic kind: the linked original artisan or work.\n source: CraftSkillSourceReferenceSchema,\n }),\n z.object({\n ...craftSkillBaseShape,\n kind: z.literal('mimicOffTtt'),\n }),\n]);\nexport type CraftSkill = z.infer<typeof CraftSkillSchema>;\n\nexport const CraftSkillReferenceSchema = z.object({\n craftSkillId: z.string(),\n compositeId: z.string(),\n userId: z.string(),\n craftSkillName: z.string(),\n craftSkillAssetId: z.string(),\n craftSkillType: mediaKindSchema,\n tags: z.array(z.enum(CRAFT_SKILL_TAG_VALUES)),\n createdAt: z.number(),\n // Mirror of CraftSkill.hidden; lets the tag-browse filter hidden skills out.\n hidden: z.boolean(),\n // Mirror of CraftSkill.kind so the tag-browse card can render the kind badge without a\n // second read.\n kind: CraftSkillKindSchema,\n // Mirror of CraftSkill.source — present ONLY when kind === 'mimicOnTtt' (the source-doc\n // discriminated union guarantees that invariant on the authoritative side). Lets the\n // browse card render the clickable \"someone performed my work\" source link.\n source: CraftSkillSourceReferenceSchema.optional(),\n});\nexport type CraftSkillReference = z.infer<typeof CraftSkillReferenceSchema>;\n\nexport const MinimalCraftSkillSchema = z.object({\n id: z.string(),\n name: z.string(),\n mediaAssetId: z.string(),\n type: mediaKindSchema,\n});\nexport type MinimalCraftSkill = z.infer<typeof MinimalCraftSkillSchema>;\n\nexport const OwnedWorkProjectSchema = z.object({\n workProjectId: z.string(),\n workingTitle: z.string(),\n workingDescription: z.string(),\n type: z.string(),\n createdOn: z.number(),\n hallWingType: z.enum(HALL_WING_TYPE_KEYS),\n});\nexport type OwnedWorkProject = z.infer<typeof OwnedWorkProjectSchema>;\n\nexport const AssociatedWorkProjectSchema = z.object({\n workProjectId: z.string(),\n workingTitle: z.string(),\n workingDescription: z.string(),\n type: z.string(),\n joinedOn: z.number(),\n});\nexport type AssociatedWorkProject = z.infer<typeof AssociatedWorkProjectSchema>;\n\nexport const FullUserSchema = z.object({\n uid: z.string(),\n displayName: z.string(),\n displayName_lowercase: z.string(),\n // One asset, variants full/medium/small in the mediaAssets registry; URLs\n // are built at render time (media-assets-and-protected-serving.md).\n profilePictureAssetId: z.string().nullable().optional(),\n artisanCreator: z.number().optional(),\n // Cosmetic supporter badge. Set true via the Admin SDK inside the Stripe webhook's\n // pledge-record transaction once the user completes a pledge; rendered on the profile\n // page. Lives here (not publicUsers) because userProfiles/{uid} is already readable by\n // any authenticated user, so other viewers see the badge with no mirror. Not PII.\n // Revoked (→ false) on refund once refunds ship.\n hasPledged: z.boolean().optional(),\n status: UserAccountStatusSchema.optional(),\n // Stamped by the one status writer on every status change: when, and the acting admin/operator\n // uid (a system actor writes its own id). Absent on an account whose status never changed.\n statusUpdatedAt: z.number().optional(),\n // Either the authenticated actor's uid or a stable namespaced system actor\n // identifier (for example `system:autoHashLock`); never null.\n statusUpdatedBy: z.string().min(1).optional(),\n // Chat-edge-rebuild account-access domain (Contract B / round-10 blocker 1): the\n // single ban/unban ordering version + state the chat `accountAccess` sync events key\n // on. Backend-only-writable. Deliberate defaults when ABSENT: a never-touched account\n // is `{ accountAccessVersion: 0, accountAccessState: 'active' }` (NOT banned) — bumped\n // atomically on suspend/ban/unban, which enqueue the accountAccessChanged fanout.\n accountAccessVersion: z.number().optional(),\n accountAccessState: UserAccountStatusSchema.optional(),\n // Moderation: set true by the forceDisplayNameReset callable when an admin resets an\n // abusive display name. The app gates the user into a forced \"pick a new name\" flow until\n // they complete it via setMyDisplayName (which clears this). Backend-only-writable (like `status`).\n displayNameResetRequired: z.boolean().optional(),\n ownedWorkProjects: z.array(OwnedWorkProjectSchema).optional(),\n associatedWorkProjects: z.array(AssociatedWorkProjectSchema).optional(),\n createdAt: z.number(),\n // N3 data-deletion / GDPR erasure: epoch ms when the account-deletion scrub\n // anonymized this profile in place. When set, the identity fields have been\n // scrubbed (displayName → the FORMER_MEMBER_DISPLAY_NAME sentinel) and the\n // account is a tombstone. Backend-only-writable.\n anonymizedAt: z.number().optional(),\n});\nexport type FullUser = z.infer<typeof FullUserSchema>;\n\nexport const UserAgreementsSchema = z.object({\n age: z.boolean().optional(),\n nudity: z.boolean().optional(),\n meet: z.boolean().optional(),\n cookies: z.boolean().optional(),\n terms: z.boolean().optional(),\n agreedOn: z.number().optional(),\n /**\n * The Terms / Privacy versions accepted at registration, read server-side from the live\n * docs at acceptance time — never client-supplied, never a hardcoded constant. Kept for the\n * accounts that recorded them; the current per-document record is\n * `privateData.publicDocumentAcceptance`.\n *\n * `0` is the sentinel for \"registered while no legal document was published\" (a fresh\n * environment's first account). Published versions start at 1, so 0 can never equal a live\n * version — which is deliberate: it keeps the record from claiming consent that never\n * happened, and leaves the version-bump re-acceptance path free to catch the account once\n * real legal content ships.\n */\n termsVersion: z.number().int().nonnegative().optional(),\n privacyVersion: z.number().int().nonnegative().optional(),\n});\nexport type UserAgreements = z.infer<typeof UserAgreementsSchema>;\n\n/**\n * First-visit site-tour state (account-durable, server-written) stored on\n * `privateData/{uid}.siteTour`. A missing `siteTour` field means the member has never\n * handled the tour. Automatic-invitation eligibility is evaluated in this order:\n * 1. `automaticInvitesDisabledAt` present → never invite automatically (\"Don't show\n * this again\");\n * 2. `notTodayDate` equals the member's current LOCAL calendar date → do not invite\n * that day (\"Not today\");\n * 3. `completedVersion` equals `SITE_TOUR_CURRENT_VERSION` → already handled;\n * 4. otherwise → offer the tour.\n * Written ONLY by the `updateSiteTourPreference` callable via the Admin SDK; never\n * client-written. `notTodayDate` is a strict `YYYY-MM-DD` local-date string (same\n * date-string convention as the age cluster's `attestedDateOfBirth`). See\n * docs/design/landing-backstage-guide-and-first-visit-plan.md §10.\n */\nexport const UserSiteTourStateSchema = z.object({\n // The tour version the member completed. The callable stamps SITE_TOUR_CURRENT_VERSION\n // server-side at completion (the version is server-owned, never client-supplied);\n // absent until a completion is recorded.\n completedVersion: z.number().int().optional(),\n // Epoch ms when the tour was completed.\n completedAt: z.number().optional(),\n // The member's LOCAL calendar date (YYYY-MM-DD) recorded by \"Not today\"; the automatic\n // invitation is suppressed for exactly that date, then offered again on a later date.\n notTodayDate: calendarDateSchema.optional(), // 'YYYY-MM-DD'\n // Epoch ms when the member chose \"Don't show this again\" (permanent automatic-invite\n // dismissal). Manual replay from Help ignores this without clearing it.\n automaticInvitesDisabledAt: z.number().optional(),\n});\nexport type UserSiteTourState = z.infer<typeof UserSiteTourStateSchema>;\n\n/**\n * Owner-only account state at `userProfiles/{uid}/privateData/{uid}` (readable\n * only by the owner; never mirrored to publicUsers).\n */\nexport const UserPrivateDataSchema = z.object({\n email: z.string(),\n // Epoch ms when the user applied for news/political posting (not a boolean) so the\n // applicant queue can be ordered/triaged by application date. Mirrors the\n // `artisanCreator?: number` grant-timestamp pattern. Truthy when set, so existing\n // truthiness reads keep working; absent until the user applies.\n isWaitingForNewsApproval: z.number().optional(),\n // Epoch ms when the user attested they are a U.S.-based person while becoming an artisan\n // (required at artisan signup for now). Mirrors the ageAttested attestation pattern; written\n // server-side by becomeArtisanCreator.\n usPersonAttestedAt: z.number().optional(),\n // Non-U.S. artisan-interest \"waitlist\" recorded ONLY for adult accounts when a non-U.S. person\n // asks to be notified once creator signups open in their region. Owner-only, backend-written.\n // `requestedAt` is the immutable first-come-first-serve timestamp; `country`/`region` let signups\n // be opened by jurisdiction as each region's laws clear. Mirrors isWaitingForNewsApproval.\n nonUsArtisanInterest: z\n .object({\n country: z.string().min(1).max(MAX_ARTISAN_LOCATION_LENGTH),\n region: z.string().max(MAX_ARTISAN_LOCATION_LENGTH).optional(),\n requestedAt: z.number(),\n })\n .optional(),\n squareStreetzAgreementsDate: z.number().optional(),\n // The rules-and-agreements `version` in force when the user accepted; 0 when no versioned\n // rules doc existed yet, so a later real version 1 still re-prompts.\n squareStreetzAgreementsVersion: PublicDocumentVersionOrNoneSchema.optional(),\n // The rules-and-agreements version in force when the user accepted the Artisan upgrade's\n // agreement, read server-side in the grant transaction (the grant time is the profile's\n // `artisanCreator` stamp). Same 0 sentinel as `squareStreetzAgreementsVersion`.\n artisanCreatorAgreementsVersion: PublicDocumentVersionOrNoneSchema.optional(),\n // Epoch ms when the user accepted the one-time Hall download acknowledgement\n // (personal offline use only, no redistribution). Written server-side by the\n // acceptHallDownloadAcknowledgement callable; gates the Hall download button.\n hallDownloadAcknowledgedAt: z.number().optional(),\n agreements: UserAgreementsSchema.optional(),\n // The latest accepted version of each public document and the accepted level (see\n // PublicDocumentAcceptanceSchema). Written by registration and the acceptance callable only;\n // the `docsAccepted` claim mirrors `acceptedLevel`. Absent = nothing accepted (level 0).\n publicDocumentAcceptance: PublicDocumentAcceptanceSchema.optional(),\n // First-visit site-tour state (account-durable; the SOLE authority for tour\n // eligibility — no local-storage cache/mirror). Absent = never handled. Written only\n // by the updateSiteTourPreference callable. See UserSiteTourStateSchema above.\n siteTour: UserSiteTourStateSchema.optional(),\n // Moderation: human-readable reason for the current account status (set when an\n // admin suspends/bans the user). Written by the setUserStatus callable via the\n // Admin SDK; readable only by the owner (shown in their restricted view).\n // Cleared when the account is reinstated to 'active'.\n statusReason: z.string().optional(),\n statusReasonAt: z.number().optional(),\n // Trust & Safety (§A8): silent interim safety-lock flag. Backend-only-writable,\n // restricted to the owner's view. Set true while a child-safety/NCII action is\n // pending against the account; the app gates the user accordingly.\n safetyLocked: z.boolean().optional(),\n // Trust & Safety (§A7): server-write-only age/registration fields, merged from the\n // standalone age cluster shape (./safety/age.js) so the canonical schema and the\n // age cluster cannot drift.\n ...userPrivateDataAgeFieldsShape,\n});\nexport type UserPrivateData = z.infer<typeof UserPrivateDataSchema>;\n"]}
@@ -4,6 +4,19 @@ import { z } from 'zod';
4
4
  export declare const displayNameSchema: z.ZodString;
5
5
  export declare const AcceptSquareStreetzAgreementsInputSchema: z.ZodObject<{}, z.core.$strict>;
6
6
  export type AcceptSquareStreetzAgreementsInput = z.infer<typeof AcceptSquareStreetzAgreementsInputSchema>;
7
+ /**
8
+ * `social.squareStreetzAgreementsAccepted` — the `metadata` of the event written with the
9
+ * private acceptance record. The card incorporates the Rules & Agreements page by reference, so
10
+ * the version is that page's: `acceptedVersion` is the one this acceptance recorded (0 while no
11
+ * Rules version is published), and `previousAcceptedVersion` the one the record held before,
12
+ * null when none was recorded (the first acceptance). The actor and server time ride the event
13
+ * envelope.
14
+ */
15
+ export declare const SquareStreetzAgreementsAcceptedAuditPayloadSchema: z.ZodObject<{
16
+ acceptedVersion: z.ZodNumber;
17
+ previousAcceptedVersion: z.ZodNullable<z.ZodNumber>;
18
+ }, z.core.$strict>;
19
+ export type SquareStreetzAgreementsAcceptedAuditPayload = z.infer<typeof SquareStreetzAgreementsAcceptedAuditPayloadSchema>;
7
20
  export declare const AcceptHallDownloadAcknowledgementInputSchema: z.ZodObject<{}, z.core.$strict>;
8
21
  export type AcceptHallDownloadAcknowledgementInput = z.infer<typeof AcceptHallDownloadAcknowledgementInputSchema>;
9
22
  export declare const BecomeArtisanCreatorInputSchema: z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/schemas/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB;gFACgF;AAChF,eAAO,MAAM,iBAAiB,aAIN,CAAC;AAEzB,eAAO,MAAM,wCAAwC,iCAAwB,CAAC;AAC9E,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC;AAM1G,eAAO,MAAM,4CAA4C,iCAAwB,CAAC;AAClF,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4CAA4C,CAAC,CAAC;AAKlH,eAAO,MAAM,+BAA+B;;;;;;;;kBAiBjC,CAAC;AACZ,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,eAAO,MAAM,qCAAqC,iCAAwB,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AI1F,eAAO,MAAM,2BAA2B;;kBAE7B,CAAC;AACZ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAKhF,eAAO,MAAM,oCAAoC;;kBAEtC,CAAC;AACZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAKlG,eAAO,MAAM,gCAAgC;;;;;;kBAMlC,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAK1F,eAAO,MAAM,4BAA4B;;kBAE9B,CAAC;AACZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAOlF,eAAO,MAAM,iCAAiC;;kBAEnC,CAAC;AACZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAK5F,eAAO,MAAM,kCAAkC;;;;iBAM7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,eAAO,MAAM,iCAAiC;;;iBAI5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,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 { PublicDocumentVersionOrNoneSchema } from '../doc-schemas/public-documents.js';
5
6
  import { ShownPublicDocumentVersionsSchema, PublicDocumentsRefreshRequiredResultSchema, } from './public-documents.js';
6
7
  /** The ONE composed display-name field validator (length bounds + charset). Every
7
8
  * callable accepting a display name spreads this — never a re-composed copy. */
@@ -11,6 +12,18 @@ export const displayNameSchema = z
11
12
  .max(USERNAME_MAX_LENGTH)
12
13
  .regex(USERNAME_REGEX);
13
14
  export const AcceptSquareStreetzAgreementsInputSchema = z.object({}).strict();
15
+ /**
16
+ * `social.squareStreetzAgreementsAccepted` — the `metadata` of the event written with the
17
+ * private acceptance record. The card incorporates the Rules & Agreements page by reference, so
18
+ * the version is that page's: `acceptedVersion` is the one this acceptance recorded (0 while no
19
+ * Rules version is published), and `previousAcceptedVersion` the one the record held before,
20
+ * null when none was recorded (the first acceptance). The actor and server time ride the event
21
+ * envelope.
22
+ */
23
+ export const SquareStreetzAgreementsAcceptedAuditPayloadSchema = z.object({
24
+ acceptedVersion: PublicDocumentVersionOrNoneSchema,
25
+ previousAcceptedVersion: PublicDocumentVersionOrNoneSchema.nullable(),
26
+ }).strict();
14
27
  // One-time acknowledgement gate before a user may download Hall content for personal
15
28
  // offline use (final wording owned by the legal-and-content step). No payload — the
16
29
  // callable records the timestamp in the caller's privateData. See