@ttt-productions/ttt-core 0.79.49 → 0.79.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/craft-skill-statements.d.ts +20 -0
- package/dist/constants/craft-skill-statements.d.ts.map +1 -1
- package/dist/constants/craft-skill-statements.js +25 -9
- package/dist/constants/craft-skill-statements.js.map +1 -1
- package/dist/constants/legal-review-notice.d.ts +3 -0
- package/dist/constants/legal-review-notice.d.ts.map +1 -1
- package/dist/constants/legal-review-notice.js +3 -0
- package/dist/constants/legal-review-notice.js.map +1 -1
- package/dist/constants/public-documents.d.ts +7 -0
- package/dist/constants/public-documents.d.ts.map +1 -1
- package/dist/constants/public-documents.js +7 -0
- package/dist/constants/public-documents.js.map +1 -1
- package/dist/doc-schemas/ncii/config.d.ts +1 -5
- package/dist/doc-schemas/ncii/config.d.ts.map +1 -1
- package/dist/doc-schemas/ncii/config.js +8 -19
- package/dist/doc-schemas/ncii/config.js.map +1 -1
- package/dist/doc-schemas/operational.d.ts +47 -2
- package/dist/doc-schemas/operational.d.ts.map +1 -1
- package/dist/doc-schemas/operational.js +32 -7
- package/dist/doc-schemas/operational.js.map +1 -1
- package/dist/doc-schemas/registry.d.ts +14 -7
- package/dist/doc-schemas/registry.d.ts.map +1 -1
- package/dist/doc-schemas/system.d.ts.map +1 -1
- package/dist/doc-schemas/system.js +2 -0
- package/dist/doc-schemas/system.js.map +1 -1
- package/dist/schemas/public-documents.d.ts +25 -0
- package/dist/schemas/public-documents.d.ts.map +1 -1
- package/dist/schemas/public-documents.js +20 -8
- package/dist/schemas/public-documents.js.map +1 -1
- package/dist/schemas/users.d.ts +17 -0
- package/dist/schemas/users.d.ts.map +1 -1
- package/dist/schemas/users.js +13 -0
- package/dist/schemas/users.js.map +1 -1
- package/dist/schemas/utility.d.ts +2 -0
- package/dist/schemas/utility.d.ts.map +1 -1
- package/dist/schemas/utility.js +5 -2
- package/dist/schemas/utility.js.map +1 -1
- package/dist/utils/app-config.d.ts +26 -0
- package/dist/utils/app-config.d.ts.map +1 -0
- package/dist/utils/app-config.js +58 -0
- package/dist/utils/app-config.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/public-documents.d.ts +14 -0
- package/dist/utils/public-documents.d.ts.map +1 -1
- package/dist/utils/public-documents.js +20 -0
- package/dist/utils/public-documents.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operational.js","sourceRoot":"","sources":["../../src/doc-schemas/operational.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,kGAAkG;AAElG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD,6FAA6F;AAC7F,8EAA8E;AAC9E,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAC;AAGH,kGAAkG;AAClG,qGAAqG;AACrG,8FAA8F;AAC9F,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,4EAA4E;IAC5E,+EAA+E;IAC/E,8EAA8E;IAC9E,qEAAqE;IACrE,gDAAgD;IAChD,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAGH,8FAA8F;AAC9F,sEAAsE;AACtE,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,OAAO,EAAE,CAAC,CAAC,M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MAAM,EAAE;CAC1B,CAAC,CAAC","sourcesContent":["// Operational / utility Firestore document SCHEMAS — small backend-written docs that aren't\n// part of a feature domain. Reverse-engineered from their backend write sites. Types via z.infer.\n\nimport { z } from 'zod';\nimport { UserAccountStatusSchema } from './user.js';\n\n// reservedDisplayNames/{displayNameUppercase} — uniqueness claim written in the registerUser\n// transaction; existence == name taken. (functions/src/users/registerUser.ts)\nexport const ReservedDisplayNameSchema = z.object({\n userId: z.string(),\n displayName: z.string(),\n});\nexport type ReservedDisplayName = z.infer<typeof ReservedDisplayNameSchema>;\n\n// reservedRealmNames/{workingTitleUppercase} — platform-wide Realm-name uniqueness claim, written\n// in the createWorkRealm transaction (existence == name taken). Mirrors reservedDisplayNames; key is\n// the UPPERCASE realm working title. (legal-convo [BUILD]: realm names unique platform-wide.)\nexport const ReservedRealmNameSchema = z.object({\n workRealmId: z.string(),\n workingTitle: z.string(),\n // RETIRED name (DJ ruling 2026-07-12, option B): set true when a moderation\n // force-retitle removes this name — the name is dead platform-wide FOREVER; no\n // realm (including the original owner) can ever claim it again, and no rename\n // path releases the reservation. Ordinary renames release un-retired\n // reservations normally. Backend-only-writable.\n retired: z.boolean().optional(),\n});\nexport type ReservedRealmName = z.infer<typeof ReservedRealmNameSchema>;\n\n// stakeShareAuditEvents/{eventId} — Firestore-trigger audit of guildmate stake-share changes.\n// (functions/src/audit/runWorkProjectGuildmateUserStakeShareAudit.ts)\nexport const StakeShareAuditEventSchema = z.object({\n eventId: z.string(),\n subtype: z.string(),\n reason: z.string(),\n workProjectId: z.string(),\n guildmateUserUid: z.string(),\n guildmateUserPath: z.string(),\n beforeStakeShares: z.number().nullable(),\n afterStakeShares: z.number().nullable(),\n createdAt: z.number(),\n source: z.string(),\n});\nexport type StakeShareAuditEvent = z.infer<typeof StakeShareAuditEventSchema>;\n\n// shortLinks/{shortId} — short link to a share target (Audition / AuditionEntry /\n// Commission), with a click counter. (functions/src/utility/createShortLink.ts)\n// `type` mirrors the CreateShortLinkInput target type; `metadata` carries the target\n// id(s) the destination URL was built from. Fields are per-target-optional so a new\n// target type slots in without reworking the map. Add a `type` value when adding a target.\nexport const ShortLinkSchema = z.object({\n shortId: z.string(),\n shortUrl: z.string(),\n destinationUrl: z.string(),\n type: z.enum(['audition', 'audition-entry', 'commission']),\n metadata: z.object({\n auditionId: z.string().nullable(),\n auditionEntryId: z.string().nullable(),\n commissionListingId: z.string().nullable(),\n }),\n createdAt: z.number(),\n createdBy: z.string(),\n clicks: z.number(),\n});\nexport type ShortLink = z.infer<typeof ShortLinkSchema>;\n\n// statusReconcileQueue/{uid} — backend-only retry queue for post-commit Auth-effect reconciliation.\n// Written when a change committed to Firestore but its follow-on Auth effect failed; the drain\n// re-converges every Auth-side mirror of the uid from its canonical docs and deletes the entry on\n// success. Keyed by the affected uid (doc id == uid; one entry per uid, whichever effect queued\n// it); Admin-SDK-only. Timestamps are epoch-millis numbers (this repo never uses Firestore\n// Timestamps).\n\n/**\n * Which post-commit Auth effect failed and queued the uid:\n * - `accountStatus` — the status claim / `disabled` flag / token revocation after a status change;\n * - `publicDocumentsAcceptedClaim` — the `docsAccepted` claim after a public-document acceptance.\n * An entry without `authEffect` predates the field and is an `accountStatus` entry.\n */\nexport const STATUS_RECONCILE_QUEUE_AUTH_EFFECTS = ['accountStatus', 'publicDocumentsAcceptedClaim'] as const;\nexport const StatusReconcileQueueAuthEffectSchema = z.enum(STATUS_RECONCILE_QUEUE_AUTH_EFFECTS);\nexport type StatusReconcileQueueAuthEffect = z.infer<typeof StatusReconcileQueueAuthEffectSchema>;\n\nconst statusReconcileQueueEntryBase = {\n uid: z.string(),\n enqueuedAt: z.number(),\n lastAttemptAt: z.number().optional(),\n attemptCount: z.number(),\n reason: z.literal('postCommitAuthEffectFailed'),\n};\n\n/** A failed status effect: the drain drives the account toward `targetStatus`. */\nexport const StatusReconcileQueueAccountStatusEntrySchema = z.object({\n ...statusReconcileQueueEntryBase,\n authEffect: z.literal('accountStatus' satisfies StatusReconcileQueueAuthEffect).optional(),\n targetStatus: UserAccountStatusSchema,\n});\nexport type StatusReconcileQueueAccountStatusEntry = z.infer<typeof StatusReconcileQueueAccountStatusEntrySchema>;\n\n/** A failed `docsAccepted` claim write. Strict: it carries no status, so no `targetStatus`. */\nexport const StatusReconcileQueuePublicDocumentsAcceptedClaimEntrySchema = z\n .object({\n ...statusReconcileQueueEntryBase,\n authEffect: z.literal('publicDocumentsAcceptedClaim' satisfies StatusReconcileQueueAuthEffect),\n })\n .strict();\nexport type StatusReconcileQueuePublicDocumentsAcceptedClaimEntry = z.infer<\n typeof StatusReconcileQueuePublicDocumentsAcceptedClaimEntrySchema\n>;\n\nexport const StatusReconcileQueueEntrySchema = z.discriminatedUnion('authEffect', [\n StatusReconcileQueueAccountStatusEntrySchema,\n StatusReconcileQueuePublicDocumentsAcceptedClaimEntrySchema,\n]);\nexport type StatusReconcileQueueEntry = z.infer<typeof StatusReconcileQueueEntrySchema>;\n\n// feedbackAliases/{aliasId} — Console-managed map collapsing a synonym suggestion onto a canonical\n// one; read by submitFeedback, no callable writes it. (firestore.rules §3F / submitFeedback.ts)\nexport const FeedbackAliasSchema = z.object({\n canonicalId: z.string(),\n originalType: z.string(),\n});\nexport type FeedbackAlias = z.infer<typeof FeedbackAliasSchema>;\n\n// feedbackSubmissions/{feedbackType}/userSuggestions/{suggestionId} — an aggregated user\n// suggestion with its deduped submitter list + count. The path nests the feedbackSubmissions +\n// userSuggestions registry segments. (functions/src/utility/submitFeedback.ts)\nexport const UserSuggestionSchema = z.object({\n suggestionText: z.string(),\n count: z.number(),\n submittedBy: z.array(z.object({ userId: z.string() })),\n lastSubmitted: z.number(),\n});\nexport type UserSuggestion = z.infer<typeof UserSuggestionSchema>;\n"]}
|
|
@@ -4710,18 +4710,26 @@ export declare const COLLECTION_SCHEMAS: {
|
|
|
4710
4710
|
}, z.core.$strip>>;
|
|
4711
4711
|
lastSubmitted: z.ZodNumber;
|
|
4712
4712
|
}, z.core.$strip>;
|
|
4713
|
-
readonly 'statusReconcileQueue/{uid}': z.ZodObject<{
|
|
4714
|
-
|
|
4715
|
-
enqueuedAt: z.ZodNumber;
|
|
4716
|
-
lastAttemptAt: z.ZodOptional<z.ZodNumber>;
|
|
4717
|
-
attemptCount: z.ZodNumber;
|
|
4713
|
+
readonly 'statusReconcileQueue/{uid}': z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4714
|
+
authEffect: z.ZodOptional<z.ZodLiteral<"accountStatus">>;
|
|
4718
4715
|
targetStatus: z.ZodEnum<{
|
|
4719
4716
|
banned: "banned";
|
|
4720
4717
|
active: "active";
|
|
4721
4718
|
suspended: "suspended";
|
|
4722
4719
|
}>;
|
|
4720
|
+
uid: z.ZodString;
|
|
4721
|
+
enqueuedAt: z.ZodNumber;
|
|
4722
|
+
lastAttemptAt: z.ZodOptional<z.ZodNumber>;
|
|
4723
|
+
attemptCount: z.ZodNumber;
|
|
4723
4724
|
reason: z.ZodLiteral<"postCommitAuthEffectFailed">;
|
|
4724
|
-
}, z.core.$strip
|
|
4725
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
4726
|
+
authEffect: z.ZodLiteral<"publicDocumentsAcceptedClaim">;
|
|
4727
|
+
uid: z.ZodString;
|
|
4728
|
+
enqueuedAt: z.ZodNumber;
|
|
4729
|
+
lastAttemptAt: z.ZodOptional<z.ZodNumber>;
|
|
4730
|
+
attemptCount: z.ZodNumber;
|
|
4731
|
+
reason: z.ZodLiteral<"postCommitAuthEffectFailed">;
|
|
4732
|
+
}, z.core.$strict>], "authEffect">;
|
|
4725
4733
|
readonly 'publicDocuments/{documentId}/publicDocumentVersions/{versionId}': z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4726
4734
|
documentId: z.ZodLiteral<"termsOfService">;
|
|
4727
4735
|
content: z.ZodObject<{
|
|
@@ -7185,7 +7193,6 @@ export declare const COLLECTION_SCHEMAS: {
|
|
|
7185
7193
|
evidenceScanMemoryBudgetMb: z.ZodNumber;
|
|
7186
7194
|
rejectArchiveAndPolyglotPayloads: z.ZodBoolean;
|
|
7187
7195
|
approvedBy: z.ZodLiteral<"operatorLaunchDefault">;
|
|
7188
|
-
counselApproved: z.ZodBoolean;
|
|
7189
7196
|
}, z.core.$strict>;
|
|
7190
7197
|
readonly '_serverData/privilegedReviewerSecurity': z.ZodObject<{
|
|
7191
7198
|
requiredSecondFactor: z.ZodLiteral<"passkeyWebAuthn">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/registry.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmN7B,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/registry.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmN7B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmQkB,CAAC;AAElD,MAAM,MAAM,wBAAwB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAEvE;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;CAmBiC,CAAC;AAEvE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAOvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;iBAqB1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAIxD,eAAO,MAAM,eAAe;;;iBAG1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAIxD,eAAO,MAAM,mBAAmB;;;;;iBAQ9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAOhE,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAKxE,eAAO,MAAM,2BAA2B;;;iBAGtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAIhF,eAAO,MAAM,mBAAmB;;;;;;iBAG9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { MAX_ANNOUNCEMENT_MESSAGE_LENGTH } from '../constants/business-admin.js';
|
|
5
5
|
import { PublicDocumentVersionBlockSchema } from './public-documents.js';
|
|
6
|
+
// Its write rule is `mergeAppConfigUpdate` (../utils/app-config.ts): an update over the doc as
|
|
7
|
+
// read, any missing field from DEFAULT_APP_CONFIG, the whole doc validated against this schema.
|
|
6
8
|
export const AppConfigSchema = z.object({
|
|
7
9
|
appVersion: z.string(),
|
|
8
10
|
maintenanceMode: z.boolean(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],"names":[],"mapp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AM,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 { MAX_ANNOUNCEMENT_MESSAGE_LENGTH } from '../constants/business-admin.js';\nimport { PublicDocumentVersionBlockSchema } from './public-documents.js';\n\nexport const AppConfigSchema = z.object({\n appVersion: z.string(),\n maintenanceMode: z.boolean(),\n maintenanceMessage: z.string().optional(),\n registrationEnabled: z.boolean(),\n // Announcement banner (the third operational lever, alongside maintenanceMode and\n // registrationEnabled). OPTIONAL, and EMPTY means no banner — there is no separate\n // on/off boolean, so clearing the text IS turning the banner off. Non-empty renders a\n // banner on the landing page and login screen. Set via updateAppConfig (audited).\n announcementMessage: z.string().max(MAX_ANNOUNCEMENT_MESSAGE_LENGTH).optional(),\n // Runtime abuse throttle (incident lever — NOT the charter/full mode, which is\n // a ttt-core code constant). Scales every rate limiter's maxRequests DOWN:\n // 0 < m <= 1, tighten-only. Absent = 1 (no throttle). Set via updateAppConfig\n // (audited); read by the backend limiter wrapper with a short in-memory cache.\n rateLimitMultiplier: z.number().gt(0).max(1).optional(),\n // Public-document version block — per document its current version and the latest version\n // that required acceptance, plus the one required-acceptance level. Written ONLY by the\n // release publish transaction (never updateAppConfig); every session already reads this doc\n // live, so a required release reaches open sessions without a new listener. Absent until the\n // first release: every document is then version 0 and nothing is required.\n publicDocumentVersions: PublicDocumentVersionBlockSchema.optional(),\n});\nexport type AppConfig = z.infer<typeof AppConfigSchema>;\n\n// _systemData/adminList — the admin / jrAdmin uid lists; source of truth synced to custom claims\n// by setAdminStatusClaim. (functions/src/auth/runUpdateAdminList.ts)\nexport const AdminListSchema = z.object({\n admins: z.array(z.string()),\n jrAdmins: z.array(z.string()),\n});\nexport type AdminList = z.infer<typeof AdminListSchema>;\n\n// _systemData/profanityList — the moderation word list read by the runtime text filter.\n// (functions/src/utility/seedProfanityList.ts / curateProfanityList.ts)\nexport const ProfanityListSchema = z.object({\n words: z.array(z.string()),\n updatedAt: z.number(),\n wordCount: z.number(),\n // Monotonic version for the chat-realtime word-list sync (Contract B). Bumped by each\n // curation; the chat Worker KV snapshot + the channel-DO lazy version check key on it.\n // Absent ⇒ 0.\n wordListVersion: z.number().optional(),\n});\nexport type ProfanityList = z.infer<typeof ProfanityListSchema>;\n\n// _systemData/reservedUsernames — curated brand/impersonation terms blocked at registration\n// by exact normalized (UPPERCASE) match. Distinct from the per-user `reservedDisplayNames`\n// uniqueness collection. Seeded by functions/src/utility/seedReservedUsernames.ts; consulted by\n// registerUser + checkDisplayNameAvailable. Names are stored UPPERCASE to match the\n// reservedDisplayName case-folding convention.\nexport const ReservedUsernamesSchema = z.object({\n names: z.array(z.string()),\n updatedAt: z.number(),\n});\nexport type ReservedUsernames = z.infer<typeof ReservedUsernamesSchema>;\n\n// _systemData/blockedFranchiseNames — curated famous-franchise / IP names (UPPERCASE), consulted\n// when creating/publishing a Work or Realm title and by the admin trademark-assist button. Distinct\n// from reservedUsernames (registration). Seeded by an admin seed callable. (legal-convo [BUILD].)\nexport const BlockedFranchiseNamesSchema = z.object({\n names: z.array(z.string()),\n updatedAt: z.number(),\n});\nexport type BlockedFranchiseNames = z.infer<typeof BlockedFranchiseNamesSchema>;\n\n// _systemData/appMode — the charter→full mode marker that recordAppModeFlip writes.\n// `current` mirrors the deployed `APP_MODE` constant after a flip is recorded.\nexport const AppModeMarkerSchema = z.object({\n current: z.enum(['charter', 'full']),\n updatedAt: z.number(),\n});\nexport type AppModeMarker = z.infer<typeof AppModeMarkerSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,sEAAsE;AAEtE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,uBAAuB,CAAC;AAEzE,+FAA+F;AAC/F,gGAAgG;AAChG,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,eAAe,EAAE,CAAC,CAAC,OAAO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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 { MAX_ANNOUNCEMENT_MESSAGE_LENGTH } 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.\nexport const AppConfigSchema = z.object({\n appVersion: z.string(),\n maintenanceMode: z.boolean(),\n maintenanceMessage: z.string().optional(),\n registrationEnabled: z.boolean(),\n // Announcement banner (the third operational lever, alongside maintenanceMode and\n // registrationEnabled). OPTIONAL, and EMPTY means no banner — there is no separate\n // on/off boolean, so clearing the text IS turning the banner off. Non-empty renders a\n // banner on the landing page and login screen. Set via updateAppConfig (audited).\n announcementMessage: z.string().max(MAX_ANNOUNCEMENT_MESSAGE_LENGTH).optional(),\n // Runtime abuse throttle (incident lever — NOT the charter/full mode, which is\n // a ttt-core code constant). Scales every rate limiter's maxRequests DOWN:\n // 0 < m <= 1, tighten-only. Absent = 1 (no throttle). Set via updateAppConfig\n // (audited); read by the backend limiter wrapper with a short in-memory cache.\n rateLimitMultiplier: z.number().gt(0).max(1).optional(),\n // Public-document version block — per document its current version and the latest version\n // that required acceptance, plus the one required-acceptance level. Written ONLY by the\n // release publish transaction (never updateAppConfig); every session already reads this doc\n // live, so a required release reaches open sessions without a new listener. Absent until the\n // first release: every document is then version 0 and nothing is required.\n publicDocumentVersions: PublicDocumentVersionBlockSchema.optional(),\n});\nexport type AppConfig = z.infer<typeof AppConfigSchema>;\n\n// _systemData/adminList — the admin / jrAdmin uid lists; source of truth synced to custom claims\n// by setAdminStatusClaim. (functions/src/auth/runUpdateAdminList.ts)\nexport const AdminListSchema = z.object({\n admins: z.array(z.string()),\n jrAdmins: z.array(z.string()),\n});\nexport type AdminList = z.infer<typeof AdminListSchema>;\n\n// _systemData/profanityList — the moderation word list read by the runtime text filter.\n// (functions/src/utility/seedProfanityList.ts / curateProfanityList.ts)\nexport const ProfanityListSchema = z.object({\n words: z.array(z.string()),\n updatedAt: z.number(),\n wordCount: z.number(),\n // Monotonic version for the chat-realtime word-list sync (Contract B). Bumped by each\n // curation; the chat Worker KV snapshot + the channel-DO lazy version check key on it.\n // Absent ⇒ 0.\n wordListVersion: z.number().optional(),\n});\nexport type ProfanityList = z.infer<typeof ProfanityListSchema>;\n\n// _systemData/reservedUsernames — curated brand/impersonation terms blocked at registration\n// by exact normalized (UPPERCASE) match. Distinct from the per-user `reservedDisplayNames`\n// uniqueness collection. Seeded by functions/src/utility/seedReservedUsernames.ts; consulted by\n// registerUser + checkDisplayNameAvailable. Names are stored UPPERCASE to match the\n// reservedDisplayName case-folding convention.\nexport const ReservedUsernamesSchema = z.object({\n names: z.array(z.string()),\n updatedAt: z.number(),\n});\nexport type ReservedUsernames = z.infer<typeof ReservedUsernamesSchema>;\n\n// _systemData/blockedFranchiseNames — curated famous-franchise / IP names (UPPERCASE), consulted\n// when creating/publishing a Work or Realm title and by the admin trademark-assist button. Distinct\n// from reservedUsernames (registration). Seeded by an admin seed callable. (legal-convo [BUILD].)\nexport const BlockedFranchiseNamesSchema = z.object({\n names: z.array(z.string()),\n updatedAt: z.number(),\n});\nexport type BlockedFranchiseNames = z.infer<typeof BlockedFranchiseNamesSchema>;\n\n// _systemData/appMode — the charter→full mode marker that recordAppModeFlip writes.\n// `current` mirrors the deployed `APP_MODE` constant after a flip is recorded.\nexport const AppModeMarkerSchema = z.object({\n current: z.enum(['charter', 'full']),\n updatedAt: z.number(),\n});\nexport type AppModeMarker = z.infer<typeof AppModeMarkerSchema>;\n"]}
|
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The document/version pairs a surface SHOWED before the person agreed — the acceptance prompt
|
|
4
|
+
* (`acceptPublicDocuments`) and the signup page (`registerUser`). Each document at most once. It
|
|
5
|
+
* is never authority: the server re-reads the version block in its transaction and compares this
|
|
6
|
+
* with what is current now (`samePublicDocumentVersions`); a difference means a publish raced
|
|
7
|
+
* what was shown.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ShownPublicDocumentVersionsSchema: z.ZodArray<z.ZodObject<{
|
|
10
|
+
documentId: z.ZodEnum<{
|
|
11
|
+
futurePlans: "futurePlans";
|
|
12
|
+
rulesAndAgreements: "rulesAndAgreements";
|
|
13
|
+
termsOfService: "termsOfService";
|
|
14
|
+
privacyPolicy: "privacyPolicy";
|
|
15
|
+
takeItDownPageCopy: "takeItDownPageCopy";
|
|
16
|
+
dmcaPolicy: "dmcaPolicy";
|
|
17
|
+
}>;
|
|
18
|
+
version: z.ZodNumber;
|
|
19
|
+
}, z.core.$strict>>;
|
|
20
|
+
/**
|
|
21
|
+
* The answer when a publish raced what the surface showed: nothing was written. The surface
|
|
22
|
+
* reads the version block live, so it shows the current versions and asks again.
|
|
23
|
+
*/
|
|
24
|
+
export declare const PublicDocumentsRefreshRequiredResultSchema: z.ZodObject<{
|
|
25
|
+
status: z.ZodLiteral<"refreshRequired">;
|
|
26
|
+
}, z.core.$strip>;
|
|
2
27
|
/**
|
|
3
28
|
* `savePublicDocumentDraft` — replace a document's one private working copy with the editor's
|
|
4
29
|
* FULL content. `baseVersion` is the published version the edit started from (the prior version
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-documents.d.ts","sourceRoot":"","sources":["../../src/schemas/public-documents.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"public-documents.d.ts","sourceRoot":"","sources":["../../src/schemas/public-documents.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA6BxB;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;mBAGyB,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,0CAA0C;;iBAErD,CAAC;AAIH;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCA+B7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,eAAO,MAAM,mCAAmC;;;;;;;;;;;iBAI9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAIhG;;;;;;;GAOG;AACH,eAAO,MAAM,uCAAuC;;;;;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,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC"}
|
|
@@ -13,6 +13,24 @@ import { LegalPageContentInputSchema, RulesAndAgreementsContentInputSchema, Futu
|
|
|
13
13
|
const baseVersionSchema = z.number().int().nonnegative();
|
|
14
14
|
/** A document/version list that names each document at most once. */
|
|
15
15
|
const distinctVersionRefs = (refs) => new Set(refs.map((ref) => ref.documentId)).size === refs.length;
|
|
16
|
+
/**
|
|
17
|
+
* The document/version pairs a surface SHOWED before the person agreed — the acceptance prompt
|
|
18
|
+
* (`acceptPublicDocuments`) and the signup page (`registerUser`). Each document at most once. It
|
|
19
|
+
* is never authority: the server re-reads the version block in its transaction and compares this
|
|
20
|
+
* with what is current now (`samePublicDocumentVersions`); a difference means a publish raced
|
|
21
|
+
* what was shown.
|
|
22
|
+
*/
|
|
23
|
+
export const ShownPublicDocumentVersionsSchema = z
|
|
24
|
+
.array(PublicDocumentVersionRefSchema)
|
|
25
|
+
.max(PUBLIC_DOCUMENT_IDS.length)
|
|
26
|
+
.refine(distinctVersionRefs, { message: 'List each document once.' });
|
|
27
|
+
/**
|
|
28
|
+
* The answer when a publish raced what the surface showed: nothing was written. The surface
|
|
29
|
+
* reads the version block live, so it shows the current versions and asks again.
|
|
30
|
+
*/
|
|
31
|
+
export const PublicDocumentsRefreshRequiredResultSchema = z.object({
|
|
32
|
+
status: z.literal('refreshRequired'),
|
|
33
|
+
});
|
|
16
34
|
// ── Save a working copy ──────────────────────────────────────────────────────
|
|
17
35
|
/**
|
|
18
36
|
* `savePublicDocumentDraft` — replace a document's one private working copy with the editor's
|
|
@@ -90,10 +108,7 @@ export const PublishPublicDocumentReleaseResultSchema = z.object({
|
|
|
90
108
|
* the prompt asks again. Idempotent.
|
|
91
109
|
*/
|
|
92
110
|
export const AcceptPublicDocumentsInputSchema = z.object({
|
|
93
|
-
documents:
|
|
94
|
-
.array(PublicDocumentVersionRefSchema)
|
|
95
|
-
.max(PUBLIC_DOCUMENT_IDS.length)
|
|
96
|
-
.refine(distinctVersionRefs, { message: 'List each document once.' }),
|
|
111
|
+
documents: ShownPublicDocumentVersionsSchema,
|
|
97
112
|
}).strict();
|
|
98
113
|
export const AcceptPublicDocumentsResultSchema = z.discriminatedUnion('status', [
|
|
99
114
|
z.object({
|
|
@@ -101,10 +116,7 @@ export const AcceptPublicDocumentsResultSchema = z.discriminatedUnion('status',
|
|
|
101
116
|
/** The level now on the private summary and the `docsAccepted` claim (refresh the token). */
|
|
102
117
|
acceptedLevel: PublicDocumentAcceptanceLevelSchema,
|
|
103
118
|
}),
|
|
104
|
-
|
|
105
|
-
/** A publish raced the prompt: what it showed is no longer current. Nothing was written. */
|
|
106
|
-
status: z.literal('refreshRequired'),
|
|
107
|
-
}),
|
|
119
|
+
PublicDocumentsRefreshRequiredResultSchema,
|
|
108
120
|
]);
|
|
109
121
|
// ── History ──────────────────────────────────────────────────────────────────
|
|
110
122
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-documents.js","sourceRoot":"","sources":["../../src/schemas/public-documents.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,0FAA0F;AAC1F,EAAE;AACF,8FAA8F;AAC9F,6FAA6F;AAC7F,mFAAmF;AAEnF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,kCAAkC,GACnC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,sBAAsB,EACtB,iCAAiC,EACjC,mCAAmC,EACnC,8BAA8B,EAC9B,2BAA2B,GAE5B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EACL,2BAA2B,EAC3B,oCAAoC,EACpC,6BAA6B,EAC7B,4BAA4B,EAC5B,oCAAoC,GACrC,MAAM,YAAY,CAAC;AAEpB,MAAM,iBAAiB,GAAG,CA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AC,MAAM,CAAC;IAChE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE;IAC9B,uBAAuB,EAAE,mCAAmC;CAC7D,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ;;;;GAIG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChE,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,kCAAkC,CAAC;IACvD,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC;IAClD,aAAa,EAAE,mCAAmC;IAClD,yBAAyB,EAAE,+BAA+B,CAAC,QAAQ,EAAE;IACrE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["// Callable wire contracts of the versioned public-document system, plus the payloads of its two\n// audit events. The Firestore document shapes live in ../doc-schemas/public-documents.ts.\n//\n// The client never supplies an authoritative version, identity, or time: a working copy names\n// only the version its edit STARTED from; the publish assigns versions; the acceptance names\n// only the versions it SHOWED, which the server compares with what is current now.\n\nimport { z } from 'zod';\nimport { SPECIAL_DOCS } from '../paths/collections.js';\nimport {\n PUBLIC_DOCUMENT_IDS,\n PUBLIC_DOCUMENT_ACCEPTANCE_SOURCES,\n} from '../constants/public-documents.js';\nimport {\n PublicDocumentIdSchema,\n PublicDocumentVersionNumberSchema,\n PublicDocumentAcceptanceLevelSchema,\n PublicDocumentVersionRefSchema,\n PublicDocumentVersionSchema,\n type PublicDocumentVersionRef,\n} from '../doc-schemas/public-documents.js';\nimport { LegalReviewNoticeRevisionSchema } from '../doc-schemas/legal-review-notice.js';\nimport {\n LegalPageContentInputSchema,\n RulesAndAgreementsContentInputSchema,\n FuturePlansContentInputSchema,\n DmcaPolicyContentInputSchema,\n TakeItDownPageCopyContentInputSchema,\n} from './admin.js';\n\nconst baseVersionSchema = z.number().int().nonnegative();\n\n/** A document/version list that names each document at most once. */\nconst distinctVersionRefs = (refs: readonly PublicDocumentVersionRef[]) =>\n new Set(refs.map((ref) => ref.documentId)).size === refs.length;\n\n// ── Save a working copy ──────────────────────────────────────────────────────\n\n/**\n * `savePublicDocumentDraft` — replace a document's one private working copy with the editor's\n * FULL content. `baseVersion` is the published version the edit started from (the prior version\n * the editor showed for reference; 0 for a never-published document). The server refuses a base\n * that is no longer current. Discriminated on `documentId`, so each document's content is\n * validated by its own schema.\n */\nexport const SavePublicDocumentDraftInputSchema = z.discriminatedUnion('documentId', [\n z.object({\n documentId: z.literal(SPECIAL_DOCS.TERMS_PAGE),\n baseVersion: baseVersionSchema,\n content: LegalPageContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.PRIVACY_PAGE),\n baseVersion: baseVersionSchema,\n content: LegalPageContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.RULES_AND_AGREEMENTS),\n baseVersion: baseVersionSchema,\n content: RulesAndAgreementsContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.FUTURE_PLANS),\n baseVersion: baseVersionSchema,\n content: FuturePlansContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.DMCA_POLICY),\n baseVersion: baseVersionSchema,\n content: DmcaPolicyContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.TAKE_IT_DOWN_PAGE_COPY),\n baseVersion: baseVersionSchema,\n content: TakeItDownPageCopyContentInputSchema,\n }).strict(),\n]);\nexport type SavePublicDocumentDraftInput = z.infer<typeof SavePublicDocumentDraftInputSchema>;\n\nexport const SavePublicDocumentDraftResultSchema = z.object({\n documentId: PublicDocumentIdSchema,\n baseVersion: baseVersionSchema,\n savedAt: z.number(),\n});\nexport type SavePublicDocumentDraftResult = z.infer<typeof SavePublicDocumentDraftResultSchema>;\n\n// ── Publish a release ────────────────────────────────────────────────────────\n\n/**\n * `publishPublicDocumentRelease` — publish the saved working copies of the listed documents as\n * ONE all-or-nothing release. `releaseId` is minted by the client once per release attempt and\n * reused on retry, so a repeated call finds the release it already committed instead of\n * publishing twice. `requireAcceptance` is the release's one choice (the form defaults it to yes).\n * Every listed document must have a saved working copy whose base is still current and whose\n * content differs from the current version.\n */\nexport const PublishPublicDocumentReleaseInputSchema = z.object({\n releaseId: z.string().uuid(),\n documentIds: z\n .array(PublicDocumentIdSchema)\n .min(1)\n .max(PUBLIC_DOCUMENT_IDS.length)\n .refine((ids) => new Set(ids).size === ids.length, { message: 'List each document once.' }),\n requireAcceptance: z.boolean(),\n}).strict();\nexport type PublishPublicDocumentReleaseInput = z.infer<typeof PublishPublicDocumentReleaseInputSchema>;\n\nexport const PublishPublicDocumentReleaseResultSchema = z.object({\n releaseId: z.string().min(1),\n documents: z.array(PublicDocumentVersionRefSchema).min(1),\n requireAcceptance: z.boolean(),\n requiredAcceptanceLevel: PublicDocumentAcceptanceLevelSchema,\n});\nexport type PublishPublicDocumentReleaseResult = z.infer<typeof PublishPublicDocumentReleaseResultSchema>;\n\n// ── Accept ───────────────────────────────────────────────────────────────────\n\n/**\n * `acceptPublicDocuments` — the acceptance prompt's Accept. `documents` is exactly the list the\n * prompt SHOWED (`changedPublicDocuments` for this person, at the versions shown). The server\n * accepts only when that equals what is current now; otherwise it answers `refreshRequired` and\n * the prompt asks again. Idempotent.\n */\nexport const AcceptPublicDocumentsInputSchema = z.object({\n documents: z\n .array(PublicDocumentVersionRefSchema)\n .max(PUBLIC_DOCUMENT_IDS.length)\n .refine(distinctVersionRefs, { message: 'List each document once.' }),\n}).strict();\nexport type AcceptPublicDocumentsInput = z.infer<typeof AcceptPublicDocumentsInputSchema>;\n\nexport const AcceptPublicDocumentsResultSchema = z.discriminatedUnion('status', [\n z.object({\n status: z.literal('accepted'),\n /** The level now on the private summary and the `docsAccepted` claim (refresh the token). */\n acceptedLevel: PublicDocumentAcceptanceLevelSchema,\n }),\n z.object({\n /** A publish raced the prompt: what it showed is no longer current. Nothing was written. */\n status: z.literal('refreshRequired'),\n }),\n]);\nexport type AcceptPublicDocumentsResult = z.infer<typeof AcceptPublicDocumentsResultSchema>;\n\n// ── History ──────────────────────────────────────────────────────────────────\n\n/**\n * `readPublicDocumentHistory` — Admin's read-only history of one document, newest first, a page\n * of PUBLIC_DOCUMENT_HISTORY_PAGE_LIMIT at a time. `beforeVersion` continues from the previous\n * page's `nextBeforeVersion`.\n */\nexport const ReadPublicDocumentHistoryInputSchema = z.object({\n documentId: PublicDocumentIdSchema,\n beforeVersion: PublicDocumentVersionNumberSchema.nullish(),\n}).strict();\nexport type ReadPublicDocumentHistoryInput = z.infer<typeof ReadPublicDocumentHistoryInputSchema>;\n\nexport const ReadPublicDocumentHistoryResultSchema = z.object({\n /** Full immutable versions — content, version, release, publisher uid, and time. */\n versions: z.array(PublicDocumentVersionSchema),\n /** Pass as `beforeVersion` for the next page; null when this page reached v1. */\n nextBeforeVersion: PublicDocumentVersionNumberSchema.nullable(),\n});\nexport type ReadPublicDocumentHistoryResult = z.infer<typeof ReadPublicDocumentHistoryResultSchema>;\n\n// ── Audit payloads ───────────────────────────────────────────────────────────\n// The `metadata` of the two audit events. The actor, target, and server timestamp ride the\n// event envelope; these carry what the release or acceptance was.\n\n/** `publicDocuments.released` — written in the publish transaction (adminReview actor). */\nexport const PublicDocumentsReleasedAuditPayloadSchema = z.object({\n releaseId: z.string().min(1),\n documents: z.array(PublicDocumentVersionRefSchema).min(1),\n requireAcceptance: z.boolean(),\n requiredAcceptanceLevel: PublicDocumentAcceptanceLevelSchema,\n}).strict();\nexport type PublicDocumentsReleasedAuditPayload = z.infer<typeof PublicDocumentsReleasedAuditPayloadSchema>;\n\n/**\n * `publicDocuments.accepted` — written in the same commit as the private summary, by the\n * acceptance callable (the pairs the prompt showed) and by registration (every current document).\n * `legalReviewNoticeRevision` is null when the notice was off. `acceptedAt` is server time.\n */\nexport const PublicDocumentsAcceptedAuditPayloadSchema = z.object({\n acceptedVia: z.enum(PUBLIC_DOCUMENT_ACCEPTANCE_SOURCES),\n documents: z.array(PublicDocumentVersionRefSchema),\n acceptedLevel: PublicDocumentAcceptanceLevelSchema,\n legalReviewNoticeRevision: LegalReviewNoticeRevisionSchema.nullable(),\n acceptedAt: z.number(),\n}).strict();\nexport type PublicDocumentsAcceptedAuditPayload = z.infer<typeof PublicDocumentsAcceptedAuditPayloadSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"public-documents.js","sourceRoot":"","sources":["../../src/schemas/public-documents.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,0FAA0F;AAC1F,EAAE;AACF,8FAA8F;AAC9F,6FAA6F;AAC7F,mFAAmF;AAEnF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,kCAAkC,GACnC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,sBAAsB,EACtB,iCAAiC,EACjC,mCAAmC,EACnC,8BAA8B,EAC9B,2BAA2B,GAE5B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EACL,2BAA2B,EAC3B,oCAAoC,EACpC,6BAA6B,EAC7B,4BAA4B,EAC5B,oCAAoC,GACrC,MAAM,YAAY,CAAC;AAEpB,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;AAEzD,qEAAqE;AACrE,MAAM,mBAAmB,GAAG,CAAC,IAAyC,EAAE,EAAE,CACxE,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC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B,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE;IAC9B,uBAAuB,EAAE,mCAAmC;CAC7D,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ;;;;GAIG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChE,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,kCAAkC,CAAC;IACvD,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC;IAClD,aAAa,EAAE,mCAAmC;IAClD,yBAAyB,EAAE,+BAA+B,CAAC,QAAQ,EAAE;IACrE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["// Callable wire contracts of the versioned public-document system, plus the payloads of its two\n// audit events. The Firestore document shapes live in ../doc-schemas/public-documents.ts.\n//\n// The client never supplies an authoritative version, identity, or time: a working copy names\n// only the version its edit STARTED from; the publish assigns versions; the acceptance names\n// only the versions it SHOWED, which the server compares with what is current now.\n\nimport { z } from 'zod';\nimport { SPECIAL_DOCS } from '../paths/collections.js';\nimport {\n PUBLIC_DOCUMENT_IDS,\n PUBLIC_DOCUMENT_ACCEPTANCE_SOURCES,\n} from '../constants/public-documents.js';\nimport {\n PublicDocumentIdSchema,\n PublicDocumentVersionNumberSchema,\n PublicDocumentAcceptanceLevelSchema,\n PublicDocumentVersionRefSchema,\n PublicDocumentVersionSchema,\n type PublicDocumentVersionRef,\n} from '../doc-schemas/public-documents.js';\nimport { LegalReviewNoticeRevisionSchema } from '../doc-schemas/legal-review-notice.js';\nimport {\n LegalPageContentInputSchema,\n RulesAndAgreementsContentInputSchema,\n FuturePlansContentInputSchema,\n DmcaPolicyContentInputSchema,\n TakeItDownPageCopyContentInputSchema,\n} from './admin.js';\n\nconst baseVersionSchema = z.number().int().nonnegative();\n\n/** A document/version list that names each document at most once. */\nconst distinctVersionRefs = (refs: readonly PublicDocumentVersionRef[]) =>\n new Set(refs.map((ref) => ref.documentId)).size === refs.length;\n\n/**\n * The document/version pairs a surface SHOWED before the person agreed — the acceptance prompt\n * (`acceptPublicDocuments`) and the signup page (`registerUser`). Each document at most once. It\n * is never authority: the server re-reads the version block in its transaction and compares this\n * with what is current now (`samePublicDocumentVersions`); a difference means a publish raced\n * what was shown.\n */\nexport const ShownPublicDocumentVersionsSchema = z\n .array(PublicDocumentVersionRefSchema)\n .max(PUBLIC_DOCUMENT_IDS.length)\n .refine(distinctVersionRefs, { message: 'List each document once.' });\n\n/**\n * The answer when a publish raced what the surface showed: nothing was written. The surface\n * reads the version block live, so it shows the current versions and asks again.\n */\nexport const PublicDocumentsRefreshRequiredResultSchema = z.object({\n status: z.literal('refreshRequired'),\n});\n\n// ── Save a working copy ──────────────────────────────────────────────────────\n\n/**\n * `savePublicDocumentDraft` — replace a document's one private working copy with the editor's\n * FULL content. `baseVersion` is the published version the edit started from (the prior version\n * the editor showed for reference; 0 for a never-published document). The server refuses a base\n * that is no longer current. Discriminated on `documentId`, so each document's content is\n * validated by its own schema.\n */\nexport const SavePublicDocumentDraftInputSchema = z.discriminatedUnion('documentId', [\n z.object({\n documentId: z.literal(SPECIAL_DOCS.TERMS_PAGE),\n baseVersion: baseVersionSchema,\n content: LegalPageContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.PRIVACY_PAGE),\n baseVersion: baseVersionSchema,\n content: LegalPageContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.RULES_AND_AGREEMENTS),\n baseVersion: baseVersionSchema,\n content: RulesAndAgreementsContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.FUTURE_PLANS),\n baseVersion: baseVersionSchema,\n content: FuturePlansContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.DMCA_POLICY),\n baseVersion: baseVersionSchema,\n content: DmcaPolicyContentInputSchema,\n }).strict(),\n z.object({\n documentId: z.literal(SPECIAL_DOCS.TAKE_IT_DOWN_PAGE_COPY),\n baseVersion: baseVersionSchema,\n content: TakeItDownPageCopyContentInputSchema,\n }).strict(),\n]);\nexport type SavePublicDocumentDraftInput = z.infer<typeof SavePublicDocumentDraftInputSchema>;\n\nexport const SavePublicDocumentDraftResultSchema = z.object({\n documentId: PublicDocumentIdSchema,\n baseVersion: baseVersionSchema,\n savedAt: z.number(),\n});\nexport type SavePublicDocumentDraftResult = z.infer<typeof SavePublicDocumentDraftResultSchema>;\n\n// ── Publish a release ────────────────────────────────────────────────────────\n\n/**\n * `publishPublicDocumentRelease` — publish the saved working copies of the listed documents as\n * ONE all-or-nothing release. `releaseId` is minted by the client once per release attempt and\n * reused on retry, so a repeated call finds the release it already committed instead of\n * publishing twice. `requireAcceptance` is the release's one choice (the form defaults it to yes).\n * Every listed document must have a saved working copy whose base is still current and whose\n * content differs from the current version.\n */\nexport const PublishPublicDocumentReleaseInputSchema = z.object({\n releaseId: z.string().uuid(),\n documentIds: z\n .array(PublicDocumentIdSchema)\n .min(1)\n .max(PUBLIC_DOCUMENT_IDS.length)\n .refine((ids) => new Set(ids).size === ids.length, { message: 'List each document once.' }),\n requireAcceptance: z.boolean(),\n}).strict();\nexport type PublishPublicDocumentReleaseInput = z.infer<typeof PublishPublicDocumentReleaseInputSchema>;\n\nexport const PublishPublicDocumentReleaseResultSchema = z.object({\n releaseId: z.string().min(1),\n documents: z.array(PublicDocumentVersionRefSchema).min(1),\n requireAcceptance: z.boolean(),\n requiredAcceptanceLevel: PublicDocumentAcceptanceLevelSchema,\n});\nexport type PublishPublicDocumentReleaseResult = z.infer<typeof PublishPublicDocumentReleaseResultSchema>;\n\n// ── Accept ───────────────────────────────────────────────────────────────────\n\n/**\n * `acceptPublicDocuments` — the acceptance prompt's Accept. `documents` is exactly the list the\n * prompt SHOWED (`changedPublicDocuments` for this person, at the versions shown). The server\n * accepts only when that equals what is current now; otherwise it answers `refreshRequired` and\n * the prompt asks again. Idempotent.\n */\nexport const AcceptPublicDocumentsInputSchema = z.object({\n documents: ShownPublicDocumentVersionsSchema,\n}).strict();\nexport type AcceptPublicDocumentsInput = z.infer<typeof AcceptPublicDocumentsInputSchema>;\n\nexport const AcceptPublicDocumentsResultSchema = z.discriminatedUnion('status', [\n z.object({\n status: z.literal('accepted'),\n /** The level now on the private summary and the `docsAccepted` claim (refresh the token). */\n acceptedLevel: PublicDocumentAcceptanceLevelSchema,\n }),\n PublicDocumentsRefreshRequiredResultSchema,\n]);\nexport type AcceptPublicDocumentsResult = z.infer<typeof AcceptPublicDocumentsResultSchema>;\n\n// ── History ──────────────────────────────────────────────────────────────────\n\n/**\n * `readPublicDocumentHistory` — Admin's read-only history of one document, newest first, a page\n * of PUBLIC_DOCUMENT_HISTORY_PAGE_LIMIT at a time. `beforeVersion` continues from the previous\n * page's `nextBeforeVersion`.\n */\nexport const ReadPublicDocumentHistoryInputSchema = z.object({\n documentId: PublicDocumentIdSchema,\n beforeVersion: PublicDocumentVersionNumberSchema.nullish(),\n}).strict();\nexport type ReadPublicDocumentHistoryInput = z.infer<typeof ReadPublicDocumentHistoryInputSchema>;\n\nexport const ReadPublicDocumentHistoryResultSchema = z.object({\n /** Full immutable versions — content, version, release, publisher uid, and time. */\n versions: z.array(PublicDocumentVersionSchema),\n /** Pass as `beforeVersion` for the next page; null when this page reached v1. */\n nextBeforeVersion: PublicDocumentVersionNumberSchema.nullable(),\n});\nexport type ReadPublicDocumentHistoryResult = z.infer<typeof ReadPublicDocumentHistoryResultSchema>;\n\n// ── Audit payloads ───────────────────────────────────────────────────────────\n// The `metadata` of the two audit events. The actor, target, and server timestamp ride the\n// event envelope; these carry what the release or acceptance was.\n\n/** `publicDocuments.released` — written in the publish transaction (adminReview actor). */\nexport const PublicDocumentsReleasedAuditPayloadSchema = z.object({\n releaseId: z.string().min(1),\n documents: z.array(PublicDocumentVersionRefSchema).min(1),\n requireAcceptance: z.boolean(),\n requiredAcceptanceLevel: PublicDocumentAcceptanceLevelSchema,\n}).strict();\nexport type PublicDocumentsReleasedAuditPayload = z.infer<typeof PublicDocumentsReleasedAuditPayloadSchema>;\n\n/**\n * `publicDocuments.accepted` — written in the same commit as the private summary, by the\n * acceptance callable (the pairs the prompt showed) and by registration (every current document).\n * `legalReviewNoticeRevision` is null when the notice was off. `acceptedAt` is server time.\n */\nexport const PublicDocumentsAcceptedAuditPayloadSchema = z.object({\n acceptedVia: z.enum(PUBLIC_DOCUMENT_ACCEPTANCE_SOURCES),\n documents: z.array(PublicDocumentVersionRefSchema),\n acceptedLevel: PublicDocumentAcceptanceLevelSchema,\n legalReviewNoticeRevision: LegalReviewNoticeRevisionSchema.nullable(),\n acceptedAt: z.number(),\n}).strict();\nexport type PublicDocumentsAcceptedAuditPayload = z.infer<typeof PublicDocumentsAcceptedAuditPayloadSchema>;\n"]}
|
package/dist/schemas/users.d.ts
CHANGED
|
@@ -63,8 +63,25 @@ export declare const RegisterUserInputSchema: z.ZodObject<{
|
|
|
63
63
|
cookies: z.ZodLiteral<true>;
|
|
64
64
|
terms: z.ZodLiteral<true>;
|
|
65
65
|
}, z.core.$strict>;
|
|
66
|
+
publicDocuments: z.ZodArray<z.ZodObject<{
|
|
67
|
+
documentId: z.ZodEnum<{
|
|
68
|
+
futurePlans: "futurePlans";
|
|
69
|
+
rulesAndAgreements: "rulesAndAgreements";
|
|
70
|
+
termsOfService: "termsOfService";
|
|
71
|
+
privacyPolicy: "privacyPolicy";
|
|
72
|
+
takeItDownPageCopy: "takeItDownPageCopy";
|
|
73
|
+
dmcaPolicy: "dmcaPolicy";
|
|
74
|
+
}>;
|
|
75
|
+
version: z.ZodNumber;
|
|
76
|
+
}, z.core.$strict>>;
|
|
66
77
|
}, z.core.$strict>;
|
|
67
78
|
export type RegisterUserInput = z.infer<typeof RegisterUserInputSchema>;
|
|
79
|
+
export declare const RegisterUserResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
80
|
+
status: z.ZodLiteral<"registered">;
|
|
81
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
82
|
+
status: z.ZodLiteral<"refreshRequired">;
|
|
83
|
+
}, z.core.$strip>], "status">;
|
|
84
|
+
export type RegisterUserResult = z.infer<typeof RegisterUserResultSchema>;
|
|
68
85
|
export declare const SetUserStatusInputSchema: z.ZodObject<{
|
|
69
86
|
userId: z.ZodString;
|
|
70
87
|
status: z.ZodEnum<{
|
|
@@ -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;
|
|
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,CAAC;AAC3E,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAapG,eAAO,MAAM,mCAAmC;;;;;;;8BAW9C,CAAC;AACH,MAAM,MAAM,6BAA6B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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"}
|
package/dist/schemas/users.js
CHANGED
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { userIdSchema, calendarDateSchema } from './atoms.js';
|
|
3
3
|
import { USERNAME_MIN_LENGTH, USERNAME_MAX_LENGTH, USERNAME_REGEX, MAX_ARTISAN_LOCATION_LENGTH, MAX_INTERNAL_REASON_LENGTH, MAX_USER_SEARCH_QUERY_LENGTH, } from '../constants/business.js';
|
|
4
4
|
import { UserAccountStatusSchema } from '../doc-schemas/user.js';
|
|
5
|
+
import { ShownPublicDocumentVersionsSchema, PublicDocumentsRefreshRequiredResultSchema, } from './public-documents.js';
|
|
5
6
|
/** The ONE composed display-name field validator (length bounds + charset). Every
|
|
6
7
|
* callable accepting a display name spreads this — never a re-composed copy. */
|
|
7
8
|
export const displayNameSchema = z
|
|
@@ -128,7 +129,19 @@ export const RegisterUserInputSchema = z.object({
|
|
|
128
129
|
cookies: z.literal(true),
|
|
129
130
|
terms: z.literal(true),
|
|
130
131
|
}).strict(),
|
|
132
|
+
// The public-document versions the signup page SHOWED when the person agreed: every published
|
|
133
|
+
// document at its current version, `changedPublicDocuments(block, undefined)` off the live
|
|
134
|
+
// `_appConfig/app` version block. Empty before the first release (the first-admin bootstrap).
|
|
135
|
+
// Registration re-reads the block in its transaction and answers `refreshRequired`, writing
|
|
136
|
+
// nothing, when a publish raced the page — the same comparison the acceptance prompt's Accept makes.
|
|
137
|
+
publicDocuments: ShownPublicDocumentVersionsSchema,
|
|
131
138
|
}).strict();
|
|
139
|
+
export const RegisterUserResultSchema = z.discriminatedUnion('status', [
|
|
140
|
+
// The account is registered with the documents shown accepted (or already was — an idempotent
|
|
141
|
+
// replay). Refresh the token: the `docsAccepted` claim was set after the commit.
|
|
142
|
+
z.object({ status: z.literal('registered') }),
|
|
143
|
+
PublicDocumentsRefreshRequiredResultSchema,
|
|
144
|
+
]);
|
|
132
145
|
export const SetUserStatusInputSchema = z.object({
|
|
133
146
|
userId: userIdSchema,
|
|
134
147
|
status: UserAccountStatusSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/schemas/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE;gFACgF;AAChF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,MAAM,EAAE;KACR,GAAG,CAAC,mBAAmB,CAAC;KACxB,GAAG,CAAC,mBAAmB,CAAC;KACxB,KAAK,CAAC,cAAc,CAAC,CAAC;AAEzB,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAG9E,qFAAqF;AACrF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CAAC;IACzD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACxB,oFAAoF;IACpF,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,oFAAoF;IACpF,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE;CAC5B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACxB,2EAA2E;IAC3E,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;CACvB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { userIdSchema, calendarDateSchema } from './atoms.js';\nimport {\n USERNAME_MIN_LENGTH,\n USERNAME_MAX_LENGTH,\n USERNAME_REGEX,\n MAX_ARTISAN_LOCATION_LENGTH,\n MAX_INTERNAL_REASON_LENGTH,\n MAX_USER_SEARCH_QUERY_LENGTH,\n} from '../constants/business.js';\nimport { UserAccountStatusSchema } from '../doc-schemas/user.js';\n\n/** The ONE composed display-name field validator (length bounds + charset). Every\n * callable accepting a display name spreads this — never a re-composed copy. */\nexport const displayNameSchema = z\n .string()\n .min(USERNAME_MIN_LENGTH)\n .max(USERNAME_MAX_LENGTH)\n .regex(USERNAME_REGEX);\n\nexport const AcceptSquareStreetzAgreementsInputSchema = z.object({}).strict();\nexport type AcceptSquareStreetzAgreementsInput = z.infer<typeof AcceptSquareStreetzAgreementsInputSchema>;\n\n// One-time acknowledgement gate before a user may download Hall content for personal\n// offline use (final wording owned by the legal-and-content step). No payload — the\n// callable records the timestamp in the caller's privateData. See\n// docs/design/media-assets-and-protected-serving.md (Hall/Library downloads).\nexport const AcceptHallDownloadAcknowledgementInputSchema = z.object({}).strict();\nexport type AcceptHallDownloadAcknowledgementInput = z.infer<typeof AcceptHallDownloadAcknowledgementInputSchema>;\n\n// The become-creator dialog's \"I confirm I am 18 years of age or older\" checkbox must reach the\n// server: the callable rejects when absent and records the attestation on the\n// artisanCreator.grantedToUser audit event (immutable, timestamped, with IP/UA) so it is provable.\nexport const BecomeArtisanCreatorInputSchema = z.object({\n ageAttested: z.literal(true),\n // \"I confirm I am a person located in the United States\" — required for now (only U.S. persons\n // may become artisans). Mirrors ageAttested: the callable rejects when absent and records the\n // attestation timestamp (privateData.usPersonAttestedAt) + the grant audit event.\n usPersonAttested: z.literal(true),\n // [Q21.5 REVISED — DJ 2026-07-06] The artisan's date of birth — the ONLY point in the system\n // where a DOB is collected for persistence (registration/upgrade derive the bracket and store\n // nothing). The dialog copy tells the user this must be THEIR birthday: when the payout system\n // ships, it has to match their payout (KYC) identity. The callable re-derives 18+ server-side\n // from this value; an under-18 derivation rejects (failure audit, nothing stored). Stored as\n // privateData attestedDateOfBirth + attestedDobSource 'artisanOnboarding'.\n dob: z.object({\n year: z.number().int(),\n month: z.number().int().min(1).max(12),\n day: z.number().int().min(1).max(31),\n }).strict(),\n}).strict();\nexport type BecomeArtisanCreatorInput = z.infer<typeof BecomeArtisanCreatorInputSchema>;\n\nexport const MarkWaitingForNewsApprovalInputSchema = z.object({}).strict();\nexport type MarkWaitingForNewsApprovalInput = z.infer<typeof MarkWaitingForNewsApprovalInputSchema>;\n\n// First-visit site-tour preference writer (updateSiteTourPreference). This is the ONE\n// server writer for `privateData/{uid}.siteTour`; the client never writes tour state\n// directly. Discriminated on `action`:\n// - deferToday: records the member's LOCAL calendar `date` (\"Not today\"); the automatic\n// invitation is suppressed for exactly that date.\n// - dismissAutomaticInvites: records the permanent \"Don't show this again\" time; no payload.\n// - completeTour: records completion; the callable stamps SITE_TOUR_CURRENT_VERSION and\n// completedAt server-side, so no version is accepted from the client (mirrors the\n// acknowledgement callables that record the authoritative value server-side rather than\n// trusting a client-supplied one). Bump SITE_TOUR_CURRENT_VERSION to re-invite everyone.\n// `date` uses the same strict YYYY-MM-DD convention as the age cluster's attestedDateOfBirth.\nexport const UpdateSiteTourPreferenceInputSchema = z.discriminatedUnion('action', [\n z.object({\n action: z.literal('deferToday'),\n date: calendarDateSchema, // 'YYYY-MM-DD' (member's LOCAL calendar date)\n }).strict(),\n z.object({\n action: z.literal('dismissAutomaticInvites'),\n }).strict(),\n z.object({\n action: z.literal('completeTour'),\n }).strict(),\n]);\nexport type UpdateSiteTourPreferenceInput = z.infer<typeof UpdateSiteTourPreferenceInputSchema>;\n\n// The device-local shape behind the ONE sanctioned optimistic-hide exception: a site-tour choice\n// the member has already made, persisted at `siteTourPendingStorageKey(uid)`\n// (constants/storage-keys.ts) while its `updateSiteTourPreference` write is unconfirmed. It exists\n// so the overlay can close on the click instead of after a callable round-trip, and so a failed\n// write is replayed on the next boot rather than silently lost.\n//\n// It is NOT a cache, mirror, or second authority: `privateData/{uid}.siteTour` remains the sole\n// source of tour eligibility, and this entry only OVERLAYS it (suppressing an invitation the member\n// has already dismissed) until the server state converges.\n//\n// Every field is load-bearing against a specific failure:\n// - `schemaVersion` lets a future shape change be recognized instead of silently mis-parsed.\n// - `id` is the compare-and-remove token: on callable success the owner removes the entry ONLY if\n// the stored id still matches the one it sent, so a slow response in tab A can never erase a\n// newer choice made in tab B.\n// - `uid` must equal the authenticated key owner before the entry may affect eligibility or be\n// replayed — defence in depth behind the uid-scoped key itself.\n// - `createdAt` is epoch ms, for ordering/diagnostics only; it is never an expiry.\n// - `completeTour` carries the `tourVersion` the member actually completed. On reconciliation an\n// entry whose version differs from SITE_TOUR_CURRENT_VERSION is STALE and is discarded, so an\n// old pending completion can never complete a newer tour. The callable payload stays\n// version-free (the server stamps the authoritative version) — this is a replay guard, not\n// server authority.\n//\n// STRICT and fully validated on read: malformed or unknown persisted data is removed and\n// eligibility falls back to the server. Invalid storage must never hide the tour forever.\nexport const SiteTourPendingPreferenceSchema = z.discriminatedUnion('action', [\n z.object({\n schemaVersion: z.literal(1),\n id: z.string().min(1),\n uid: userIdSchema,\n createdAt: z.number(),\n action: z.literal('deferToday'),\n date: calendarDateSchema, // 'YYYY-MM-DD' (member's LOCAL calendar date)\n }).strict(),\n z.object({\n schemaVersion: z.literal(1),\n id: z.string().min(1),\n uid: userIdSchema,\n createdAt: z.number(),\n action: z.literal('dismissAutomaticInvites'),\n }).strict(),\n z.object({\n schemaVersion: z.literal(1),\n id: z.string().min(1),\n uid: userIdSchema,\n createdAt: z.number(),\n action: z.literal('completeTour'),\n tourVersion: z.number().int().positive(),\n }).strict(),\n]);\nexport type SiteTourPendingPreference = z.infer<typeof SiteTourPendingPreferenceSchema>;\n\n// Non-U.S. artisan-interest signup (the FCFS \"waitlist\" fields on privateData). Mirrors\n// MarkWaitingForNewsApproval but carries the applicant's country (+ optional region) so signups\n// can be opened by jurisdiction as each region's laws clear. The callable records it ONLY for\n// adult accounts (never a minor's location).\nexport const MarkNonUsArtisanInterestInputSchema = z.object({\n country: z.string().min(1).max(MAX_ARTISAN_LOCATION_LENGTH),\n region: z.string().max(MAX_ARTISAN_LOCATION_LENGTH).optional(),\n}).strict();\nexport type MarkNonUsArtisanInterestInput = z.infer<typeof MarkNonUsArtisanInterestInputSchema>;\n\nexport const RegisterUserInputSchema = z.object({\n displayName: displayNameSchema,\n agreements: z.object({\n age: z.literal(true),\n nudity: z.literal(true),\n meet: z.literal(true),\n cookies: z.literal(true),\n terms: z.literal(true),\n }).strict(),\n}).strict();\nexport type RegisterUserInput = z.infer<typeof RegisterUserInputSchema>;\n\nexport const SetUserStatusInputSchema = z.object({\n userId: userIdSchema,\n status: UserAccountStatusSchema,\n // Required by the callable when status is 'suspended' or 'banned' (shown to the\n // user in their restricted view and recorded on the audit event). Optional here\n // so reinstating to 'active' can omit it; the callable enforces presence.\n reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH).optional(),\n}).strict();\nexport type SetUserStatusInput = z.infer<typeof SetUserStatusInputSchema>;\n\n// Admin forces an abusive display name off a user: the name is swapped to a neutral\n// placeholder, the old name is blocked from reuse, and the user must pick a new one.\nexport const ForceDisplayNameResetInputSchema = z.object({\n userId: userIdSchema,\n // Optional admin note recorded on the audit event.\n reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH).optional(),\n}).strict();\nexport type ForceDisplayNameResetInput = z.infer<typeof ForceDisplayNameResetInputSchema>;\n\n// User completes a forced display-name reset by choosing a new name. Only honored while\n// the caller's userProfiles doc has `displayNameResetRequired === true`.\nexport const SetMyDisplayNameInputSchema = z.object({\n displayName: displayNameSchema,\n}).strict();\nexport type SetMyDisplayNameInput = z.infer<typeof SetMyDisplayNameInputSchema>;\n\n// Unauthenticated soft-check the register page runs BEFORE creating the Auth user so a\n// taken name never orphans an auth account. Mirrors the RegisterUser displayName contract\n// (same length + regex). The authoritative claim still happens inside registerUser.\nexport const CheckDisplayNameAvailableInputSchema = z.object({\n displayName: displayNameSchema,\n}).strict();\nexport type CheckDisplayNameAvailableInput = z.infer<typeof CheckDisplayNameAvailableInputSchema>;\n\n// Teen→adult upgrade: a transient DOB (never persisted) the callable re-derives adult\n// eligibility from server-side against a fresh attestation. Only the shape is validated\n// here; the age math + attestation binding live in the callable.\nexport const UpgradeAccountToAdultInputSchema = z.object({\n dob: z.object({\n year: z.number().int(),\n month: z.number().int().min(1).max(12),\n day: z.number().int().min(1).max(31),\n }).strict(),\n}).strict();\nexport type UpgradeAccountToAdultInput = z.infer<typeof UpgradeAccountToAdultInputSchema>;\n\n// Admin-only user lookup for the User Management view (prefix search on publicUsers by\n// displayName). Only the trimmed query string is validated here; authz (admin/jr-admin)\n// lives in the callable.\nexport const SearchPublicUsersInputSchema = z.object({\n query: z.string().trim().min(1).max(MAX_USER_SEARCH_QUERY_LENGTH),\n}).strict();\nexport type SearchPublicUsersInput = z.infer<typeof SearchPublicUsersInputSchema>;\n\n// Admin exact-account lookup (\"look up by email or uid\" in User Management): a solo full\n// admin resolves ONE account by its exact email, uid, or display name. The app detects\n// email-vs-uid-vs-name both client- and server-side, so there is ONE query field (mirrors\n// SearchPublicUsersInput's single trimmed-query shape + bound). Only the trimmed query is\n// validated here; authz (full admin) lives in the callable.\nexport const LookupUserByEmailOrUidInputSchema = z.object({\n query: z.string().trim().min(1).max(MAX_USER_SEARCH_QUERY_LENGTH),\n}).strict();\nexport type LookupUserByEmailOrUidInput = z.infer<typeof LookupUserByEmailOrUidInputSchema>;\n\n// N3 account deletion — wire result contracts for the two user-facing callables (both take\n// no input). Previously declared independently in functions/src and src/hooks — one drifting\n// pair per callable. Non-strict (server → client result posture).\nexport const RequestAccountDeletionResultSchema = z.object({\n success: z.literal(true),\n /** When the scheduled scrub will run (requestedAt + the grace window), epoch ms. */\n scheduledScrubAt: z.number(),\n /** True when an ACTIVE request already existed and its schedule was re-returned. */\n alreadyPending: z.boolean(),\n});\nexport type RequestAccountDeletionResult = z.infer<typeof RequestAccountDeletionResultSchema>;\n\nexport const CancelAccountDeletionResultSchema = z.object({\n success: z.literal(true),\n /** False when there was no active request to cancel (idempotent no-op). */\n cancelled: z.boolean(),\n});\nexport type CancelAccountDeletionResult = z.infer<typeof CancelAccountDeletionResultSchema>;\n\n"]}
|
|
1
|
+
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/schemas/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EACL,iCAAiC,EACjC,0CAA0C,GAC3C,MAAM,uBAAuB,CAAC;AAE/B;gFACgF;AAChF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,MAAM,EAAE;KACR,GAAG,CAAC,mBAAmB,CAAC;KACxB,GAAG,CAAC,mBAAmB,CAAC;KACxB,KAAK,CAAC,cAAc,CAAC,CAAC;AAEzB,MAAM,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A4B,CAAC;CAClE,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,yFAAyF;AACzF,uFAAuF;AACvF,0FAA0F;AAC1F,0FAA0F;AAC1F,4DAA4D;AAC5D,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,4BAA4B,CAAC;CAClE,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,2FAA2F;AAC3F,6FAA6F;AAC7F,kEAAkE;AAClE,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACxB,oFAAoF;IACpF,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,oFAAoF;IACpF,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE;CAC5B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACxB,2EAA2E;IAC3E,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;CACvB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { userIdSchema, calendarDateSchema } from './atoms.js';\nimport {\n USERNAME_MIN_LENGTH,\n USERNAME_MAX_LENGTH,\n USERNAME_REGEX,\n MAX_ARTISAN_LOCATION_LENGTH,\n MAX_INTERNAL_REASON_LENGTH,\n MAX_USER_SEARCH_QUERY_LENGTH,\n} from '../constants/business.js';\nimport { UserAccountStatusSchema } from '../doc-schemas/user.js';\nimport {\n ShownPublicDocumentVersionsSchema,\n PublicDocumentsRefreshRequiredResultSchema,\n} from './public-documents.js';\n\n/** The ONE composed display-name field validator (length bounds + charset). Every\n * callable accepting a display name spreads this — never a re-composed copy. */\nexport const displayNameSchema = z\n .string()\n .min(USERNAME_MIN_LENGTH)\n .max(USERNAME_MAX_LENGTH)\n .regex(USERNAME_REGEX);\n\nexport const AcceptSquareStreetzAgreementsInputSchema = z.object({}).strict();\nexport type AcceptSquareStreetzAgreementsInput = z.infer<typeof AcceptSquareStreetzAgreementsInputSchema>;\n\n// One-time acknowledgement gate before a user may download Hall content for personal\n// offline use (final wording owned by the legal-and-content step). No payload — the\n// callable records the timestamp in the caller's privateData. See\n// docs/design/media-assets-and-protected-serving.md (Hall/Library downloads).\nexport const AcceptHallDownloadAcknowledgementInputSchema = z.object({}).strict();\nexport type AcceptHallDownloadAcknowledgementInput = z.infer<typeof AcceptHallDownloadAcknowledgementInputSchema>;\n\n// The become-creator dialog's \"I confirm I am 18 years of age or older\" checkbox must reach the\n// server: the callable rejects when absent and records the attestation on the\n// artisanCreator.grantedToUser audit event (immutable, timestamped, with IP/UA) so it is provable.\nexport const BecomeArtisanCreatorInputSchema = z.object({\n ageAttested: z.literal(true),\n // \"I confirm I am a person located in the United States\" — required for now (only U.S. persons\n // may become artisans). Mirrors ageAttested: the callable rejects when absent and records the\n // attestation timestamp (privateData.usPersonAttestedAt) + the grant audit event.\n usPersonAttested: z.literal(true),\n // [Q21.5 REVISED — DJ 2026-07-06] The artisan's date of birth — the ONLY point in the system\n // where a DOB is collected for persistence (registration/upgrade derive the bracket and store\n // nothing). The dialog copy tells the user this must be THEIR birthday: when the payout system\n // ships, it has to match their payout (KYC) identity. The callable re-derives 18+ server-side\n // from this value; an under-18 derivation rejects (failure audit, nothing stored). Stored as\n // privateData attestedDateOfBirth + attestedDobSource 'artisanOnboarding'.\n dob: z.object({\n year: z.number().int(),\n month: z.number().int().min(1).max(12),\n day: z.number().int().min(1).max(31),\n }).strict(),\n}).strict();\nexport type BecomeArtisanCreatorInput = z.infer<typeof BecomeArtisanCreatorInputSchema>;\n\nexport const MarkWaitingForNewsApprovalInputSchema = z.object({}).strict();\nexport type MarkWaitingForNewsApprovalInput = z.infer<typeof MarkWaitingForNewsApprovalInputSchema>;\n\n// First-visit site-tour preference writer (updateSiteTourPreference). This is the ONE\n// server writer for `privateData/{uid}.siteTour`; the client never writes tour state\n// directly. Discriminated on `action`:\n// - deferToday: records the member's LOCAL calendar `date` (\"Not today\"); the automatic\n// invitation is suppressed for exactly that date.\n// - dismissAutomaticInvites: records the permanent \"Don't show this again\" time; no payload.\n// - completeTour: records completion; the callable stamps SITE_TOUR_CURRENT_VERSION and\n// completedAt server-side, so no version is accepted from the client (mirrors the\n// acknowledgement callables that record the authoritative value server-side rather than\n// trusting a client-supplied one). Bump SITE_TOUR_CURRENT_VERSION to re-invite everyone.\n// `date` uses the same strict YYYY-MM-DD convention as the age cluster's attestedDateOfBirth.\nexport const UpdateSiteTourPreferenceInputSchema = z.discriminatedUnion('action', [\n z.object({\n action: z.literal('deferToday'),\n date: calendarDateSchema, // 'YYYY-MM-DD' (member's LOCAL calendar date)\n }).strict(),\n z.object({\n action: z.literal('dismissAutomaticInvites'),\n }).strict(),\n z.object({\n action: z.literal('completeTour'),\n }).strict(),\n]);\nexport type UpdateSiteTourPreferenceInput = z.infer<typeof UpdateSiteTourPreferenceInputSchema>;\n\n// The device-local shape behind the ONE sanctioned optimistic-hide exception: a site-tour choice\n// the member has already made, persisted at `siteTourPendingStorageKey(uid)`\n// (constants/storage-keys.ts) while its `updateSiteTourPreference` write is unconfirmed. It exists\n// so the overlay can close on the click instead of after a callable round-trip, and so a failed\n// write is replayed on the next boot rather than silently lost.\n//\n// It is NOT a cache, mirror, or second authority: `privateData/{uid}.siteTour` remains the sole\n// source of tour eligibility, and this entry only OVERLAYS it (suppressing an invitation the member\n// has already dismissed) until the server state converges.\n//\n// Every field is load-bearing against a specific failure:\n// - `schemaVersion` lets a future shape change be recognized instead of silently mis-parsed.\n// - `id` is the compare-and-remove token: on callable success the owner removes the entry ONLY if\n// the stored id still matches the one it sent, so a slow response in tab A can never erase a\n// newer choice made in tab B.\n// - `uid` must equal the authenticated key owner before the entry may affect eligibility or be\n// replayed — defence in depth behind the uid-scoped key itself.\n// - `createdAt` is epoch ms, for ordering/diagnostics only; it is never an expiry.\n// - `completeTour` carries the `tourVersion` the member actually completed. On reconciliation an\n// entry whose version differs from SITE_TOUR_CURRENT_VERSION is STALE and is discarded, so an\n// old pending completion can never complete a newer tour. The callable payload stays\n// version-free (the server stamps the authoritative version) — this is a replay guard, not\n// server authority.\n//\n// STRICT and fully validated on read: malformed or unknown persisted data is removed and\n// eligibility falls back to the server. Invalid storage must never hide the tour forever.\nexport const SiteTourPendingPreferenceSchema = z.discriminatedUnion('action', [\n z.object({\n schemaVersion: z.literal(1),\n id: z.string().min(1),\n uid: userIdSchema,\n createdAt: z.number(),\n action: z.literal('deferToday'),\n date: calendarDateSchema, // 'YYYY-MM-DD' (member's LOCAL calendar date)\n }).strict(),\n z.object({\n schemaVersion: z.literal(1),\n id: z.string().min(1),\n uid: userIdSchema,\n createdAt: z.number(),\n action: z.literal('dismissAutomaticInvites'),\n }).strict(),\n z.object({\n schemaVersion: z.literal(1),\n id: z.string().min(1),\n uid: userIdSchema,\n createdAt: z.number(),\n action: z.literal('completeTour'),\n tourVersion: z.number().int().positive(),\n }).strict(),\n]);\nexport type SiteTourPendingPreference = z.infer<typeof SiteTourPendingPreferenceSchema>;\n\n// Non-U.S. artisan-interest signup (the FCFS \"waitlist\" fields on privateData). Mirrors\n// MarkWaitingForNewsApproval but carries the applicant's country (+ optional region) so signups\n// can be opened by jurisdiction as each region's laws clear. The callable records it ONLY for\n// adult accounts (never a minor's location).\nexport const MarkNonUsArtisanInterestInputSchema = z.object({\n country: z.string().min(1).max(MAX_ARTISAN_LOCATION_LENGTH),\n region: z.string().max(MAX_ARTISAN_LOCATION_LENGTH).optional(),\n}).strict();\nexport type MarkNonUsArtisanInterestInput = z.infer<typeof MarkNonUsArtisanInterestInputSchema>;\n\nexport const RegisterUserInputSchema = z.object({\n displayName: displayNameSchema,\n agreements: z.object({\n age: z.literal(true),\n nudity: z.literal(true),\n meet: z.literal(true),\n cookies: z.literal(true),\n terms: z.literal(true),\n }).strict(),\n // The public-document versions the signup page SHOWED when the person agreed: every published\n // document at its current version, `changedPublicDocuments(block, undefined)` off the live\n // `_appConfig/app` version block. Empty before the first release (the first-admin bootstrap).\n // Registration re-reads the block in its transaction and answers `refreshRequired`, writing\n // nothing, when a publish raced the page — the same comparison the acceptance prompt's Accept makes.\n publicDocuments: ShownPublicDocumentVersionsSchema,\n}).strict();\nexport type RegisterUserInput = z.infer<typeof RegisterUserInputSchema>;\n\nexport const RegisterUserResultSchema = z.discriminatedUnion('status', [\n // The account is registered with the documents shown accepted (or already was — an idempotent\n // replay). Refresh the token: the `docsAccepted` claim was set after the commit.\n z.object({ status: z.literal('registered') }),\n PublicDocumentsRefreshRequiredResultSchema,\n]);\nexport type RegisterUserResult = z.infer<typeof RegisterUserResultSchema>;\n\nexport const SetUserStatusInputSchema = z.object({\n userId: userIdSchema,\n status: UserAccountStatusSchema,\n // Required by the callable when status is 'suspended' or 'banned' (shown to the\n // user in their restricted view and recorded on the audit event). Optional here\n // so reinstating to 'active' can omit it; the callable enforces presence.\n reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH).optional(),\n}).strict();\nexport type SetUserStatusInput = z.infer<typeof SetUserStatusInputSchema>;\n\n// Admin forces an abusive display name off a user: the name is swapped to a neutral\n// placeholder, the old name is blocked from reuse, and the user must pick a new one.\nexport const ForceDisplayNameResetInputSchema = z.object({\n userId: userIdSchema,\n // Optional admin note recorded on the audit event.\n reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH).optional(),\n}).strict();\nexport type ForceDisplayNameResetInput = z.infer<typeof ForceDisplayNameResetInputSchema>;\n\n// User completes a forced display-name reset by choosing a new name. Only honored while\n// the caller's userProfiles doc has `displayNameResetRequired === true`.\nexport const SetMyDisplayNameInputSchema = z.object({\n displayName: displayNameSchema,\n}).strict();\nexport type SetMyDisplayNameInput = z.infer<typeof SetMyDisplayNameInputSchema>;\n\n// Unauthenticated soft-check the register page runs BEFORE creating the Auth user so a\n// taken name never orphans an auth account. Mirrors the RegisterUser displayName contract\n// (same length + regex). The authoritative claim still happens inside registerUser.\nexport const CheckDisplayNameAvailableInputSchema = z.object({\n displayName: displayNameSchema,\n}).strict();\nexport type CheckDisplayNameAvailableInput = z.infer<typeof CheckDisplayNameAvailableInputSchema>;\n\n// Teen→adult upgrade: a transient DOB (never persisted) the callable re-derives adult\n// eligibility from server-side against a fresh attestation. Only the shape is validated\n// here; the age math + attestation binding live in the callable.\nexport const UpgradeAccountToAdultInputSchema = z.object({\n dob: z.object({\n year: z.number().int(),\n month: z.number().int().min(1).max(12),\n day: z.number().int().min(1).max(31),\n }).strict(),\n}).strict();\nexport type UpgradeAccountToAdultInput = z.infer<typeof UpgradeAccountToAdultInputSchema>;\n\n// Admin-only user lookup for the User Management view (prefix search on publicUsers by\n// displayName). Only the trimmed query string is validated here; authz (admin/jr-admin)\n// lives in the callable.\nexport const SearchPublicUsersInputSchema = z.object({\n query: z.string().trim().min(1).max(MAX_USER_SEARCH_QUERY_LENGTH),\n}).strict();\nexport type SearchPublicUsersInput = z.infer<typeof SearchPublicUsersInputSchema>;\n\n// Admin exact-account lookup (\"look up by email or uid\" in User Management): a solo full\n// admin resolves ONE account by its exact email, uid, or display name. The app detects\n// email-vs-uid-vs-name both client- and server-side, so there is ONE query field (mirrors\n// SearchPublicUsersInput's single trimmed-query shape + bound). Only the trimmed query is\n// validated here; authz (full admin) lives in the callable.\nexport const LookupUserByEmailOrUidInputSchema = z.object({\n query: z.string().trim().min(1).max(MAX_USER_SEARCH_QUERY_LENGTH),\n}).strict();\nexport type LookupUserByEmailOrUidInput = z.infer<typeof LookupUserByEmailOrUidInputSchema>;\n\n// N3 account deletion — wire result contracts for the two user-facing callables (both take\n// no input). Previously declared independently in functions/src and src/hooks — one drifting\n// pair per callable. Non-strict (server → client result posture).\nexport const RequestAccountDeletionResultSchema = z.object({\n success: z.literal(true),\n /** When the scheduled scrub will run (requestedAt + the grace window), epoch ms. */\n scheduledScrubAt: z.number(),\n /** True when an ACTIVE request already existed and its schedule was re-returned. */\n alreadyPending: z.boolean(),\n});\nexport type RequestAccountDeletionResult = z.infer<typeof RequestAccountDeletionResultSchema>;\n\nexport const CancelAccountDeletionResultSchema = z.object({\n success: z.literal(true),\n /** False when there was no active request to cancel (idempotent no-op). */\n cancelled: z.boolean(),\n});\nexport type CancelAccountDeletionResult = z.infer<typeof CancelAccountDeletionResultSchema>;\n\n"]}
|
|
@@ -37,6 +37,8 @@ export declare const SeedPrivacyPageInputSchema: z.ZodObject<{}, z.core.$strict>
|
|
|
37
37
|
export type SeedPrivacyPageInput = z.infer<typeof SeedPrivacyPageInputSchema>;
|
|
38
38
|
export declare const SeedTakeItDownPageCopyInputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
39
39
|
export type SeedTakeItDownPageCopyInput = z.infer<typeof SeedTakeItDownPageCopyInputSchema>;
|
|
40
|
+
export declare const SeedDmcaPolicyInputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
41
|
+
export type SeedDmcaPolicyInput = z.infer<typeof SeedDmcaPolicyInputSchema>;
|
|
40
42
|
/** Admin add/remove words on the self-owned curated profanity list (no external sync). */
|
|
41
43
|
export declare const CurateProfanityListInputSchema: z.ZodObject<{
|
|
42
44
|
add: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../src/schemas/utility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,kCAAkC;;kBAEpC,CAAC;AACZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAK9F,eAAO,MAAM,yBAAyB;;;;EAAuD,CAAC;AAC9F,MAAM,MAAM,mBAAmB,GAAG,CAAC,C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CAAC;AAEtF,eAAO,MAAM,yBAAyB;;;;;;;;;kBAG3B,CAAC;AACZ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,8BAA8B;;kBAEhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,gCAAgC;;kBAElC,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAI1F,eAAO,MAAM,0BAA0B;;iBAErC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAI9E,eAAO,MAAM,iCAAiC;;iBAE5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAI5F,eAAO,MAAM,+BAA+B;;;;;;iBAS1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAIxF,eAAO,MAAM,mCAAmC;;;;;iBAQ9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC"}
|
package/dist/schemas/utility.js
CHANGED
|
@@ -28,13 +28,16 @@ export const CreateShortLinkInputSchema = z.discriminatedUnion('targetType', [
|
|
|
28
28
|
export const SeedProfanityListInputSchema = z.object({}).strict();
|
|
29
29
|
export const SeedReservedUsernamesInputSchema = z.object({}).strict();
|
|
30
30
|
export const SeedBlockedFranchiseNamesInputSchema = z.object({}).strict();
|
|
31
|
+
// Public-document seed callables (Ready for Launch tab), one per PublicDocumentId. Each
|
|
32
|
+
// publishes its document's launch content as v1 through the public-document release owner,
|
|
33
|
+
// only while that document has never been published (otherwise a no-op). The input is
|
|
34
|
+
// intentionally empty.
|
|
31
35
|
export const SeedRulesAndAgreementsInputSchema = z.object({}).strict();
|
|
32
36
|
export const SeedFuturePlansInputSchema = z.object({}).strict();
|
|
33
|
-
// Content-pages migration (DJ ruling 2026-07-06): seed callables for the three
|
|
34
|
-
// editable content-page singletons (strict seed-if-empty — doc exists ⇒ no-op).
|
|
35
37
|
export const SeedTermsPageInputSchema = z.object({}).strict();
|
|
36
38
|
export const SeedPrivacyPageInputSchema = z.object({}).strict();
|
|
37
39
|
export const SeedTakeItDownPageCopyInputSchema = z.object({}).strict();
|
|
40
|
+
export const SeedDmcaPolicyInputSchema = z.object({}).strict();
|
|
38
41
|
/** Admin add/remove words on the self-owned curated profanity list (no external sync). */
|
|
39
42
|
export const CurateProfanityListInputSchema = z
|
|
40
43
|
.object({
|