@ttt-productions/ttt-core 0.79.10 → 0.79.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/storage-keys.d.ts +5 -0
- package/dist/constants/storage-keys.d.ts.map +1 -1
- package/dist/constants/storage-keys.js +10 -0
- package/dist/constants/storage-keys.js.map +1 -1
- package/dist/doc-schemas/account-deletion.d.ts +38 -0
- package/dist/doc-schemas/account-deletion.d.ts.map +1 -1
- package/dist/doc-schemas/account-deletion.js +35 -0
- package/dist/doc-schemas/account-deletion.js.map +1 -1
- package/dist/doc-schemas/registry.d.ts +4 -4
- package/dist/media/domain-events-work.d.ts +2 -2
- package/dist/media/domain-events-work.d.ts.map +1 -1
- package/dist/media/domain-events-work.js +5 -2
- package/dist/media/domain-events-work.js.map +1 -1
- package/dist/media/domain-events.d.ts +1 -1
- package/dist/media/domain-events.js +2 -2
- package/dist/media/domain-events.js.map +1 -1
- package/dist/media/pending-media.d.ts +11 -11
- package/dist/permissions/work-project-permissions-data.d.ts +6 -6
- package/dist/permissions/work-project-permissions-data.js +6 -6
- package/dist/permissions/work-project-permissions-data.js.map +1 -1
- package/dist/schemas/admin.d.ts +10 -0
- package/dist/schemas/admin.d.ts.map +1 -1
- package/dist/schemas/admin.js +25 -1
- package/dist/schemas/admin.js.map +1 -1
- package/dist/schemas/atoms.d.ts +10 -0
- package/dist/schemas/atoms.d.ts.map +1 -1
- package/dist/schemas/atoms.js +10 -0
- package/dist/schemas/atoms.js.map +1 -1
- package/dist/schemas/chat.d.ts +5 -0
- package/dist/schemas/chat.d.ts.map +1 -1
- package/dist/schemas/chat.js +8 -0
- package/dist/schemas/chat.js.map +1 -1
- package/dist/schemas/commissions.d.ts +0 -4
- package/dist/schemas/commissions.d.ts.map +1 -1
- package/dist/schemas/commissions.js +0 -3
- package/dist/schemas/commissions.js.map +1 -1
- package/dist/types/audit.d.ts +1 -1
- package/dist/types/audit.d.ts.map +1 -1
- package/dist/types/audit.js.map +1 -1
- package/package.json +2 -2
|
@@ -25,4 +25,9 @@ export declare const REDUCED_MOTION_STORAGE_KEY = "ttt-reduced-motion";
|
|
|
25
25
|
/** Same-tab window event dispatched when REDUCED_MOTION_STORAGE_KEY changes (localStorage
|
|
26
26
|
* 'storage' events do not fire in the writing tab), mirroring COMPANION_CHANGE_EVENT. */
|
|
27
27
|
export declare const REDUCED_MOTION_CHANGE_EVENT = "ttt-reduced-motion-change";
|
|
28
|
+
/** localStorage key holding the member's text-size preference ('standard' | 'large'). */
|
|
29
|
+
export declare const TEXT_SIZE_STORAGE_KEY = "ttt-text-size";
|
|
30
|
+
/** Same-tab window event dispatched when TEXT_SIZE_STORAGE_KEY changes (localStorage
|
|
31
|
+
* 'storage' events do not fire in the writing tab), mirroring REDUCED_MOTION_CHANGE_EVENT. */
|
|
32
|
+
export declare const TEXT_SIZE_CHANGE_EVENT = "ttt-text-size-change";
|
|
28
33
|
//# sourceMappingURL=storage-keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-keys.d.ts","sourceRoot":"","sources":["../../src/constants/storage-keys.ts"],"names":[],"mappings":"AAEA,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD,2FAA2F;AAC3F,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,uFAAuF;AACvF,eAAO,MAAM,uBAAuB,iCAAiC,CAAC;AAMtE,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAE7D,qFAAqF;AACrF,eAAO,MAAM,yBAAyB,oBAAoB,CAAC;AAE3D;uCACuC;AACvC,eAAO,MAAM,6BAA6B,wBAAwB,CAAC;AAEnE;sEACsE;AACtE,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AAEjE,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,iCAAiC,CAAC;AAErE;0CAC0C;AAC1C,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAS/D;8EAC8E;AAC9E,eAAO,MAAM,0BAA0B,uBAAuB,CAAC;AAE/D;0FAC0F;AAC1F,eAAO,MAAM,2BAA2B,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"storage-keys.d.ts","sourceRoot":"","sources":["../../src/constants/storage-keys.ts"],"names":[],"mappings":"AAEA,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD,2FAA2F;AAC3F,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,uFAAuF;AACvF,eAAO,MAAM,uBAAuB,iCAAiC,CAAC;AAMtE,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAE7D,qFAAqF;AACrF,eAAO,MAAM,yBAAyB,oBAAoB,CAAC;AAE3D;uCACuC;AACvC,eAAO,MAAM,6BAA6B,wBAAwB,CAAC;AAEnE;sEACsE;AACtE,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AAEjE,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,iCAAiC,CAAC;AAErE;0CAC0C;AAC1C,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAS/D;8EAC8E;AAC9E,eAAO,MAAM,0BAA0B,uBAAuB,CAAC;AAE/D;0FAC0F;AAC1F,eAAO,MAAM,2BAA2B,8BAA8B,CAAC;AAQvE,yFAAyF;AACzF,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AAErD;+FAC+F;AAC/F,eAAO,MAAM,sBAAsB,yBAAyB,CAAC"}
|
|
@@ -35,4 +35,14 @@ export const REDUCED_MOTION_STORAGE_KEY = 'ttt-reduced-motion';
|
|
|
35
35
|
/** Same-tab window event dispatched when REDUCED_MOTION_STORAGE_KEY changes (localStorage
|
|
36
36
|
* 'storage' events do not fire in the writing tab), mirroring COMPANION_CHANGE_EVENT. */
|
|
37
37
|
export const REDUCED_MOTION_CHANGE_EVENT = 'ttt-reduced-motion-change';
|
|
38
|
+
// --- Large-text House control (device-local) ---
|
|
39
|
+
// The root font-size scale behind the House "Text size" control. Same device-local
|
|
40
|
+
// useSyncExternalStore shape as the reduced-motion control above — never mirrored to Firestore
|
|
41
|
+
// or the private user document. The <html> CSS hook it applies stays app-side next to the rule
|
|
42
|
+
// that defines it (as the reduced-motion store's root attribute does).
|
|
43
|
+
/** localStorage key holding the member's text-size preference ('standard' | 'large'). */
|
|
44
|
+
export const TEXT_SIZE_STORAGE_KEY = 'ttt-text-size';
|
|
45
|
+
/** Same-tab window event dispatched when TEXT_SIZE_STORAGE_KEY changes (localStorage
|
|
46
|
+
* 'storage' events do not fire in the writing tab), mirroring REDUCED_MOTION_CHANGE_EVENT. */
|
|
47
|
+
export const TEXT_SIZE_CHANGE_EVENT = 'ttt-text-size-change';
|
|
38
48
|
//# sourceMappingURL=storage-keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-keys.js","sourceRoot":"","sources":["../../src/constants/storage-keys.ts"],"names":[],"mappings":"AAAA,iEAAiE;AAEjE,4FAA4F;AAC5F,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAEhD,2FAA2F;AAC3F,MAAM,CAAC,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAEhD,uFAAuF;AACvF,MAAM,CAAC,MAAM,uBAAuB,GAAG,8BAA8B,CAAC;AAEtE,uEAAuE;AACvE,4EAA4E;AAC5E,0DAA0D;AAE1D,qFAAqF;AACrF,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAE7D,qFAAqF;AACrF,MAAM,CAAC,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;AAE3D;uCACuC;AACvC,MAAM,CAAC,MAAM,6BAA6B,GAAG,qBAAqB,CAAC;AAEnE;sEACsE;AACtE,MAAM,CAAC,MAAM,0BAA0B,GAAG,sBAAsB,CAAC;AAEjE,2EAA2E;AAC3E,MAAM,CAAC,MAAM,sBAAsB,GAAG,8BAA8B,CAAC;AAErE;0CAC0C;AAC1C,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAE/D,6DAA6D;AAC7D,yFAAyF;AACzF,0FAA0F;AAC1F,wFAAwF;AACxF,2FAA2F;AAC3F,8DAA8D;AAE9D;8EAC8E;AAC9E,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAAoB,CAAC;AAE/D;0FAC0F;AAC1F,MAAM,CAAC,MAAM,2BAA2B,GAAG,2BAA2B,CAAC","sourcesContent":["// Well-known keys used in browser sessionStorage / localStorage.\n\n/** sessionStorage key holding the path the user wanted before being redirected to login. */\nexport const REDIRECT_PATH_KEY = 'redirectPath';\n\n/** localStorage key holding the last-seen app version (used by version-gate component). */\nexport const LS_VERSION_KEY = 'ttt-app-version';\n\n/** sessionStorage key marking that a version-mismatch reload was already attempted. */\nexport const SS_RELOAD_ATTEMPTED_KEY = 'ttt-version-reload-attempted';\n\n// --- Company / Green Room dock companion (device-local v1 stores) ---\n// Values are byte-stable for backward compatibility — the historical 'bill'\n// naming predates the Company rename and MUST NOT change.\n\n/** localStorage key holding the user's chosen dock companion id ('bill' | 'kit'). */\nexport const COMPANION_STORAGE_KEY = 'ttt-company-companion';\n\n/** localStorage key: 'true' when the user has hidden the dock companion entirely. */\nexport const MASCOT_HIDDEN_STORAGE_KEY = 'ttt-bill-hidden';\n\n/** localStorage key holding the last-shown dock-bubble line index (avoids an\n * immediate repeat across visits). */\nexport const MASCOT_LINE_INDEX_STORAGE_KEY = 'ttt-bill-line-index';\n\n/** Same-tab window event dispatched when MASCOT_HIDDEN_STORAGE_KEY changes\n * (localStorage 'storage' events do not fire in the writing tab). */\nexport const MASCOT_HIDDEN_CHANGE_EVENT = 'ttt-bill-pref-change';\n\n/** Same-tab window event dispatched when COMPANION_STORAGE_KEY changes. */\nexport const COMPANION_CHANGE_EVENT = 'ttt-company-companion-change';\n\n/** Same-tab window event dispatched when the transient dock-puppet pose changes\n * (in-memory store; never persisted). */\nexport const MASCOT_POSE_CHANGE_EVENT = 'ttt-bill-pose-change';\n\n// --- Manual reduced-motion House control (device-local) ---\n// Independent of the companion visibility store above: reducing motion does not hide the\n// companion, and hiding the companion does not change motion. Effective reduced motion is\n// (the device's prefers-reduced-motion request) OR (this manual preference); the device\n// request always wins. Device-local BY DESIGN — never mirrored to Firestore or the private\n// user document (unlike the account-durable site-tour state).\n\n/** localStorage key: 'true' when the member has manually enabled TTT's app-wide\n * reduced-motion preference (the \"Motion: Full / Reduced\" House control). */\nexport const REDUCED_MOTION_STORAGE_KEY = 'ttt-reduced-motion';\n\n/** Same-tab window event dispatched when REDUCED_MOTION_STORAGE_KEY changes (localStorage\n * 'storage' events do not fire in the writing tab), mirroring COMPANION_CHANGE_EVENT. */\nexport const REDUCED_MOTION_CHANGE_EVENT = 'ttt-reduced-motion-change';\n"]}
|
|
1
|
+
{"version":3,"file":"storage-keys.js","sourceRoot":"","sources":["../../src/constants/storage-keys.ts"],"names":[],"mappings":"AAAA,iEAAiE;AAEjE,4FAA4F;AAC5F,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAEhD,2FAA2F;AAC3F,MAAM,CAAC,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAEhD,uFAAuF;AACvF,MAAM,CAAC,MAAM,uBAAuB,GAAG,8BAA8B,CAAC;AAEtE,uEAAuE;AACvE,4EAA4E;AAC5E,0DAA0D;AAE1D,qFAAqF;AACrF,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAE7D,qFAAqF;AACrF,MAAM,CAAC,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;AAE3D;uCACuC;AACvC,MAAM,CAAC,MAAM,6BAA6B,GAAG,qBAAqB,CAAC;AAEnE;sEACsE;AACtE,MAAM,CAAC,MAAM,0BAA0B,GAAG,sBAAsB,CAAC;AAEjE,2EAA2E;AAC3E,MAAM,CAAC,MAAM,sBAAsB,GAAG,8BAA8B,CAAC;AAErE;0CAC0C;AAC1C,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAE/D,6DAA6D;AAC7D,yFAAyF;AACzF,0FAA0F;AAC1F,wFAAwF;AACxF,2FAA2F;AAC3F,8DAA8D;AAE9D;8EAC8E;AAC9E,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAAoB,CAAC;AAE/D;0FAC0F;AAC1F,MAAM,CAAC,MAAM,2BAA2B,GAAG,2BAA2B,CAAC;AAEvE,kDAAkD;AAClD,mFAAmF;AACnF,+FAA+F;AAC/F,+FAA+F;AAC/F,uEAAuE;AAEvE,yFAAyF;AACzF,MAAM,CAAC,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAErD;+FAC+F;AAC/F,MAAM,CAAC,MAAM,sBAAsB,GAAG,sBAAsB,CAAC","sourcesContent":["// Well-known keys used in browser sessionStorage / localStorage.\n\n/** sessionStorage key holding the path the user wanted before being redirected to login. */\nexport const REDIRECT_PATH_KEY = 'redirectPath';\n\n/** localStorage key holding the last-seen app version (used by version-gate component). */\nexport const LS_VERSION_KEY = 'ttt-app-version';\n\n/** sessionStorage key marking that a version-mismatch reload was already attempted. */\nexport const SS_RELOAD_ATTEMPTED_KEY = 'ttt-version-reload-attempted';\n\n// --- Company / Green Room dock companion (device-local v1 stores) ---\n// Values are byte-stable for backward compatibility — the historical 'bill'\n// naming predates the Company rename and MUST NOT change.\n\n/** localStorage key holding the user's chosen dock companion id ('bill' | 'kit'). */\nexport const COMPANION_STORAGE_KEY = 'ttt-company-companion';\n\n/** localStorage key: 'true' when the user has hidden the dock companion entirely. */\nexport const MASCOT_HIDDEN_STORAGE_KEY = 'ttt-bill-hidden';\n\n/** localStorage key holding the last-shown dock-bubble line index (avoids an\n * immediate repeat across visits). */\nexport const MASCOT_LINE_INDEX_STORAGE_KEY = 'ttt-bill-line-index';\n\n/** Same-tab window event dispatched when MASCOT_HIDDEN_STORAGE_KEY changes\n * (localStorage 'storage' events do not fire in the writing tab). */\nexport const MASCOT_HIDDEN_CHANGE_EVENT = 'ttt-bill-pref-change';\n\n/** Same-tab window event dispatched when COMPANION_STORAGE_KEY changes. */\nexport const COMPANION_CHANGE_EVENT = 'ttt-company-companion-change';\n\n/** Same-tab window event dispatched when the transient dock-puppet pose changes\n * (in-memory store; never persisted). */\nexport const MASCOT_POSE_CHANGE_EVENT = 'ttt-bill-pose-change';\n\n// --- Manual reduced-motion House control (device-local) ---\n// Independent of the companion visibility store above: reducing motion does not hide the\n// companion, and hiding the companion does not change motion. Effective reduced motion is\n// (the device's prefers-reduced-motion request) OR (this manual preference); the device\n// request always wins. Device-local BY DESIGN — never mirrored to Firestore or the private\n// user document (unlike the account-durable site-tour state).\n\n/** localStorage key: 'true' when the member has manually enabled TTT's app-wide\n * reduced-motion preference (the \"Motion: Full / Reduced\" House control). */\nexport const REDUCED_MOTION_STORAGE_KEY = 'ttt-reduced-motion';\n\n/** Same-tab window event dispatched when REDUCED_MOTION_STORAGE_KEY changes (localStorage\n * 'storage' events do not fire in the writing tab), mirroring COMPANION_CHANGE_EVENT. */\nexport const REDUCED_MOTION_CHANGE_EVENT = 'ttt-reduced-motion-change';\n\n// --- Large-text House control (device-local) ---\n// The root font-size scale behind the House \"Text size\" control. Same device-local\n// useSyncExternalStore shape as the reduced-motion control above — never mirrored to Firestore\n// or the private user document. The <html> CSS hook it applies stays app-side next to the rule\n// that defines it (as the reduced-motion store's root attribute does).\n\n/** localStorage key holding the member's text-size preference ('standard' | 'large'). */\nexport const TEXT_SIZE_STORAGE_KEY = 'ttt-text-size';\n\n/** Same-tab window event dispatched when TEXT_SIZE_STORAGE_KEY changes (localStorage\n * 'storage' events do not fire in the writing tab), mirroring REDUCED_MOTION_CHANGE_EVENT. */\nexport const TEXT_SIZE_CHANGE_EVENT = 'ttt-text-size-change';\n"]}
|
|
@@ -10,6 +10,43 @@ export declare const AccountDeletionRequestStatusSchema: z.ZodEnum<{
|
|
|
10
10
|
superseded: "superseded";
|
|
11
11
|
}>;
|
|
12
12
|
export type AccountDeletionRequestStatus = z.infer<typeof AccountDeletionRequestStatusSchema>;
|
|
13
|
+
/**
|
|
14
|
+
* ACTIVE = the request is still OPEN and still cancellable. This is the one predicate the
|
|
15
|
+
* lifecycle's enforcement points share — `requestAccountDeletion`'s idempotent re-return of the
|
|
16
|
+
* existing schedule, `cancelAccountDeletion`'s cancel gate, the scrub worker's due-request query,
|
|
17
|
+
* and the client's live own-request read — each of which previously restated
|
|
18
|
+
* `status === 'pending' || status === 'parkedOnHold'` locally (ARCH-102).
|
|
19
|
+
*
|
|
20
|
+
* Declared as an EXHAUSTIVE Record over the status union, not as a subset array: a subset array
|
|
21
|
+
* only catches a REMOVED member, whereas adding a lifecycle status must be a compile error here
|
|
22
|
+
* until that status is classified. A new status silently defaulting to "not active" is exactly the
|
|
23
|
+
* drift this classification exists to prevent.
|
|
24
|
+
*
|
|
25
|
+
* `scrubbing` / `leased` are deliberately NOT active — the destructive erasure has already begun,
|
|
26
|
+
* so there is no schedule left to re-offer and nothing left to cancel. `cancelled` / `completed` /
|
|
27
|
+
* `superseded` are terminal.
|
|
28
|
+
*/
|
|
29
|
+
declare const DELETION_REQUEST_STATUS_IS_ACTIVE: {
|
|
30
|
+
readonly pending: true;
|
|
31
|
+
readonly cancelled: false;
|
|
32
|
+
readonly scrubbing: false;
|
|
33
|
+
readonly leased: false;
|
|
34
|
+
readonly parkedOnHold: true;
|
|
35
|
+
readonly completed: false;
|
|
36
|
+
readonly superseded: false;
|
|
37
|
+
};
|
|
38
|
+
/** The statuses classified ACTIVE above, as a literal union — derived, never restated. */
|
|
39
|
+
export type ActiveDeletionRequestStatus = {
|
|
40
|
+
[K in AccountDeletionRequestStatus]: (typeof DELETION_REQUEST_STATUS_IS_ACTIVE)[K] extends true ? K : never;
|
|
41
|
+
}[AccountDeletionRequestStatus];
|
|
42
|
+
/** The ACTIVE (open, still-cancellable) deletion-request statuses, projected from the
|
|
43
|
+
* classification above in union-declaration order — so it can also feed a Firestore
|
|
44
|
+
* `where('status', 'in', ACTIVE_DELETION_REQUEST_STATUSES)` query directly. */
|
|
45
|
+
export declare const ACTIVE_DELETION_REQUEST_STATUSES: readonly ActiveDeletionRequestStatus[];
|
|
46
|
+
/** True for an ACTIVE (open, still-cancellable) deletion request. Takes `unknown` because every
|
|
47
|
+
* caller reads the status off an unvalidated Firestore doc: anything outside the canonical active
|
|
48
|
+
* set — a terminal/mid-scrub status, an unrecognized value, a missing field — is false. */
|
|
49
|
+
export declare function isActiveDeletionRequest(status: unknown): status is ActiveDeletionRequestStatus;
|
|
13
50
|
/**
|
|
14
51
|
* [C-02] The erasure LEASE / epoch token — the race fence between the destructive
|
|
15
52
|
* scrub and a mid-scrub safety hold.
|
|
@@ -80,4 +117,5 @@ export declare const AccountDeletionRequestV1Schema: z.ZodObject<{
|
|
|
80
117
|
updatedAt: z.ZodNumber;
|
|
81
118
|
}, z.core.$strict>;
|
|
82
119
|
export type AccountDeletionRequestV1 = z.infer<typeof AccountDeletionRequestV1Schema>;
|
|
120
|
+
export {};
|
|
83
121
|
//# sourceMappingURL=account-deletion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-deletion.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/account-deletion.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gDAAgD;AAChD,eAAO,MAAM,kCAAkC;;;;;;;;EAU7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;kBAmBtB,CAAC;AACZ,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,yEAAyE;AACzE,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0BhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"account-deletion.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/account-deletion.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gDAAgD;AAChD,eAAO,MAAM,kCAAkC;;;;;;;;EAU7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,iCAAiC;;;;;;;;CAQ2B,CAAC;AAEnE,0FAA0F;AAC1F,MAAM,MAAM,2BAA2B,GAAG;KACvC,CAAC,IAAI,4BAA4B,GAAG,CAAC,OAAO,iCAAiC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,KAAK;CAC5G,CAAC,4BAA4B,CAAC,CAAC;AAEhC;;gFAEgF;AAChF,eAAO,MAAM,gCAAgC,EAAE,SAAS,2BAA2B,EAEmB,CAAC;AAEvG;;4FAE4F;AAC5F,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,2BAA2B,CAE9F;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;kBAmBtB,CAAC;AACZ,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,yEAAyE;AACzE,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0BhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -38,6 +38,41 @@ export const AccountDeletionRequestStatusSchema = z.enum([
|
|
|
38
38
|
'completed', // erasure finished
|
|
39
39
|
'superseded', // overridden by a ban-for-cause / evidence-preservation outcome
|
|
40
40
|
]);
|
|
41
|
+
/**
|
|
42
|
+
* ACTIVE = the request is still OPEN and still cancellable. This is the one predicate the
|
|
43
|
+
* lifecycle's enforcement points share — `requestAccountDeletion`'s idempotent re-return of the
|
|
44
|
+
* existing schedule, `cancelAccountDeletion`'s cancel gate, the scrub worker's due-request query,
|
|
45
|
+
* and the client's live own-request read — each of which previously restated
|
|
46
|
+
* `status === 'pending' || status === 'parkedOnHold'` locally (ARCH-102).
|
|
47
|
+
*
|
|
48
|
+
* Declared as an EXHAUSTIVE Record over the status union, not as a subset array: a subset array
|
|
49
|
+
* only catches a REMOVED member, whereas adding a lifecycle status must be a compile error here
|
|
50
|
+
* until that status is classified. A new status silently defaulting to "not active" is exactly the
|
|
51
|
+
* drift this classification exists to prevent.
|
|
52
|
+
*
|
|
53
|
+
* `scrubbing` / `leased` are deliberately NOT active — the destructive erasure has already begun,
|
|
54
|
+
* so there is no schedule left to re-offer and nothing left to cancel. `cancelled` / `completed` /
|
|
55
|
+
* `superseded` are terminal.
|
|
56
|
+
*/
|
|
57
|
+
const DELETION_REQUEST_STATUS_IS_ACTIVE = {
|
|
58
|
+
pending: true,
|
|
59
|
+
cancelled: false,
|
|
60
|
+
scrubbing: false,
|
|
61
|
+
leased: false,
|
|
62
|
+
parkedOnHold: true,
|
|
63
|
+
completed: false,
|
|
64
|
+
superseded: false,
|
|
65
|
+
};
|
|
66
|
+
/** The ACTIVE (open, still-cancellable) deletion-request statuses, projected from the
|
|
67
|
+
* classification above in union-declaration order — so it can also feed a Firestore
|
|
68
|
+
* `where('status', 'in', ACTIVE_DELETION_REQUEST_STATUSES)` query directly. */
|
|
69
|
+
export const ACTIVE_DELETION_REQUEST_STATUSES = Object.keys(DELETION_REQUEST_STATUS_IS_ACTIVE).filter((status) => DELETION_REQUEST_STATUS_IS_ACTIVE[status]);
|
|
70
|
+
/** True for an ACTIVE (open, still-cancellable) deletion request. Takes `unknown` because every
|
|
71
|
+
* caller reads the status off an unvalidated Firestore doc: anything outside the canonical active
|
|
72
|
+
* set — a terminal/mid-scrub status, an unrecognized value, a missing field — is false. */
|
|
73
|
+
export function isActiveDeletionRequest(status) {
|
|
74
|
+
return typeof status === 'string' && ACTIVE_DELETION_REQUEST_STATUSES.includes(status);
|
|
75
|
+
}
|
|
41
76
|
/**
|
|
42
77
|
* [C-02] The erasure LEASE / epoch token — the race fence between the destructive
|
|
43
78
|
* scrub and a mid-scrub safety hold.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-deletion.js","sourceRoot":"","sources":["../../src/doc-schemas/account-deletion.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,EAAE;AACF,6EAA6E;AAC7E,gFAAgF;AAChF,iFAAiF;AACjF,6EAA6E;AAC7E,mEAAmE;AACnE,iFAAiF;AACjF,qEAAqE;AACrE,iFAAiF;AACjF,iFAAiF;AACjF,kFAAkF;AAClF,6CAA6C;AAC7C,EAAE;AACF,gFAAgF;AAChF,8DAA8D;AAC9D,EAAE;AACF,+EAA+E;AAC/E,iFAAiF;AACjF,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,+EAA+E;AAC/E,kFAAkF;AAClF,gFAAgF;AAChF,iFAAiF;AACjF,yEAAyE;AAEzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gDAAgD;AAChD,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,IAAI,CAAC;IACvD,SAAS,EAAE,4DAA4D;IACvE,WAAW,EAAE,4DAA4D;IACzE,WAAW,EAAE,8DAA8D;IAC3E,gFAAgF;IAChF,wFAAwF;IACxF,QAAQ;IACR,cAAc,EAAE,mEAAmE;IACnF,WAAW,EAAE,mBAAmB;IAChC,YAAY,EAAE,gEAAgE;CAC/E,CAAC,CAAC;AAGH;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC;KAClC,MAAM,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,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,+EAA+E;IAC/E,gFAAgF;IAChF,YAAY,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC7C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Account-deletion / GDPR-erasure request SCHEMA — `accountDeletionRequests/{uid}`.\n//\n// N3 data-deletion flow. A user clicks \"delete account\" on their profile → a\n// request doc is created (one per user, doc id = uid, create-if-absent) and the\n// account is immediately deactivated/locked out. The request runs a 30-day grace\n// window (logging back in CANCELS it). After the window, the scheduled scrub\n// worker checks for any BLOCKING safety hold over the user's data:\n// - no hold → anonymize-in-place (scrub PII, release reserved name, anonymize\n// chat history, tombstone memberships) → `completed`.\n// - hold → `parkedOnHold` (re-checked periodically): resumes + `completed`\n// once cleared, or → `superseded` if it becomes a ban-for-cause /\n// evidence-preservation outcome (the erasure is overridden and the\n// data retained as evidence).\n//\n// The scrub itself deletes/anonymizes data across many collections; this doc is\n// ONLY the request lifecycle + the worker's resumable cursor.\n//\n// [C-02] Erasure-vs-safety-hold race fence. The destructive scrub and a safety\n// hold landing mid-scrub race over the SAME account. The fence is an epoch LEASE\n// stamped on THIS doc (`erasureLease`): the scrub transactionally acquires the\n// lease ONLY when the account owns no active blocking hold; every destructive\n// write re-checks the SAME epoch in its own transaction; and `commitSafetyHold`\n// (the SINGLE shared hold authority) reads this doc's live lease and PARKS the\n// erasure (revoking the epoch) before committing a hold against a leased account.\n// A revoked epoch makes every still-running destructive step a no-op. The lease\n// lives HERE — not a parallel safety-only deletion subsystem — so the one shared\n// hold/destructive contract owns the fence (engineering-rules ARCH-001).\n\nimport { z } from 'zod';\n\n/** Lifecycle of an account-deletion request. */\nexport const AccountDeletionRequestStatusSchema = z.enum([\n 'pending', // grace window running; user can still cancel by logging in\n 'cancelled', // user cancelled (logged back in) before the window elapsed\n 'scrubbing', // the scrub worker has started the anonymize-in-place erasure\n // [C-02] the scrub holds an ACTIVE erasure lease and is mid-destruction. A hold\n // landing now revokes the lease (→ parkedOnHold) so the scrub aborts deterministically.\n 'leased',\n 'parkedOnHold', // erasure deferred — a blocking safety hold covers the user's data\n 'completed', // erasure finished\n 'superseded', // overridden by a ban-for-cause / evidence-preservation outcome\n]);\nexport type AccountDeletionRequestStatus = z.infer<typeof AccountDeletionRequestStatusSchema>;\n\n/**\n * [C-02] The erasure LEASE / epoch token — the race fence between the destructive\n * scrub and a mid-scrub safety hold.\n *\n * The scrub acquires this transactionally ONLY when the account owns no active\n * blocking hold; it then re-verifies the SAME `epoch` inside every destructive\n * Firestore transaction and immediately before AND after each non-transactional\n * external delete (Auth/Storage). `commitSafetyHold` reads this lease and, when it\n * is `active`, REVOKES it (sets `revokedByHold`/`revokedAt`, status → `parkedOnHold`)\n * in the SAME transaction that commits the hold — so a hold deterministically wins\n * the race and the scrub, finding its epoch revoked on the next check, aborts into\n * a recoverable parked state without finishing the destruction.\n */\nexport const ErasureLeaseV1Schema = z\n .object({\n /** Monotonic acquisition token. The \"live lease\" identity: every destructive step\n * re-reads the doc and proceeds ONLY if this still equals the epoch it acquired. */\n epoch: z.number().int().nonnegative(),\n /** 'active' = the scrub holds the lease; 'revoked' = a hold reclaimed it mid-scrub\n * (the scrub must abort); 'released' = the scrub finished/relinquished cleanly. */\n state: z.enum(['active', 'revoked', 'released']),\n acquiredAt: z.number(),\n /** Staleness boundary. A still-`active` lease past this is presumed crashed and may\n * be safely superseded by a fresh acquisition (idempotent retry / crash recovery). */\n expiresAt: z.number(),\n /** Last destructive phase the scrub reached under this epoch (observability + recovery). */\n phase: z.string().optional(),\n /** Set when a hold revoked the lease — the caseId/refId of the winning hold (audit trail). */\n revokedByHoldRefId: z.string().min(1).optional(),\n revokedAt: z.number().optional(),\n releasedAt: z.number().optional(),\n })\n .strict();\nexport type ErasureLeaseV1 = z.infer<typeof ErasureLeaseV1Schema>;\n\n/** `accountDeletionRequests/{uid}` — one per user; doc id IS the uid. */\nexport const AccountDeletionRequestV1Schema = z\n .object({\n schemaVersion: z.literal(1),\n uid: z.string().min(1),\n status: AccountDeletionRequestStatusSchema,\n requestedAt: z.number(),\n // requestedAt + graceDays; the scrub worker queries status='pending' AND\n // scheduledScrubAt <= now (composite index, ttt-prod firestore.indexes.json).\n scheduledScrubAt: z.number(),\n graceDays: z.number(), // recorded for the audit/compliance trail (30 at launch)\n cancelledAt: z.number().optional(),\n scrubStartedAt: z.number().optional(),\n // Why a scrub is parked (e.g. 'blocking safety hold over user data') — kept for\n // the GDPR compliance record so a deferred erasure is explainable.\n parkedReason: z.string().optional(),\n parkedAt: z.number().optional(),\n lastHoldCheckAt: z.number().optional(),\n completedAt: z.number().optional(),\n supersededAt: z.number().optional(),\n supersededReason: z.string().optional(),\n // [C-02] the erasure-vs-hold race fence (see ErasureLeaseV1). Absent until the\n // scrub first acquires the lease; thereafter it carries the live epoch + state.\n erasureLease: ErasureLeaseV1Schema.optional(),\n createdAt: z.number(),\n updatedAt: z.number(),\n })\n .strict();\nexport type AccountDeletionRequestV1 = z.infer<typeof AccountDeletionRequestV1Schema>;\n"]}
|
|
1
|
+
{"version":3,"file":"account-deletion.js","sourceRoot":"","sources":["../../src/doc-schemas/account-deletion.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,EAAE;AACF,6EAA6E;AAC7E,gFAAgF;AAChF,iFAAiF;AACjF,6EAA6E;AAC7E,mEAAm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E;IACrC,gFAAgF;IAChF,mEAAmE;IACnE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,+EAA+E;IAC/E,gFAAgF;IAChF,YAAY,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC7C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// Account-deletion / GDPR-erasure request SCHEMA — `accountDeletionRequests/{uid}`.\n//\n// N3 data-deletion flow. A user clicks \"delete account\" on their profile → a\n// request doc is created (one per user, doc id = uid, create-if-absent) and the\n// account is immediately deactivated/locked out. The request runs a 30-day grace\n// window (logging back in CANCELS it). After the window, the scheduled scrub\n// worker checks for any BLOCKING safety hold over the user's data:\n// - no hold → anonymize-in-place (scrub PII, release reserved name, anonymize\n// chat history, tombstone memberships) → `completed`.\n// - hold → `parkedOnHold` (re-checked periodically): resumes + `completed`\n// once cleared, or → `superseded` if it becomes a ban-for-cause /\n// evidence-preservation outcome (the erasure is overridden and the\n// data retained as evidence).\n//\n// The scrub itself deletes/anonymizes data across many collections; this doc is\n// ONLY the request lifecycle + the worker's resumable cursor.\n//\n// [C-02] Erasure-vs-safety-hold race fence. The destructive scrub and a safety\n// hold landing mid-scrub race over the SAME account. The fence is an epoch LEASE\n// stamped on THIS doc (`erasureLease`): the scrub transactionally acquires the\n// lease ONLY when the account owns no active blocking hold; every destructive\n// write re-checks the SAME epoch in its own transaction; and `commitSafetyHold`\n// (the SINGLE shared hold authority) reads this doc's live lease and PARKS the\n// erasure (revoking the epoch) before committing a hold against a leased account.\n// A revoked epoch makes every still-running destructive step a no-op. The lease\n// lives HERE — not a parallel safety-only deletion subsystem — so the one shared\n// hold/destructive contract owns the fence (engineering-rules ARCH-001).\n\nimport { z } from 'zod';\n\n/** Lifecycle of an account-deletion request. */\nexport const AccountDeletionRequestStatusSchema = z.enum([\n 'pending', // grace window running; user can still cancel by logging in\n 'cancelled', // user cancelled (logged back in) before the window elapsed\n 'scrubbing', // the scrub worker has started the anonymize-in-place erasure\n // [C-02] the scrub holds an ACTIVE erasure lease and is mid-destruction. A hold\n // landing now revokes the lease (→ parkedOnHold) so the scrub aborts deterministically.\n 'leased',\n 'parkedOnHold', // erasure deferred — a blocking safety hold covers the user's data\n 'completed', // erasure finished\n 'superseded', // overridden by a ban-for-cause / evidence-preservation outcome\n]);\nexport type AccountDeletionRequestStatus = z.infer<typeof AccountDeletionRequestStatusSchema>;\n\n/**\n * ACTIVE = the request is still OPEN and still cancellable. This is the one predicate the\n * lifecycle's enforcement points share — `requestAccountDeletion`'s idempotent re-return of the\n * existing schedule, `cancelAccountDeletion`'s cancel gate, the scrub worker's due-request query,\n * and the client's live own-request read — each of which previously restated\n * `status === 'pending' || status === 'parkedOnHold'` locally (ARCH-102).\n *\n * Declared as an EXHAUSTIVE Record over the status union, not as a subset array: a subset array\n * only catches a REMOVED member, whereas adding a lifecycle status must be a compile error here\n * until that status is classified. A new status silently defaulting to \"not active\" is exactly the\n * drift this classification exists to prevent.\n *\n * `scrubbing` / `leased` are deliberately NOT active — the destructive erasure has already begun,\n * so there is no schedule left to re-offer and nothing left to cancel. `cancelled` / `completed` /\n * `superseded` are terminal.\n */\nconst DELETION_REQUEST_STATUS_IS_ACTIVE = {\n pending: true,\n cancelled: false,\n scrubbing: false,\n leased: false,\n parkedOnHold: true,\n completed: false,\n superseded: false,\n} as const satisfies Record<AccountDeletionRequestStatus, boolean>;\n\n/** The statuses classified ACTIVE above, as a literal union — derived, never restated. */\nexport type ActiveDeletionRequestStatus = {\n [K in AccountDeletionRequestStatus]: (typeof DELETION_REQUEST_STATUS_IS_ACTIVE)[K] extends true ? K : never;\n}[AccountDeletionRequestStatus];\n\n/** The ACTIVE (open, still-cancellable) deletion-request statuses, projected from the\n * classification above in union-declaration order — so it can also feed a Firestore\n * `where('status', 'in', ACTIVE_DELETION_REQUEST_STATUSES)` query directly. */\nexport const ACTIVE_DELETION_REQUEST_STATUSES: readonly ActiveDeletionRequestStatus[] = (\n Object.keys(DELETION_REQUEST_STATUS_IS_ACTIVE) as AccountDeletionRequestStatus[]\n).filter((status): status is ActiveDeletionRequestStatus => DELETION_REQUEST_STATUS_IS_ACTIVE[status]);\n\n/** True for an ACTIVE (open, still-cancellable) deletion request. Takes `unknown` because every\n * caller reads the status off an unvalidated Firestore doc: anything outside the canonical active\n * set — a terminal/mid-scrub status, an unrecognized value, a missing field — is false. */\nexport function isActiveDeletionRequest(status: unknown): status is ActiveDeletionRequestStatus {\n return typeof status === 'string' && (ACTIVE_DELETION_REQUEST_STATUSES as readonly string[]).includes(status);\n}\n\n/**\n * [C-02] The erasure LEASE / epoch token — the race fence between the destructive\n * scrub and a mid-scrub safety hold.\n *\n * The scrub acquires this transactionally ONLY when the account owns no active\n * blocking hold; it then re-verifies the SAME `epoch` inside every destructive\n * Firestore transaction and immediately before AND after each non-transactional\n * external delete (Auth/Storage). `commitSafetyHold` reads this lease and, when it\n * is `active`, REVOKES it (sets `revokedByHold`/`revokedAt`, status → `parkedOnHold`)\n * in the SAME transaction that commits the hold — so a hold deterministically wins\n * the race and the scrub, finding its epoch revoked on the next check, aborts into\n * a recoverable parked state without finishing the destruction.\n */\nexport const ErasureLeaseV1Schema = z\n .object({\n /** Monotonic acquisition token. The \"live lease\" identity: every destructive step\n * re-reads the doc and proceeds ONLY if this still equals the epoch it acquired. */\n epoch: z.number().int().nonnegative(),\n /** 'active' = the scrub holds the lease; 'revoked' = a hold reclaimed it mid-scrub\n * (the scrub must abort); 'released' = the scrub finished/relinquished cleanly. */\n state: z.enum(['active', 'revoked', 'released']),\n acquiredAt: z.number(),\n /** Staleness boundary. A still-`active` lease past this is presumed crashed and may\n * be safely superseded by a fresh acquisition (idempotent retry / crash recovery). */\n expiresAt: z.number(),\n /** Last destructive phase the scrub reached under this epoch (observability + recovery). */\n phase: z.string().optional(),\n /** Set when a hold revoked the lease — the caseId/refId of the winning hold (audit trail). */\n revokedByHoldRefId: z.string().min(1).optional(),\n revokedAt: z.number().optional(),\n releasedAt: z.number().optional(),\n })\n .strict();\nexport type ErasureLeaseV1 = z.infer<typeof ErasureLeaseV1Schema>;\n\n/** `accountDeletionRequests/{uid}` — one per user; doc id IS the uid. */\nexport const AccountDeletionRequestV1Schema = z\n .object({\n schemaVersion: z.literal(1),\n uid: z.string().min(1),\n status: AccountDeletionRequestStatusSchema,\n requestedAt: z.number(),\n // requestedAt + graceDays; the scrub worker queries status='pending' AND\n // scheduledScrubAt <= now (composite index, ttt-prod firestore.indexes.json).\n scheduledScrubAt: z.number(),\n graceDays: z.number(), // recorded for the audit/compliance trail (30 at launch)\n cancelledAt: z.number().optional(),\n scrubStartedAt: z.number().optional(),\n // Why a scrub is parked (e.g. 'blocking safety hold over user data') — kept for\n // the GDPR compliance record so a deferred erasure is explainable.\n parkedReason: z.string().optional(),\n parkedAt: z.number().optional(),\n lastHoldCheckAt: z.number().optional(),\n completedAt: z.number().optional(),\n supersededAt: z.number().optional(),\n supersededReason: z.string().optional(),\n // [C-02] the erasure-vs-hold race fence (see ErasureLeaseV1). Absent until the\n // scrub first acquires the lease; thereafter it carries the live epoch + state.\n erasureLease: ErasureLeaseV1Schema.optional(),\n createdAt: z.number(),\n updatedAt: z.number(),\n })\n .strict();\nexport type AccountDeletionRequestV1 = z.infer<typeof AccountDeletionRequestV1Schema>;\n"]}
|
|
@@ -2096,7 +2096,7 @@ export declare const COLLECTION_SCHEMAS: {
|
|
|
2096
2096
|
workProjectId: z.ZodOptional<z.ZodString>;
|
|
2097
2097
|
}, z.core.$strict>;
|
|
2098
2098
|
}, z.core.$strict>, z.ZodObject<{
|
|
2099
|
-
type: z.ZodLiteral<"commission.
|
|
2099
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
2100
2100
|
ids: z.ZodObject<{
|
|
2101
2101
|
commissionListingId: z.ZodString;
|
|
2102
2102
|
workProjectId: z.ZodString;
|
|
@@ -2526,7 +2526,7 @@ export declare const COLLECTION_SCHEMAS: {
|
|
|
2526
2526
|
workProjectId: z.ZodOptional<z.ZodString>;
|
|
2527
2527
|
}, z.core.$strict>;
|
|
2528
2528
|
}, z.core.$strict>, z.ZodObject<{
|
|
2529
|
-
type: z.ZodLiteral<"commission.
|
|
2529
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
2530
2530
|
ids: z.ZodObject<{
|
|
2531
2531
|
commissionListingId: z.ZodString;
|
|
2532
2532
|
workProjectId: z.ZodString;
|
|
@@ -2887,7 +2887,7 @@ export declare const COLLECTION_SCHEMAS: {
|
|
|
2887
2887
|
workProjectId: z.ZodOptional<z.ZodString>;
|
|
2888
2888
|
}, z.core.$strict>;
|
|
2889
2889
|
}, z.core.$strict>, z.ZodObject<{
|
|
2890
|
-
type: z.ZodLiteral<"commission.
|
|
2890
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
2891
2891
|
ids: z.ZodObject<{
|
|
2892
2892
|
commissionListingId: z.ZodString;
|
|
2893
2893
|
workProjectId: z.ZodString;
|
|
@@ -3319,7 +3319,7 @@ export declare const COLLECTION_SCHEMAS: {
|
|
|
3319
3319
|
workProjectId: z.ZodOptional<z.ZodString>;
|
|
3320
3320
|
}, z.core.$strict>;
|
|
3321
3321
|
}, z.core.$strict>, z.ZodObject<{
|
|
3322
|
-
type: z.ZodLiteral<"commission.
|
|
3322
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
3323
3323
|
ids: z.ZodObject<{
|
|
3324
3324
|
commissionListingId: z.ZodString;
|
|
3325
3325
|
workProjectId: z.ZodString;
|
|
@@ -107,8 +107,8 @@ export declare const CommissionProposalSubmittedEventSchema: z.ZodObject<{
|
|
|
107
107
|
commissionProposalId: z.ZodString;
|
|
108
108
|
}, z.core.$strict>;
|
|
109
109
|
}, z.core.$strict>;
|
|
110
|
-
export declare const
|
|
111
|
-
type: z.ZodLiteral<"commission.
|
|
110
|
+
export declare const CommissionClosedEventSchema: z.ZodObject<{
|
|
111
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
112
112
|
ids: z.ZodObject<{
|
|
113
113
|
commissionListingId: z.ZodString;
|
|
114
114
|
workProjectId: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-events-work.d.ts","sourceRoot":"","sources":["../../src/media/domain-events-work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,6BAA6B;;;;;;kBAU/B,CAAC;AAEZ,eAAO,MAAM,6BAA6B;;;;;kBAK/B,CAAC;AAEZ,eAAO,MAAM,+BAA+B;;;;;;kBAUjC,CAAC;AAEZ,eAAO,MAAM,wCAAwC;;;;;kBAS1C,CAAC;AAEZ,eAAO,MAAM,0BAA0B;;;;;;;;kBAY5B,CAAC;AAEZ,eAAO,MAAM,8BAA8B;;;;;;;kBAWhC,CAAC;AAEZ,eAAO,MAAM,8BAA8B;;;;;;;kBAWhC,CAAC;AAEZ,eAAO,MAAM,+BAA+B;;;;;;kBAUjC,CAAC;AAEZ,eAAO,MAAM,gCAAgC;;;;;;;kBAWlC,CAAC;AAEZ,eAAO,MAAM,iCAAiC;;;;;;;;kBAYnC,CAAC;AAEZ,eAAO,MAAM,oCAAoC;;;;;;;;kBAYtC,CAAC;AAEZ,eAAO,MAAM,yBAAyB;;;;;;kBAU3B,CAAC;AAEZ,eAAO,MAAM,4BAA4B;;;;;;;kBAW9B,CAAC;AAEZ,eA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12 @@ export const CommissionProposalSubmittedEventSchema = z
|
|
|
162
162
|
.strict(),
|
|
163
163
|
})
|
|
164
164
|
.strict();
|
|
165
|
-
|
|
165
|
+
// Commission closed — the closeCommission callable's terminal transition. A
|
|
166
|
+
// commission listing is never deleted; closing is the only way it leaves the
|
|
167
|
+
// board, so the event name says closed.
|
|
168
|
+
export const CommissionClosedEventSchema = z
|
|
166
169
|
.object({
|
|
167
|
-
type: z.literal('commission.
|
|
170
|
+
type: z.literal('commission.closed'),
|
|
168
171
|
ids: z
|
|
169
172
|
.object({
|
|
170
173
|
commissionListingId: z.string().min(1),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-events-work.js","sourceRoot":"","sources":["../../src/media/domain-events-work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yEAAyE;AACzE,uEAAuE;AACvE,4EAA4E;AAE5E,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC;KAC3C,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC;IACtC,GAAG,EAAE,CAAC;SACH,MAAM,CAAC;QACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACzB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KACjC,CAAC;SACD,MAAM,EAAE;CACZ,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC;KAC3C,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC;IACtC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;CAC7D,CAAC;KACD,MAAM,E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KAClD,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,4BAA4B,CAAC;IAC7C,GAAG,EAAE,CAAC;SACH,MAAM,CAAC;QACN,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAChC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAC;QAC/D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KAC1B,CAAC;SACD,MAAM,EAAE;CACZ,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,4BAA4B,CAAC;IAC7C,GAAG,EAAE,CAAC;SACH,MAAM,CAAC;QACN,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KACjC,CAAC;SACD,MAAM,EAAE;CACZ,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["import { z } from \"zod\";\n\n// DomainEvent schemas for the work-project domain — work projects, guild\n// invites, auditions, commissions, hall library, and threshold-library\n// submission. Assembled into the discriminated union in ./domain-events.ts.\n\nexport const WorkProjectCreatedEventSchema = z\n .object({\n type: z.literal('workProject.created'),\n ids: z\n .object({\n userId: z.string().min(1),\n workProjectId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const WorkProjectUpdatedEventSchema = z\n .object({\n type: z.literal('workProject.updated'),\n ids: z.object({ workProjectId: z.string().min(1) }).strict(),\n })\n .strict();\n\nexport const WorkProjectPublishedEventSchema = z\n .object({\n type: z.literal('workProject.published'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n userId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const WorkProjectStakeSharesUpdatedEventSchema = z\n .object({\n type: z.literal('workProject.stakeSharesUpdated'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const GuildInviteSentEventSchema = z\n .object({\n type: z.literal('workProject.guildInviteSent'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n guildInviteId: z.string().min(1),\n inviterId: z.string().min(1),\n inviteeId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const GuildInviteAcceptedEventSchema = z\n .object({\n type: z.literal('workProject.guildInviteAccepted'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n guildInviteId: z.string().min(1),\n userId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const GuildInviteDeclinedEventSchema = z\n .object({\n type: z.literal('workProject.guildInviteDeclined'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n guildInviteId: z.string().min(1),\n userId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const GuildInviteCancelledEventSchema = z\n .object({\n type: z.literal('workProject.guildInviteCancelled'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n guildInviteId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const AuditionPromptCreatedEventSchema = z\n .object({\n type: z.literal('audition.promptCreated'),\n ids: z\n .object({\n userId: z.string().min(1),\n auditionId: z.string().min(1),\n workProjectId: z.string().min(1).optional(),\n })\n .strict(),\n })\n .strict();\n\nexport const AuditionEntrySubmittedEventSchema = z\n .object({\n type: z.literal('audition.entryCreated'),\n ids: z\n .object({\n userId: z.string().min(1),\n auditionId: z.string().min(1),\n auditionEntryId: z.string().min(1),\n workProjectId: z.string().min(1).optional(),\n })\n .strict(),\n })\n .strict();\n\nexport const AuditionEntryVoteRecordedEventSchema = z\n .object({\n type: z.literal('audition.entryVoted'),\n ids: z\n .object({\n userId: z.string().min(1),\n auditionId: z.string().min(1),\n auditionEntryId: z.string().min(1),\n workProjectId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const AuditionClosedEventSchema = z\n .object({\n type: z.literal('audition.closed'),\n ids: z\n .object({\n auditionId: z.string().min(1),\n workProjectId: z.string().min(1).optional(),\n })\n .strict(),\n })\n .strict();\n\nexport const CommissionCreatedEventSchema = z\n .object({\n type: z.literal('commission.created'),\n ids: z\n .object({\n userId: z.string().min(1),\n commissionListingId: z.string().min(1),\n workProjectId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const CommissionProposalSubmittedEventSchema = z\n .object({\n type: z.literal('commission.commissionProposalSubmitted'),\n ids: z\n .object({\n userId: z.string().min(1),\n commissionListingId: z.string().min(1),\n workProjectId: z.string().min(1),\n commissionProposalId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const CommissionDeletedEventSchema = z\n .object({\n type: z.literal('commission.deleted'),\n ids: z\n .object({\n commissionListingId: z.string().min(1),\n workProjectId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const CommissionProposalSavedEventSchema = z\n .object({\n type: z.literal('commission.commissionProposalSaved'),\n ids: z\n .object({\n commissionListingId: z.string().min(1),\n commissionProposalId: z.string().min(1),\n userId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const CommissionProposalRemovedEventSchema = z\n .object({\n type: z.literal('commission.commissionProposalRemoved'),\n ids: z\n .object({\n commissionListingId: z.string().min(1),\n commissionProposalId: z.string().min(1),\n userId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const HallLibraryCoverUpdatedEventSchema = z\n .object({\n type: z.literal('hallLibrary.coverUpdated'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n itemType: z.enum(['tale', 'tune', 'television']),\n itemId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\n// Realm cover published — the 'realm-cover' upload origin's publication adapter\n// wrote `realmCoverAssetId` onto workRealms/{workRealmId}.\nexport const WorkRealmCoverUpdatedEventSchema = z\n .object({\n type: z.literal('workRealm.coverUpdated'),\n ids: z\n .object({\n workRealmId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const HallLibrarySubItemUpdatedEventSchema = z\n .object({\n type: z.literal('hallLibrary.subItemUpdated'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n itemType: z.enum(['chapter', 'tuneTrack', 'televisionEpisode']),\n parentId: z.string().min(1),\n itemId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const ThresholdLibrarySubmittedEventSchema = z\n .object({\n type: z.literal('thresholdLibrary.submitted'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n"]}
|
|
1
|
+
{"version":3,"file":"domain-events-work.js","sourceRoot":"","sources":["../../src/media/domain-events-work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yEAAyE;AACzE,uEAAuE;AACvE,4EAA4E;AAE5E,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC;KAC3C,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC;IACtC,GAAG,EAAE,CAAC;SACH,MAAM,CAAC;QACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACzB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KACjC,CAAC;SACD,MAAM,EAAE;CACZ,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC;KAC3C,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC;IACtC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;CAC7D,C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AM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,4BAA4B,CAAC;IAC7C,GAAG,EAAE,CAAC;SACH,MAAM,CAAC;QACN,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAChC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAC;QAC/D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KAC1B,CAAC;SACD,MAAM,EAAE;CACZ,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,4BAA4B,CAAC;IAC7C,GAAG,EAAE,CAAC;SACH,MAAM,CAAC;QACN,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KACjC,CAAC;SACD,MAAM,EAAE;CACZ,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["import { z } from \"zod\";\n\n// DomainEvent schemas for the work-project domain — work projects, guild\n// invites, auditions, commissions, hall library, and threshold-library\n// submission. Assembled into the discriminated union in ./domain-events.ts.\n\nexport const WorkProjectCreatedEventSchema = z\n .object({\n type: z.literal('workProject.created'),\n ids: z\n .object({\n userId: z.string().min(1),\n workProjectId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const WorkProjectUpdatedEventSchema = z\n .object({\n type: z.literal('workProject.updated'),\n ids: z.object({ workProjectId: z.string().min(1) }).strict(),\n })\n .strict();\n\nexport const WorkProjectPublishedEventSchema = z\n .object({\n type: z.literal('workProject.published'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n userId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const WorkProjectStakeSharesUpdatedEventSchema = z\n .object({\n type: z.literal('workProject.stakeSharesUpdated'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const GuildInviteSentEventSchema = z\n .object({\n type: z.literal('workProject.guildInviteSent'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n guildInviteId: z.string().min(1),\n inviterId: z.string().min(1),\n inviteeId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const GuildInviteAcceptedEventSchema = z\n .object({\n type: z.literal('workProject.guildInviteAccepted'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n guildInviteId: z.string().min(1),\n userId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const GuildInviteDeclinedEventSchema = z\n .object({\n type: z.literal('workProject.guildInviteDeclined'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n guildInviteId: z.string().min(1),\n userId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const GuildInviteCancelledEventSchema = z\n .object({\n type: z.literal('workProject.guildInviteCancelled'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n guildInviteId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const AuditionPromptCreatedEventSchema = z\n .object({\n type: z.literal('audition.promptCreated'),\n ids: z\n .object({\n userId: z.string().min(1),\n auditionId: z.string().min(1),\n workProjectId: z.string().min(1).optional(),\n })\n .strict(),\n })\n .strict();\n\nexport const AuditionEntrySubmittedEventSchema = z\n .object({\n type: z.literal('audition.entryCreated'),\n ids: z\n .object({\n userId: z.string().min(1),\n auditionId: z.string().min(1),\n auditionEntryId: z.string().min(1),\n workProjectId: z.string().min(1).optional(),\n })\n .strict(),\n })\n .strict();\n\nexport const AuditionEntryVoteRecordedEventSchema = z\n .object({\n type: z.literal('audition.entryVoted'),\n ids: z\n .object({\n userId: z.string().min(1),\n auditionId: z.string().min(1),\n auditionEntryId: z.string().min(1),\n workProjectId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const AuditionClosedEventSchema = z\n .object({\n type: z.literal('audition.closed'),\n ids: z\n .object({\n auditionId: z.string().min(1),\n workProjectId: z.string().min(1).optional(),\n })\n .strict(),\n })\n .strict();\n\nexport const CommissionCreatedEventSchema = z\n .object({\n type: z.literal('commission.created'),\n ids: z\n .object({\n userId: z.string().min(1),\n commissionListingId: z.string().min(1),\n workProjectId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const CommissionProposalSubmittedEventSchema = z\n .object({\n type: z.literal('commission.commissionProposalSubmitted'),\n ids: z\n .object({\n userId: z.string().min(1),\n commissionListingId: z.string().min(1),\n workProjectId: z.string().min(1),\n commissionProposalId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\n// Commission closed — the closeCommission callable's terminal transition. A\n// commission listing is never deleted; closing is the only way it leaves the\n// board, so the event name says closed.\nexport const CommissionClosedEventSchema = z\n .object({\n type: z.literal('commission.closed'),\n ids: z\n .object({\n commissionListingId: z.string().min(1),\n workProjectId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const CommissionProposalSavedEventSchema = z\n .object({\n type: z.literal('commission.commissionProposalSaved'),\n ids: z\n .object({\n commissionListingId: z.string().min(1),\n commissionProposalId: z.string().min(1),\n userId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const CommissionProposalRemovedEventSchema = z\n .object({\n type: z.literal('commission.commissionProposalRemoved'),\n ids: z\n .object({\n commissionListingId: z.string().min(1),\n commissionProposalId: z.string().min(1),\n userId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const HallLibraryCoverUpdatedEventSchema = z\n .object({\n type: z.literal('hallLibrary.coverUpdated'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n itemType: z.enum(['tale', 'tune', 'television']),\n itemId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\n// Realm cover published — the 'realm-cover' upload origin's publication adapter\n// wrote `realmCoverAssetId` onto workRealms/{workRealmId}.\nexport const WorkRealmCoverUpdatedEventSchema = z\n .object({\n type: z.literal('workRealm.coverUpdated'),\n ids: z\n .object({\n workRealmId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const HallLibrarySubItemUpdatedEventSchema = z\n .object({\n type: z.literal('hallLibrary.subItemUpdated'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n itemType: z.enum(['chapter', 'tuneTrack', 'televisionEpisode']),\n parentId: z.string().min(1),\n itemId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n\nexport const ThresholdLibrarySubmittedEventSchema = z\n .object({\n type: z.literal('thresholdLibrary.submitted'),\n ids: z\n .object({\n workProjectId: z.string().min(1),\n })\n .strict(),\n })\n .strict();\n"]}
|
|
@@ -225,7 +225,7 @@ export declare const DomainEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
225
225
|
workProjectId: z.ZodOptional<z.ZodString>;
|
|
226
226
|
}, z.core.$strict>;
|
|
227
227
|
}, z.core.$strict>, z.ZodObject<{
|
|
228
|
-
type: z.ZodLiteral<"commission.
|
|
228
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
229
229
|
ids: z.ZodObject<{
|
|
230
230
|
commissionListingId: z.ZodString;
|
|
231
231
|
workProjectId: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ProfilePictureUpdatedEventSchema, ProfilePreferencesUpdatedEventSchema, CraftSkillCreatedEventSchema, CraftSkillUpdatedEventSchema, CraftSkillDeletedEventSchema, FollowCreatedEventSchema, FollowRemovedEventSchema, MentionReadEventSchema, AuthStatusChangedEventSchema, } from "./domain-events-user.js";
|
|
3
|
-
import { WorkProjectCreatedEventSchema, WorkProjectUpdatedEventSchema, WorkProjectPublishedEventSchema, WorkProjectStakeSharesUpdatedEventSchema, GuildInviteSentEventSchema, GuildInviteAcceptedEventSchema, GuildInviteDeclinedEventSchema, GuildInviteCancelledEventSchema, AuditionPromptCreatedEventSchema, AuditionEntrySubmittedEventSchema, AuditionEntryVoteRecordedEventSchema, AuditionClosedEventSchema, CommissionCreatedEventSchema, CommissionProposalSubmittedEventSchema,
|
|
3
|
+
import { WorkProjectCreatedEventSchema, WorkProjectUpdatedEventSchema, WorkProjectPublishedEventSchema, WorkProjectStakeSharesUpdatedEventSchema, GuildInviteSentEventSchema, GuildInviteAcceptedEventSchema, GuildInviteDeclinedEventSchema, GuildInviteCancelledEventSchema, AuditionPromptCreatedEventSchema, AuditionEntrySubmittedEventSchema, AuditionEntryVoteRecordedEventSchema, AuditionClosedEventSchema, CommissionCreatedEventSchema, CommissionProposalSubmittedEventSchema, CommissionClosedEventSchema, CommissionProposalSavedEventSchema, CommissionProposalRemovedEventSchema, HallLibraryCoverUpdatedEventSchema, WorkRealmCoverUpdatedEventSchema, HallLibrarySubItemUpdatedEventSchema, ThresholdLibrarySubmittedEventSchema, } from "./domain-events-work.js";
|
|
4
4
|
import { SquareStreetzPostCreatedEventSchema, SquareStreetzPostLikedEventSchema, SquareStreetzPostUnlikedEventSchema, } from "./domain-events-social.js";
|
|
5
5
|
import { ModerationViolationCreatedEventSchema, ThresholdLibraryApprovedEventSchema, ThresholdLibraryNeedsRevisionEventSchema, AdminDispatchSystemMarkedEventSchema, AdminDispatchThreadUpdatedEventSchema, AdminAppealReviewedEventSchema, AdminDispatchReviewedEventSchema, ViolationAppealSubmittedEventSchema, } from "./domain-events-admin.js";
|
|
6
6
|
export * from "./domain-events-user.js";
|
|
@@ -49,7 +49,7 @@ export const DomainEventSchema = z.discriminatedUnion('type', [
|
|
|
49
49
|
GuildInviteCancelledEventSchema,
|
|
50
50
|
AuditionEntryVoteRecordedEventSchema,
|
|
51
51
|
AuditionClosedEventSchema,
|
|
52
|
-
|
|
52
|
+
CommissionClosedEventSchema,
|
|
53
53
|
CommissionProposalSavedEventSchema,
|
|
54
54
|
CommissionProposalRemovedEventSchema,
|
|
55
55
|
ThresholdLibrarySubmittedEventSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-events.js","sourceRoot":"","sources":["../../src/media/domain-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,gCAAgC,EAChC,oCAAoC,EACpC,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,+BAA+B,EAC/B,wCAAwC,EACxC,0BAA0B,EAC1B,8BAA8B,EAC9B,8BAA8B,EAC9B,+BAA+B,EAC/B,gCAAgC,EAChC,iCAAiC,EACjC,oCAAoC,EACpC,yBAAyB,EACzB,4BAA4B,EAC5B,sCAAsC,EACtC,
|
|
1
|
+
{"version":3,"file":"domain-events.js","sourceRoot":"","sources":["../../src/media/domain-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,gCAAgC,EAChC,oCAAoC,EACpC,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,+BAA+B,EAC/B,wCAAwC,EACxC,0BAA0B,EAC1B,8BAA8B,EAC9B,8BAA8B,EAC9B,+BAA+B,EAC/B,gCAAgC,EAChC,iCAAiC,EACjC,oCAAoC,EACpC,yBAAyB,EACzB,4BAA4B,EAC5B,sCAAsC,EACtC,2BAA2B,EAC3B,kCAAkC,EAClC,oCAAoC,EACpC,kCAAkC,EAClC,gCAAgC,EACh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AAsB;IACtB,4BAA4B;IAC5B,mCAAmC;CACpC,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n ProfilePictureUpdatedEventSchema,\n ProfilePreferencesUpdatedEventSchema,\n CraftSkillCreatedEventSchema,\n CraftSkillUpdatedEventSchema,\n CraftSkillDeletedEventSchema,\n FollowCreatedEventSchema,\n FollowRemovedEventSchema,\n MentionReadEventSchema,\n AuthStatusChangedEventSchema,\n} from \"./domain-events-user.js\";\nimport {\n WorkProjectCreatedEventSchema,\n WorkProjectUpdatedEventSchema,\n WorkProjectPublishedEventSchema,\n WorkProjectStakeSharesUpdatedEventSchema,\n GuildInviteSentEventSchema,\n GuildInviteAcceptedEventSchema,\n GuildInviteDeclinedEventSchema,\n GuildInviteCancelledEventSchema,\n AuditionPromptCreatedEventSchema,\n AuditionEntrySubmittedEventSchema,\n AuditionEntryVoteRecordedEventSchema,\n AuditionClosedEventSchema,\n CommissionCreatedEventSchema,\n CommissionProposalSubmittedEventSchema,\n CommissionClosedEventSchema,\n CommissionProposalSavedEventSchema,\n CommissionProposalRemovedEventSchema,\n HallLibraryCoverUpdatedEventSchema,\n WorkRealmCoverUpdatedEventSchema,\n HallLibrarySubItemUpdatedEventSchema,\n ThresholdLibrarySubmittedEventSchema,\n} from \"./domain-events-work.js\";\nimport {\n SquareStreetzPostCreatedEventSchema,\n SquareStreetzPostLikedEventSchema,\n SquareStreetzPostUnlikedEventSchema,\n} from \"./domain-events-social.js\";\nimport {\n ModerationViolationCreatedEventSchema,\n ThresholdLibraryApprovedEventSchema,\n ThresholdLibraryNeedsRevisionEventSchema,\n AdminDispatchSystemMarkedEventSchema,\n AdminDispatchThreadUpdatedEventSchema,\n AdminAppealReviewedEventSchema,\n AdminDispatchReviewedEventSchema,\n ViolationAppealSubmittedEventSchema,\n} from \"./domain-events-admin.js\";\n\nexport * from \"./domain-events-user.js\";\nexport * from \"./domain-events-work.js\";\nexport * from \"./domain-events-social.js\";\nexport * from \"./domain-events-admin.js\";\n\n// ============================================================================\n// DomainEvent — typed business actions emitted by mutations and upload\n// processors. The frontend registry (ttt-prod/src/lib/domain-events.ts) maps\n// each variant to a list of TanStack Query cache invalidations.\n//\n// Adding a new variant is a coordinated deploy:\n// 1. Add it here. Publish this package.\n// 2. Add a registry entry in ttt-prod. Deploy.\n// 3. Update producers (mutation hooks or processors) to emit it.\n//\n// The schema is .strict() end-to-end — unknown event types fail parse and\n// the consuming hook in ttt-prod logs to Sentry and skips the doc.\n// ============================================================================\n\nexport const DomainEventSchema = z.discriminatedUnion('type', [\n ProfilePictureUpdatedEventSchema,\n CraftSkillCreatedEventSchema,\n SquareStreetzPostCreatedEventSchema,\n AuditionPromptCreatedEventSchema,\n AuditionEntrySubmittedEventSchema,\n CommissionCreatedEventSchema,\n CommissionProposalSubmittedEventSchema,\n WorkProjectUpdatedEventSchema,\n HallLibraryCoverUpdatedEventSchema,\n WorkRealmCoverUpdatedEventSchema,\n HallLibrarySubItemUpdatedEventSchema,\n ModerationViolationCreatedEventSchema,\n FollowCreatedEventSchema,\n FollowRemovedEventSchema,\n SquareStreetzPostLikedEventSchema,\n SquareStreetzPostUnlikedEventSchema,\n ProfilePreferencesUpdatedEventSchema,\n CraftSkillDeletedEventSchema,\n CraftSkillUpdatedEventSchema,\n WorkProjectCreatedEventSchema,\n WorkProjectPublishedEventSchema,\n WorkProjectStakeSharesUpdatedEventSchema,\n GuildInviteSentEventSchema,\n GuildInviteAcceptedEventSchema,\n GuildInviteDeclinedEventSchema,\n GuildInviteCancelledEventSchema,\n AuditionEntryVoteRecordedEventSchema,\n AuditionClosedEventSchema,\n CommissionClosedEventSchema,\n CommissionProposalSavedEventSchema,\n CommissionProposalRemovedEventSchema,\n ThresholdLibrarySubmittedEventSchema,\n ThresholdLibraryApprovedEventSchema,\n ThresholdLibraryNeedsRevisionEventSchema,\n AdminDispatchSystemMarkedEventSchema,\n AdminDispatchThreadUpdatedEventSchema,\n AdminAppealReviewedEventSchema,\n AdminDispatchReviewedEventSchema,\n MentionReadEventSchema,\n AuthStatusChangedEventSchema,\n ViolationAppealSubmittedEventSchema,\n]);\n\nexport type DomainEvent = z.infer<typeof DomainEventSchema>;\n\n// Helper for callers that need to extract the ids type for a specific\n// event variant (e.g. registry entries in the consuming repo).\nexport type DomainEventIdsFor<T extends DomainEvent['type']> = Extract<\n DomainEvent,\n { type: T }\n>['ids'];\n\n\n\n\n\n"]}
|
|
@@ -230,7 +230,7 @@ export declare const PendingMediaResultSchema: z.ZodObject<{
|
|
|
230
230
|
workProjectId: z.ZodOptional<z.ZodString>;
|
|
231
231
|
}, z.core.$strict>;
|
|
232
232
|
}, z.core.$strict>, z.ZodObject<{
|
|
233
|
-
type: z.ZodLiteral<"commission.
|
|
233
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
234
234
|
ids: z.ZodObject<{
|
|
235
235
|
commissionListingId: z.ZodString;
|
|
236
236
|
workProjectId: z.ZodString;
|
|
@@ -645,7 +645,7 @@ export declare const PendingMediaCompletedSchema: z.ZodObject<{
|
|
|
645
645
|
workProjectId: z.ZodOptional<z.ZodString>;
|
|
646
646
|
}, z.core.$strict>;
|
|
647
647
|
}, z.core.$strict>, z.ZodObject<{
|
|
648
|
-
type: z.ZodLiteral<"commission.
|
|
648
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
649
649
|
ids: z.ZodObject<{
|
|
650
650
|
commissionListingId: z.ZodString;
|
|
651
651
|
workProjectId: z.ZodString;
|
|
@@ -1077,7 +1077,7 @@ export declare const PendingMediaRejectedSchema: z.ZodObject<{
|
|
|
1077
1077
|
workProjectId: z.ZodOptional<z.ZodString>;
|
|
1078
1078
|
}, z.core.$strict>;
|
|
1079
1079
|
}, z.core.$strict>, z.ZodObject<{
|
|
1080
|
-
type: z.ZodLiteral<"commission.
|
|
1080
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
1081
1081
|
ids: z.ZodObject<{
|
|
1082
1082
|
commissionListingId: z.ZodString;
|
|
1083
1083
|
workProjectId: z.ZodString;
|
|
@@ -1538,7 +1538,7 @@ export declare const PendingMediaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1538
1538
|
workProjectId: z.ZodOptional<z.ZodString>;
|
|
1539
1539
|
}, z.core.$strict>;
|
|
1540
1540
|
}, z.core.$strict>, z.ZodObject<{
|
|
1541
|
-
type: z.ZodLiteral<"commission.
|
|
1541
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
1542
1542
|
ids: z.ZodObject<{
|
|
1543
1543
|
commissionListingId: z.ZodString;
|
|
1544
1544
|
workProjectId: z.ZodString;
|
|
@@ -1968,7 +1968,7 @@ export declare const PendingMediaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1968
1968
|
workProjectId: z.ZodOptional<z.ZodString>;
|
|
1969
1969
|
}, z.core.$strict>;
|
|
1970
1970
|
}, z.core.$strict>, z.ZodObject<{
|
|
1971
|
-
type: z.ZodLiteral<"commission.
|
|
1971
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
1972
1972
|
ids: z.ZodObject<{
|
|
1973
1973
|
commissionListingId: z.ZodString;
|
|
1974
1974
|
workProjectId: z.ZodString;
|
|
@@ -2329,7 +2329,7 @@ export declare const ArchivedPendingMediaCompletedSchema: z.ZodObject<{
|
|
|
2329
2329
|
workProjectId: z.ZodOptional<z.ZodString>;
|
|
2330
2330
|
}, z.core.$strict>;
|
|
2331
2331
|
}, z.core.$strict>, z.ZodObject<{
|
|
2332
|
-
type: z.ZodLiteral<"commission.
|
|
2332
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
2333
2333
|
ids: z.ZodObject<{
|
|
2334
2334
|
commissionListingId: z.ZodString;
|
|
2335
2335
|
workProjectId: z.ZodString;
|
|
@@ -2763,7 +2763,7 @@ export declare const ArchivedPendingMediaRejectedSchema: z.ZodObject<{
|
|
|
2763
2763
|
workProjectId: z.ZodOptional<z.ZodString>;
|
|
2764
2764
|
}, z.core.$strict>;
|
|
2765
2765
|
}, z.core.$strict>, z.ZodObject<{
|
|
2766
|
-
type: z.ZodLiteral<"commission.
|
|
2766
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
2767
2767
|
ids: z.ZodObject<{
|
|
2768
2768
|
commissionListingId: z.ZodString;
|
|
2769
2769
|
workProjectId: z.ZodString;
|
|
@@ -3125,7 +3125,7 @@ export declare const ArchivedPendingMediaSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
3125
3125
|
workProjectId: z.ZodOptional<z.ZodString>;
|
|
3126
3126
|
}, z.core.$strict>;
|
|
3127
3127
|
}, z.core.$strict>, z.ZodObject<{
|
|
3128
|
-
type: z.ZodLiteral<"commission.
|
|
3128
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
3129
3129
|
ids: z.ZodObject<{
|
|
3130
3130
|
commissionListingId: z.ZodString;
|
|
3131
3131
|
workProjectId: z.ZodString;
|
|
@@ -3557,7 +3557,7 @@ export declare const ArchivedPendingMediaSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
3557
3557
|
workProjectId: z.ZodOptional<z.ZodString>;
|
|
3558
3558
|
}, z.core.$strict>;
|
|
3559
3559
|
}, z.core.$strict>, z.ZodObject<{
|
|
3560
|
-
type: z.ZodLiteral<"commission.
|
|
3560
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
3561
3561
|
ids: z.ZodObject<{
|
|
3562
3562
|
commissionListingId: z.ZodString;
|
|
3563
3563
|
workProjectId: z.ZodString;
|
|
@@ -3924,7 +3924,7 @@ export declare const ArchivedPendingMediaDocSchema: z.ZodUnion<readonly [z.ZodDi
|
|
|
3924
3924
|
workProjectId: z.ZodOptional<z.ZodString>;
|
|
3925
3925
|
}, z.core.$strict>;
|
|
3926
3926
|
}, z.core.$strict>, z.ZodObject<{
|
|
3927
|
-
type: z.ZodLiteral<"commission.
|
|
3927
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
3928
3928
|
ids: z.ZodObject<{
|
|
3929
3929
|
commissionListingId: z.ZodString;
|
|
3930
3930
|
workProjectId: z.ZodString;
|
|
@@ -4356,7 +4356,7 @@ export declare const ArchivedPendingMediaDocSchema: z.ZodUnion<readonly [z.ZodDi
|
|
|
4356
4356
|
workProjectId: z.ZodOptional<z.ZodString>;
|
|
4357
4357
|
}, z.core.$strict>;
|
|
4358
4358
|
}, z.core.$strict>, z.ZodObject<{
|
|
4359
|
-
type: z.ZodLiteral<"commission.
|
|
4359
|
+
type: z.ZodLiteral<"commission.closed">;
|
|
4360
4360
|
ids: z.ZodObject<{
|
|
4361
4361
|
commissionListingId: z.ZodString;
|
|
4362
4362
|
workProjectId: z.ZodString;
|
|
@@ -29,7 +29,7 @@ export declare const GUILD_STANDINGS: {
|
|
|
29
29
|
};
|
|
30
30
|
readonly CommissionManager: {
|
|
31
31
|
readonly label: "Commission Manager";
|
|
32
|
-
readonly description: "Can open
|
|
32
|
+
readonly description: "Can open and close workProject commissions and manage proposals without starting invite conversations.";
|
|
33
33
|
};
|
|
34
34
|
readonly AuditionManager: {
|
|
35
35
|
readonly label: "Audition Manager";
|
|
@@ -157,11 +157,6 @@ export declare const WORK_PROJECT_ACTIONS: {
|
|
|
157
157
|
readonly description: "Close workProject commission postings.";
|
|
158
158
|
readonly grantedTo: readonly ["StewardOwner", "WorkProjectManager", "CommissionManager"];
|
|
159
159
|
};
|
|
160
|
-
readonly 'commission.delete': {
|
|
161
|
-
readonly label: "Delete commissions";
|
|
162
|
-
readonly description: "Delete workProject commission postings.";
|
|
163
|
-
readonly grantedTo: readonly ["StewardOwner", "WorkProjectManager", "CommissionManager"];
|
|
164
|
-
};
|
|
165
160
|
readonly 'commission.commissionProposal.save': {
|
|
166
161
|
readonly label: "Save commission proposals";
|
|
167
162
|
readonly description: "Save or unsave workProject commission proposals.";
|
|
@@ -282,6 +277,11 @@ export declare const WORK_PROJECT_ACTIONS: {
|
|
|
282
277
|
readonly description: "Archive workProject chat channels.";
|
|
283
278
|
readonly grantedTo: readonly ["StewardOwner", "WorkProjectManager", "GuildChatChannelManager"];
|
|
284
279
|
};
|
|
280
|
+
readonly 'guildChatChannel.unarchive': {
|
|
281
|
+
readonly label: "Restore archived chat channels";
|
|
282
|
+
readonly description: "Restore workProject chat channels out of the archive.";
|
|
283
|
+
readonly grantedTo: readonly ["StewardOwner", "WorkProjectManager", "GuildChatChannelManager"];
|
|
284
|
+
};
|
|
285
285
|
readonly 'guildChatChannel.delete': {
|
|
286
286
|
readonly label: "Delete chat channels";
|
|
287
287
|
readonly description: "Delete (tombstone) workProject chat channels; storage is retained.";
|
|
@@ -29,7 +29,7 @@ export const GUILD_STANDINGS = {
|
|
|
29
29
|
},
|
|
30
30
|
CommissionManager: {
|
|
31
31
|
label: 'Commission Manager',
|
|
32
|
-
description: 'Can open
|
|
32
|
+
description: 'Can open and close workProject commissions and manage proposals without starting invite conversations.',
|
|
33
33
|
},
|
|
34
34
|
AuditionManager: {
|
|
35
35
|
label: 'Audition Manager',
|
|
@@ -160,11 +160,6 @@ export const WORK_PROJECT_ACTIONS = {
|
|
|
160
160
|
description: 'Close workProject commission postings.',
|
|
161
161
|
grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],
|
|
162
162
|
},
|
|
163
|
-
'commission.delete': {
|
|
164
|
-
label: 'Delete commissions',
|
|
165
|
-
description: 'Delete workProject commission postings.',
|
|
166
|
-
grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],
|
|
167
|
-
},
|
|
168
163
|
'commission.commissionProposal.save': {
|
|
169
164
|
label: 'Save commission proposals',
|
|
170
165
|
description: 'Save or unsave workProject commission proposals.',
|
|
@@ -285,6 +280,11 @@ export const WORK_PROJECT_ACTIONS = {
|
|
|
285
280
|
description: 'Archive workProject chat channels.',
|
|
286
281
|
grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],
|
|
287
282
|
},
|
|
283
|
+
'guildChatChannel.unarchive': {
|
|
284
|
+
label: 'Restore archived chat channels',
|
|
285
|
+
description: 'Restore workProject chat channels out of the archive.',
|
|
286
|
+
grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],
|
|
287
|
+
},
|
|
288
288
|
'guildChatChannel.delete': {
|
|
289
289
|
label: 'Delete chat channels',
|
|
290
290
|
description: 'Delete (tombstone) workProject chat channels; storage is retained.',
|