@ttt-productions/ttt-core 0.79.64 → 0.79.65
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.
|
@@ -222,10 +222,12 @@ export declare const RealmFileListsChangeSchema: z.ZodObject<{
|
|
|
222
222
|
}, z.core.$strict>;
|
|
223
223
|
export type RealmFileListsChange = z.infer<typeof RealmFileListsChangeSchema>;
|
|
224
224
|
/** The answer of every action that changes a file's Realm standing: request, withdraw, approve,
|
|
225
|
-
* decline, canon toggle, folder move, and the admin un-share.
|
|
225
|
+
* decline, canon toggle, folder move, and the admin un-share. `change` is present when the read
|
|
226
|
+
* after the commit succeeded; a failed read never fails an action that already committed (ENG-009),
|
|
227
|
+
* and the client keeps its loaded pages when it is absent. Non-strict (server → client). */
|
|
226
228
|
export declare const RealmFileTransitionResultSchema: z.ZodObject<{
|
|
227
229
|
success: z.ZodLiteral<true>;
|
|
228
|
-
change: z.ZodObject<{
|
|
230
|
+
change: z.ZodOptional<z.ZodObject<{
|
|
229
231
|
mediaAssetId: z.ZodString;
|
|
230
232
|
workProjectId: z.ZodString;
|
|
231
233
|
workFileId: z.ZodString;
|
|
@@ -277,17 +279,18 @@ export declare const RealmFileTransitionResultSchema: z.ZodObject<{
|
|
|
277
279
|
name: z.ZodString;
|
|
278
280
|
fileCount: z.ZodNumber;
|
|
279
281
|
}, z.core.$strict>>;
|
|
280
|
-
}, z.core.$strict
|
|
282
|
+
}, z.core.$strict>>;
|
|
281
283
|
}, z.core.$strip>;
|
|
282
284
|
export type RealmFileTransitionResult = z.infer<typeof RealmFileTransitionResultSchema>;
|
|
283
|
-
/** The answer of a Realm folder create or rename: the folder as the gallery shows it
|
|
285
|
+
/** The answer of a Realm folder create or rename: the folder as the gallery shows it, present when
|
|
286
|
+
* the read after the commit succeeded (ENG-009; the client keeps its pages when it is absent). */
|
|
284
287
|
export declare const RealmFileFolderResultSchema: z.ZodObject<{
|
|
285
288
|
success: z.ZodLiteral<true>;
|
|
286
|
-
folder: z.ZodObject<{
|
|
289
|
+
folder: z.ZodOptional<z.ZodObject<{
|
|
287
290
|
realmFileFolderId: z.ZodString;
|
|
288
291
|
name: z.ZodString;
|
|
289
292
|
fileCount: z.ZodNumber;
|
|
290
|
-
}, z.core.$strict
|
|
293
|
+
}, z.core.$strict>>;
|
|
291
294
|
}, z.core.$strip>;
|
|
292
295
|
export type RealmFileFolderResult = z.infer<typeof RealmFileFolderResultSchema>;
|
|
293
296
|
/** The answer of a Realm folder delete: the folder it removed. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-project-management.d.ts","sourceRoot":"","sources":["../../src/schemas/work-project-management.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyDxB;mEACmE;AACnE,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;kBAsBjC,CAAC;AACZ,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;;qBAEqB;AACrB,eAAO,MAAM,+BAA+B;;;;kBASjC,CAAC;AACZ,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAKxF,eAAO,MAAM,8BAA8B;;;;kBAIhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF;;;oDAGoD;AACpD,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;kBAInC,CAAC;AACZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAO5F;;kCAEkC;AAClC,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;kBAgBlC,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,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AAC,CAAC"}
|
|
@@ -162,8 +162,8 @@ export const GetWorkFileRealmShareStatesResponseSchema = z.object({
|
|
|
162
162
|
// ---- what a Realm-file action changed ------------------------------------------------------
|
|
163
163
|
// The gallery and the steward's queue are endless lists a client patches in place, never reloads
|
|
164
164
|
// (FRONTEND-103); their rows are server projections the client cannot read, so every action that
|
|
165
|
-
// changes a file's standing answers with the file's row in each list after it
|
|
166
|
-
// projection owners the reads use.
|
|
165
|
+
// changes a file's standing answers with the file's row in each list after it whenever its
|
|
166
|
+
// post-commit read succeeds, built by the same projection owners the reads use.
|
|
167
167
|
/**
|
|
168
168
|
* One file's rows after an action: its gallery row, its queue row, and its Work-side share state —
|
|
169
169
|
* each `null` when the file is absent from that list — plus every folder whose server-computed
|
|
@@ -182,15 +182,18 @@ export const RealmFileListsChangeSchema = z.object({
|
|
|
182
182
|
folders: z.array(RealmFileFolderProjectionSchema),
|
|
183
183
|
}).strict();
|
|
184
184
|
/** The answer of every action that changes a file's Realm standing: request, withdraw, approve,
|
|
185
|
-
* decline, canon toggle, folder move, and the admin un-share.
|
|
185
|
+
* decline, canon toggle, folder move, and the admin un-share. `change` is present when the read
|
|
186
|
+
* after the commit succeeded; a failed read never fails an action that already committed (ENG-009),
|
|
187
|
+
* and the client keeps its loaded pages when it is absent. Non-strict (server → client). */
|
|
186
188
|
export const RealmFileTransitionResultSchema = z.object({
|
|
187
189
|
success: z.literal(true),
|
|
188
|
-
change: RealmFileListsChangeSchema,
|
|
190
|
+
change: RealmFileListsChangeSchema.optional(),
|
|
189
191
|
});
|
|
190
|
-
/** The answer of a Realm folder create or rename: the folder as the gallery shows it
|
|
192
|
+
/** The answer of a Realm folder create or rename: the folder as the gallery shows it, present when
|
|
193
|
+
* the read after the commit succeeded (ENG-009; the client keeps its pages when it is absent). */
|
|
191
194
|
export const RealmFileFolderResultSchema = z.object({
|
|
192
195
|
success: z.literal(true),
|
|
193
|
-
folder: RealmFileFolderProjectionSchema,
|
|
196
|
+
folder: RealmFileFolderProjectionSchema.optional(),
|
|
194
197
|
});
|
|
195
198
|
/** The answer of a Realm folder delete: the folder it removed. */
|
|
196
199
|
export const DeleteRealmFileFolderResultSchema = z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-project-management.js","sourceRoot":"","sources":["../../src/schemas/work-project-management.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC1B,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,mCAAmC,EACnC,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,6BAA6B,EAC7B,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EACL,+BAA+B,EAC/B,6BAA6B,EAC7B,mCAAmC,EACnC,2BAA2B,EAC3B,iCAAiC,EACjC,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,6BAA6B,EAC7B,qCAAqC,GACtC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,6BAA6B,EAC7B,oCAAoC,EACpC,2BAA2B,EAC3B,kCAAkC,EAClC,sBAAsB,GACvB,MAAM,gCAAgC,CAAC;AAExC,8EAA8E;AAC9E,2FAA2F;AAC3F,qFAAqF;AACrF,2FAA2F;AAC3F,4FAA4F;AAC5F,4FAA4F;AAC5F,gCAAgC;AAChC,EAAE;AACF,8FAA8F;AAC9F,gFAAgF;AAChF,8EAA8E;AAE9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AAC,MAAM,CAAC;IACvD,WAAW,EAAE,iBAAiB;IAC9B,iBAAiB,EAAE,uBAAuB;CAC3C,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ;;kCAEkC;AAClC,MAAM,CAAC,MAAM,0CAA0C,GAAG,CAAC,CAAC,MAAM,CAAC;IACjE,WAAW,EAAE,iBAAiB;IAC9B,YAAY,EAAE,kBAAkB;IAChC,yBAAyB,EAAE,uBAAuB;IAClD,iBAAiB,EAAE,uBAAuB;CAC3C,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n workProjectIdSchema,\n userIdSchema,\n addRemoveActionSchema,\n workProjectTypeSchema,\n hallWingTypeSchema,\n commissionListingIdSchema,\n commissionProposalIdSchema,\n auditionIdSchema,\n auditionEntryIdSchema,\n craftSkillIdSchema,\n guildInviteConversationStatusSchema,\n mediaAssetIdSchema,\n workRealmIdSchema,\n realmFileFolderIdSchema,\n realmFileShareRequestIdSchema,\n documentIdSegmentSchema,\n workFileFolderIdSchema,\n workFileIdSchema,\n} from './atoms.js';\nimport { TRADE_PROFESSION_OPTIONS, TRADE_PROFESSION_VALUES } from '../constants/options.js';\nimport { GUILD_STANDING_VALUES } from '../permissions/index.js';\nimport { FullWorkProjectSchema } from '../doc-schemas/work-project.js';\nimport {\n MAX_GUILD_INVITE_MESSAGE_LENGTH,\n MAX_WORK_PROJECT_TITLE_LENGTH,\n MAX_WORK_PROJECT_DESCRIPTION_LENGTH,\n MAX_WORK_REALM_TITLE_LENGTH,\n MAX_WORK_REALM_DESCRIPTION_LENGTH,\n MAX_CRAFT_SKILL_NAME_LENGTH,\n MAX_FILE_FOLDER_NAME_LENGTH,\n} from '../constants/business.js';\nimport {\n REALM_SHARED_FILES_PAGE_LIMIT,\n REALM_FILE_PROMOTION_QUEUE_PAGE_LIMIT,\n} from '../constants/pagination.js';\nimport {\n RealmFileApprovedStatusSchema,\n RealmFilePendingApprovalStatusSchema,\n RealmFileActiveStatusSchema,\n REALM_FILE_PENDING_APPROVAL_STATUS,\n ContentMediaKindSchema,\n} from '../doc-schemas/media-assets.js';\n\n// ===========================================================================\n// S7 realm shared-files gallery (ARTISAN-ONLY, plus a full-admin bypass for the admin-only\n// un-share support action). `mediaAssets` is client-unreadable, so the gallery reads\n// realm-shared work files via THIS server projection callable (never a client query) — and\n// for the same reason the Realm's FOLDER documents are returned through the same projection\n// owner rather than opened to direct client reads: artisan / admin / hidden-Realm access is\n// decided in ONE backend owner.\n//\n// Serving is the `'artisan'` media tier (mutate-in-place scoped→artisan at APPROVAL — see the\n// approval gate below). V1 = view + download, grouped by the steward's folders.\n// ===========================================================================\n\n/** One APPROVED shared file. Accepts only the two approved standings — a pending or\n * unshared row is structurally inexpressible in this response. */\nexport const RealmSharedFileProjectionSchema = z.object({\n mediaAssetId: mediaAssetIdSchema,\n // The canonical stored media kind — RealmSharedFileProjection is a projection OF a\n // MediaAsset, so it shares the ONE ContentMediaKindSchema.\n mediaKind: ContentMediaKindSchema,\n // Never the full status union: 'nonCanon' | 'canon' only.\n realmFileCanonStatus: RealmFileApprovedStatusSchema,\n /** The Work file's own `name`. A file browser that groups unnamed thumbnails by folder is\n * not a file browser — the name is part of the projection, not something the client is\n * expected to resolve. (It is file metadata, NOT display identity: creator names and\n * avatars still resolve at render from `creatorUid`.) */\n name: z.string(),\n /** The steward-assigned folder this file sits in. Always present — approval IS folder\n * assignment, so an approved file without a folder cannot exist. */\n realmFileFolderId: realmFileFolderIdSchema,\n creatorUid: userIdSchema,\n /** The asset's `createdAt` (epoch ms): the gallery reads newest first by it, then by\n * `mediaAssetId`, so a row entering the gallery is placed in that order. */\n createdAt: z.number(),\n // For the per-file steward canon toggle + download (updateWorkFileRealmCanon takes these).\n workProjectId: workProjectIdSchema,\n workFileId: z.string(),\n}).strict();\nexport type RealmSharedFileProjection = z.infer<typeof RealmSharedFileProjectionSchema>;\n\n/** A Realm shared-file folder as the gallery sees it. The FOLDER DOCUMENT stores no counts;\n * `fileCount` here is SERVER-COMPUTED per response, so it can never drift the way a stored\n * counter would. */\nexport const RealmFileFolderProjectionSchema = z.object({\n realmFileFolderId: realmFileFolderIdSchema,\n name: z.string(),\n /** Number of files currently ASSIGNED to this folder — counting every assigned file\n * regardless of canon state and regardless of serving state (a hidden or quarantined file\n * still occupies its folder, and is still why a delete-folder attempt will refuse).\n * Server-computed so the steward UI stops deriving counts from whichever gallery pages\n * happen to be loaded — a paged client can only ever see part of a folder. */\n fileCount: z.number().int().min(0),\n}).strict();\nexport type RealmFileFolderProjection = z.infer<typeof RealmFileFolderProjectionSchema>;\n\n// Paginated: the pre-approval-gate query was unbounded. `limit` is bounded by the ONE named\n// page constant the server also clamps to, and `cursor` is an OPAQUE server-minted token —\n// the client never constructs or interprets it, so the ordering fields stay a server detail.\nexport const GetRealmSharedFilesInputSchema = z.object({\n realmId: workRealmIdSchema,\n limit: z.number().int().min(1).max(REALM_SHARED_FILES_PAGE_LIMIT).optional(),\n cursor: z.string().min(1).optional(),\n}).strict();\nexport type GetRealmSharedFilesInput = z.infer<typeof GetRealmSharedFilesInputSchema>;\n\n/** `{ files }` is preserved as-is; `folders` and `nextCursor` are ADDITIVE. `folders` is the\n * Realm's complete folder set (bounded by MAX_REALM_FILE_FOLDERS), not a page — the gallery\n * must be able to render an empty folder, and the steward must see one to move files into.\n * `nextCursor` is absent/null on the last page. */\nexport const GetRealmSharedFilesResponseSchema = z.object({\n files: z.array(RealmSharedFileProjectionSchema),\n folders: z.array(RealmFileFolderProjectionSchema),\n nextCursor: z.string().min(1).nullable().optional(),\n}).strict();\nexport type GetRealmSharedFilesResponse = z.infer<typeof GetRealmSharedFilesResponseSchema>;\n\n// ---- realm-file promotion queue (steward / full admin) ---------------------------------\n// A SEPARATE bounded projection rather than an `includePending` flag on the artisan gallery:\n// a caller-controlled flag would put \"may this caller see pending rows\" in the client's\n// hands. Ordinary artisans can never enumerate pending requests.\n\n/** One AWAITING-DECISION request. Accepts only the pending-approval standing (via\n * RealmFilePendingApprovalStatusSchema) — an approved or unshared row is structurally\n * inexpressible in the queue. */\nexport const RealmFilePromotionQueueRowSchema = z.object({\n mediaAssetId: mediaAssetIdSchema,\n mediaKind: ContentMediaKindSchema,\n realmFileCanonStatus: RealmFilePendingApprovalStatusSchema,\n /** The Work file's own name — the steward decides on a named file, not a thumbnail. */\n name: z.string(),\n creatorUid: userIdSchema,\n workProjectId: workProjectIdSchema,\n workFileId: z.string(),\n /** Echoed so the approve/decline call can carry the exact observed request id; a stale tab\n * deciding a superseded request is then a visible conflict, not a silent overwrite. */\n realmFileShareRequestId: realmFileShareRequestIdSchema,\n /** The RECORDED requester — the resolution notification is addressed from this, never\n * guessed from the uploader. */\n realmFileShareRequestedByUid: userIdSchema,\n realmFileShareRequestedAt: z.number(),\n}).strict();\nexport type RealmFilePromotionQueueRow = z.infer<typeof RealmFilePromotionQueueRowSchema>;\n\nexport const GetRealmFilePromotionQueueInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n limit: z.number().int().min(1).max(REALM_FILE_PROMOTION_QUEUE_PAGE_LIMIT).optional(),\n cursor: z.string().min(1).optional(),\n}).strict();\nexport type GetRealmFilePromotionQueueInput = z.infer<typeof GetRealmFilePromotionQueueInputSchema>;\n\n/** `folders` rides along so the approval UI can offer the folder picker (and detect the\n * \"no folders yet\" state) without a second round-trip. */\nexport const GetRealmFilePromotionQueueResponseSchema = z.object({\n requests: z.array(RealmFilePromotionQueueRowSchema),\n folders: z.array(RealmFileFolderProjectionSchema),\n nextCursor: z.string().min(1).nullable().optional(),\n}).strict();\nexport type GetRealmFilePromotionQueueResponse = z.infer<typeof GetRealmFilePromotionQueueResponseSchema>;\n\n// ---- WORK-side share-state projection --------------------------------------------------\n// The mirror image of the two Realm-side projections above, for the WORK's own files surface:\n// a file admin looking at their folder listing needs to know which files are already shared\n// or awaiting a steward decision, so the row can show \"Requested\" / \"Shared\" and offer\n// withdraw where it applies.\n//\n// It is a SERVER projection for the same reason the gallery is: `mediaAssets` is\n// client-unreadable, so share state cannot be read from the file document. File-admin\n// authorization is asserted in the callable; this shape carries no authority hint.\n\n/** One work file's realm-share state.\n *\n * The `requestId` is present EXACTLY while the file is awaiting a decision — it is what the\n * withdraw call must carry, and it is meaningless once the request is resolved. Enforced\n * rather than merely optional, mirroring the asset's own legal-combination invariant, so the\n * UI can never be handed a pending row with nothing to withdraw (or an approved row carrying\n * a stale request id it might send).\n *\n * `workFileId` uses plain `z.string()` like the sibling projection rows in this file\n * (inputs use `.min(1)`; projection rows describe server-produced data). */\nexport const WorkFileRealmShareStateSchema = z.object({\n workFileId: z.string(),\n // Never `none`: an unshared file simply has no row (see the response below).\n realmFileCanonStatus: RealmFileActiveStatusSchema,\n realmFileShareRequestId: realmFileShareRequestIdSchema.optional(),\n}).strict().superRefine((val, ctx) => {\n const isPending = val.realmFileCanonStatus === REALM_FILE_PENDING_APPROVAL_STATUS;\n if (isPending && val.realmFileShareRequestId === undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['realmFileShareRequestId'],\n message: 'a pending row must carry its request id — it is what the withdraw call compares against',\n });\n }\n if (!isPending && val.realmFileShareRequestId !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['realmFileShareRequestId'],\n message: 'a resolved row must not carry a request id — the request is no longer pending',\n });\n }\n});\nexport type WorkFileRealmShareState = z.infer<typeof WorkFileRealmShareStateSchema>;\n\nexport const GetWorkFileRealmShareStatesInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n}).strict();\nexport type GetWorkFileRealmShareStatesInput = z.infer<typeof GetWorkFileRealmShareStatesInputSchema>;\n\n/** Rows exist ONLY for files whose standing is not `none`. An ABSENT row therefore means the\n * file has never been requested or shared — that is the encoding, so the client must treat a\n * missing entry as \"not shared\" rather than \"unknown\". Bounded implicitly by the Work's own\n * file cap (MAX_WORK_FILES), so this response needs no page cursor of its own. */\nexport const GetWorkFileRealmShareStatesResponseSchema = z.object({\n states: z.array(WorkFileRealmShareStateSchema),\n}).strict();\nexport type GetWorkFileRealmShareStatesResponse = z.infer<typeof GetWorkFileRealmShareStatesResponseSchema>;\n\n// ---- what a Realm-file action changed ------------------------------------------------------\n// The gallery and the steward's queue are endless lists a client patches in place, never reloads\n// (FRONTEND-103); their rows are server projections the client cannot read, so every action that\n// changes a file's standing answers with the file's row in each list after it, built by the same\n// projection owners the reads use.\n\n/**\n * One file's rows after an action: its gallery row, its queue row, and its Work-side share state —\n * each `null` when the file is absent from that list — plus every folder whose server-computed\n * `fileCount` the action changed (an approval, a move, or an un-share), as the gallery shows it.\n * Each row is non-null only when the file passes that list's own read filters — `sharedFile` only\n * for an approved file whose serving status is `servable`, so an action on a hidden or quarantined\n * file never puts it back into a gallery the read would not show it in.\n */\nexport const RealmFileListsChangeSchema = z.object({\n mediaAssetId: mediaAssetIdSchema,\n workProjectId: workProjectIdSchema,\n workFileId: z.string(),\n sharedFile: RealmSharedFileProjectionSchema.nullable(),\n promotionRequest: RealmFilePromotionQueueRowSchema.nullable(),\n shareState: WorkFileRealmShareStateSchema.nullable(),\n folders: z.array(RealmFileFolderProjectionSchema),\n}).strict();\nexport type RealmFileListsChange = z.infer<typeof RealmFileListsChangeSchema>;\n\n/** The answer of every action that changes a file's Realm standing: request, withdraw, approve,\n * decline, canon toggle, folder move, and the admin un-share. Non-strict (server → client). */\nexport const RealmFileTransitionResultSchema = z.object({\n success: z.literal(true),\n change: RealmFileListsChangeSchema,\n});\nexport type RealmFileTransitionResult = z.infer<typeof RealmFileTransitionResultSchema>;\n\n/** The answer of a Realm folder create or rename: the folder as the gallery shows it. */\nexport const RealmFileFolderResultSchema = z.object({\n success: z.literal(true),\n folder: RealmFileFolderProjectionSchema,\n});\nexport type RealmFileFolderResult = z.infer<typeof RealmFileFolderResultSchema>;\n\n/** The answer of a Realm folder delete: the folder it removed. */\nexport const DeleteRealmFileFolderResultSchema = z.object({\n success: z.literal(true),\n realmFileFolderId: realmFileFolderIdSchema,\n});\nexport type DeleteRealmFileFolderResult = z.infer<typeof DeleteRealmFileFolderResultSchema>;\n\nconst baseFields = {\n workingTitle: z.string().min(1).max(MAX_WORK_PROJECT_TITLE_LENGTH),\n workingDescription: z.string().min(1).max(MAX_WORK_PROJECT_DESCRIPTION_LENGTH),\n workProjectType: workProjectTypeSchema,\n hallWingType: hallWingTypeSchema,\n};\n\n// A Realm working title is reserved under `reservedRealmNames/{UPPER(title)}` — the\n// UPPERCASED title IS the Firestore doc ID (runCreateWorkRealm.reservedRealmNameRef).\n// Firestore doc IDs cannot contain `/` and cannot be exactly `.` or `..`, so a title\n// that would produce an invalid/ambiguous doc ID must be rejected at the callable\n// boundary (both the create transaction and the soft availability check) rather than\n// hard-failing with an opaque `internal` error deep inside ref construction. Length\n// derives from MAX_WORK_REALM_TITLE_LENGTH; only the doc-ID-breaking characters are\n// forbidden. Keep CheckRealmNameAvailableInputSchema in lockstep so a valid-at-create\n// name is never rejected at form time (and vice-versa).\nexport const realmWorkingTitleSchema = z\n .string()\n .min(1)\n .max(MAX_WORK_REALM_TITLE_LENGTH)\n .refine((v) => !v.includes('/'), { message: 'Realm name cannot contain a slash (/).' })\n .refine((v) => v !== '.' && v !== '..', { message: 'Realm name cannot be \".\" or \"..\".' });\n\nexport const RealmCreationModeSchema = z.enum([\n 'newPublicRealm',\n 'newStandaloneRealm',\n 'existingPublicRealm',\n]);\nexport type RealmCreationMode = z.infer<typeof RealmCreationModeSchema>;\n\nexport const CreateWorkProjectInputSchema = z.discriminatedUnion('realmCreationMode', [\n z.object({\n ...baseFields,\n realmCreationMode: z.literal('newPublicRealm'),\n realmWorkingTitle: realmWorkingTitleSchema,\n realmWorkingDescription: z.string().min(1).max(MAX_WORK_REALM_DESCRIPTION_LENGTH),\n }).strict(),\n // Standalone realms are background plumbing (DJ ruling 2026-07-19): the user enters NO\n // realm information — the backend creates the realm shell with a synthetic unique\n // title/description (the generated workRealmId), so nothing user-authored exists on it\n // and no human realm name is consumed from the reservedRealmNames namespace.\n z.object({\n ...baseFields,\n realmCreationMode: z.literal('newStandaloneRealm'),\n }).strict(),\n z.object({\n ...baseFields,\n realmCreationMode: z.literal('existingPublicRealm'),\n workRealmId: workRealmIdSchema,\n }).strict(),\n]);\nexport type CreateWorkProjectInput = z.infer<typeof CreateWorkProjectInputSchema>;\n\n/** The `createWorkProject` answer: the new Work's id and its stored document, which that id names. */\nexport const CreateWorkProjectResultSchema = z\n .object({\n success: z.literal(true),\n workProjectId: workProjectIdSchema,\n workProjectData: FullWorkProjectSchema,\n })\n .strict()\n .superRefine((result, ctx) => {\n if (result.workProjectData.workProjectId !== result.workProjectId) {\n ctx.addIssue({ code: 'custom', path: ['workProjectData', 'workProjectId'] });\n }\n });\nexport type CreateWorkProjectResult = z.infer<typeof CreateWorkProjectResultSchema>;\n\n// Identified by the workAssets subcollection doc id — never by URL parsing\n// (no delete path may depend on a URL; see media-assets-and-protected-serving.md).\nexport const DeleteWorkAssetInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n workAssetId: documentIdSegmentSchema,\n}).strict();\nexport type DeleteWorkAssetInput = z.infer<typeof DeleteWorkAssetInputSchema>;\n\nexport const InviteSourceSchema = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('standalone'),\n }).strict(),\n z.object({\n type: z.literal('craftSkill'),\n data: z.object({\n craftSkillId: craftSkillIdSchema,\n craftSkillOwnerUserId: userIdSchema,\n craftSkillName: z.string().min(1).max(MAX_CRAFT_SKILL_NAME_LENGTH),\n }).strict(),\n }).strict(),\n z.object({\n type: z.literal('commission'),\n // Titles are NOT snapshotted here (Display Identity Invariant — client display text\n // must be re-sourced at render by id). `postingStakeSharesOffered` is not display text;\n // the server re-sources it from the posting doc in the invite transaction (never trusts\n // the client copy) — kept so the shape stays server-writable.\n data: z.object({\n commissionListingId: commissionListingIdSchema,\n commissionProposalId: commissionProposalIdSchema,\n proposalArtisanUserId: userIdSchema,\n postingStakeSharesOffered: z.number().int().min(1),\n }).strict(),\n }).strict(),\n z.object({\n type: z.literal('audition'),\n data: z.object({\n auditionId: auditionIdSchema,\n auditionEntryId: auditionEntryIdSchema,\n respondentUserId: userIdSchema,\n postingStakeSharesOffered: z.number().int().min(1),\n }).strict(),\n }).strict(),\n]);\nexport type InviteSource = z.infer<typeof InviteSourceSchema>;\nexport type InviteSourceType = InviteSource['type'];\n\nexport const InviteUserToGuildInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n inviteeUid: userIdSchema,\n message: z.string().min(1).max(MAX_GUILD_INVITE_MESSAGE_LENGTH),\n stakeSharesOffered: z.number().int().min(1),\n source: InviteSourceSchema,\n}).strict();\nexport type InviteUserToGuildInput = z.infer<typeof InviteUserToGuildInputSchema>;\n\n// `finalized` is the terminal SUCCESS state (`accepted` is a transient state a trigger\n// consumes within seconds). Managers must be able to list finalized invites to see the\n// guild's actual recruitment history — not only failures and in-flight items. Derives from\n// the ONE canonical status enum (schemas/atoms.ts), never a re-declared literal.\n// The history is paged: the server reads `ITEMS_PER_PAGE_GUILD_INVITES` invites per call (the\n// caller sends no page size), and `cursor` is the opaque token the previous page answered.\n// The result is `ListGuildInvitesResultSchema` (doc-schemas/messaging, beside the invite doc).\nexport const ListGuildInvitesInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n statuses: z.array(guildInviteConversationStatusSchema).min(1),\n cursor: z.string().min(1).optional(),\n}).strict();\nexport type ListGuildInvitesInput = z.infer<typeof ListGuildInvitesInputSchema>;\n\nexport const UpdateGuildmateTradeProfessionsInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n userId: userIdSchema,\n tradeProfession: z.enum(TRADE_PROFESSION_VALUES),\n action: addRemoveActionSchema,\n}).strict();\nexport type UpdateGuildmateTradeProfessionsInput = z.infer<typeof UpdateGuildmateTradeProfessionsInputSchema>;\n\nconst GUILD_STANDING_VALUES_ENUM = GUILD_STANDING_VALUES as [typeof GUILD_STANDING_VALUES[number], ...typeof GUILD_STANDING_VALUES[number][]];\n\nexport const UpdateGuildmateStandingInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n userId: userIdSchema,\n guildStanding: z.enum(GUILD_STANDING_VALUES_ENUM),\n action: addRemoveActionSchema,\n}).strict();\nexport type UpdateGuildmateStandingInput = z.infer<typeof UpdateGuildmateStandingInputSchema>;\n\n// Member self-leave (leaveWorkProject). The leaver is ALWAYS request.auth.uid — never a\n// client-supplied uid (invariant 3) — so the input carries only the workProjectId. The\n// callable composes the internal `depart` stake-share operation for ctx.uid.\nexport const LeaveWorkProjectInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n}).strict();\nexport type LeaveWorkProjectInput = z.infer<typeof LeaveWorkProjectInputSchema>;\n\nexport const UpdatePublicWorkProjectDetailsInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n workingTitle: z.string().min(1).max(MAX_WORK_PROJECT_TITLE_LENGTH),\n workingDescription: z.string().min(1).max(MAX_WORK_PROJECT_DESCRIPTION_LENGTH),\n}).strict();\nexport type UpdatePublicWorkProjectDetailsInput = z.infer<typeof UpdatePublicWorkProjectDetailsInputSchema>;\n\nexport const UpdateWorkRealmDetailsInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n workingTitle: z.string().min(1).max(MAX_WORK_REALM_TITLE_LENGTH),\n workingDescription: z.string().min(1).max(MAX_WORK_REALM_DESCRIPTION_LENGTH),\n}).strict();\nexport type UpdateWorkRealmDetailsInput = z.infer<typeof UpdateWorkRealmDetailsInputSchema>;\n\n// Unauthenticated soft-check for a Realm working title. Must match the authoritative\n// realmWorkingTitle contract in CreateWorkProjectInputSchema (realmWorkingTitleSchema:\n// MAX_WORK_REALM_TITLE_LENGTH, rejecting the doc-ID-breaking `/` and reserved `.`/`..`). Never be\n// stricter than the create transaction or a valid-at-create name would be rejected at\n// form time — reuse the SAME schema so the two can never drift.\nexport const CheckRealmNameAvailableInputSchema = z.object({\n workingTitle: realmWorkingTitleSchema,\n}).strict();\nexport type CheckRealmNameAvailableInput = z.infer<typeof CheckRealmNameAvailableInputSchema>;\n\n// ---- work-project file folders (S7) ---------------------------------------------------\n// The default \"All Guildmates\" folder is immutable; custom-folder access is by trade\n// profession. All four callables require a file-admin standing via assertCanManageFolders.\n\nconst tradeProfessionListSchema = z\n .array(z.enum(TRADE_PROFESSION_VALUES))\n .max(TRADE_PROFESSION_OPTIONS.length);\n\nexport const CreateFileFolderInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n name: z.string().min(1).max(MAX_FILE_FOLDER_NAME_LENGTH),\n canViewTradeProfessions: tradeProfessionListSchema,\n canUploadTradeProfessions: tradeProfessionListSchema,\n canDeleteTradeProfessions: tradeProfessionListSchema,\n}).strict();\nexport type CreateFileFolderInput = z.infer<typeof CreateFileFolderInputSchema>;\n\nexport const RenameFileFolderInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n folderId: workFileFolderIdSchema,\n name: z.string().min(1).max(MAX_FILE_FOLDER_NAME_LENGTH),\n}).strict();\nexport type RenameFileFolderInput = z.infer<typeof RenameFileFolderInputSchema>;\n\nexport const UpdateFolderProfessionsInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n folderId: workFileFolderIdSchema,\n canViewTradeProfessions: tradeProfessionListSchema,\n canUploadTradeProfessions: tradeProfessionListSchema,\n canDeleteTradeProfessions: tradeProfessionListSchema,\n}).strict();\nexport type UpdateFolderProfessionsInput = z.infer<typeof UpdateFolderProfessionsInputSchema>;\n\nexport const DeleteFileFolderInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n folderId: workFileFolderIdSchema,\n}).strict();\nexport type DeleteFileFolderInput = z.infer<typeof DeleteFileFolderInputSchema>;\n\n// ---- realm shared files ---------------------------------------------------------------\n\n// Delete a single work file (by folder + file id). File-admin authz is enforced in the\n// callable/core transaction.\nexport const DeleteWorkFileInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n folderId: workFileFolderIdSchema,\n workFileId: workFileIdSchema,\n}).strict();\nexport type DeleteWorkFileInput = z.infer<typeof DeleteWorkFileInputSchema>;\n\n// Set canon status on a realm shared file. Realm-steward-only authz is enforced inside the\n// core's transaction against workRealms/{workRealmId}.workStewardUid.\nexport const UpdateWorkFileRealmCanonInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n mediaAssetId: mediaAssetIdSchema,\n canon: z.boolean(),\n}).strict();\nexport type UpdateWorkFileRealmCanonInput = z.infer<typeof UpdateWorkFileRealmCanonInputSchema>;\n\n// ---- the promotion approval gate -------------------------------------------------------\n// Promotion is a REQUEST, not an instant share: the Work file admin asks, and the REALM\n// steward approves (choosing the folder) or declines. Nothing is served to the Realm until\n// approval — a requested file stays `scoped` and invisible to the member gallery.\n//\n// Every one of these carries the `requestId` so a decision always names the exact request it\n// observed. Realm-side authority (steward, public + non-hidden Realm) is derived from the\n// Realm document inside each core's transaction; these shapes carry no authority hints.\n\n// REQUEST promotion of a work file into its Realm's shared-file pool. File-admin authz\n// (`workFile.promoteToRealm`) is enforced inside the core's transaction.\n// `requestId` is CLIENT-generated and stable: replaying the same id is an idempotent success\n// (no second audit event, no second notification), while a DIFFERENT id arriving while one\n// request is already pending is a conflict — never a silent overwrite.\nexport const UpdateWorkFileRealmShareInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n workFileId: workFileIdSchema,\n requestId: realmFileShareRequestIdSchema,\n}).strict();\nexport type UpdateWorkFileRealmShareInput = z.infer<typeof UpdateWorkFileRealmShareInputSchema>;\n\n// WITHDRAW a still-pending request (the requesting Work's file admin). Realm-share\n// permanence begins at APPROVAL — before a steward decides, an accidental request must be\n// correctable by the side that made it. Addressed by Work coordinates like the request\n// itself, and compares `requestId` so a withdrawal can never cancel a newer re-request.\nexport const WithdrawRealmFilePromotionRequestInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n workFileId: workFileIdSchema,\n requestId: realmFileShareRequestIdSchema,\n}).strict();\nexport type WithdrawRealmFilePromotionRequestInput = z.infer<typeof WithdrawRealmFilePromotionRequestInputSchema>;\n\n// APPROVE a pending request (Realm steward). Approval assigns the folder — there is no\n// default folder, so `realmFileFolderId` is REQUIRED and the core verifies the folder is\n// under this exact Realm before flipping the file to `nonCanon` + the artisan tier.\nexport const ApproveRealmFilePromotionInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n mediaAssetId: mediaAssetIdSchema,\n realmFileFolderId: realmFileFolderIdSchema,\n requestId: realmFileShareRequestIdSchema,\n}).strict();\nexport type ApproveRealmFilePromotionInput = z.infer<typeof ApproveRealmFilePromotionInputSchema>;\n\n// DECLINE a pending request (Realm steward). Returns the file to `none` and clears the Realm\n// + request fields. No folder is involved — a declined file never entered the pool.\nexport const DeclineRealmFilePromotionInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n mediaAssetId: mediaAssetIdSchema,\n requestId: realmFileShareRequestIdSchema,\n}).strict();\nexport type DeclineRealmFilePromotionInput = z.infer<typeof DeclineRealmFilePromotionInputSchema>;\n\n// ADMIN un-share of an ALREADY-APPROVED realm file (`adminUpdateWorkFileRealmUnshare`).\n// Once a steward approves, sharing is PERMANENT for members — the only way out is an admin\n// acting on a support thread. This is its own input rather than a reuse of the share/request\n// shape: an approved file has NO pending request, so `requestId` is meaningless here and\n// requiring one would make the callable unusable against exactly the state it exists to\n// unwind. It carries the ORIGINAL two-field Work-coordinate shape the share input had before\n// the approval gate; the core resolves the file by collection-group query on\n// (`workProjectId`, `workFileId`). Admin authority is asserted at the callable's admin gate\n// and re-asserted in the core (which rejects any non-`adminOverride` actor) — never inferred\n// from anything in this payload.\nexport const AdminUpdateWorkFileRealmUnshareInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n workFileId: workFileIdSchema,\n}).strict();\nexport type AdminUpdateWorkFileRealmUnshareInput = z.infer<typeof AdminUpdateWorkFileRealmUnshareInputSchema>;\n\n// ---- realm shared-file folders (steward-managed) ---------------------------------------\n// Mirrors the Work-side folder CRUD shapes, minus the trade-profession access lists: Realm\n// folders are organizational only (Realm-level visibility is the whole access model at\n// launch). Names reuse the ONE platform folder-name bound; the server derives\n// `name_lowercase` and enforces case-insensitive uniqueness within the Realm.\n\nexport const CreateRealmFileFolderInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n name: z.string().min(1).max(MAX_FILE_FOLDER_NAME_LENGTH),\n}).strict();\nexport type CreateRealmFileFolderInput = z.infer<typeof CreateRealmFileFolderInputSchema>;\n\n/** Rename. `update*` per BACKEND-305 — it modifies an existing doc in place. */\nexport const UpdateRealmFileFolderInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n realmFileFolderId: realmFileFolderIdSchema,\n name: z.string().min(1).max(MAX_FILE_FOLDER_NAME_LENGTH),\n}).strict();\nexport type UpdateRealmFileFolderInput = z.infer<typeof UpdateRealmFileFolderInputSchema>;\n\n/** Delete requires the folder to be EMPTY (the steward moves files out first) — no surprise\n * data moves and no reassignment-target picker at launch. Emptiness is proven by an\n * in-transaction query for ANY asset carrying this folder id, regardless of serving/hidden/\n * canon state: a hidden file still occupies its folder. */\nexport const DeleteRealmFileFolderInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n realmFileFolderId: realmFileFolderIdSchema,\n}).strict();\nexport type DeleteRealmFileFolderInput = z.infer<typeof DeleteRealmFileFolderInputSchema>;\n\n/** Move an approved shared file between folders. `expectedRealmFileFolderId` is a\n * compare-and-set precondition — a steward acting on a stale view must not silently undo a\n * move made from another tab. */\nexport const UpdateRealmFileFolderAssignmentInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n mediaAssetId: mediaAssetIdSchema,\n expectedRealmFileFolderId: realmFileFolderIdSchema,\n realmFileFolderId: realmFileFolderIdSchema,\n}).strict();\nexport type UpdateRealmFileFolderAssignmentInput = z.infer<typeof UpdateRealmFileFolderAssignmentInputSchema>;\n\n\n"]}
|
|
1
|
+
{"version":3,"file":"work-project-management.js","sourceRoot":"","sources":["../../src/schemas/work-project-management.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC1B,gBAAgB,EAChB,qBAAqB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{\n workProjectIdSchema,\n userIdSchema,\n addRemoveActionSchema,\n workProjectTypeSchema,\n hallWingTypeSchema,\n commissionListingIdSchema,\n commissionProposalIdSchema,\n auditionIdSchema,\n auditionEntryIdSchema,\n craftSkillIdSchema,\n guildInviteConversationStatusSchema,\n mediaAssetIdSchema,\n workRealmIdSchema,\n realmFileFolderIdSchema,\n realmFileShareRequestIdSchema,\n documentIdSegmentSchema,\n workFileFolderIdSchema,\n workFileIdSchema,\n} from './atoms.js';\nimport { TRADE_PROFESSION_OPTIONS, TRADE_PROFESSION_VALUES } from '../constants/options.js';\nimport { GUILD_STANDING_VALUES } from '../permissions/index.js';\nimport { FullWorkProjectSchema } from '../doc-schemas/work-project.js';\nimport {\n MAX_GUILD_INVITE_MESSAGE_LENGTH,\n MAX_WORK_PROJECT_TITLE_LENGTH,\n MAX_WORK_PROJECT_DESCRIPTION_LENGTH,\n MAX_WORK_REALM_TITLE_LENGTH,\n MAX_WORK_REALM_DESCRIPTION_LENGTH,\n MAX_CRAFT_SKILL_NAME_LENGTH,\n MAX_FILE_FOLDER_NAME_LENGTH,\n} from '../constants/business.js';\nimport {\n REALM_SHARED_FILES_PAGE_LIMIT,\n REALM_FILE_PROMOTION_QUEUE_PAGE_LIMIT,\n} from '../constants/pagination.js';\nimport {\n RealmFileApprovedStatusSchema,\n RealmFilePendingApprovalStatusSchema,\n RealmFileActiveStatusSchema,\n REALM_FILE_PENDING_APPROVAL_STATUS,\n ContentMediaKindSchema,\n} from '../doc-schemas/media-assets.js';\n\n// ===========================================================================\n// S7 realm shared-files gallery (ARTISAN-ONLY, plus a full-admin bypass for the admin-only\n// un-share support action). `mediaAssets` is client-unreadable, so the gallery reads\n// realm-shared work files via THIS server projection callable (never a client query) — and\n// for the same reason the Realm's FOLDER documents are returned through the same projection\n// owner rather than opened to direct client reads: artisan / admin / hidden-Realm access is\n// decided in ONE backend owner.\n//\n// Serving is the `'artisan'` media tier (mutate-in-place scoped→artisan at APPROVAL — see the\n// approval gate below). V1 = view + download, grouped by the steward's folders.\n// ===========================================================================\n\n/** One APPROVED shared file. Accepts only the two approved standings — a pending or\n * unshared row is structurally inexpressible in this response. */\nexport const RealmSharedFileProjectionSchema = z.object({\n mediaAssetId: mediaAssetIdSchema,\n // The canonical stored media kind — RealmSharedFileProjection is a projection OF a\n // MediaAsset, so it shares the ONE ContentMediaKindSchema.\n mediaKind: ContentMediaKindSchema,\n // Never the full status union: 'nonCanon' | 'canon' only.\n realmFileCanonStatus: RealmFileApprovedStatusSchema,\n /** The Work file's own `name`. A file browser that groups unnamed thumbnails by folder is\n * not a file browser — the name is part of the projection, not something the client is\n * expected to resolve. (It is file metadata, NOT display identity: creator names and\n * avatars still resolve at render from `creatorUid`.) */\n name: z.string(),\n /** The steward-assigned folder this file sits in. Always present — approval IS folder\n * assignment, so an approved file without a folder cannot exist. */\n realmFileFolderId: realmFileFolderIdSchema,\n creatorUid: userIdSchema,\n /** The asset's `createdAt` (epoch ms): the gallery reads newest first by it, then by\n * `mediaAssetId`, so a row entering the gallery is placed in that order. */\n createdAt: z.number(),\n // For the per-file steward canon toggle + download (updateWorkFileRealmCanon takes these).\n workProjectId: workProjectIdSchema,\n workFileId: z.string(),\n}).strict();\nexport type RealmSharedFileProjection = z.infer<typeof RealmSharedFileProjectionSchema>;\n\n/** A Realm shared-file folder as the gallery sees it. The FOLDER DOCUMENT stores no counts;\n * `fileCount` here is SERVER-COMPUTED per response, so it can never drift the way a stored\n * counter would. */\nexport const RealmFileFolderProjectionSchema = z.object({\n realmFileFolderId: realmFileFolderIdSchema,\n name: z.string(),\n /** Number of files currently ASSIGNED to this folder — counting every assigned file\n * regardless of canon state and regardless of serving state (a hidden or quarantined file\n * still occupies its folder, and is still why a delete-folder attempt will refuse).\n * Server-computed so the steward UI stops deriving counts from whichever gallery pages\n * happen to be loaded — a paged client can only ever see part of a folder. */\n fileCount: z.number().int().min(0),\n}).strict();\nexport type RealmFileFolderProjection = z.infer<typeof RealmFileFolderProjectionSchema>;\n\n// Paginated: the pre-approval-gate query was unbounded. `limit` is bounded by the ONE named\n// page constant the server also clamps to, and `cursor` is an OPAQUE server-minted token —\n// the client never constructs or interprets it, so the ordering fields stay a server detail.\nexport const GetRealmSharedFilesInputSchema = z.object({\n realmId: workRealmIdSchema,\n limit: z.number().int().min(1).max(REALM_SHARED_FILES_PAGE_LIMIT).optional(),\n cursor: z.string().min(1).optional(),\n}).strict();\nexport type GetRealmSharedFilesInput = z.infer<typeof GetRealmSharedFilesInputSchema>;\n\n/** `{ files }` is preserved as-is; `folders` and `nextCursor` are ADDITIVE. `folders` is the\n * Realm's complete folder set (bounded by MAX_REALM_FILE_FOLDERS), not a page — the gallery\n * must be able to render an empty folder, and the steward must see one to move files into.\n * `nextCursor` is absent/null on the last page. */\nexport const GetRealmSharedFilesResponseSchema = z.object({\n files: z.array(RealmSharedFileProjectionSchema),\n folders: z.array(RealmFileFolderProjectionSchema),\n nextCursor: z.string().min(1).nullable().optional(),\n}).strict();\nexport type GetRealmSharedFilesResponse = z.infer<typeof GetRealmSharedFilesResponseSchema>;\n\n// ---- realm-file promotion queue (steward / full admin) ---------------------------------\n// A SEPARATE bounded projection rather than an `includePending` flag on the artisan gallery:\n// a caller-controlled flag would put \"may this caller see pending rows\" in the client's\n// hands. Ordinary artisans can never enumerate pending requests.\n\n/** One AWAITING-DECISION request. Accepts only the pending-approval standing (via\n * RealmFilePendingApprovalStatusSchema) — an approved or unshared row is structurally\n * inexpressible in the queue. */\nexport const RealmFilePromotionQueueRowSchema = z.object({\n mediaAssetId: mediaAssetIdSchema,\n mediaKind: ContentMediaKindSchema,\n realmFileCanonStatus: RealmFilePendingApprovalStatusSchema,\n /** The Work file's own name — the steward decides on a named file, not a thumbnail. */\n name: z.string(),\n creatorUid: userIdSchema,\n workProjectId: workProjectIdSchema,\n workFileId: z.string(),\n /** Echoed so the approve/decline call can carry the exact observed request id; a stale tab\n * deciding a superseded request is then a visible conflict, not a silent overwrite. */\n realmFileShareRequestId: realmFileShareRequestIdSchema,\n /** The RECORDED requester — the resolution notification is addressed from this, never\n * guessed from the uploader. */\n realmFileShareRequestedByUid: userIdSchema,\n realmFileShareRequestedAt: z.number(),\n}).strict();\nexport type RealmFilePromotionQueueRow = z.infer<typeof RealmFilePromotionQueueRowSchema>;\n\nexport const GetRealmFilePromotionQueueInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n limit: z.number().int().min(1).max(REALM_FILE_PROMOTION_QUEUE_PAGE_LIMIT).optional(),\n cursor: z.string().min(1).optional(),\n}).strict();\nexport type GetRealmFilePromotionQueueInput = z.infer<typeof GetRealmFilePromotionQueueInputSchema>;\n\n/** `folders` rides along so the approval UI can offer the folder picker (and detect the\n * \"no folders yet\" state) without a second round-trip. */\nexport const GetRealmFilePromotionQueueResponseSchema = z.object({\n requests: z.array(RealmFilePromotionQueueRowSchema),\n folders: z.array(RealmFileFolderProjectionSchema),\n nextCursor: z.string().min(1).nullable().optional(),\n}).strict();\nexport type GetRealmFilePromotionQueueResponse = z.infer<typeof GetRealmFilePromotionQueueResponseSchema>;\n\n// ---- WORK-side share-state projection --------------------------------------------------\n// The mirror image of the two Realm-side projections above, for the WORK's own files surface:\n// a file admin looking at their folder listing needs to know which files are already shared\n// or awaiting a steward decision, so the row can show \"Requested\" / \"Shared\" and offer\n// withdraw where it applies.\n//\n// It is a SERVER projection for the same reason the gallery is: `mediaAssets` is\n// client-unreadable, so share state cannot be read from the file document. File-admin\n// authorization is asserted in the callable; this shape carries no authority hint.\n\n/** One work file's realm-share state.\n *\n * The `requestId` is present EXACTLY while the file is awaiting a decision — it is what the\n * withdraw call must carry, and it is meaningless once the request is resolved. Enforced\n * rather than merely optional, mirroring the asset's own legal-combination invariant, so the\n * UI can never be handed a pending row with nothing to withdraw (or an approved row carrying\n * a stale request id it might send).\n *\n * `workFileId` uses plain `z.string()` like the sibling projection rows in this file\n * (inputs use `.min(1)`; projection rows describe server-produced data). */\nexport const WorkFileRealmShareStateSchema = z.object({\n workFileId: z.string(),\n // Never `none`: an unshared file simply has no row (see the response below).\n realmFileCanonStatus: RealmFileActiveStatusSchema,\n realmFileShareRequestId: realmFileShareRequestIdSchema.optional(),\n}).strict().superRefine((val, ctx) => {\n const isPending = val.realmFileCanonStatus === REALM_FILE_PENDING_APPROVAL_STATUS;\n if (isPending && val.realmFileShareRequestId === undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['realmFileShareRequestId'],\n message: 'a pending row must carry its request id — it is what the withdraw call compares against',\n });\n }\n if (!isPending && val.realmFileShareRequestId !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['realmFileShareRequestId'],\n message: 'a resolved row must not carry a request id — the request is no longer pending',\n });\n }\n});\nexport type WorkFileRealmShareState = z.infer<typeof WorkFileRealmShareStateSchema>;\n\nexport const GetWorkFileRealmShareStatesInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n}).strict();\nexport type GetWorkFileRealmShareStatesInput = z.infer<typeof GetWorkFileRealmShareStatesInputSchema>;\n\n/** Rows exist ONLY for files whose standing is not `none`. An ABSENT row therefore means the\n * file has never been requested or shared — that is the encoding, so the client must treat a\n * missing entry as \"not shared\" rather than \"unknown\". Bounded implicitly by the Work's own\n * file cap (MAX_WORK_FILES), so this response needs no page cursor of its own. */\nexport const GetWorkFileRealmShareStatesResponseSchema = z.object({\n states: z.array(WorkFileRealmShareStateSchema),\n}).strict();\nexport type GetWorkFileRealmShareStatesResponse = z.infer<typeof GetWorkFileRealmShareStatesResponseSchema>;\n\n// ---- what a Realm-file action changed ------------------------------------------------------\n// The gallery and the steward's queue are endless lists a client patches in place, never reloads\n// (FRONTEND-103); their rows are server projections the client cannot read, so every action that\n// changes a file's standing answers with the file's row in each list after it whenever its\n// post-commit read succeeds, built by the same projection owners the reads use.\n\n/**\n * One file's rows after an action: its gallery row, its queue row, and its Work-side share state —\n * each `null` when the file is absent from that list — plus every folder whose server-computed\n * `fileCount` the action changed (an approval, a move, or an un-share), as the gallery shows it.\n * Each row is non-null only when the file passes that list's own read filters — `sharedFile` only\n * for an approved file whose serving status is `servable`, so an action on a hidden or quarantined\n * file never puts it back into a gallery the read would not show it in.\n */\nexport const RealmFileListsChangeSchema = z.object({\n mediaAssetId: mediaAssetIdSchema,\n workProjectId: workProjectIdSchema,\n workFileId: z.string(),\n sharedFile: RealmSharedFileProjectionSchema.nullable(),\n promotionRequest: RealmFilePromotionQueueRowSchema.nullable(),\n shareState: WorkFileRealmShareStateSchema.nullable(),\n folders: z.array(RealmFileFolderProjectionSchema),\n}).strict();\nexport type RealmFileListsChange = z.infer<typeof RealmFileListsChangeSchema>;\n\n/** The answer of every action that changes a file's Realm standing: request, withdraw, approve,\n * decline, canon toggle, folder move, and the admin un-share. `change` is present when the read\n * after the commit succeeded; a failed read never fails an action that already committed (ENG-009),\n * and the client keeps its loaded pages when it is absent. Non-strict (server → client). */\nexport const RealmFileTransitionResultSchema = z.object({\n success: z.literal(true),\n change: RealmFileListsChangeSchema.optional(),\n});\nexport type RealmFileTransitionResult = z.infer<typeof RealmFileTransitionResultSchema>;\n\n/** The answer of a Realm folder create or rename: the folder as the gallery shows it, present when\n * the read after the commit succeeded (ENG-009; the client keeps its pages when it is absent). */\nexport const RealmFileFolderResultSchema = z.object({\n success: z.literal(true),\n folder: RealmFileFolderProjectionSchema.optional(),\n});\nexport type RealmFileFolderResult = z.infer<typeof RealmFileFolderResultSchema>;\n\n/** The answer of a Realm folder delete: the folder it removed. */\nexport const DeleteRealmFileFolderResultSchema = z.object({\n success: z.literal(true),\n realmFileFolderId: realmFileFolderIdSchema,\n});\nexport type DeleteRealmFileFolderResult = z.infer<typeof DeleteRealmFileFolderResultSchema>;\n\nconst baseFields = {\n workingTitle: z.string().min(1).max(MAX_WORK_PROJECT_TITLE_LENGTH),\n workingDescription: z.string().min(1).max(MAX_WORK_PROJECT_DESCRIPTION_LENGTH),\n workProjectType: workProjectTypeSchema,\n hallWingType: hallWingTypeSchema,\n};\n\n// A Realm working title is reserved under `reservedRealmNames/{UPPER(title)}` — the\n// UPPERCASED title IS the Firestore doc ID (runCreateWorkRealm.reservedRealmNameRef).\n// Firestore doc IDs cannot contain `/` and cannot be exactly `.` or `..`, so a title\n// that would produce an invalid/ambiguous doc ID must be rejected at the callable\n// boundary (both the create transaction and the soft availability check) rather than\n// hard-failing with an opaque `internal` error deep inside ref construction. Length\n// derives from MAX_WORK_REALM_TITLE_LENGTH; only the doc-ID-breaking characters are\n// forbidden. Keep CheckRealmNameAvailableInputSchema in lockstep so a valid-at-create\n// name is never rejected at form time (and vice-versa).\nexport const realmWorkingTitleSchema = z\n .string()\n .min(1)\n .max(MAX_WORK_REALM_TITLE_LENGTH)\n .refine((v) => !v.includes('/'), { message: 'Realm name cannot contain a slash (/).' })\n .refine((v) => v !== '.' && v !== '..', { message: 'Realm name cannot be \".\" or \"..\".' });\n\nexport const RealmCreationModeSchema = z.enum([\n 'newPublicRealm',\n 'newStandaloneRealm',\n 'existingPublicRealm',\n]);\nexport type RealmCreationMode = z.infer<typeof RealmCreationModeSchema>;\n\nexport const CreateWorkProjectInputSchema = z.discriminatedUnion('realmCreationMode', [\n z.object({\n ...baseFields,\n realmCreationMode: z.literal('newPublicRealm'),\n realmWorkingTitle: realmWorkingTitleSchema,\n realmWorkingDescription: z.string().min(1).max(MAX_WORK_REALM_DESCRIPTION_LENGTH),\n }).strict(),\n // Standalone realms are background plumbing (DJ ruling 2026-07-19): the user enters NO\n // realm information — the backend creates the realm shell with a synthetic unique\n // title/description (the generated workRealmId), so nothing user-authored exists on it\n // and no human realm name is consumed from the reservedRealmNames namespace.\n z.object({\n ...baseFields,\n realmCreationMode: z.literal('newStandaloneRealm'),\n }).strict(),\n z.object({\n ...baseFields,\n realmCreationMode: z.literal('existingPublicRealm'),\n workRealmId: workRealmIdSchema,\n }).strict(),\n]);\nexport type CreateWorkProjectInput = z.infer<typeof CreateWorkProjectInputSchema>;\n\n/** The `createWorkProject` answer: the new Work's id and its stored document, which that id names. */\nexport const CreateWorkProjectResultSchema = z\n .object({\n success: z.literal(true),\n workProjectId: workProjectIdSchema,\n workProjectData: FullWorkProjectSchema,\n })\n .strict()\n .superRefine((result, ctx) => {\n if (result.workProjectData.workProjectId !== result.workProjectId) {\n ctx.addIssue({ code: 'custom', path: ['workProjectData', 'workProjectId'] });\n }\n });\nexport type CreateWorkProjectResult = z.infer<typeof CreateWorkProjectResultSchema>;\n\n// Identified by the workAssets subcollection doc id — never by URL parsing\n// (no delete path may depend on a URL; see media-assets-and-protected-serving.md).\nexport const DeleteWorkAssetInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n workAssetId: documentIdSegmentSchema,\n}).strict();\nexport type DeleteWorkAssetInput = z.infer<typeof DeleteWorkAssetInputSchema>;\n\nexport const InviteSourceSchema = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('standalone'),\n }).strict(),\n z.object({\n type: z.literal('craftSkill'),\n data: z.object({\n craftSkillId: craftSkillIdSchema,\n craftSkillOwnerUserId: userIdSchema,\n craftSkillName: z.string().min(1).max(MAX_CRAFT_SKILL_NAME_LENGTH),\n }).strict(),\n }).strict(),\n z.object({\n type: z.literal('commission'),\n // Titles are NOT snapshotted here (Display Identity Invariant — client display text\n // must be re-sourced at render by id). `postingStakeSharesOffered` is not display text;\n // the server re-sources it from the posting doc in the invite transaction (never trusts\n // the client copy) — kept so the shape stays server-writable.\n data: z.object({\n commissionListingId: commissionListingIdSchema,\n commissionProposalId: commissionProposalIdSchema,\n proposalArtisanUserId: userIdSchema,\n postingStakeSharesOffered: z.number().int().min(1),\n }).strict(),\n }).strict(),\n z.object({\n type: z.literal('audition'),\n data: z.object({\n auditionId: auditionIdSchema,\n auditionEntryId: auditionEntryIdSchema,\n respondentUserId: userIdSchema,\n postingStakeSharesOffered: z.number().int().min(1),\n }).strict(),\n }).strict(),\n]);\nexport type InviteSource = z.infer<typeof InviteSourceSchema>;\nexport type InviteSourceType = InviteSource['type'];\n\nexport const InviteUserToGuildInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n inviteeUid: userIdSchema,\n message: z.string().min(1).max(MAX_GUILD_INVITE_MESSAGE_LENGTH),\n stakeSharesOffered: z.number().int().min(1),\n source: InviteSourceSchema,\n}).strict();\nexport type InviteUserToGuildInput = z.infer<typeof InviteUserToGuildInputSchema>;\n\n// `finalized` is the terminal SUCCESS state (`accepted` is a transient state a trigger\n// consumes within seconds). Managers must be able to list finalized invites to see the\n// guild's actual recruitment history — not only failures and in-flight items. Derives from\n// the ONE canonical status enum (schemas/atoms.ts), never a re-declared literal.\n// The history is paged: the server reads `ITEMS_PER_PAGE_GUILD_INVITES` invites per call (the\n// caller sends no page size), and `cursor` is the opaque token the previous page answered.\n// The result is `ListGuildInvitesResultSchema` (doc-schemas/messaging, beside the invite doc).\nexport const ListGuildInvitesInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n statuses: z.array(guildInviteConversationStatusSchema).min(1),\n cursor: z.string().min(1).optional(),\n}).strict();\nexport type ListGuildInvitesInput = z.infer<typeof ListGuildInvitesInputSchema>;\n\nexport const UpdateGuildmateTradeProfessionsInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n userId: userIdSchema,\n tradeProfession: z.enum(TRADE_PROFESSION_VALUES),\n action: addRemoveActionSchema,\n}).strict();\nexport type UpdateGuildmateTradeProfessionsInput = z.infer<typeof UpdateGuildmateTradeProfessionsInputSchema>;\n\nconst GUILD_STANDING_VALUES_ENUM = GUILD_STANDING_VALUES as [typeof GUILD_STANDING_VALUES[number], ...typeof GUILD_STANDING_VALUES[number][]];\n\nexport const UpdateGuildmateStandingInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n userId: userIdSchema,\n guildStanding: z.enum(GUILD_STANDING_VALUES_ENUM),\n action: addRemoveActionSchema,\n}).strict();\nexport type UpdateGuildmateStandingInput = z.infer<typeof UpdateGuildmateStandingInputSchema>;\n\n// Member self-leave (leaveWorkProject). The leaver is ALWAYS request.auth.uid — never a\n// client-supplied uid (invariant 3) — so the input carries only the workProjectId. The\n// callable composes the internal `depart` stake-share operation for ctx.uid.\nexport const LeaveWorkProjectInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n}).strict();\nexport type LeaveWorkProjectInput = z.infer<typeof LeaveWorkProjectInputSchema>;\n\nexport const UpdatePublicWorkProjectDetailsInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n workingTitle: z.string().min(1).max(MAX_WORK_PROJECT_TITLE_LENGTH),\n workingDescription: z.string().min(1).max(MAX_WORK_PROJECT_DESCRIPTION_LENGTH),\n}).strict();\nexport type UpdatePublicWorkProjectDetailsInput = z.infer<typeof UpdatePublicWorkProjectDetailsInputSchema>;\n\nexport const UpdateWorkRealmDetailsInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n workingTitle: z.string().min(1).max(MAX_WORK_REALM_TITLE_LENGTH),\n workingDescription: z.string().min(1).max(MAX_WORK_REALM_DESCRIPTION_LENGTH),\n}).strict();\nexport type UpdateWorkRealmDetailsInput = z.infer<typeof UpdateWorkRealmDetailsInputSchema>;\n\n// Unauthenticated soft-check for a Realm working title. Must match the authoritative\n// realmWorkingTitle contract in CreateWorkProjectInputSchema (realmWorkingTitleSchema:\n// MAX_WORK_REALM_TITLE_LENGTH, rejecting the doc-ID-breaking `/` and reserved `.`/`..`). Never be\n// stricter than the create transaction or a valid-at-create name would be rejected at\n// form time — reuse the SAME schema so the two can never drift.\nexport const CheckRealmNameAvailableInputSchema = z.object({\n workingTitle: realmWorkingTitleSchema,\n}).strict();\nexport type CheckRealmNameAvailableInput = z.infer<typeof CheckRealmNameAvailableInputSchema>;\n\n// ---- work-project file folders (S7) ---------------------------------------------------\n// The default \"All Guildmates\" folder is immutable; custom-folder access is by trade\n// profession. All four callables require a file-admin standing via assertCanManageFolders.\n\nconst tradeProfessionListSchema = z\n .array(z.enum(TRADE_PROFESSION_VALUES))\n .max(TRADE_PROFESSION_OPTIONS.length);\n\nexport const CreateFileFolderInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n name: z.string().min(1).max(MAX_FILE_FOLDER_NAME_LENGTH),\n canViewTradeProfessions: tradeProfessionListSchema,\n canUploadTradeProfessions: tradeProfessionListSchema,\n canDeleteTradeProfessions: tradeProfessionListSchema,\n}).strict();\nexport type CreateFileFolderInput = z.infer<typeof CreateFileFolderInputSchema>;\n\nexport const RenameFileFolderInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n folderId: workFileFolderIdSchema,\n name: z.string().min(1).max(MAX_FILE_FOLDER_NAME_LENGTH),\n}).strict();\nexport type RenameFileFolderInput = z.infer<typeof RenameFileFolderInputSchema>;\n\nexport const UpdateFolderProfessionsInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n folderId: workFileFolderIdSchema,\n canViewTradeProfessions: tradeProfessionListSchema,\n canUploadTradeProfessions: tradeProfessionListSchema,\n canDeleteTradeProfessions: tradeProfessionListSchema,\n}).strict();\nexport type UpdateFolderProfessionsInput = z.infer<typeof UpdateFolderProfessionsInputSchema>;\n\nexport const DeleteFileFolderInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n folderId: workFileFolderIdSchema,\n}).strict();\nexport type DeleteFileFolderInput = z.infer<typeof DeleteFileFolderInputSchema>;\n\n// ---- realm shared files ---------------------------------------------------------------\n\n// Delete a single work file (by folder + file id). File-admin authz is enforced in the\n// callable/core transaction.\nexport const DeleteWorkFileInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n folderId: workFileFolderIdSchema,\n workFileId: workFileIdSchema,\n}).strict();\nexport type DeleteWorkFileInput = z.infer<typeof DeleteWorkFileInputSchema>;\n\n// Set canon status on a realm shared file. Realm-steward-only authz is enforced inside the\n// core's transaction against workRealms/{workRealmId}.workStewardUid.\nexport const UpdateWorkFileRealmCanonInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n mediaAssetId: mediaAssetIdSchema,\n canon: z.boolean(),\n}).strict();\nexport type UpdateWorkFileRealmCanonInput = z.infer<typeof UpdateWorkFileRealmCanonInputSchema>;\n\n// ---- the promotion approval gate -------------------------------------------------------\n// Promotion is a REQUEST, not an instant share: the Work file admin asks, and the REALM\n// steward approves (choosing the folder) or declines. Nothing is served to the Realm until\n// approval — a requested file stays `scoped` and invisible to the member gallery.\n//\n// Every one of these carries the `requestId` so a decision always names the exact request it\n// observed. Realm-side authority (steward, public + non-hidden Realm) is derived from the\n// Realm document inside each core's transaction; these shapes carry no authority hints.\n\n// REQUEST promotion of a work file into its Realm's shared-file pool. File-admin authz\n// (`workFile.promoteToRealm`) is enforced inside the core's transaction.\n// `requestId` is CLIENT-generated and stable: replaying the same id is an idempotent success\n// (no second audit event, no second notification), while a DIFFERENT id arriving while one\n// request is already pending is a conflict — never a silent overwrite.\nexport const UpdateWorkFileRealmShareInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n workFileId: workFileIdSchema,\n requestId: realmFileShareRequestIdSchema,\n}).strict();\nexport type UpdateWorkFileRealmShareInput = z.infer<typeof UpdateWorkFileRealmShareInputSchema>;\n\n// WITHDRAW a still-pending request (the requesting Work's file admin). Realm-share\n// permanence begins at APPROVAL — before a steward decides, an accidental request must be\n// correctable by the side that made it. Addressed by Work coordinates like the request\n// itself, and compares `requestId` so a withdrawal can never cancel a newer re-request.\nexport const WithdrawRealmFilePromotionRequestInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n workFileId: workFileIdSchema,\n requestId: realmFileShareRequestIdSchema,\n}).strict();\nexport type WithdrawRealmFilePromotionRequestInput = z.infer<typeof WithdrawRealmFilePromotionRequestInputSchema>;\n\n// APPROVE a pending request (Realm steward). Approval assigns the folder — there is no\n// default folder, so `realmFileFolderId` is REQUIRED and the core verifies the folder is\n// under this exact Realm before flipping the file to `nonCanon` + the artisan tier.\nexport const ApproveRealmFilePromotionInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n mediaAssetId: mediaAssetIdSchema,\n realmFileFolderId: realmFileFolderIdSchema,\n requestId: realmFileShareRequestIdSchema,\n}).strict();\nexport type ApproveRealmFilePromotionInput = z.infer<typeof ApproveRealmFilePromotionInputSchema>;\n\n// DECLINE a pending request (Realm steward). Returns the file to `none` and clears the Realm\n// + request fields. No folder is involved — a declined file never entered the pool.\nexport const DeclineRealmFilePromotionInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n mediaAssetId: mediaAssetIdSchema,\n requestId: realmFileShareRequestIdSchema,\n}).strict();\nexport type DeclineRealmFilePromotionInput = z.infer<typeof DeclineRealmFilePromotionInputSchema>;\n\n// ADMIN un-share of an ALREADY-APPROVED realm file (`adminUpdateWorkFileRealmUnshare`).\n// Once a steward approves, sharing is PERMANENT for members — the only way out is an admin\n// acting on a support thread. This is its own input rather than a reuse of the share/request\n// shape: an approved file has NO pending request, so `requestId` is meaningless here and\n// requiring one would make the callable unusable against exactly the state it exists to\n// unwind. It carries the ORIGINAL two-field Work-coordinate shape the share input had before\n// the approval gate; the core resolves the file by collection-group query on\n// (`workProjectId`, `workFileId`). Admin authority is asserted at the callable's admin gate\n// and re-asserted in the core (which rejects any non-`adminOverride` actor) — never inferred\n// from anything in this payload.\nexport const AdminUpdateWorkFileRealmUnshareInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n workFileId: workFileIdSchema,\n}).strict();\nexport type AdminUpdateWorkFileRealmUnshareInput = z.infer<typeof AdminUpdateWorkFileRealmUnshareInputSchema>;\n\n// ---- realm shared-file folders (steward-managed) ---------------------------------------\n// Mirrors the Work-side folder CRUD shapes, minus the trade-profession access lists: Realm\n// folders are organizational only (Realm-level visibility is the whole access model at\n// launch). Names reuse the ONE platform folder-name bound; the server derives\n// `name_lowercase` and enforces case-insensitive uniqueness within the Realm.\n\nexport const CreateRealmFileFolderInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n name: z.string().min(1).max(MAX_FILE_FOLDER_NAME_LENGTH),\n}).strict();\nexport type CreateRealmFileFolderInput = z.infer<typeof CreateRealmFileFolderInputSchema>;\n\n/** Rename. `update*` per BACKEND-305 — it modifies an existing doc in place. */\nexport const UpdateRealmFileFolderInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n realmFileFolderId: realmFileFolderIdSchema,\n name: z.string().min(1).max(MAX_FILE_FOLDER_NAME_LENGTH),\n}).strict();\nexport type UpdateRealmFileFolderInput = z.infer<typeof UpdateRealmFileFolderInputSchema>;\n\n/** Delete requires the folder to be EMPTY (the steward moves files out first) — no surprise\n * data moves and no reassignment-target picker at launch. Emptiness is proven by an\n * in-transaction query for ANY asset carrying this folder id, regardless of serving/hidden/\n * canon state: a hidden file still occupies its folder. */\nexport const DeleteRealmFileFolderInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n realmFileFolderId: realmFileFolderIdSchema,\n}).strict();\nexport type DeleteRealmFileFolderInput = z.infer<typeof DeleteRealmFileFolderInputSchema>;\n\n/** Move an approved shared file between folders. `expectedRealmFileFolderId` is a\n * compare-and-set precondition — a steward acting on a stale view must not silently undo a\n * move made from another tab. */\nexport const UpdateRealmFileFolderAssignmentInputSchema = z.object({\n workRealmId: workRealmIdSchema,\n mediaAssetId: mediaAssetIdSchema,\n expectedRealmFileFolderId: realmFileFolderIdSchema,\n realmFileFolderId: realmFileFolderIdSchema,\n}).strict();\nexport type UpdateRealmFileFolderAssignmentInput = z.infer<typeof UpdateRealmFileFolderAssignmentInputSchema>;\n\n\n"]}
|