@ttt-productions/ttt-core 0.79.94 → 0.79.96

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.
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ /** The `createMediaGrant` input: a participant's scopes. */
2
3
  export declare const CreateMediaGrantInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
4
  scopeKind: z.ZodLiteral<"workProject">;
4
5
  workProjectId: z.ZodString;
@@ -16,10 +17,6 @@ export declare const CreateMediaGrantInputSchema: z.ZodDiscriminatedUnion<[z.Zod
16
17
  }, z.core.$strict>, z.ZodObject<{
17
18
  scopeKind: z.ZodLiteral<"adminSupport">;
18
19
  adminDispatchId: z.ZodString;
19
- }, z.core.$strict>, z.ZodObject<{
20
- scopeKind: z.ZodLiteral<"adminReview">;
21
- reportGroupId: z.ZodString;
22
- mediaAssetId: z.ZodString;
23
20
  }, z.core.$strict>, z.ZodObject<{
24
21
  scopeKind: z.ZodLiteral<"realmFilePreview">;
25
22
  workRealmId: z.ZodString;
@@ -27,4 +24,23 @@ export declare const CreateMediaGrantInputSchema: z.ZodDiscriminatedUnion<[z.Zod
27
24
  realmFileShareRequestId: z.ZodString;
28
25
  }, z.core.$strict>], "scopeKind">;
29
26
  export type CreateMediaGrantInput = z.infer<typeof CreateMediaGrantInputSchema>;
27
+ /** The `adminCreateMediaGrant` input: the scopes an admin reaches as an admin. */
28
+ export declare const AdminCreateMediaGrantInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
29
+ scopeKind: z.ZodLiteral<"workProject">;
30
+ workProjectId: z.ZodString;
31
+ }, z.core.$strict>, z.ZodObject<{
32
+ scopeKind: z.ZodLiteral<"adminSupport">;
33
+ adminDispatchId: z.ZodString;
34
+ }, z.core.$strict>, z.ZodObject<{
35
+ scopeKind: z.ZodLiteral<"adminReview">;
36
+ reportGroupId: z.ZodString;
37
+ mediaAssetId: z.ZodString;
38
+ }, z.core.$strict>], "scopeKind">;
39
+ export type AdminCreateMediaGrantInput = z.infer<typeof AdminCreateMediaGrantInputSchema>;
40
+ /** Both grant callables answer the same signed grant, bound to the caller. */
41
+ export declare const CreateMediaGrantResultSchema: z.ZodObject<{
42
+ grant: z.ZodString;
43
+ expiresAt: z.ZodNumber;
44
+ }, z.core.$strict>;
45
+ export type CreateMediaGrantResult = z.infer<typeof CreateMediaGrantResultSchema>;
30
46
  //# sourceMappingURL=media.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/schemas/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuBxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;iCAqDtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
1
+ {"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/schemas/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoFxB,4DAA4D;AAC5D,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;iCAOtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,kFAAkF;AAClF,eAAO,MAAM,gCAAgC;;;;;;;;;;iCAI3C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,8EAA8E;AAC9E,eAAO,MAAM,4BAA4B;;;kBAI9B,CAAC;AACZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
@@ -1,66 +1,86 @@
1
1
  import { z } from 'zod';
2
2
  import { workProjectIdSchema, guildInviteIdSchema, workFileFolderIdSchema, commissionListingIdSchema, commissionProposalIdSchema, adminDispatchIdSchema, reportGroupIdSchema, mediaAssetIdSchema, workRealmIdSchema, realmFileShareRequestIdSchema, } from './atoms.js';
3
- // Scoped-media grant request for the gateway Worker (design doc: scoped tier =
4
- // cookie + user-bound grant). This is the CLIENT-CALLED wire contract for the
5
- // `createMediaGrant` callable — it crosses the backend↔frontend boundary, so it
6
- // lives here (callable-validation convention), not locally in the functions repo.
7
- // The EXACT Firestore permission check happens in the callable; this schema only
8
- // pins the shape. A custom folder's bytes must be unreachable outside its view
9
- // trade-professions, so `workFileFolder` is the EXACT folder scope (not the whole
10
- // Work grant); guildInvite / adminSupport are the two per-CONVERSATION scopes that
11
- // serve Conversation Files (guild chat channels have none — no guildChannel scope).
3
+ // Scoped-media grant requests for the gateway Worker: the scoped tier is a session cookie plus a
4
+ // user-bound grant. These are the CLIENT-CALLED wire contracts of the two grant callables, so they
5
+ // live here, not in the functions repo. The EXACT Firestore permission check happens in the
6
+ // callable; a schema only pins the shape. A custom folder's bytes must be unreachable outside its
7
+ // view trade-professions, so `workFileFolder` is the EXACT folder scope (not the whole Work grant);
8
+ // guildInvite / adminSupport are the two per-CONVERSATION scopes that serve Conversation Files
9
+ // (guild chat channels have none — no guildChannel scope).
10
+ //
11
+ // Admin authority is a callable of its own (BACKEND-004): `createMediaGrant` serves a
12
+ // participant, `adminCreateMediaGrant` an admin acting in review or support, and spends a
13
+ // single-use App Check token. Each scope is declared once and joins the union of every callable
14
+ // that serves it.
15
+ // Pre-publish content media of a work project (hall covers / sub-item media). A participant needs
16
+ // project read membership; an admin reaches it from a review surface. Work FILES use the tighter
17
+ // workFileFolder scope.
18
+ const WorkProjectGrantScopeSchema = z.object({
19
+ scopeKind: z.literal('workProject'),
20
+ workProjectId: workProjectIdSchema,
21
+ }).strict();
22
+ // One work-project FILE FOLDER — the EXACT folder scope, NOT the whole-Work grant.
23
+ const WorkFileFolderGrantScopeSchema = z.object({
24
+ scopeKind: z.literal('workFileFolder'),
25
+ workProjectId: workProjectIdSchema,
26
+ workFileFolderId: workFileFolderIdSchema,
27
+ }).strict();
28
+ // One commission proposal's media — proposal author or listing-side manager.
29
+ const CommissionProposalGrantScopeSchema = z.object({
30
+ scopeKind: z.literal('commissionProposal'),
31
+ commissionListingId: commissionListingIdSchema,
32
+ commissionProposalId: commissionProposalIdSchema,
33
+ }).strict();
34
+ // A guild-INVITE conversation's Conversation File (no workProjectId to match on).
35
+ const GuildInviteGrantScopeSchema = z.object({
36
+ scopeKind: z.literal('guildInvite'),
37
+ guildInviteId: guildInviteIdSchema,
38
+ }).strict();
39
+ // An admin-support THREAD's Conversation File — per-thread scope keyed by adminDispatchId: the
40
+ // thread owner through `createMediaGrant`, the admin side through `adminCreateMediaGrant`.
41
+ const AdminSupportGrantScopeSchema = z.object({
42
+ scopeKind: z.literal('adminSupport'),
43
+ adminDispatchId: adminDispatchIdSchema,
44
+ }).strict();
45
+ // Moderation reveal of ONE reported asset, bound to its report group — full or jr admin only. The
46
+ // callable verifies the asset belongs to the group's derived target (or its frozen report-time
47
+ // snapshot) before minting; the grant is bound to exactly that asset id, short TTL. Admins see
48
+ // reported things BECAUSE they were reported — this is never a browse-any-asset scope.
49
+ const AdminReviewGrantScopeSchema = z.object({
50
+ scopeKind: z.literal('adminReview'),
51
+ reportGroupId: reportGroupIdSchema,
52
+ mediaAssetId: mediaAssetIdSchema,
53
+ }).strict();
54
+ // A Realm steward's preview of ONE Work file awaiting their promotion decision — the Realm's
55
+ // current steward only, and only while the file is still pending under this request id in this
56
+ // Realm (the callable re-checks all three at mint). The request id is the one the steward's queue
57
+ // row showed, so a decided, withdrawn, or superseded request mints nothing. The grant names
58
+ // exactly that asset and never reveals a hidden one.
59
+ const RealmFilePreviewGrantScopeSchema = z.object({
60
+ scopeKind: z.literal('realmFilePreview'),
61
+ workRealmId: workRealmIdSchema,
62
+ mediaAssetId: mediaAssetIdSchema,
63
+ realmFileShareRequestId: realmFileShareRequestIdSchema,
64
+ }).strict();
65
+ /** The `createMediaGrant` input: a participant's scopes. */
12
66
  export const CreateMediaGrantInputSchema = z.discriminatedUnion('scopeKind', [
13
- // Pre-publish content media of a work project (hall covers / sub-item media) —
14
- // requires project read membership. Work FILES use the tighter workFileFolder scope.
15
- z.object({
16
- scopeKind: z.literal('workProject'),
17
- workProjectId: workProjectIdSchema,
18
- }).strict(),
19
- // One work-project FILE FOLDER — the EXACT folder scope, NOT the whole-Work grant.
20
- z.object({
21
- scopeKind: z.literal('workFileFolder'),
22
- workProjectId: workProjectIdSchema,
23
- workFileFolderId: workFileFolderIdSchema,
24
- }).strict(),
25
- // One commission proposal's media — proposal author or listing-side manager.
26
- z.object({
27
- scopeKind: z.literal('commissionProposal'),
28
- commissionListingId: commissionListingIdSchema,
29
- commissionProposalId: commissionProposalIdSchema,
30
- }).strict(),
31
- // A guild-INVITE conversation's Conversation File (no workProjectId to match on).
32
- z.object({
33
- scopeKind: z.literal('guildInvite'),
34
- guildInviteId: guildInviteIdSchema,
35
- }).strict(),
36
- // An admin-support THREAD's Conversation File — per-thread scope keyed by adminDispatchId
37
- // (thread owner or admin authority; the callable runs the same checks startUpload's
38
- // adminSupport branch does).
39
- z.object({
40
- scopeKind: z.literal('adminSupport'),
41
- adminDispatchId: adminDispatchIdSchema,
42
- }).strict(),
43
- // Moderation reveal of ONE reported asset, bound to its report group — full or jr
44
- // admin only (the callable's explicit secure check, matching getReportedContentDetail's
45
- // gate). The callable verifies the asset belongs to the group's derived target (or its
46
- // frozen report-time snapshot) before minting; the grant is bound to exactly that asset
47
- // id, short TTL. Admins see reported things BECAUSE they were reported — this is never
48
- // a browse-any-asset scope.
49
- z.object({
50
- scopeKind: z.literal('adminReview'),
51
- reportGroupId: reportGroupIdSchema,
52
- mediaAssetId: mediaAssetIdSchema,
53
- }).strict(),
54
- // A Realm steward's preview of ONE Work file awaiting their promotion decision — the Realm's
55
- // current steward only, and only while the file is still pending under this request id in this
56
- // Realm (the callable re-checks all three at mint). The request id is the one the steward's queue
57
- // row showed, so a decided, withdrawn, or superseded request mints nothing. The grant names
58
- // exactly that asset and never reveals a hidden one.
59
- z.object({
60
- scopeKind: z.literal('realmFilePreview'),
61
- workRealmId: workRealmIdSchema,
62
- mediaAssetId: mediaAssetIdSchema,
63
- realmFileShareRequestId: realmFileShareRequestIdSchema,
64
- }).strict(),
67
+ WorkProjectGrantScopeSchema,
68
+ WorkFileFolderGrantScopeSchema,
69
+ CommissionProposalGrantScopeSchema,
70
+ GuildInviteGrantScopeSchema,
71
+ AdminSupportGrantScopeSchema,
72
+ RealmFilePreviewGrantScopeSchema,
65
73
  ]);
74
+ /** The `adminCreateMediaGrant` input: the scopes an admin reaches as an admin. */
75
+ export const AdminCreateMediaGrantInputSchema = z.discriminatedUnion('scopeKind', [
76
+ WorkProjectGrantScopeSchema,
77
+ AdminSupportGrantScopeSchema,
78
+ AdminReviewGrantScopeSchema,
79
+ ]);
80
+ /** Both grant callables answer the same signed grant, bound to the caller. */
81
+ export const CreateMediaGrantResultSchema = z.object({
82
+ grant: z.string().min(1),
83
+ /** Epoch ms; a client refreshes under it. */
84
+ expiresAt: z.number().int().positive(),
85
+ }).strict();
66
86
  //# sourceMappingURL=media.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"media.js","sourceRoot":"","sources":["../../src/schemas/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AAEpB,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,kFAAkF;AAClF,iFAAiF;AACjF,+EAA+E;AAC/E,kFAAkF;AAClF,mFAAmF;AACnF,oFAAoF;AACpF,MAAM,CAAC,MAAM,2BAA2B,GAA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F;IAC5F,qDAAqD;IACrD,CAAC,CAAC,MAAM,CAAC;QACP,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;QACxC,WAAW,EAAE,iBAAiB;QAC9B,YAAY,EAAE,kBAAkB;QAChC,uBAAuB,EAAE,6BAA6B;KACvD,CAAC,CAAC,MAAM,EAAE;CACZ,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n workProjectIdSchema,\n guildInviteIdSchema,\n workFileFolderIdSchema,\n commissionListingIdSchema,\n commissionProposalIdSchema,\n adminDispatchIdSchema,\n reportGroupIdSchema,\n mediaAssetIdSchema,\n workRealmIdSchema,\n realmFileShareRequestIdSchema,\n} from './atoms.js';\n\n// Scoped-media grant request for the gateway Worker (design doc: scoped tier =\n// cookie + user-bound grant). This is the CLIENT-CALLED wire contract for the\n// `createMediaGrant` callable — it crosses the backend↔frontend boundary, so it\n// lives here (callable-validation convention), not locally in the functions repo.\n// The EXACT Firestore permission check happens in the callable; this schema only\n// pins the shape. A custom folder's bytes must be unreachable outside its view\n// trade-professions, so `workFileFolder` is the EXACT folder scope (not the whole\n// Work grant); guildInvite / adminSupport are the two per-CONVERSATION scopes that\n// serve Conversation Files (guild chat channels have none — no guildChannel scope).\nexport const CreateMediaGrantInputSchema = z.discriminatedUnion('scopeKind', [\n // Pre-publish content media of a work project (hall covers / sub-item media) —\n // requires project read membership. Work FILES use the tighter workFileFolder scope.\n z.object({\n scopeKind: z.literal('workProject'),\n workProjectId: workProjectIdSchema,\n }).strict(),\n // One work-project FILE FOLDER — the EXACT folder scope, NOT the whole-Work grant.\n z.object({\n scopeKind: z.literal('workFileFolder'),\n workProjectId: workProjectIdSchema,\n workFileFolderId: workFileFolderIdSchema,\n }).strict(),\n // One commission proposal's media — proposal author or listing-side manager.\n z.object({\n scopeKind: z.literal('commissionProposal'),\n commissionListingId: commissionListingIdSchema,\n commissionProposalId: commissionProposalIdSchema,\n }).strict(),\n // A guild-INVITE conversation's Conversation File (no workProjectId to match on).\n z.object({\n scopeKind: z.literal('guildInvite'),\n guildInviteId: guildInviteIdSchema,\n }).strict(),\n // An admin-support THREAD's Conversation File — per-thread scope keyed by adminDispatchId\n // (thread owner or admin authority; the callable runs the same checks startUpload's\n // adminSupport branch does).\n z.object({\n scopeKind: z.literal('adminSupport'),\n adminDispatchId: adminDispatchIdSchema,\n }).strict(),\n // Moderation reveal of ONE reported asset, bound to its report group — full or jr\n // admin only (the callable's explicit secure check, matching getReportedContentDetail's\n // gate). The callable verifies the asset belongs to the group's derived target (or its\n // frozen report-time snapshot) before minting; the grant is bound to exactly that asset\n // id, short TTL. Admins see reported things BECAUSE they were reported — this is never\n // a browse-any-asset scope.\n z.object({\n scopeKind: z.literal('adminReview'),\n reportGroupId: reportGroupIdSchema,\n mediaAssetId: mediaAssetIdSchema,\n }).strict(),\n // A Realm steward's preview of ONE Work file awaiting their promotion decision — the Realm's\n // current steward only, and only while the file is still pending under this request id in this\n // Realm (the callable re-checks all three at mint). The request id is the one the steward's queue\n // row showed, so a decided, withdrawn, or superseded request mints nothing. The grant names\n // exactly that asset and never reveals a hidden one.\n z.object({\n scopeKind: z.literal('realmFilePreview'),\n workRealmId: workRealmIdSchema,\n mediaAssetId: mediaAssetIdSchema,\n realmFileShareRequestId: realmFileShareRequestIdSchema,\n }).strict(),\n]);\nexport type CreateMediaGrantInput = z.infer<typeof CreateMediaGrantInputSchema>;\n"]}
1
+ {"version":3,"file":"media.js","sourceRoot":"","sources":["../../src/schemas/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AAEpB,iGAAiG;AACjG,mGAAmG;AACnG,4FAA4F;AAC5F,kGAA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,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IACnC,aAAa,EAAE,mBAAmB;IAClC,YAAY,EAAE,kBAAkB;CACjC,CAAC,CAAC,MAAM,EAAE,CAAC;AAEZ,6FAA6F;AAC7F,+FAA+F;AAC/F,kGAAkG;AAClG,4FAA4F;AAC5F,qDAAqD;AACrD,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;IACxC,WAAW,EAAE,iBAAiB;IAC9B,YAAY,EAAE,kBAAkB;IAChC,uBAAuB,EAAE,6BAA6B;CACvD,CAAC,CAAC,MAAM,EAAE,CAAC;AAEZ,4DAA4D;AAC5D,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,kBAAkB,CAAC,WAAW,EAAE;IAC3E,2BAA2B;IAC3B,8BAA8B;IAC9B,kCAAkC;IAClC,2BAA2B;IAC3B,4BAA4B;IAC5B,gCAAgC;CACjC,CAAC,CAAC;AAGH,kFAAkF;AAClF,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,kBAAkB,CAAC,WAAW,EAAE;IAChF,2BAA2B;IAC3B,4BAA4B;IAC5B,2BAA2B;CAC5B,CAAC,CAAC;AAGH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,6CAA6C;IAC7C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n workProjectIdSchema,\n guildInviteIdSchema,\n workFileFolderIdSchema,\n commissionListingIdSchema,\n commissionProposalIdSchema,\n adminDispatchIdSchema,\n reportGroupIdSchema,\n mediaAssetIdSchema,\n workRealmIdSchema,\n realmFileShareRequestIdSchema,\n} from './atoms.js';\n\n// Scoped-media grant requests for the gateway Worker: the scoped tier is a session cookie plus a\n// user-bound grant. These are the CLIENT-CALLED wire contracts of the two grant callables, so they\n// live here, not in the functions repo. The EXACT Firestore permission check happens in the\n// callable; a schema only pins the shape. A custom folder's bytes must be unreachable outside its\n// view trade-professions, so `workFileFolder` is the EXACT folder scope (not the whole Work grant);\n// guildInvite / adminSupport are the two per-CONVERSATION scopes that serve Conversation Files\n// (guild chat channels have none — no guildChannel scope).\n//\n// Admin authority is a callable of its own (BACKEND-004): `createMediaGrant` serves a\n// participant, `adminCreateMediaGrant` an admin acting in review or support, and spends a\n// single-use App Check token. Each scope is declared once and joins the union of every callable\n// that serves it.\n\n// Pre-publish content media of a work project (hall covers / sub-item media). A participant needs\n// project read membership; an admin reaches it from a review surface. Work FILES use the tighter\n// workFileFolder scope.\nconst WorkProjectGrantScopeSchema = z.object({\n scopeKind: z.literal('workProject'),\n workProjectId: workProjectIdSchema,\n}).strict();\n\n// One work-project FILE FOLDER — the EXACT folder scope, NOT the whole-Work grant.\nconst WorkFileFolderGrantScopeSchema = z.object({\n scopeKind: z.literal('workFileFolder'),\n workProjectId: workProjectIdSchema,\n workFileFolderId: workFileFolderIdSchema,\n}).strict();\n\n// One commission proposal's media — proposal author or listing-side manager.\nconst CommissionProposalGrantScopeSchema = z.object({\n scopeKind: z.literal('commissionProposal'),\n commissionListingId: commissionListingIdSchema,\n commissionProposalId: commissionProposalIdSchema,\n}).strict();\n\n// A guild-INVITE conversation's Conversation File (no workProjectId to match on).\nconst GuildInviteGrantScopeSchema = z.object({\n scopeKind: z.literal('guildInvite'),\n guildInviteId: guildInviteIdSchema,\n}).strict();\n\n// An admin-support THREAD's Conversation File — per-thread scope keyed by adminDispatchId: the\n// thread owner through `createMediaGrant`, the admin side through `adminCreateMediaGrant`.\nconst AdminSupportGrantScopeSchema = z.object({\n scopeKind: z.literal('adminSupport'),\n adminDispatchId: adminDispatchIdSchema,\n}).strict();\n\n// Moderation reveal of ONE reported asset, bound to its report group — full or jr admin only. The\n// callable verifies the asset belongs to the group's derived target (or its frozen report-time\n// snapshot) before minting; the grant is bound to exactly that asset id, short TTL. Admins see\n// reported things BECAUSE they were reported — this is never a browse-any-asset scope.\nconst AdminReviewGrantScopeSchema = z.object({\n scopeKind: z.literal('adminReview'),\n reportGroupId: reportGroupIdSchema,\n mediaAssetId: mediaAssetIdSchema,\n}).strict();\n\n// A Realm steward's preview of ONE Work file awaiting their promotion decision — the Realm's\n// current steward only, and only while the file is still pending under this request id in this\n// Realm (the callable re-checks all three at mint). The request id is the one the steward's queue\n// row showed, so a decided, withdrawn, or superseded request mints nothing. The grant names\n// exactly that asset and never reveals a hidden one.\nconst RealmFilePreviewGrantScopeSchema = z.object({\n scopeKind: z.literal('realmFilePreview'),\n workRealmId: workRealmIdSchema,\n mediaAssetId: mediaAssetIdSchema,\n realmFileShareRequestId: realmFileShareRequestIdSchema,\n}).strict();\n\n/** The `createMediaGrant` input: a participant's scopes. */\nexport const CreateMediaGrantInputSchema = z.discriminatedUnion('scopeKind', [\n WorkProjectGrantScopeSchema,\n WorkFileFolderGrantScopeSchema,\n CommissionProposalGrantScopeSchema,\n GuildInviteGrantScopeSchema,\n AdminSupportGrantScopeSchema,\n RealmFilePreviewGrantScopeSchema,\n]);\nexport type CreateMediaGrantInput = z.infer<typeof CreateMediaGrantInputSchema>;\n\n/** The `adminCreateMediaGrant` input: the scopes an admin reaches as an admin. */\nexport const AdminCreateMediaGrantInputSchema = z.discriminatedUnion('scopeKind', [\n WorkProjectGrantScopeSchema,\n AdminSupportGrantScopeSchema,\n AdminReviewGrantScopeSchema,\n]);\nexport type AdminCreateMediaGrantInput = z.infer<typeof AdminCreateMediaGrantInputSchema>;\n\n/** Both grant callables answer the same signed grant, bound to the caller. */\nexport const CreateMediaGrantResultSchema = z.object({\n grant: z.string().min(1),\n /** Epoch ms; a client refreshes under it. */\n expiresAt: z.number().int().positive(),\n}).strict();\nexport type CreateMediaGrantResult = z.infer<typeof CreateMediaGrantResultSchema>;\n"]}
@@ -240,27 +240,6 @@ export declare const CreateNotificationBroadcastInputSchema: z.ZodObject<{
240
240
  message: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
241
241
  }, z.core.$strict>;
242
242
  export type CreateNotificationBroadcastInput = z.infer<typeof CreateNotificationBroadcastInputSchema>;
243
- /** Archive scope: a single notification, or the caller's whole category. */
244
- export declare const ArchiveNotificationScopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
245
- kind: z.ZodLiteral<"single">;
246
- notificationId: z.ZodString;
247
- }, z.core.$strict>, z.ZodObject<{
248
- kind: z.ZodLiteral<"all">;
249
- }, z.core.$strict>], "kind">;
250
- export type ArchiveNotificationScope = z.infer<typeof ArchiveNotificationScopeSchema>;
251
- export declare const ArchiveNotificationInputSchema: z.ZodObject<{
252
- category: z.ZodEnum<{
253
- user: "user";
254
- admin: "admin";
255
- }>;
256
- scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
257
- kind: z.ZodLiteral<"single">;
258
- notificationId: z.ZodString;
259
- }, z.core.$strict>, z.ZodObject<{
260
- kind: z.ZodLiteral<"all">;
261
- }, z.core.$strict>], "kind">;
262
- }, z.core.$strict>;
263
- export type ArchiveNotificationInput = z.infer<typeof ArchiveNotificationInputSchema>;
264
243
  export declare const MarkNotificationsSeenInputSchema: z.ZodObject<{
265
244
  category: z.ZodLiteral<"user">;
266
245
  }, z.core.$strict>;
@@ -321,16 +300,13 @@ export type ArchiveNotificationObservedScope = z.infer<typeof ArchiveNotificatio
321
300
  * audienceScope, requestId:activeId)`), so a single archive can never collide on another
322
301
  * card's history doc.
323
302
  *
324
- * `category` scopes which active-notification collection is archived
325
- * (`activeUserNotifications` vs `activeAdminNotifications`) and forms part of
326
- * the history doc path.
303
+ * The input names no category: `archiveNotification` archives the caller's own `user` cards and
304
+ * `adminArchiveNotification` the shared `admin` cards, so the callable — never a field a client
305
+ * sets — decides which active-notification collection is archived and which history path it
306
+ * forms part of.
327
307
  */
328
308
  export declare const ArchiveNotificationObservedInputSchema: z.ZodObject<{
329
309
  requestId: z.ZodString;
330
- category: z.ZodEnum<{
331
- user: "user";
332
- admin: "admin";
333
- }>;
334
310
  scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
335
311
  kind: z.ZodLiteral<"single">;
336
312
  notificationId: z.ZodString;
@@ -353,10 +329,6 @@ export declare const ArchiveNotificationResultSchema: z.ZodObject<{
353
329
  export type ArchiveNotificationResult = z.infer<typeof ArchiveNotificationResultSchema>;
354
330
  export declare const EnqueueArchiveAllInputSchema: z.ZodObject<{
355
331
  requestId: z.ZodString;
356
- category: z.ZodEnum<{
357
- user: "user";
358
- admin: "admin";
359
- }>;
360
332
  }, z.core.$strict>;
361
333
  export type EnqueueArchiveAllInput = z.infer<typeof EnqueueArchiveAllInputSchema>;
362
334
  export declare const GetArchiveAllStatusInputSchema: z.ZodObject<{
@@ -376,6 +348,9 @@ export declare const DeadLetteredFanoutJobRowSchema: z.ZodObject<{
376
348
  ageMs: z.ZodNullable<z.ZodNumber>;
377
349
  }, z.core.$strip>;
378
350
  export type DeadLetteredFanoutJobRow = z.infer<typeof DeadLetteredFanoutJobRowSchema>;
351
+ /** The `listDeadLetteredFanoutJobs` input: the inventory takes no parameters, and anything sent is refused. */
352
+ export declare const ListDeadLetteredFanoutJobsInputSchema: z.ZodObject<{}, z.core.$strict>;
353
+ export type ListDeadLetteredFanoutJobsInput = z.infer<typeof ListDeadLetteredFanoutJobsInputSchema>;
379
354
  export declare const ListDeadLetteredFanoutJobsResultSchema: z.ZodObject<{
380
355
  jobs: z.ZodArray<z.ZodObject<{
381
356
  jobId: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/schemas/notification.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,CAAC,EAAE,MAAM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AAC,CAAC;AAMhF;;;;GAIG;AACH,MAAM,WAAW,sCAAsC;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,yBAAyB,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,sCAAsC;IACrD,KAAK,EAAE,QAAQ,GAAG,KAAK,CAAC;IACxB,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,iDAAiD;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -175,7 +175,7 @@ export const NotificationMetadataByTypeSchema = z.discriminatedUnion('type', [
175
175
  workProjectId: workProjectIdSchema,
176
176
  }).strict(),
177
177
  // Author feedback for a review decision. Mirrors what runReviewThresholdItem
178
- // (ttt-prod) sends: only `needs_revision` is delivered today; `adminNotes` is
178
+ // (ttt-prod) sends: only `needs_revision` is delivered; `adminNotes` is
179
179
  // the reviewer's note, sent as null when the reviewer left none.
180
180
  z.object({
181
181
  type: z.literal('threshold_library_reviewed'),
@@ -326,16 +326,6 @@ export const CreateNotificationBroadcastInputSchema = z.object({
326
326
  title: textFieldSchema(BROADCAST_TITLE_INPUT),
327
327
  message: textFieldSchema(BROADCAST_MESSAGE_INPUT),
328
328
  }).strict();
329
- /** Archive scope: a single notification, or the caller's whole category. */
330
- export const ArchiveNotificationScopeSchema = z.discriminatedUnion('kind', [
331
- z.object({ kind: z.literal('single'), notificationId: activeNotificationIdSchema }).strict(),
332
- z.object({ kind: z.literal('all') }).strict(),
333
- ]);
334
- // No `device` field on the archive input — archive metadata is server-derived.
335
- export const ArchiveNotificationInputSchema = z.object({
336
- category: NotificationCategorySchema,
337
- scope: ArchiveNotificationScopeSchema,
338
- }).strict();
339
329
  // Shared admin notifications have no per-admin seen state, so only the personal
340
330
  // `user` category can be marked seen.
341
331
  export const MarkNotificationsSeenInputSchema = z.object({
@@ -345,8 +335,7 @@ export const MarkNotificationsSeenInputSchema = z.object({
345
335
  // OBSERVED-GENERATION CALLABLE INPUT SCHEMAS
346
336
  //
347
337
  // The inputs of the observed-generation callables the notification tray invokes. The
348
- // category-wide callables take MarkNotificationsSeenInputSchema /
349
- // ArchiveNotificationInputSchema above.
338
+ // category-wide mark-seen callable takes MarkNotificationsSeenInputSchema above.
350
339
  // ============================================================================
351
340
  // Max items per mark-seen call matches a sane notification tray page size.
352
341
  const MARK_SEEN_MAX_ITEMS = 50;
@@ -413,13 +402,13 @@ export const ArchiveNotificationObservedScopeSchema = z.discriminatedUnion('kind
413
402
  * audienceScope, requestId:activeId)`), so a single archive can never collide on another
414
403
  * card's history doc.
415
404
  *
416
- * `category` scopes which active-notification collection is archived
417
- * (`activeUserNotifications` vs `activeAdminNotifications`) and forms part of
418
- * the history doc path.
405
+ * The input names no category: `archiveNotification` archives the caller's own `user` cards and
406
+ * `adminArchiveNotification` the shared `admin` cards, so the callable — never a field a client
407
+ * sets — decides which active-notification collection is archived and which history path it
408
+ * forms part of.
419
409
  */
420
410
  export const ArchiveNotificationObservedInputSchema = z.object({
421
411
  requestId: z.string().min(1),
422
- category: NotificationCategorySchema,
423
412
  scope: ArchiveNotificationObservedScopeSchema,
424
413
  }).strict();
425
414
  /**
@@ -433,18 +422,19 @@ export const ArchiveNotificationResultSchema = z.object({
433
422
  hasMore: z.boolean().optional(),
434
423
  });
435
424
  // ============================================================================
436
- // SERVER-OWNED ARCHIVE-ALL JOB (replaces the browser clear-all loop)
425
+ // SERVER-OWNED ARCHIVE-ALL JOB
437
426
  //
438
- // `enqueueArchiveAll` enqueues ONE durable archive-all job scoped to the tab's
439
- // category (idempotent per user+category+requestId) and returns { jobId }; the
427
+ // `enqueueArchiveAll` / `adminEnqueueArchiveAll` enqueue ONE durable archive-all job
428
+ // scoped to the callable's category (idempotent per user+category+requestId) and return { jobId }; the
440
429
  // bounded server worker drains that category's active cards each in its own
441
430
  // atomic archive+audit txn (per-card observed-generation precondition preserved).
442
431
  // `getArchiveAllStatus` is polled by the thin client hook. Per-tab scoping is
443
432
  // REQUIRED — a job only ever archives its own category, never all tabs.
444
433
  // ============================================================================
434
+ // No category, for the reason ArchiveNotificationObservedInputSchema gives: `enqueueArchiveAll`
435
+ // clears the caller's `user` tab and `adminEnqueueArchiveAll` the shared `admin` tab.
445
436
  export const EnqueueArchiveAllInputSchema = z.object({
446
437
  requestId: z.string().min(1),
447
- category: NotificationCategorySchema,
448
438
  }).strict();
449
439
  export const GetArchiveAllStatusInputSchema = z.object({
450
440
  jobId: documentIdSegmentSchema,
@@ -467,6 +457,8 @@ export const DeadLetteredFanoutJobRowSchema = z.object({
467
457
  lastError: z.string().nullable(),
468
458
  ageMs: z.number().nullable(),
469
459
  });
460
+ /** The `listDeadLetteredFanoutJobs` input: the inventory takes no parameters, and anything sent is refused. */
461
+ export const ListDeadLetteredFanoutJobsInputSchema = z.object({}).strict();
470
462
  export const ListDeadLetteredFanoutJobsResultSchema = z.object({
471
463
  jobs: z.array(DeadLetteredFanoutJobRowSchema),
472
464
  });