@ttt-productions/ttt-core 0.79.10 → 0.79.11
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/permissions/work-project-permissions-data.d.ts +5 -0
- package/dist/permissions/work-project-permissions-data.d.ts.map +1 -1
- package/dist/permissions/work-project-permissions-data.js +5 -0
- 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/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,CAAC;IACN;yFACqF;IACrF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACrC;wFACoF;IACpF,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IAChD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB;2FACuF;IACvF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,4FAA4F;IAC5F,KAAK,EAA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,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,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,K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AQ,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"]}
|
|
@@ -282,6 +282,11 @@ export declare const WORK_PROJECT_ACTIONS: {
|
|
|
282
282
|
readonly description: "Archive workProject chat channels.";
|
|
283
283
|
readonly grantedTo: readonly ["StewardOwner", "WorkProjectManager", "GuildChatChannelManager"];
|
|
284
284
|
};
|
|
285
|
+
readonly 'guildChatChannel.unarchive': {
|
|
286
|
+
readonly label: "Restore archived chat channels";
|
|
287
|
+
readonly description: "Restore workProject chat channels out of the archive.";
|
|
288
|
+
readonly grantedTo: readonly ["StewardOwner", "WorkProjectManager", "GuildChatChannelManager"];
|
|
289
|
+
};
|
|
285
290
|
readonly 'guildChatChannel.delete': {
|
|
286
291
|
readonly label: "Delete chat channels";
|
|
287
292
|
readonly description: "Delete (tombstone) workProject chat channels; storage is retained.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-project-permissions-data.d.ts","sourceRoot":"","sources":["../../src/permissions/work-project-permissions-data.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDlB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,eAAe,CAAC;AAC3D,eAAO,MAAM,kBAAkB,EAAmC,eAAe,EAAE,CAAC;AACpF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;CAaa,CAAC;AACrD,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,eAAe,CAAC,CAAC;AACtF,eAAO,MAAM,qBAAqB,EAAgD,kBAAkB,EAAE,CAAC;AAEvG,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"work-project-permissions-data.d.ts","sourceRoot":"","sources":["../../src/permissions/work-project-permissions-data.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDlB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,eAAe,CAAC;AAC3D,eAAO,MAAM,kBAAkB,EAAmC,eAAe,EAAE,CAAC;AACpF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;CAaa,CAAC;AACrD,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,eAAe,CAAC,CAAC;AACtF,eAAO,MAAM,qBAAqB,EAAgD,kBAAkB,EAAE,CAAC;AAEvG,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwP/B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,oBAAoB,CAAC;AACpE,eAAO,MAAM,uBAAuB,EAAwC,mBAAmB,EAAE,CAAC"}
|
|
@@ -285,6 +285,11 @@ export const WORK_PROJECT_ACTIONS = {
|
|
|
285
285
|
description: 'Archive workProject chat channels.',
|
|
286
286
|
grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],
|
|
287
287
|
},
|
|
288
|
+
'guildChatChannel.unarchive': {
|
|
289
|
+
label: 'Restore archived chat channels',
|
|
290
|
+
description: 'Restore workProject chat channels out of the archive.',
|
|
291
|
+
grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],
|
|
292
|
+
},
|
|
288
293
|
'guildChatChannel.delete': {
|
|
289
294
|
label: 'Delete chat channels',
|
|
290
295
|
description: 'Delete (tombstone) workProject chat channels; storage is retained.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-project-permissions-data.js","sourceRoot":"","sources":["../../src/permissions/work-project-permissions-data.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,YAAY,EAAE;QACZ,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,8JAA8J;KAC5K;IACD,kBAAkB,EAAE;QAClB,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,+HAA+H;KAC7I;IACD,uBAAuB,EAAE;QACvB,KAAK,EAAE,2BAA2B;QAClC,WAAW,EAAE,kEAAkE;KAChF;IACD,oBAAoB,EAAE;QACpB,KAAK,EAAE,wBAAwB;QAC/B,WAAW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oCAAoC;QACjD,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,EAAE,yBAAyB,CAAC;KAC7E;IACD,yBAAyB,EAAE;QACzB,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE,oEAAoE;QACjF,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,EAAE,yBAAyB,CAAC;KAC7E;IACD,2BAA2B,EAAE;QAC3B,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE,+DAA+D;QAC5E,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,EAAE,yBAAyB,CAAC;KAC7E;IACD,qBAAqB,EAAE;QACrB,KAAK,EAAE,4BAA4B;QACnC,WAAW,EACT,0FAA0F;YAC1F,kFAAkF;QACpF,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,CAAC;KAClD;CAKD,CAAC;AAGH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAA0B,CAAC","sourcesContent":["export const GUILD_STANDINGS = {\n StewardOwner: {\n label: 'Steward',\n description: 'Work steward. Holds all workProject actions implicitly. Assigned automatically at workProject creation and non-assignable via guild standing management UIs.',\n },\n WorkProjectManager: {\n label: 'WorkProject Manager',\n description: 'Can perform every workProject action except granting Steward, WorkProjectManager, GuildStandingManager, or StakeShareManager.',\n },\n PublicWorkProjectEditor: {\n label: 'Public WorkProject Editor',\n description: 'Can edit public-facing workProject title, description, and copy.',\n },\n GuildStandingManager: {\n label: 'Guild Standing Manager',\n description: 'Can assign and remove ordinary workProject guild standings without escalating manager, stake-share, or trade-profession authority (tradeProfessions are folder/chat access keys, editable only by file-admin standings).',\n },\n StakeShareManager: {\n label: 'Stake Share Manager',\n description: 'Can adjust active Guildmate stakes and pending invite stake offers.',\n },\n InviteManager: {\n label: 'Invite Manager',\n description: 'Can send workProject invites, view invite state, and cancel or revoke pending invites.',\n },\n WorkAssetAdmin: {\n label: 'Work Asset Admin',\n description: 'Delegated file-system administration: create/rename file folders, assign folder trade-profession access, view every folder and file, and delete any file. Assignable only by the Steward.',\n },\n CommissionManager: {\n label: 'Commission Manager',\n description: 'Can open, close, and delete workProject commissions and manage proposals without starting invite conversations.',\n },\n AuditionManager: {\n label: 'Audition Manager',\n description: 'Can open, edit, and close workProject auditions and manage respondents without starting invite conversations.',\n },\n HallLibraryEditor: {\n label: 'Hall Editor',\n description: 'Can create and edit Tales, Tunes, Television content, Genres, and media assets.',\n },\n HallLibrarySubmitter: {\n label: 'Hall Submitter',\n description: 'Can submit workProject hall content for admin hall review.',\n },\n GuildChatChannelManager: {\n label: 'Guild Chat Channel Manager',\n description: 'Can create, update, archive, delete, and moderate workProject chat channels.',\n },\n} as const;\n\nexport type GuildStandingId = keyof typeof GUILD_STANDINGS;\nexport const GUILD_STANDING_IDS = Object.keys(GUILD_STANDINGS) as GuildStandingId[];\nexport const GUILD_STANDING_VALUE_BY_ID = {\n StewardOwner: 'Steward',\n WorkProjectManager: 'WorkProjectManager',\n PublicWorkProjectEditor: 'PublicWorkProjectEditor',\n GuildStandingManager: 'GuildStandingManager',\n StakeShareManager: 'StakeShareManager',\n InviteManager: 'InviteManager',\n WorkAssetAdmin: 'WorkAssetAdmin',\n CommissionManager: 'CommissionManager',\n AuditionManager: 'AuditionManager',\n HallLibraryEditor: 'HallLibraryEditor',\n HallLibrarySubmitter: 'HallLibrarySubmitter',\n GuildChatChannelManager: 'GuildChatChannelManager',\n} as const satisfies Record<GuildStandingId, string>;\nexport type GuildStandingValue = (typeof GUILD_STANDING_VALUE_BY_ID)[GuildStandingId];\nexport const GUILD_STANDING_VALUES = Object.values(GUILD_STANDING_VALUE_BY_ID) as GuildStandingValue[];\n\nexport const WORK_PROJECT_ACTIONS = {\n 'workProject.read': {\n label: 'Read workProject',\n description: 'Baseline active-Guildmate read floor for internal workProject state.',\n grantedTo: GUILD_STANDING_IDS,\n },\n 'workProject.metadata.update': {\n label: 'Update workProject metadata',\n description: 'Edit working title, description, and public workProject copy.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'PublicWorkProjectEditor'],\n },\n 'guildmateUser.guildStanding.update': {\n label: 'Update Guildmate guild standings',\n description: 'Assign or remove workProject guild standings on active Guildmates.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildStandingManager'],\n },\n 'guildmateUser.tradeProfession.update': {\n label: 'Update Guildmate tradeProfessions',\n description:\n 'Assign or remove Guildmate tradeProfessions. tradeProfessions gate custom-folder ' +\n 'visibility and chat-channel access targeting — they are access keys, not just staffing ' +\n 'labels — so this is restricted to file-admin standings (Steward + WorkProject Manager). ' +\n 'A trade edit can never grant the editor access they lack, since every grantee already ' +\n 'holds file-admin override.',\n grantedTo: ['StewardOwner', 'WorkProjectManager'],\n },\n 'workProject.stakeShares.manage': {\n label: 'Manage workProject stakes',\n description: 'Run workProject stake-share operations under the 1000-stake cap.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'StakeShareManager'],\n },\n 'workProject.stakeShares.addActive': {\n label: 'Add active Guildmate stakes',\n description: 'Increase stakes for an existing active workProject Guildmate.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'StakeShareManager'],\n },\n 'guildInvite.send': {\n label: 'Send invites',\n description: 'Start a workProject invite conversation and reserve pending stakes.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'InviteManager'],\n },\n 'guildInvite.list': {\n label: 'List invites',\n description: 'View workProject invite conversation state.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'InviteManager'],\n },\n 'guildInvite.revokeAny': {\n label: 'Revoke pending invites',\n description: 'Cancel or revoke pending workProject invites.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'InviteManager'],\n },\n 'guildInvite.stakeShares.update': {\n label: 'Update invite stakes',\n description: 'Increase stakes offered on a pending invite.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'StakeShareManager'],\n },\n 'fileFolder.create': {\n label: 'Create file folders',\n description: 'Create workProject file folders and set their trade-profession access lists.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'WorkAssetAdmin'],\n },\n 'fileFolder.manage': {\n label: 'Manage file folders',\n description: 'Rename folders, edit folder trade-profession access lists, and delete folders.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'WorkAssetAdmin'],\n },\n 'fileFolder.viewAll': {\n label: 'View all file folders',\n description: 'View every folder and file regardless of folder trade-profession access (admin override).',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'WorkAssetAdmin'],\n },\n 'workFile.uploadAny': {\n label: 'Upload to any folder',\n description: 'Upload files to any folder regardless of folder trade-profession access (admin override).',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'WorkAssetAdmin'],\n },\n 'workFile.deleteAny': {\n label: 'Delete any file',\n description: 'Delete any file regardless of folder trade-profession access (admin override).',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'WorkAssetAdmin'],\n },\n 'workFile.promoteToRealm': {\n label: 'Share file to realm',\n description: 'Instantly share a work file into its realm shared-file pool (as non-canon). ' +\n 'Canon promotion is a separate realm-steward power, evaluated at the realm level, not here.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'WorkAssetAdmin'],\n },\n 'commission.open': {\n label: 'Open commissions',\n description: 'Create workProject commission postings.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'commission.close': {\n label: 'Close commissions',\n description: 'Close workProject commission postings.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'commission.delete': {\n label: 'Delete commissions',\n description: 'Delete workProject commission postings.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'commission.commissionProposal.save': {\n label: 'Save commission proposals',\n description: 'Save or unsave workProject commission proposals.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'commission.commissionProposal.reject': {\n label: 'Reject commission proposals',\n description: 'Reject workProject commission proposals.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'audition.open': {\n label: 'Open auditions',\n description: 'Create workProject audition prompts.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'AuditionManager'],\n },\n 'audition.edit': {\n label: 'Edit auditions',\n description: 'Edit workProject audition prompts.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'AuditionManager'],\n },\n 'audition.close': {\n label: 'Close auditions',\n description: 'Close workProject auditions.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'AuditionManager'],\n },\n 'audition.respondent.manage': {\n label: 'Manage audition respondents',\n description: 'Manage workProject audition respondents without starting invite conversations.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'AuditionManager'],\n },\n 'hallLibrary.chapter.create': {\n label: 'Create Tale chapters',\n description: 'Create Tale chapter content.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tuneTrack.create': {\n label: 'Create Tune tracks',\n description: 'Create Tune track content.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.televisionEpisode.create': {\n label: 'Create Television episodes',\n description: 'Create Television episode content.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tale.details.update': {\n label: 'Update Tale details',\n description: 'Edit Tale details and public copy.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tune.details.update': {\n label: 'Update Tune details',\n description: 'Edit Tune details and public copy.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.television.details.update': {\n label: 'Update Television details',\n description: 'Edit Television details and public copy.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.chapter.details.update': {\n label: 'Update chapter details',\n description: 'Edit chapter details and body fields.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tuneTrack.details.update': {\n label: 'Update track details',\n description: 'Edit track details and media metadata.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.televisionEpisode.details.update': {\n label: 'Update episode details',\n description: 'Edit episode details and media metadata.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tale.workGenres.update': {\n label: 'Update Tale Genres',\n description: 'Edit Tale Genre assignments.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tune.workGenres.update': {\n label: 'Update Tune Genres',\n description: 'Edit Tune Genre assignments.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.television.workGenres.update': {\n label: 'Update Television Genres',\n description: 'Edit Television Genre assignments.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.asset.upload': {\n label: 'Upload hallLibrary assets',\n description: 'Upload or replace covers and sub-item media assets.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.review.submit': {\n label: 'Submit hall review',\n description: 'Submit workProject content for admin hall review. Also gates withdrawing a still-pending submission.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibrarySubmitter'],\n },\n 'hallLibrary.changeRequest.submit': {\n label: 'Request published changes',\n description: 'Propose text changes to a PUBLISHED hall item (reviewed by admins before anything changes).',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibrarySubmitter'],\n },\n 'guildChatChannel.create': {\n label: 'Create chat channels',\n description: 'Create workProject chat channels.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatChannel.update': {\n label: 'Update chat channels',\n description: 'Update workProject chat channel settings and access policy.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatChannel.archive': {\n label: 'Archive chat channels',\n description: 'Archive workProject chat channels.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatChannel.delete': {\n label: 'Delete chat channels',\n description: 'Delete (tombstone) workProject chat channels; storage is retained.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatMessage.moderate': {\n label: 'Moderate chat messages',\n description: 'Update or delete workProject channel messages for moderation.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'adminDispatch.start': {\n label: 'Start admin correspondence',\n description:\n 'Open a platform correspondence thread with the admin team on behalf of the workProject. ' +\n 'Replying in an open workProject thread is any active Guildmate (not gated here).',\n grantedTo: ['StewardOwner', 'WorkProjectManager'],\n },\n} as const satisfies Record<string, {\n label: string;\n description: string;\n grantedTo: readonly GuildStandingId[];\n}>;\n\nexport type WorkProjectActionId = keyof typeof WORK_PROJECT_ACTIONS;\nexport const WORK_PROJECT_ACTION_IDS = Object.keys(WORK_PROJECT_ACTIONS) as WorkProjectActionId[];\n\n\n\n"]}
|
|
1
|
+
{"version":3,"file":"work-project-permissions-data.js","sourceRoot":"","sources":["../../src/permissions/work-project-permissions-data.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,YAAY,EAAE;QACZ,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,8JAA8J;KAC5K;IACD,kBAAkB,EAAE;QAClB,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,+HAA+H;KAC7I;IACD,uBAAuB,EAAE;QACvB,KAAK,EAAE,2BAA2B;QAClC,WAAW,EAAE,kEAAkE;KAChF;IACD,oBAAoB,EAAE;QACpB,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE,0NAA0N;KACxO;IACD,iBAAiB,EAAE;QACjB,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,qEAAqE;KACnF;IACD,aAAa,EAAE;QACb,KAAK,EAAE,gBA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,EAAE,uDAAuD;QACpE,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,EAAE,yBAAyB,CAAC;KAC7E;IACD,yBAAyB,EAAE;QACzB,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE,oEAAoE;QACjF,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,EAAE,yBAAyB,CAAC;KAC7E;IACD,2BAA2B,EAAE;QAC3B,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE,+DAA+D;QAC5E,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,EAAE,yBAAyB,CAAC;KAC7E;IACD,qBAAqB,EAAE;QACrB,KAAK,EAAE,4BAA4B;QACnC,WAAW,EACT,0FAA0F;YAC1F,kFAAkF;QACpF,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,CAAC;KAClD;CAKD,CAAC;AAGH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAA0B,CAAC","sourcesContent":["export const GUILD_STANDINGS = {\n StewardOwner: {\n label: 'Steward',\n description: 'Work steward. Holds all workProject actions implicitly. Assigned automatically at workProject creation and non-assignable via guild standing management UIs.',\n },\n WorkProjectManager: {\n label: 'WorkProject Manager',\n description: 'Can perform every workProject action except granting Steward, WorkProjectManager, GuildStandingManager, or StakeShareManager.',\n },\n PublicWorkProjectEditor: {\n label: 'Public WorkProject Editor',\n description: 'Can edit public-facing workProject title, description, and copy.',\n },\n GuildStandingManager: {\n label: 'Guild Standing Manager',\n description: 'Can assign and remove ordinary workProject guild standings without escalating manager, stake-share, or trade-profession authority (tradeProfessions are folder/chat access keys, editable only by file-admin standings).',\n },\n StakeShareManager: {\n label: 'Stake Share Manager',\n description: 'Can adjust active Guildmate stakes and pending invite stake offers.',\n },\n InviteManager: {\n label: 'Invite Manager',\n description: 'Can send workProject invites, view invite state, and cancel or revoke pending invites.',\n },\n WorkAssetAdmin: {\n label: 'Work Asset Admin',\n description: 'Delegated file-system administration: create/rename file folders, assign folder trade-profession access, view every folder and file, and delete any file. Assignable only by the Steward.',\n },\n CommissionManager: {\n label: 'Commission Manager',\n description: 'Can open, close, and delete workProject commissions and manage proposals without starting invite conversations.',\n },\n AuditionManager: {\n label: 'Audition Manager',\n description: 'Can open, edit, and close workProject auditions and manage respondents without starting invite conversations.',\n },\n HallLibraryEditor: {\n label: 'Hall Editor',\n description: 'Can create and edit Tales, Tunes, Television content, Genres, and media assets.',\n },\n HallLibrarySubmitter: {\n label: 'Hall Submitter',\n description: 'Can submit workProject hall content for admin hall review.',\n },\n GuildChatChannelManager: {\n label: 'Guild Chat Channel Manager',\n description: 'Can create, update, archive, delete, and moderate workProject chat channels.',\n },\n} as const;\n\nexport type GuildStandingId = keyof typeof GUILD_STANDINGS;\nexport const GUILD_STANDING_IDS = Object.keys(GUILD_STANDINGS) as GuildStandingId[];\nexport const GUILD_STANDING_VALUE_BY_ID = {\n StewardOwner: 'Steward',\n WorkProjectManager: 'WorkProjectManager',\n PublicWorkProjectEditor: 'PublicWorkProjectEditor',\n GuildStandingManager: 'GuildStandingManager',\n StakeShareManager: 'StakeShareManager',\n InviteManager: 'InviteManager',\n WorkAssetAdmin: 'WorkAssetAdmin',\n CommissionManager: 'CommissionManager',\n AuditionManager: 'AuditionManager',\n HallLibraryEditor: 'HallLibraryEditor',\n HallLibrarySubmitter: 'HallLibrarySubmitter',\n GuildChatChannelManager: 'GuildChatChannelManager',\n} as const satisfies Record<GuildStandingId, string>;\nexport type GuildStandingValue = (typeof GUILD_STANDING_VALUE_BY_ID)[GuildStandingId];\nexport const GUILD_STANDING_VALUES = Object.values(GUILD_STANDING_VALUE_BY_ID) as GuildStandingValue[];\n\nexport const WORK_PROJECT_ACTIONS = {\n 'workProject.read': {\n label: 'Read workProject',\n description: 'Baseline active-Guildmate read floor for internal workProject state.',\n grantedTo: GUILD_STANDING_IDS,\n },\n 'workProject.metadata.update': {\n label: 'Update workProject metadata',\n description: 'Edit working title, description, and public workProject copy.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'PublicWorkProjectEditor'],\n },\n 'guildmateUser.guildStanding.update': {\n label: 'Update Guildmate guild standings',\n description: 'Assign or remove workProject guild standings on active Guildmates.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildStandingManager'],\n },\n 'guildmateUser.tradeProfession.update': {\n label: 'Update Guildmate tradeProfessions',\n description:\n 'Assign or remove Guildmate tradeProfessions. tradeProfessions gate custom-folder ' +\n 'visibility and chat-channel access targeting — they are access keys, not just staffing ' +\n 'labels — so this is restricted to file-admin standings (Steward + WorkProject Manager). ' +\n 'A trade edit can never grant the editor access they lack, since every grantee already ' +\n 'holds file-admin override.',\n grantedTo: ['StewardOwner', 'WorkProjectManager'],\n },\n 'workProject.stakeShares.manage': {\n label: 'Manage workProject stakes',\n description: 'Run workProject stake-share operations under the 1000-stake cap.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'StakeShareManager'],\n },\n 'workProject.stakeShares.addActive': {\n label: 'Add active Guildmate stakes',\n description: 'Increase stakes for an existing active workProject Guildmate.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'StakeShareManager'],\n },\n 'guildInvite.send': {\n label: 'Send invites',\n description: 'Start a workProject invite conversation and reserve pending stakes.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'InviteManager'],\n },\n 'guildInvite.list': {\n label: 'List invites',\n description: 'View workProject invite conversation state.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'InviteManager'],\n },\n 'guildInvite.revokeAny': {\n label: 'Revoke pending invites',\n description: 'Cancel or revoke pending workProject invites.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'InviteManager'],\n },\n 'guildInvite.stakeShares.update': {\n label: 'Update invite stakes',\n description: 'Increase stakes offered on a pending invite.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'StakeShareManager'],\n },\n 'fileFolder.create': {\n label: 'Create file folders',\n description: 'Create workProject file folders and set their trade-profession access lists.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'WorkAssetAdmin'],\n },\n 'fileFolder.manage': {\n label: 'Manage file folders',\n description: 'Rename folders, edit folder trade-profession access lists, and delete folders.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'WorkAssetAdmin'],\n },\n 'fileFolder.viewAll': {\n label: 'View all file folders',\n description: 'View every folder and file regardless of folder trade-profession access (admin override).',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'WorkAssetAdmin'],\n },\n 'workFile.uploadAny': {\n label: 'Upload to any folder',\n description: 'Upload files to any folder regardless of folder trade-profession access (admin override).',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'WorkAssetAdmin'],\n },\n 'workFile.deleteAny': {\n label: 'Delete any file',\n description: 'Delete any file regardless of folder trade-profession access (admin override).',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'WorkAssetAdmin'],\n },\n 'workFile.promoteToRealm': {\n label: 'Share file to realm',\n description: 'Instantly share a work file into its realm shared-file pool (as non-canon). ' +\n 'Canon promotion is a separate realm-steward power, evaluated at the realm level, not here.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'WorkAssetAdmin'],\n },\n 'commission.open': {\n label: 'Open commissions',\n description: 'Create workProject commission postings.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'commission.close': {\n label: 'Close commissions',\n description: 'Close workProject commission postings.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'commission.delete': {\n label: 'Delete commissions',\n description: 'Delete workProject commission postings.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'commission.commissionProposal.save': {\n label: 'Save commission proposals',\n description: 'Save or unsave workProject commission proposals.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'commission.commissionProposal.reject': {\n label: 'Reject commission proposals',\n description: 'Reject workProject commission proposals.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'audition.open': {\n label: 'Open auditions',\n description: 'Create workProject audition prompts.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'AuditionManager'],\n },\n 'audition.edit': {\n label: 'Edit auditions',\n description: 'Edit workProject audition prompts.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'AuditionManager'],\n },\n 'audition.close': {\n label: 'Close auditions',\n description: 'Close workProject auditions.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'AuditionManager'],\n },\n 'audition.respondent.manage': {\n label: 'Manage audition respondents',\n description: 'Manage workProject audition respondents without starting invite conversations.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'AuditionManager'],\n },\n 'hallLibrary.chapter.create': {\n label: 'Create Tale chapters',\n description: 'Create Tale chapter content.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tuneTrack.create': {\n label: 'Create Tune tracks',\n description: 'Create Tune track content.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.televisionEpisode.create': {\n label: 'Create Television episodes',\n description: 'Create Television episode content.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tale.details.update': {\n label: 'Update Tale details',\n description: 'Edit Tale details and public copy.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tune.details.update': {\n label: 'Update Tune details',\n description: 'Edit Tune details and public copy.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.television.details.update': {\n label: 'Update Television details',\n description: 'Edit Television details and public copy.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.chapter.details.update': {\n label: 'Update chapter details',\n description: 'Edit chapter details and body fields.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tuneTrack.details.update': {\n label: 'Update track details',\n description: 'Edit track details and media metadata.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.televisionEpisode.details.update': {\n label: 'Update episode details',\n description: 'Edit episode details and media metadata.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tale.workGenres.update': {\n label: 'Update Tale Genres',\n description: 'Edit Tale Genre assignments.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tune.workGenres.update': {\n label: 'Update Tune Genres',\n description: 'Edit Tune Genre assignments.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.television.workGenres.update': {\n label: 'Update Television Genres',\n description: 'Edit Television Genre assignments.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.asset.upload': {\n label: 'Upload hallLibrary assets',\n description: 'Upload or replace covers and sub-item media assets.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.review.submit': {\n label: 'Submit hall review',\n description: 'Submit workProject content for admin hall review. Also gates withdrawing a still-pending submission.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibrarySubmitter'],\n },\n 'hallLibrary.changeRequest.submit': {\n label: 'Request published changes',\n description: 'Propose text changes to a PUBLISHED hall item (reviewed by admins before anything changes).',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibrarySubmitter'],\n },\n 'guildChatChannel.create': {\n label: 'Create chat channels',\n description: 'Create workProject chat channels.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatChannel.update': {\n label: 'Update chat channels',\n description: 'Update workProject chat channel settings and access policy.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatChannel.archive': {\n label: 'Archive chat channels',\n description: 'Archive workProject chat channels.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatChannel.unarchive': {\n label: 'Restore archived chat channels',\n description: 'Restore workProject chat channels out of the archive.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatChannel.delete': {\n label: 'Delete chat channels',\n description: 'Delete (tombstone) workProject chat channels; storage is retained.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatMessage.moderate': {\n label: 'Moderate chat messages',\n description: 'Update or delete workProject channel messages for moderation.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'adminDispatch.start': {\n label: 'Start admin correspondence',\n description:\n 'Open a platform correspondence thread with the admin team on behalf of the workProject. ' +\n 'Replying in an open workProject thread is any active Guildmate (not gated here).',\n grantedTo: ['StewardOwner', 'WorkProjectManager'],\n },\n} as const satisfies Record<string, {\n label: string;\n description: string;\n grantedTo: readonly GuildStandingId[];\n}>;\n\nexport type WorkProjectActionId = keyof typeof WORK_PROJECT_ACTIONS;\nexport const WORK_PROJECT_ACTION_IDS = Object.keys(WORK_PROJECT_ACTIONS) as WorkProjectActionId[];\n\n\n\n"]}
|
package/dist/schemas/admin.d.ts
CHANGED
|
@@ -216,6 +216,16 @@ export declare const GetReportedContentDetailResultSchema: z.ZodObject<{
|
|
|
216
216
|
}, z.core.$strip>>;
|
|
217
217
|
isHidden: z.ZodNullable<z.ZodBoolean>;
|
|
218
218
|
ownerUid: z.ZodNullable<z.ZodString>;
|
|
219
|
+
clearableSurface: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
220
|
+
tale: "tale";
|
|
221
|
+
tune: "tune";
|
|
222
|
+
television: "television";
|
|
223
|
+
chapter: "chapter";
|
|
224
|
+
tuneTrack: "tuneTrack";
|
|
225
|
+
televisionEpisode: "televisionEpisode";
|
|
226
|
+
workRealm: "workRealm";
|
|
227
|
+
workProject: "workProject";
|
|
228
|
+
}>>>;
|
|
219
229
|
reportTimeSnapshot: z.ZodNullable<z.ZodObject<{
|
|
220
230
|
capturedText: z.ZodNullable<z.ZodString>;
|
|
221
231
|
capturedMediaAssetIds: z.ZodArray<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/schemas/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/schemas/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuDxB,eAAO,MAAM,oCAAoC,iCAAwB,CAAC;AAC1E,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG,eAAO,MAAM,8BAA8B;;kBAEhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAItF,eAAO,MAAM,wBAAwB;;;kBAG1B,CAAC;AACZ,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;0CAC0C;AAC1C,eAAO,MAAM,2BAA2B;;;EAAiC,CAAC;AAC1E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,8BAA8B;;;;;;;;kBAKhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAGtF,eAAO,MAAM,+BAA+B;;;;;;;;;iBAW1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+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MhF;;uFAEuF;AACvF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;EAcrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;kBAQlC,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;oBAQ1B,CAAC;AACb,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
package/dist/schemas/admin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { violationIdSchema, taskIdSchema, workProjectIdSchema, hallItemIdSchema, workProjectTypeSchema, } from './atoms.js';
|
|
2
|
+
import { violationIdSchema, taskIdSchema, workProjectIdSchema, hallItemIdSchema, workProjectTypeSchema, moderationClearableSurfaceSchema, } from './atoms.js';
|
|
3
3
|
import { ReportDispositionSchema, ReportDispositionReasonCodeSchema, refineReportDispositionReasonCode, refineReportDispositionEvidenceRefs, } from '../doc-schemas/safety/foundation.js';
|
|
4
4
|
import { ChildSafetyAccountRoleSchema, ChildSafetyAccountSubjectDispositionSchema, } from '../doc-schemas/safety/case.js';
|
|
5
5
|
import { ContentMediaKindSchema, MediaServingStatusSchema, } from '../doc-schemas/media-assets.js';
|
|
@@ -203,6 +203,30 @@ export const GetReportedContentDetailResultSchema = z.object({
|
|
|
203
203
|
isHidden: z.boolean().nullable(),
|
|
204
204
|
/** The content owner / uploader uid, when derivable. */
|
|
205
205
|
ownerUid: z.string().nullable(),
|
|
206
|
+
/**
|
|
207
|
+
* The canonical moderation-clearable SURFACE this reported doc actually IS, resolved
|
|
208
|
+
* SERVER-side: `chapter` / `tuneTrack` / `televisionEpisode` for a hall sub-item (through
|
|
209
|
+
* `HALL_CONTENT_SURFACES_BY_WORK_TYPE`, from the parent hall doc the callable already reads),
|
|
210
|
+
* `workProject` / `workRealm` for the shells.
|
|
211
|
+
*
|
|
212
|
+
* Why the resolved surface and not the `workProjectType` it was resolved from: the surface is
|
|
213
|
+
* what a consumer needs — `MODERATION_CLEARABLE_TEXT_FIELDS[clearableSurface]` is the exact
|
|
214
|
+
* clearable field set, one canonical index with no re-derivation. Shipping the work-project type
|
|
215
|
+
* instead would make every consumer redo the routing AND the detail-vs-sub-item branch, which is
|
|
216
|
+
* precisely the hand-rolled duplication that map was created to end.
|
|
217
|
+
*
|
|
218
|
+
* What it fixes: the in-flow clear's field picker offered the hall-family UNION
|
|
219
|
+
* (title/description/content) because the projection never said which surface the sub-item was —
|
|
220
|
+
* so an operator could tick `description` on a Tale chapter (title/content) or `content` on a
|
|
221
|
+
* Tune track (title/description), pass the wire refinement, and have the clear runner silently
|
|
222
|
+
* drop it. The picker now offers only this surface's fields, and the resolve path re-checks
|
|
223
|
+
* caller-supplied fields against the same set.
|
|
224
|
+
*
|
|
225
|
+
* `.nullish()`: absent on payloads produced before this field existed, and null when the
|
|
226
|
+
* reported item is not a clearable text surface at all (a square post, a chat message, a
|
|
227
|
+
* profile picture).
|
|
228
|
+
*/
|
|
229
|
+
clearableSurface: moderationClearableSurfaceSchema.nullish(),
|
|
206
230
|
/** The FROZEN report-time snapshot (captured at intake), so the operator sees what was
|
|
207
231
|
* reported even if the author edited the live doc to evade. Null for older reports. */
|
|
208
232
|
reportTimeSnapshot: z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/schemas/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,YAAY,CAAC;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BAAoB;IACpB,qBAAqB;CACtB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,UAAU,EAAE,0BAA0B;IACtC,0EAA0E;IAC1E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACjC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,0BAA0B,CAAC;IACzD,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,8DAA8D;IAC9D,UAAU,EAAE,0BAA0B,CAAC,QAAQ,EAAE;IACjD,0EAA0E;IAC1E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC;KACD,MAAM,EAAE;KACR,OAAO,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n violationIdSchema,\n taskIdSchema,\n workProjectIdSchema,\n hallItemIdSchema,\n workProjectTypeSchema,\n} from './atoms.js';\nimport {\n ReportDispositionSchema,\n ReportDispositionReasonCodeSchema,\n refineReportDispositionReasonCode,\n refineReportDispositionEvidenceRefs,\n type ReportableItemType,\n} from '../doc-schemas/safety/foundation.js';\nimport {\n ChildSafetyAccountRoleSchema,\n ChildSafetyAccountSubjectDispositionSchema,\n} from '../doc-schemas/safety/case.js';\nimport {\n ContentMediaKindSchema,\n MediaServingStatusSchema,\n} from '../doc-schemas/media-assets.js';\nimport { MAX_MANIFEST_NCMEC_RECEIPTS } from '../doc-schemas/safety/evidence.js';\nimport {\n MODERATION_CLEARABLE_TEXT_FIELDS,\n HALL_CLEARABLE_TEXT_FIELD_NAMES,\n} from '../constants/business-content.js';\nimport {\n MAX_WORK_PROJECT_TITLE_LENGTH,\n MAX_ADMIN_DISPATCH_SUBJECT_LENGTH,\n MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH,\n MAX_INTERNAL_REASON_LENGTH,\n MAX_USER_FACING_REASON_LENGTH,\n MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH,\n MAX_SAFETY_ADMIN_NOTE_LENGTH,\n MAX_FUTURE_PLAN_TITLE_LENGTH,\n MAX_FUTURE_PLAN_DESCRIPTION_LENGTH,\n MAX_PLATFORM_RULE_TITLE_LENGTH,\n MAX_PLATFORM_RULE_DESCRIPTION_LENGTH,\n MAX_AGREEMENT_POINT_LENGTH,\n MAX_CONTENT_PAGE_HEADING_LENGTH,\n MAX_CONTENT_PAGE_BODY_LENGTH,\n MAX_TAKE_IT_DOWN_COPY_LENGTH,\n MAX_MAINTENANCE_MESSAGE_LENGTH,\n MAX_APPEAL_REVIEW_NOTES_LENGTH,\n MAX_REQUIRE_RETITLE_REASON_LENGTH,\n MAX_USER_FACING_REASON_DETAIL_LENGTH,\n} from '../constants/business.js';\nimport {\n SAFETY_ACTIONS_CONFIRMATION,\n SAFETY_CASE_REOPEN_CONFIRMATION,\n} from '../constants/safety-confirmation-phrases.js';\n\nexport const CheckoutNextImportantTaskInputSchema = z.object({}).strict();\nexport type CheckoutNextImportantTaskInput = z.infer<typeof CheckoutNextImportantTaskInputSchema>;\n\nexport const GetContentViolationInputSchema = z.object({\n violationId: violationIdSchema,\n}).strict();\nexport type GetContentViolationInput = z.infer<typeof GetContentViolationInputSchema>;\n\n// `taskType` was removed — the server derives it from the task doc; the client copy was\n// ignored (and forgeable). Callers pass only the task id + the extension window.\nexport const MarkWorkLaterInputSchema = z.object({\n taskId: taskIdSchema,\n extendHours: z.union([z.literal(24), z.literal(48)]),\n}).strict();\nexport type MarkWorkLaterInput = z.infer<typeof MarkWorkLaterInputSchema>;\n\n/** The two appeal-review decisions (ONE canonical declaration — shared by the review\n * input and its authoritative result). */\nexport const ContentAppealDecisionSchema = z.enum(['approved', 'denied']);\nexport type ContentAppealDecision = z.infer<typeof ContentAppealDecisionSchema>;\n\nexport const ReviewContentAppealInputSchema = z.object({\n violationId: violationIdSchema,\n taskId: taskIdSchema,\n decision: ContentAppealDecisionSchema,\n adminNotes: z.string().max(MAX_APPEAL_REVIEW_NOTES_LENGTH),\n}).strict();\nexport type ReviewContentAppealInput = z.infer<typeof ReviewContentAppealInputSchema>;\n\n// Authoritative result of reviewContentAppeal. Non-strict (server → client posture).\nexport const ReviewContentAppealResultSchema = z.object({\n success: z.literal(true),\n violationId: violationIdSchema,\n /** Echo of the requested decision (always known — it is the input). */\n decision: ContentAppealDecisionSchema,\n /** The appealing user's uid ('' on the orphaned-task cleanup path, where the\n * underlying violation was already gone and only the stale task was cleared). */\n userId: z.string(),\n /** Operation-receipt audit id — the `admin.contentAppealReviewed` event written in the same\n * transaction. Optional/additive so an older backend that omits it still type-checks. */\n auditEventId: z.string().min(1).optional(),\n});\nexport type ReviewContentAppealResult = z.infer<typeof ReviewContentAppealResultSchema>;\n\n// --- System-doc admin updates ---\n\nconst FuturePlanItemSchema = z.object({\n id: z.string().min(1).max(128),\n title: z.string().min(1).max(MAX_FUTURE_PLAN_TITLE_LENGTH),\n description: z.string().min(1).max(MAX_FUTURE_PLAN_DESCRIPTION_LENGTH),\n order: z.number().int().min(0),\n videoUrl: z.string().url().max(2048).optional(),\n mediaType: z.enum(['video', 'image', 'audio', 'other']).optional(),\n}).strict();\n\nexport const UpdateFuturePlansInputSchema = z.object({\n plans: z.array(FuturePlanItemSchema).max(200),\n}).strict();\nexport type UpdateFuturePlansInput = z.infer<typeof UpdateFuturePlansInputSchema>;\n\nconst RuleSchema = z.object({\n id: z.string().min(1).max(128),\n title: z.string().min(1).max(MAX_PLATFORM_RULE_TITLE_LENGTH),\n description: z.string().min(1).max(MAX_PLATFORM_RULE_DESCRIPTION_LENGTH),\n videoUrl: z.string().url().max(2048).optional(),\n group: z.enum(['generic', 'workProjectType', 'hallWingType', 'workRealm', 'merchandising']).optional(),\n subgroup: z.enum(['Tales', 'Tunes', 'Television', 'entertainment', 'educational', 'newsPolitical']).optional(),\n order: z.number().int().min(0),\n}).strict();\n\nconst AgreementCategorySchema = z.object({\n points: z.array(z.string().min(1).max(MAX_AGREEMENT_POINT_LENGTH)).max(200),\n videoUrl: z.string().url().max(2048).optional(),\n}).strict();\n\nconst AgreementsSchema = z.object({\n tales: AgreementCategorySchema.optional(),\n tunes: AgreementCategorySchema.optional(),\n television: AgreementCategorySchema.optional(),\n}).strict();\n\n// Partial update — admin UI may send only `rules` or only `agreements`.\n// Server merges. At least one field must be present.\nexport const UpdateRulesAndAgreementsInputSchema = z.object({\n rules: z.array(RuleSchema).max(500).optional(),\n agreements: AgreementsSchema.optional(),\n}).strict().refine(\n (data) => data.rules !== undefined || data.agreements !== undefined,\n { message: 'At least one of `rules` or `agreements` must be provided.' },\n);\nexport type UpdateRulesAndAgreementsInput = z.infer<typeof UpdateRulesAndAgreementsInputSchema>;\n\n// --- Content-pages migration (DJ ruling 2026-07-06): per-page update callables ---\n// One callable per page (never a `kind` discriminator): updateTermsPage /\n// updatePrivacyPage / updateTakeItDownPageCopy. The client NEVER sends `version`\n// — the server bumps it atomically on every save.\n\nconst ContentPageSectionInputSchema = z.object({\n id: z.string().min(1).max(128),\n heading: z.string().min(1).max(MAX_CONTENT_PAGE_HEADING_LENGTH),\n level: z.union([z.literal(1), z.literal(2)]),\n // Empty body is LEGAL: a bare divider heading (e.g. terms \"Part 1 — Our\n // Intention\") is real content. The input schema must accept everything the\n // stored ContentPageSectionSchema accepts, or a faithfully-seeded doc becomes\n // unsaveable in the admin editor (found by adversarial review 2026-07-06).\n body: z.string().max(MAX_CONTENT_PAGE_BODY_LENGTH),\n order: z.number().int().min(0),\n}).strict();\n\nexport const UpdateTermsPageInputSchema = z.object({\n sections: z.array(ContentPageSectionInputSchema).min(1).max(300),\n}).strict();\nexport type UpdateTermsPageInput = z.infer<typeof UpdateTermsPageInputSchema>;\n\nexport const UpdatePrivacyPageInputSchema = z.object({\n sections: z.array(ContentPageSectionInputSchema).min(1).max(300),\n}).strict();\nexport type UpdatePrivacyPageInput = z.infer<typeof UpdatePrivacyPageInputSchema>;\n\nexport const UpdateTakeItDownPageCopyInputSchema = z.object({\n strings: z.record(z.string().min(1).max(128), z.string().min(1).max(MAX_TAKE_IT_DOWN_COPY_LENGTH)),\n}).strict().refine(\n (data) => {\n const count = Object.keys(data.strings).length;\n return count >= 1 && count <= 200;\n },\n { message: 'strings must contain between 1 and 200 entries.' },\n);\nexport type UpdateTakeItDownPageCopyInput = z.infer<typeof UpdateTakeItDownPageCopyInputSchema>;\n\nconst AppConfigDocIdSchema = z.literal('app');\n\nexport const UpdateAppConfigInputSchema = z.object({\n docId: AppConfigDocIdSchema,\n data: z.object({\n appVersion: z.string().min(1).max(64).optional(),\n maintenanceMode: z.boolean().optional(),\n maintenanceMessage: z.string().max(MAX_MAINTENANCE_MESSAGE_LENGTH).optional(),\n registrationEnabled: z.boolean().optional(),\n // Runtime abuse throttle: 0 < m <= 1 (tighten-only; 1 = no throttle).\n rateLimitMultiplier: z.number().gt(0).max(1).optional(),\n }).strict().refine(\n (d) => Object.keys(d).length > 0,\n { message: 'data must have at least one field' },\n ),\n}).strict();\nexport type UpdateAppConfigInput = z.infer<typeof UpdateAppConfigInputSchema>;\n\n// --- Admin list mutations ---\n\nconst uidSchema = z.string().min(1).max(128);\n\n/**\n * Wire input for the `updateAdminList` callable in ttt-prod.\n * Used to grant or revoke admin / jrAdmin status on `_systemData/adminList`.\n *\n * All four fields are optional arrays of UIDs. At least one must be non-empty.\n * The callable's core function rejects conflicting input (e.g. same UID in\n * both addAdmins and removeAdmins) with HttpsError invalid-argument.\n */\nexport const UpdateAdminListInputSchema = z.object({\n addAdmins: z.array(uidSchema).optional(),\n removeAdmins: z.array(uidSchema).optional(),\n addJrAdmins: z.array(uidSchema).optional(),\n removeJrAdmins: z.array(uidSchema).optional(),\n})\n .strict()\n .refine(\n (data) =>\n (data.addAdmins?.length ?? 0) +\n (data.removeAdmins?.length ?? 0) +\n (data.addJrAdmins?.length ?? 0) +\n (data.removeJrAdmins?.length ?? 0) >\n 0,\n { message: 'At least one of addAdmins/removeAdmins/addJrAdmins/removeJrAdmins must be non-empty.' },\n );\n\nexport type UpdateAdminListInput = z.infer<typeof UpdateAdminListInputSchema>;\n\n// Authoritative result of updateAdminList — the grant/revoke delta counts computed inside\n// the roster transaction (uids already in their target state are no-ops and not counted).\n// Non-strict (server → client result posture).\nexport const UpdateAdminListResultSchema = z.object({\n success: z.literal(true),\n adminsGranted: z.number().int().nonnegative(),\n adminsRevoked: z.number().int().nonnegative(),\n jrAdminsGranted: z.number().int().nonnegative(),\n jrAdminsRevoked: z.number().int().nonnegative(),\n /** Operation-receipt audit id — the `admin.systemRoleGranted` / `admin.systemRoleRevoked`\n * event(s) key off the same roster transaction. Optional/additive. (No single domain id: a\n * roster edit spans multiple uids, so only the audit id is a meaningful receipt handle.) */\n auditEventId: z.string().min(1).optional(),\n});\nexport type UpdateAdminListResult = z.infer<typeof UpdateAdminListResultSchema>;\n\n// --- Admin moderation: hide / restore / retitle content + Work/Realm objects ---\n\nexport const CheckTrademarkInputSchema = z.object({\n // Primary: the work project's title (franchise-level check).\n workTitle: z.string().min(1).max(MAX_WORK_PROJECT_TITLE_LENGTH),\n // Optional: the sub-item title (chapter, track, episode). Checked secondarily.\n // `.nullish()` (not `.optional()`): the Firebase callable client serializes an\n // undefined argument as JSON null, and the work-view caller passes\n // `subItemTitle: subItem?.title` which is undefined when the sub-item hasn't\n // loaded — that arrives here as null. A bare `.optional()` would 400 on it.\n subItemTitle: z.string().max(MAX_WORK_PROJECT_TITLE_LENGTH).nullish(),\n}).strict();\nexport type CheckTrademarkInput = z.infer<typeof CheckTrademarkInputSchema>;\n\nexport const GetReportedContentDetailInputSchema = z.object({\n reportGroupId: z.string().min(1),\n}).strict();\nexport type GetReportedContentDetailInput = z.infer<typeof GetReportedContentDetailInputSchema>;\n\n// --- getReportedContentDetail result (cross-boundary: produced by the callable in functions/,\n// consumed by the admin report work-view) ---\n\n/** One display-text field of the reported doc, labeled for the review panel. The server returns\n * EVERY configured non-empty text field for the item type (title, description, body, …) in\n * display order — never just the first non-empty one. */\nexport const ReportedTextFieldSchema = z.object({\n /** Raw doc field name (e.g. 'description', 'workingTitle'). */\n field: z.string().min(1),\n /** Human label the panel renders (e.g. 'Description', 'Title'). */\n label: z.string().min(1),\n /** Current live value, trimmed; empty fields are omitted from the array. */\n value: z.string().min(1),\n});\nexport type ReportedTextField = z.infer<typeof ReportedTextFieldSchema>;\n\n/** One media asset referenced by the reported content: id + kind + current serving state\n * (for click-to-reveal) + the server-derived variant key the reveal must request. */\nexport const ReportedMediaAssetSchema = z.object({\n mediaAssetId: z.string().min(1),\n mediaKind: ContentMediaKindSchema.nullable(),\n servingStatus: MediaServingStatusSchema.nullable(),\n /** The variant key the reveal must request for its single display render (image origins split\n * between 'full' and 'main'; video/audio are always 'main'). Null when the asset doc is\n * missing/variant-less. */\n displayVariantKey: z.string().nullable(),\n /** Human label of WHAT this asset is on the reported item (e.g. 'Square cover',\n * 'Track photo — <title>'). Null when the server cannot derive one. */\n label: z.string().nullable(),\n});\nexport type ReportedMediaAsset = z.infer<typeof ReportedMediaAssetSchema>;\n\nexport const GetReportedContentDetailResultSchema = z.object({\n itemType: z.string().min(1),\n reportedItemId: z.string().min(1),\n /** First non-empty display-text field (legacy single-field snapshot; textFields is the\n * complete labeled set). */\n textSnapshot: z.string().nullable(),\n textFields: z.array(ReportedTextFieldSchema),\n mediaAssets: z.array(ReportedMediaAssetSchema),\n /** Whether the reported doc is currently hidden (best-effort, doc-flag based). */\n isHidden: z.boolean().nullable(),\n /** The content owner / uploader uid, when derivable. */\n ownerUid: z.string().nullable(),\n /** The FROZEN report-time snapshot (captured at intake), so the operator sees what was\n * reported even if the author edited the live doc to evade. Null for older reports. */\n reportTimeSnapshot: z.object({\n capturedText: z.string().nullable(),\n capturedMediaAssetIds: z.array(z.string()),\n revision: z.number().nullable(),\n capturedAt: z.number().nullable(),\n }).nullable(),\n});\nexport type GetReportedContentDetailResult = z.infer<typeof GetReportedContentDetailResultSchema>;\n\nexport const HideHallSubItemInputSchema = z.object({\n hallItemId: hallItemIdSchema,\n workProjectType: workProjectTypeSchema,\n subItemId: z.string().min(1),\n reason: z.string().min(1),\n}).strict();\nexport type HideHallSubItemInput = z.infer<typeof HideHallSubItemInputSchema>;\n\nexport const RestoreHallSubItemInputSchema = z.object({\n hallItemId: hallItemIdSchema,\n workProjectType: workProjectTypeSchema,\n subItemId: z.string().min(1),\n}).strict();\nexport type RestoreHallSubItemInput = z.infer<typeof RestoreHallSubItemInputSchema>;\n\nexport const HideWorkProjectInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n reason: z.string().min(1),\n}).strict();\nexport type HideWorkProjectInput = z.infer<typeof HideWorkProjectInputSchema>;\n\nexport const HideWorkRealmInputSchema = z.object({\n workRealmId: z.string().min(1),\n reason: z.string().min(1),\n}).strict();\nexport type HideWorkRealmInput = z.infer<typeof HideWorkRealmInputSchema>;\n\n// `cascadeId` is OPTIONAL: the app backends derive all active cascades for the target when it is\n// omitted, and restore just that one cascade when it is supplied.\nexport const RestoreWorkProjectInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n cascadeId: z.string().min(1).optional(),\n}).strict();\nexport type RestoreWorkProjectInput = z.infer<typeof RestoreWorkProjectInputSchema>;\n\nexport const RestoreWorkRealmInputSchema = z.object({\n workRealmId: z.string().min(1),\n cascadeId: z.string().min(1).optional(),\n}).strict();\nexport type RestoreWorkRealmInput = z.infer<typeof RestoreWorkRealmInputSchema>;\n\n// The `requireWorkProjectRetitle` / `requireWorkRealmRetitle` callables share this base\n// `{ reason }` shape and each `.extend(...)` it with its own id field at parse time.\nexport const RequireRetitleInputSchema = z.object({\n reason: z.string().min(1).max(MAX_REQUIRE_RETITLE_REASON_LENGTH),\n}).strict();\nexport type RequireRetitleInput = z.infer<typeof RequireRetitleInputSchema>;\n\n// --- Page-level \"Clear text (moderation)\" callables (per-field extension of the retitle family) ---\n\n// The clearable SHELL fields (raw doc field names) for the workProject + workRealm contexts.\n// Derived from the canonical clearable-field map — the two shell surfaces share the same fields.\nconst ModerationShellClearFieldSchema = z.enum(MODERATION_CLEARABLE_TEXT_FIELDS.workProject);\nexport type ModerationShellClearField = z.infer<typeof ModerationShellClearFieldSchema>;\n\nexport const ClearWorkProjectTextInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n fields: z.array(ModerationShellClearFieldSchema).min(1),\n reason: z.string().trim().min(1).max(MAX_REQUIRE_RETITLE_REASON_LENGTH),\n}).strict();\nexport type ClearWorkProjectTextInput = z.infer<typeof ClearWorkProjectTextInputSchema>;\n\nexport const ClearWorkRealmTextInputSchema = z.object({\n workRealmId: z.string().min(1),\n fields: z.array(ModerationShellClearFieldSchema).min(1),\n reason: z.string().trim().min(1).max(MAX_REQUIRE_RETITLE_REASON_LENGTH),\n}).strict();\nexport type ClearWorkRealmTextInput = z.infer<typeof ClearWorkRealmTextInputSchema>;\n\n// The clearable TEXT fields across the whole hall content family — derived from the canonical\n// map (union of every hall surface's fields), never restated literals.\nconst HallClearFieldSchema = z.enum(HALL_CLEARABLE_TEXT_FIELD_NAMES);\nexport type HallClearField = z.infer<typeof HallClearFieldSchema>;\n\nexport const ClearHallContentTextInputSchema = z.object({\n hallItemId: hallItemIdSchema,\n workProjectType: workProjectTypeSchema,\n subItemId: z.string().min(1).optional(),\n fields: z.array(HallClearFieldSchema).min(1),\n reason: z.string().trim().min(1).max(MAX_REQUIRE_RETITLE_REASON_LENGTH),\n}).strict();\nexport type ClearHallContentTextInput = z.infer<typeof ClearHallContentTextInputSchema>;\n\n// --- getLatestHideCascade — resolve the latest hide-cascade id for a Work/Realm ---\n\nexport const GetLatestHideCascadeInputSchema = z.object({\n entityId: z.string().min(1),\n targetType: z.enum(['work-project', 'work-realm']),\n}).strict();\nexport type GetLatestHideCascadeInput = z.infer<typeof GetLatestHideCascadeInputSchema>;\n\n// --- moderateReportedContent — hide / restore / soft perma-remove an individual reported item ---\n\n// The single-item content-action target set (SUBSET of ReportableItemType — excludes the\n// close-out-only hall-library-sub-item).\nconst MODERATE_REPORTED_CONTENT_TARGET_TYPES = [\n 'square-streetz-post',\n 'audition',\n 'audition-entry',\n 'commission-listing',\n 'commission-proposal',\n 'work-asset',\n 'profile-picture',\n 'hall-library-item',\n 'craft-skill',\n // Conversation File — the hide/restore/remove action targets the file owner record +\n // its mediaAsset (the `work-asset` shape), never a chat message.\n 'conversation-file',\n] as const satisfies readonly ReportableItemType[];\n\nexport const ModerateReportedContentInputSchema = z.object({\n reportGroupId: z.string().min(1),\n targetType: z.enum(MODERATE_REPORTED_CONTENT_TARGET_TYPES),\n reportedItemId: z.string().min(1),\n parentItemId: z.string().min(1).optional(),\n action: z.enum(['hide', 'restore', 'remove']),\n // [EUAS-023] A destructive action (hide/remove) MUST carry a reason; restore is a reversal.\n reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH).optional(),\n})\n .strict()\n .superRefine((val, ctx) => {\n if ((val.action === 'hide' || val.action === 'remove') && !val.reason) {\n ctx.addIssue({\n code: 'custom',\n message: 'A reason is required to hide or remove content.',\n path: ['reason'],\n });\n }\n });\nexport type ModerateReportedContentInput = z.infer<typeof ModerateReportedContentInputSchema>;\n\n// --- resolveAdminTask — the ONE guided close-out for EVERY admin case type ---\n\n// [EUAS-005] The content-action target set ALSO accepts hall-library-sub-item (hide/restore only),\n// which routes to the dedicated `runSetHallSubItemHidden` core (not `runModerateReportedContent`).\nconst CONTENT_ACTION_TARGET_TYPES = [\n 'square-streetz-post',\n 'audition',\n 'audition-entry',\n 'commission-listing',\n 'commission-proposal',\n 'work-asset',\n 'profile-picture',\n 'hall-library-item',\n 'craft-skill',\n 'hall-library-sub-item',\n // Conversation File — same content action as `work-asset`, routed at the file record.\n 'conversation-file',\n] as const satisfies readonly ReportableItemType[];\n\nconst ContentActionSchema = z\n .object({\n button: z.enum(['hideContent', 'restoreContent', 'permaRemoveContent']),\n targetType: z.enum(CONTENT_ACTION_TARGET_TYPES),\n reportedItemId: z.string().min(1),\n parentItemId: z.string().min(1).optional(),\n })\n .strict();\n\nconst WarnUserSchema = z\n .object({\n button: z.literal('warnUser'),\n userId: z.string().min(1),\n // A warning IS an admin dispatch (resolveAdminTask → runCreateAdminDispatchToUser),\n // so it shares the dispatch subject/body caps.\n subject: z.string().trim().min(1).max(MAX_ADMIN_DISPATCH_SUBJECT_LENGTH),\n message: z.string().trim().min(1).max(MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH),\n })\n .strict();\n\nconst SuspendOrBanSchema = z\n .object({\n button: z.enum(['suspendUser', 'banUser']),\n userId: z.string().min(1),\n reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH),\n })\n .strict();\n\nconst ReinstateUserSchema = z\n .object({ button: z.literal('reinstateUser'), userId: z.string().min(1), reason: z.string().trim().max(MAX_INTERNAL_REASON_LENGTH).optional() })\n .strict();\n\nconst ForceUsernameResetSchema = z\n .object({ button: z.literal('forceUsernameReset'), userId: z.string().min(1), reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH).optional() })\n .strict();\n\n/** Whole-object Work/Realm remedies — `reportedItemId` is the workProjectId / workRealmId. */\nconst WorkObjectActionSchema = z\n .object({\n button: z.enum(['hideWorkObject', 'restoreWorkObject', 'forceRetitle']),\n targetType: z.enum(['work-project', 'work-realm']),\n reportedItemId: z.string().min(1),\n })\n .strict();\n\n// --- The in-flow clear-content disposition (staged counterpart of the page-level clear-text\n// callables) ---\n\n/** The three targets the in-flow text clear can neutralize — the Work/Realm shells plus a single\n * published hall sub-item. Compile-linked subset of the canonical reportable-item enum. */\nconst CLEAR_CONTENT_TEXT_TARGET_TYPES = [\n 'work-project',\n 'work-realm',\n 'hall-library-sub-item',\n] as const satisfies readonly ReportableItemType[];\nexport type ClearContentTextTargetType = (typeof CLEAR_CONTENT_TEXT_TARGET_TYPES)[number];\n\n/** Every field name the staged clear can carry across those three targets — the union of the two\n * canonical clearable owners (`MODERATION_CLEARABLE_TEXT_FIELDS` for the shells,\n * `HALL_CLEARABLE_TEXT_FIELD_NAMES` for the hall family), i.e. the same two sources\n * `ClearWorkProjectTextInputSchema` / `ClearHallContentTextInputSchema` derive from. No field\n * literal is restated here. */\nconst CLEAR_CONTENT_TEXT_FIELDS = [\n ...MODERATION_CLEARABLE_TEXT_FIELDS.workProject,\n ...HALL_CLEARABLE_TEXT_FIELD_NAMES,\n] as const;\nconst ClearContentTextFieldSchema = z.enum(CLEAR_CONTENT_TEXT_FIELDS);\nexport type ClearContentTextField = z.infer<typeof ClearContentTextFieldSchema>;\n\n/** Which fields each target legally accepts — projected from those same owners, so a\n * target/field mismatch is refused at the wire instead of reaching a clear runner that would\n * drop it. Enforced by the cross-field refinement on `StagedActionSchema` below. */\nconst CLEAR_CONTENT_TEXT_FIELDS_BY_TARGET = {\n 'work-project': MODERATION_CLEARABLE_TEXT_FIELDS.workProject,\n 'work-realm': MODERATION_CLEARABLE_TEXT_FIELDS.workRealm,\n 'hall-library-sub-item': HALL_CLEARABLE_TEXT_FIELD_NAMES,\n} as const satisfies Record<ClearContentTextTargetType, readonly ClearContentTextField[]>;\n\n/** Per-field text clear — the guided close-out's staged counterpart of the page-level\n * `clearWorkProjectText` / `clearWorkRealmText` / `clearHallContentText` callables (the\n * per-field extension of `forceRetitle`). `reportedItemId` is the workProjectId / workRealmId /\n * sub-item id; `parentItemId` is the parent hall item id, required only for the sub-item target.\n * `workProjectType` is deliberately NOT on the wire — the server re-reads it from the doc (the\n * hall hide-branch precedent). */\nconst ClearContentTextActionSchema = z\n .object({\n button: z.literal('clearContentText'),\n targetType: z.enum(CLEAR_CONTENT_TEXT_TARGET_TYPES),\n reportedItemId: z.string().min(1),\n parentItemId: z.string().min(1).optional(),\n fields: z.array(ClearContentTextFieldSchema).min(1),\n })\n .strict();\n\n/** Chat message tombstone — channel + seq from the report, revision from the live thread-read. */\nconst TombstoneChatSchema = z\n .object({\n button: z.literal('tombstoneChat'),\n channel: z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('channel'), workProjectId: z.string().min(1), guildChatChannelId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('invite'), guildInviteId: z.string().min(1) }).strict(),\n ]),\n messageSeq: z.number().int().nonnegative(),\n expectedMessageRevision: z.number().int().nonnegative(),\n })\n .strict();\n\nexport const StagedActionSchema = z\n .discriminatedUnion('button', [\n ContentActionSchema,\n WarnUserSchema,\n SuspendOrBanSchema,\n ReinstateUserSchema,\n ForceUsernameResetSchema,\n WorkObjectActionSchema,\n ClearContentTextActionSchema,\n TombstoneChatSchema,\n ])\n // The clearContentText arm's two cross-field rules, applied at the union (the\n // SafetyStagedActionSchema pattern below) because no other arm carries these fields:\n // every chosen field must belong to the chosen target's canonical clearable set, and the\n // hall sub-item target must name its parent hall item.\n .superRefine((value, ctx) => {\n if (value.button !== 'clearContentText') return;\n const clearable: readonly string[] = CLEAR_CONTENT_TEXT_FIELDS_BY_TARGET[value.targetType];\n value.fields.forEach((field, index) => {\n if (!clearable.includes(field)) {\n ctx.addIssue({\n code: 'custom',\n message: `Field '${field}' is not clearable on a '${value.targetType}' target.`,\n path: ['fields', index],\n });\n }\n });\n if (value.targetType === 'hall-library-sub-item' && !value.parentItemId) {\n ctx.addIssue({\n code: 'custom',\n message: 'parentItemId (the parent hall item id) is required for a hall sub-item target.',\n path: ['parentItemId'],\n });\n }\n });\nexport type StagedAction = z.infer<typeof StagedActionSchema>;\n\nexport const NormalReportInputSchema = z\n .object({\n caseType: z.literal('normalReport').default('normalReport'),\n taskId: z.string().min(1),\n outcome: z.enum(['founded', 'unfounded']),\n resolutionSummary: z.string().trim().min(1).max(MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH),\n actions: z.array(StagedActionSchema).max(16).default([]),\n userFacingReasonCode: z.string().trim().min(1).max(128).optional(),\n userFacingReasonDetail: z.string().trim().max(MAX_USER_FACING_REASON_DETAIL_LENGTH).optional(),\n adminNote: z.string().trim().max(MAX_SAFETY_ADMIN_NOTE_LENGTH).optional(),\n })\n .strict();\nexport type ResolveAdminTaskInput = z.infer<typeof NormalReportInputSchema>;\n\nconst SafetyDispositionActionSchema = z\n .object({\n button: z.literal('setReportDisposition'),\n // Derived from the ONE canonical disposition enum — 'undetermined' is the initial\n // state, never an operator-settable target, so it is excluded (not re-declared).\n disposition: ReportDispositionSchema.exclude(['undetermined']),\n dispositionReasonCode: ReportDispositionReasonCodeSchema,\n // Derived from the ONE receipts-cap constant (doc-schemas/safety/evidence.ts) — the same\n // bound the callable + the embedded SetReportDispositionInputV1Schema use. No field-level min:\n // the reportRequired⇒non-empty rule lives in the shared cross-field refinement below, so every\n // other disposition may legally stage this action with no evidence revealed.\n evidenceRefs: z.array(z.string().min(1)).max(MAX_MANIFEST_NCMEC_RECEIPTS),\n expectedRevision: z.number().int().nonnegative(),\n })\n .strict();\n\nconst QuarantineActionSchema = z.object({ button: z.literal('quarantinePreserveFile') }).strict();\n\n// [C-01/EUAS-002] No client-supplied requestId — the linked statutory request id(s) are derived\n// SERVER-SIDE from the case's `requestLinks` inside `enqueueNciiRemovalForCase`.\nconst HashRemoveActionSchema = z.object({ button: z.literal('hashRemoveFile') }).strict();\n\nconst SafetyAccountActionSchema = z\n .object({\n button: z.enum(['suspendUser', 'banUser', 'reinstateUser']),\n targetUid: z.string().min(1),\n reasonInternal: z.string().trim().min(4).max(MAX_INTERNAL_REASON_LENGTH),\n reasonUserFacing: z.string().trim().min(1).max(MAX_USER_FACING_REASON_LENGTH),\n role: ChildSafetyAccountRoleSchema,\n subjectDisposition: ChildSafetyAccountSubjectDispositionSchema,\n })\n .strict();\n\nexport const SafetyStagedActionSchema = z\n .discriminatedUnion('button', [\n SafetyDispositionActionSchema,\n QuarantineActionSchema,\n HashRemoveActionSchema,\n SafetyAccountActionSchema,\n ])\n // The setReportDisposition arm reuses the ONE canonical cross-field rules (foundation.ts) via the\n // shared refinements — never re-declaring them here: the disposition↔reason pairing AND the\n // reportRequired⇒evidence-present rule. Other arms carry no such fields.\n .superRefine((value, ctx) => {\n if (value.button === 'setReportDisposition') {\n refineReportDispositionReasonCode(value, ctx);\n refineReportDispositionEvidenceRefs(value, ctx);\n }\n });\nexport type SafetyStagedAction = z.infer<typeof SafetyStagedActionSchema>;\n\nexport const SafetyCaseInputSchema = z\n .object({\n caseType: z.enum(['csam', 'ncii']),\n caseId: z.string().min(1),\n outcome: z.enum(['founded', 'unfounded']),\n resolutionSummary: z.string().trim().min(1).max(MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH),\n actions: z.array(SafetyStagedActionSchema).max(16).default([]),\n adminNote: z.string().trim().max(MAX_SAFETY_ADMIN_NOTE_LENGTH).optional(),\n // [EUAS-017] Optimistic-concurrency token (`childSafetyCaseList.revision` / `nciiCases.revision`).\n // The close is rejected if the case changed since the operator loaded it — concurrent stale closes\n // can't silently overwrite. Optional for backward compatibility; the console always supplies it.\n expectedRevision: z.number().int().nonnegative().optional(),\n // Interim reauth: a single explicit typed confirmation for the privileged safety actions,\n // standing in for the passkey two-step until [H-17]. The callable is full-admin gated.\n confirmation: z.literal(SAFETY_ACTIONS_CONFIRMATION),\n })\n .strict();\nexport type SafetyCaseInput = z.infer<typeof SafetyCaseInputSchema>;\n\nexport const ReopenSafetyCaseInputSchema = z\n .object({\n caseType: z.enum(['csam', 'ncii']),\n caseId: z.string().min(1),\n reasonInternal: z.string().trim().min(4).max(MAX_INTERNAL_REASON_LENGTH),\n expectedRevision: z.number().int().nonnegative().optional(),\n confirmation: z.literal(SAFETY_CASE_REOPEN_CONFIRMATION),\n })\n .strict();\nexport type ReopenSafetyCaseInput = z.infer<typeof ReopenSafetyCaseInputSchema>;\n\n// ---------------------------------------------------------------------------\n// Dead-letter operations — adminReplayDeadLetter + getDeadLetters (Ops Repairs).\n// ---------------------------------------------------------------------------\n\n/** Every ledger the dead-letter replay callable supports. `hallSubItemEdgeSync`\n * rows live at a 4-segment nested path, so their docId IS the full document path\n * (the callable splits it); every other lane is the flat [collection, docId] tuple. */\nexport const DeadLetterCollectionSchema = z.enum([\n 'chatSyncEvents',\n 'chatAdminActionCommands',\n 'notificationDeliveries',\n 'chatMessageOutbox',\n 'squareAnnouncementJobs',\n 'chatSyncFanoutJobs',\n 'mediaAssets',\n 'quarantineSagaJobs',\n 'nciiRemovalJobs',\n 'safetyEvidenceJobs',\n 'accountActionCommands',\n 'activeReportGroups',\n 'hallSubItemEdgeSync',\n]);\nexport type DeadLetterCollection = z.infer<typeof DeadLetterCollectionSchema>;\n\nexport const AdminReplayDeadLetterInputSchema = z\n .object({\n collection: DeadLetterCollectionSchema,\n // Structural id bound (hallSubItemEdgeSync docIds are full nested paths).\n docId: z.string().min(1).max(200),\n reason: z.string().min(1).max(MAX_INTERNAL_REASON_LENGTH),\n dryRun: z.boolean().optional(),\n })\n .strict();\nexport type AdminReplayDeadLetterInput = z.infer<typeof AdminReplayDeadLetterInputSchema>;\n\nexport const GetDeadLettersInputSchema = z\n .object({\n /** Restrict to one ledger; absent = all supported ledgers. */\n collection: DeadLetterCollectionSchema.optional(),\n /** Per-ledger row cap (the callable's own ceiling applies regardless). */\n limit: z.number().int().min(1).max(200).optional(),\n })\n .strict()\n .nullish();\nexport type GetDeadLettersInput = z.infer<typeof GetDeadLettersInputSchema>;\n\n\n"]}
|
|
1
|
+
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/schemas/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,gCAAgC,GACjC,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EAC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BAAiB;IACjB,oBAAoB;IACpB,uBAAuB;IACvB,oBAAoB;IACpB,qBAAqB;CACtB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,UAAU,EAAE,0BAA0B;IACtC,0EAA0E;IAC1E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACjC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,0BAA0B,CAAC;IACzD,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,8DAA8D;IAC9D,UAAU,EAAE,0BAA0B,CAAC,QAAQ,EAAE;IACjD,0EAA0E;IAC1E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC;KACD,MAAM,EAAE;KACR,OAAO,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n violationIdSchema,\n taskIdSchema,\n workProjectIdSchema,\n hallItemIdSchema,\n workProjectTypeSchema,\n moderationClearableSurfaceSchema,\n} from './atoms.js';\nimport {\n ReportDispositionSchema,\n ReportDispositionReasonCodeSchema,\n refineReportDispositionReasonCode,\n refineReportDispositionEvidenceRefs,\n type ReportableItemType,\n} from '../doc-schemas/safety/foundation.js';\nimport {\n ChildSafetyAccountRoleSchema,\n ChildSafetyAccountSubjectDispositionSchema,\n} from '../doc-schemas/safety/case.js';\nimport {\n ContentMediaKindSchema,\n MediaServingStatusSchema,\n} from '../doc-schemas/media-assets.js';\nimport { MAX_MANIFEST_NCMEC_RECEIPTS } from '../doc-schemas/safety/evidence.js';\nimport {\n MODERATION_CLEARABLE_TEXT_FIELDS,\n HALL_CLEARABLE_TEXT_FIELD_NAMES,\n} from '../constants/business-content.js';\nimport {\n MAX_WORK_PROJECT_TITLE_LENGTH,\n MAX_ADMIN_DISPATCH_SUBJECT_LENGTH,\n MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH,\n MAX_INTERNAL_REASON_LENGTH,\n MAX_USER_FACING_REASON_LENGTH,\n MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH,\n MAX_SAFETY_ADMIN_NOTE_LENGTH,\n MAX_FUTURE_PLAN_TITLE_LENGTH,\n MAX_FUTURE_PLAN_DESCRIPTION_LENGTH,\n MAX_PLATFORM_RULE_TITLE_LENGTH,\n MAX_PLATFORM_RULE_DESCRIPTION_LENGTH,\n MAX_AGREEMENT_POINT_LENGTH,\n MAX_CONTENT_PAGE_HEADING_LENGTH,\n MAX_CONTENT_PAGE_BODY_LENGTH,\n MAX_TAKE_IT_DOWN_COPY_LENGTH,\n MAX_MAINTENANCE_MESSAGE_LENGTH,\n MAX_APPEAL_REVIEW_NOTES_LENGTH,\n MAX_REQUIRE_RETITLE_REASON_LENGTH,\n MAX_USER_FACING_REASON_DETAIL_LENGTH,\n} from '../constants/business.js';\nimport {\n SAFETY_ACTIONS_CONFIRMATION,\n SAFETY_CASE_REOPEN_CONFIRMATION,\n} from '../constants/safety-confirmation-phrases.js';\n\nexport const CheckoutNextImportantTaskInputSchema = z.object({}).strict();\nexport type CheckoutNextImportantTaskInput = z.infer<typeof CheckoutNextImportantTaskInputSchema>;\n\nexport const GetContentViolationInputSchema = z.object({\n violationId: violationIdSchema,\n}).strict();\nexport type GetContentViolationInput = z.infer<typeof GetContentViolationInputSchema>;\n\n// `taskType` was removed — the server derives it from the task doc; the client copy was\n// ignored (and forgeable). Callers pass only the task id + the extension window.\nexport const MarkWorkLaterInputSchema = z.object({\n taskId: taskIdSchema,\n extendHours: z.union([z.literal(24), z.literal(48)]),\n}).strict();\nexport type MarkWorkLaterInput = z.infer<typeof MarkWorkLaterInputSchema>;\n\n/** The two appeal-review decisions (ONE canonical declaration — shared by the review\n * input and its authoritative result). */\nexport const ContentAppealDecisionSchema = z.enum(['approved', 'denied']);\nexport type ContentAppealDecision = z.infer<typeof ContentAppealDecisionSchema>;\n\nexport const ReviewContentAppealInputSchema = z.object({\n violationId: violationIdSchema,\n taskId: taskIdSchema,\n decision: ContentAppealDecisionSchema,\n adminNotes: z.string().max(MAX_APPEAL_REVIEW_NOTES_LENGTH),\n}).strict();\nexport type ReviewContentAppealInput = z.infer<typeof ReviewContentAppealInputSchema>;\n\n// Authoritative result of reviewContentAppeal. Non-strict (server → client posture).\nexport const ReviewContentAppealResultSchema = z.object({\n success: z.literal(true),\n violationId: violationIdSchema,\n /** Echo of the requested decision (always known — it is the input). */\n decision: ContentAppealDecisionSchema,\n /** The appealing user's uid ('' on the orphaned-task cleanup path, where the\n * underlying violation was already gone and only the stale task was cleared). */\n userId: z.string(),\n /** Operation-receipt audit id — the `admin.contentAppealReviewed` event written in the same\n * transaction. Optional/additive so an older backend that omits it still type-checks. */\n auditEventId: z.string().min(1).optional(),\n});\nexport type ReviewContentAppealResult = z.infer<typeof ReviewContentAppealResultSchema>;\n\n// --- System-doc admin updates ---\n\nconst FuturePlanItemSchema = z.object({\n id: z.string().min(1).max(128),\n title: z.string().min(1).max(MAX_FUTURE_PLAN_TITLE_LENGTH),\n description: z.string().min(1).max(MAX_FUTURE_PLAN_DESCRIPTION_LENGTH),\n order: z.number().int().min(0),\n videoUrl: z.string().url().max(2048).optional(),\n mediaType: z.enum(['video', 'image', 'audio', 'other']).optional(),\n}).strict();\n\nexport const UpdateFuturePlansInputSchema = z.object({\n plans: z.array(FuturePlanItemSchema).max(200),\n}).strict();\nexport type UpdateFuturePlansInput = z.infer<typeof UpdateFuturePlansInputSchema>;\n\nconst RuleSchema = z.object({\n id: z.string().min(1).max(128),\n title: z.string().min(1).max(MAX_PLATFORM_RULE_TITLE_LENGTH),\n description: z.string().min(1).max(MAX_PLATFORM_RULE_DESCRIPTION_LENGTH),\n videoUrl: z.string().url().max(2048).optional(),\n group: z.enum(['generic', 'workProjectType', 'hallWingType', 'workRealm', 'merchandising']).optional(),\n subgroup: z.enum(['Tales', 'Tunes', 'Television', 'entertainment', 'educational', 'newsPolitical']).optional(),\n order: z.number().int().min(0),\n}).strict();\n\nconst AgreementCategorySchema = z.object({\n points: z.array(z.string().min(1).max(MAX_AGREEMENT_POINT_LENGTH)).max(200),\n videoUrl: z.string().url().max(2048).optional(),\n}).strict();\n\nconst AgreementsSchema = z.object({\n tales: AgreementCategorySchema.optional(),\n tunes: AgreementCategorySchema.optional(),\n television: AgreementCategorySchema.optional(),\n}).strict();\n\n// Partial update — admin UI may send only `rules` or only `agreements`.\n// Server merges. At least one field must be present.\nexport const UpdateRulesAndAgreementsInputSchema = z.object({\n rules: z.array(RuleSchema).max(500).optional(),\n agreements: AgreementsSchema.optional(),\n}).strict().refine(\n (data) => data.rules !== undefined || data.agreements !== undefined,\n { message: 'At least one of `rules` or `agreements` must be provided.' },\n);\nexport type UpdateRulesAndAgreementsInput = z.infer<typeof UpdateRulesAndAgreementsInputSchema>;\n\n// --- Content-pages migration (DJ ruling 2026-07-06): per-page update callables ---\n// One callable per page (never a `kind` discriminator): updateTermsPage /\n// updatePrivacyPage / updateTakeItDownPageCopy. The client NEVER sends `version`\n// — the server bumps it atomically on every save.\n\nconst ContentPageSectionInputSchema = z.object({\n id: z.string().min(1).max(128),\n heading: z.string().min(1).max(MAX_CONTENT_PAGE_HEADING_LENGTH),\n level: z.union([z.literal(1), z.literal(2)]),\n // Empty body is LEGAL: a bare divider heading (e.g. terms \"Part 1 — Our\n // Intention\") is real content. The input schema must accept everything the\n // stored ContentPageSectionSchema accepts, or a faithfully-seeded doc becomes\n // unsaveable in the admin editor (found by adversarial review 2026-07-06).\n body: z.string().max(MAX_CONTENT_PAGE_BODY_LENGTH),\n order: z.number().int().min(0),\n}).strict();\n\nexport const UpdateTermsPageInputSchema = z.object({\n sections: z.array(ContentPageSectionInputSchema).min(1).max(300),\n}).strict();\nexport type UpdateTermsPageInput = z.infer<typeof UpdateTermsPageInputSchema>;\n\nexport const UpdatePrivacyPageInputSchema = z.object({\n sections: z.array(ContentPageSectionInputSchema).min(1).max(300),\n}).strict();\nexport type UpdatePrivacyPageInput = z.infer<typeof UpdatePrivacyPageInputSchema>;\n\nexport const UpdateTakeItDownPageCopyInputSchema = z.object({\n strings: z.record(z.string().min(1).max(128), z.string().min(1).max(MAX_TAKE_IT_DOWN_COPY_LENGTH)),\n}).strict().refine(\n (data) => {\n const count = Object.keys(data.strings).length;\n return count >= 1 && count <= 200;\n },\n { message: 'strings must contain between 1 and 200 entries.' },\n);\nexport type UpdateTakeItDownPageCopyInput = z.infer<typeof UpdateTakeItDownPageCopyInputSchema>;\n\nconst AppConfigDocIdSchema = z.literal('app');\n\nexport const UpdateAppConfigInputSchema = z.object({\n docId: AppConfigDocIdSchema,\n data: z.object({\n appVersion: z.string().min(1).max(64).optional(),\n maintenanceMode: z.boolean().optional(),\n maintenanceMessage: z.string().max(MAX_MAINTENANCE_MESSAGE_LENGTH).optional(),\n registrationEnabled: z.boolean().optional(),\n // Runtime abuse throttle: 0 < m <= 1 (tighten-only; 1 = no throttle).\n rateLimitMultiplier: z.number().gt(0).max(1).optional(),\n }).strict().refine(\n (d) => Object.keys(d).length > 0,\n { message: 'data must have at least one field' },\n ),\n}).strict();\nexport type UpdateAppConfigInput = z.infer<typeof UpdateAppConfigInputSchema>;\n\n// --- Admin list mutations ---\n\nconst uidSchema = z.string().min(1).max(128);\n\n/**\n * Wire input for the `updateAdminList` callable in ttt-prod.\n * Used to grant or revoke admin / jrAdmin status on `_systemData/adminList`.\n *\n * All four fields are optional arrays of UIDs. At least one must be non-empty.\n * The callable's core function rejects conflicting input (e.g. same UID in\n * both addAdmins and removeAdmins) with HttpsError invalid-argument.\n */\nexport const UpdateAdminListInputSchema = z.object({\n addAdmins: z.array(uidSchema).optional(),\n removeAdmins: z.array(uidSchema).optional(),\n addJrAdmins: z.array(uidSchema).optional(),\n removeJrAdmins: z.array(uidSchema).optional(),\n})\n .strict()\n .refine(\n (data) =>\n (data.addAdmins?.length ?? 0) +\n (data.removeAdmins?.length ?? 0) +\n (data.addJrAdmins?.length ?? 0) +\n (data.removeJrAdmins?.length ?? 0) >\n 0,\n { message: 'At least one of addAdmins/removeAdmins/addJrAdmins/removeJrAdmins must be non-empty.' },\n );\n\nexport type UpdateAdminListInput = z.infer<typeof UpdateAdminListInputSchema>;\n\n// Authoritative result of updateAdminList — the grant/revoke delta counts computed inside\n// the roster transaction (uids already in their target state are no-ops and not counted).\n// Non-strict (server → client result posture).\nexport const UpdateAdminListResultSchema = z.object({\n success: z.literal(true),\n adminsGranted: z.number().int().nonnegative(),\n adminsRevoked: z.number().int().nonnegative(),\n jrAdminsGranted: z.number().int().nonnegative(),\n jrAdminsRevoked: z.number().int().nonnegative(),\n /** Operation-receipt audit id — the `admin.systemRoleGranted` / `admin.systemRoleRevoked`\n * event(s) key off the same roster transaction. Optional/additive. (No single domain id: a\n * roster edit spans multiple uids, so only the audit id is a meaningful receipt handle.) */\n auditEventId: z.string().min(1).optional(),\n});\nexport type UpdateAdminListResult = z.infer<typeof UpdateAdminListResultSchema>;\n\n// --- Admin moderation: hide / restore / retitle content + Work/Realm objects ---\n\nexport const CheckTrademarkInputSchema = z.object({\n // Primary: the work project's title (franchise-level check).\n workTitle: z.string().min(1).max(MAX_WORK_PROJECT_TITLE_LENGTH),\n // Optional: the sub-item title (chapter, track, episode). Checked secondarily.\n // `.nullish()` (not `.optional()`): the Firebase callable client serializes an\n // undefined argument as JSON null, and the work-view caller passes\n // `subItemTitle: subItem?.title` which is undefined when the sub-item hasn't\n // loaded — that arrives here as null. A bare `.optional()` would 400 on it.\n subItemTitle: z.string().max(MAX_WORK_PROJECT_TITLE_LENGTH).nullish(),\n}).strict();\nexport type CheckTrademarkInput = z.infer<typeof CheckTrademarkInputSchema>;\n\nexport const GetReportedContentDetailInputSchema = z.object({\n reportGroupId: z.string().min(1),\n}).strict();\nexport type GetReportedContentDetailInput = z.infer<typeof GetReportedContentDetailInputSchema>;\n\n// --- getReportedContentDetail result (cross-boundary: produced by the callable in functions/,\n// consumed by the admin report work-view) ---\n\n/** One display-text field of the reported doc, labeled for the review panel. The server returns\n * EVERY configured non-empty text field for the item type (title, description, body, …) in\n * display order — never just the first non-empty one. */\nexport const ReportedTextFieldSchema = z.object({\n /** Raw doc field name (e.g. 'description', 'workingTitle'). */\n field: z.string().min(1),\n /** Human label the panel renders (e.g. 'Description', 'Title'). */\n label: z.string().min(1),\n /** Current live value, trimmed; empty fields are omitted from the array. */\n value: z.string().min(1),\n});\nexport type ReportedTextField = z.infer<typeof ReportedTextFieldSchema>;\n\n/** One media asset referenced by the reported content: id + kind + current serving state\n * (for click-to-reveal) + the server-derived variant key the reveal must request. */\nexport const ReportedMediaAssetSchema = z.object({\n mediaAssetId: z.string().min(1),\n mediaKind: ContentMediaKindSchema.nullable(),\n servingStatus: MediaServingStatusSchema.nullable(),\n /** The variant key the reveal must request for its single display render (image origins split\n * between 'full' and 'main'; video/audio are always 'main'). Null when the asset doc is\n * missing/variant-less. */\n displayVariantKey: z.string().nullable(),\n /** Human label of WHAT this asset is on the reported item (e.g. 'Square cover',\n * 'Track photo — <title>'). Null when the server cannot derive one. */\n label: z.string().nullable(),\n});\nexport type ReportedMediaAsset = z.infer<typeof ReportedMediaAssetSchema>;\n\nexport const GetReportedContentDetailResultSchema = z.object({\n itemType: z.string().min(1),\n reportedItemId: z.string().min(1),\n /** First non-empty display-text field (legacy single-field snapshot; textFields is the\n * complete labeled set). */\n textSnapshot: z.string().nullable(),\n textFields: z.array(ReportedTextFieldSchema),\n mediaAssets: z.array(ReportedMediaAssetSchema),\n /** Whether the reported doc is currently hidden (best-effort, doc-flag based). */\n isHidden: z.boolean().nullable(),\n /** The content owner / uploader uid, when derivable. */\n ownerUid: z.string().nullable(),\n /**\n * The canonical moderation-clearable SURFACE this reported doc actually IS, resolved\n * SERVER-side: `chapter` / `tuneTrack` / `televisionEpisode` for a hall sub-item (through\n * `HALL_CONTENT_SURFACES_BY_WORK_TYPE`, from the parent hall doc the callable already reads),\n * `workProject` / `workRealm` for the shells.\n *\n * Why the resolved surface and not the `workProjectType` it was resolved from: the surface is\n * what a consumer needs — `MODERATION_CLEARABLE_TEXT_FIELDS[clearableSurface]` is the exact\n * clearable field set, one canonical index with no re-derivation. Shipping the work-project type\n * instead would make every consumer redo the routing AND the detail-vs-sub-item branch, which is\n * precisely the hand-rolled duplication that map was created to end.\n *\n * What it fixes: the in-flow clear's field picker offered the hall-family UNION\n * (title/description/content) because the projection never said which surface the sub-item was —\n * so an operator could tick `description` on a Tale chapter (title/content) or `content` on a\n * Tune track (title/description), pass the wire refinement, and have the clear runner silently\n * drop it. The picker now offers only this surface's fields, and the resolve path re-checks\n * caller-supplied fields against the same set.\n *\n * `.nullish()`: absent on payloads produced before this field existed, and null when the\n * reported item is not a clearable text surface at all (a square post, a chat message, a\n * profile picture).\n */\n clearableSurface: moderationClearableSurfaceSchema.nullish(),\n /** The FROZEN report-time snapshot (captured at intake), so the operator sees what was\n * reported even if the author edited the live doc to evade. Null for older reports. */\n reportTimeSnapshot: z.object({\n capturedText: z.string().nullable(),\n capturedMediaAssetIds: z.array(z.string()),\n revision: z.number().nullable(),\n capturedAt: z.number().nullable(),\n }).nullable(),\n});\nexport type GetReportedContentDetailResult = z.infer<typeof GetReportedContentDetailResultSchema>;\n\nexport const HideHallSubItemInputSchema = z.object({\n hallItemId: hallItemIdSchema,\n workProjectType: workProjectTypeSchema,\n subItemId: z.string().min(1),\n reason: z.string().min(1),\n}).strict();\nexport type HideHallSubItemInput = z.infer<typeof HideHallSubItemInputSchema>;\n\nexport const RestoreHallSubItemInputSchema = z.object({\n hallItemId: hallItemIdSchema,\n workProjectType: workProjectTypeSchema,\n subItemId: z.string().min(1),\n}).strict();\nexport type RestoreHallSubItemInput = z.infer<typeof RestoreHallSubItemInputSchema>;\n\nexport const HideWorkProjectInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n reason: z.string().min(1),\n}).strict();\nexport type HideWorkProjectInput = z.infer<typeof HideWorkProjectInputSchema>;\n\nexport const HideWorkRealmInputSchema = z.object({\n workRealmId: z.string().min(1),\n reason: z.string().min(1),\n}).strict();\nexport type HideWorkRealmInput = z.infer<typeof HideWorkRealmInputSchema>;\n\n// `cascadeId` is OPTIONAL: the app backends derive all active cascades for the target when it is\n// omitted, and restore just that one cascade when it is supplied.\nexport const RestoreWorkProjectInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n cascadeId: z.string().min(1).optional(),\n}).strict();\nexport type RestoreWorkProjectInput = z.infer<typeof RestoreWorkProjectInputSchema>;\n\nexport const RestoreWorkRealmInputSchema = z.object({\n workRealmId: z.string().min(1),\n cascadeId: z.string().min(1).optional(),\n}).strict();\nexport type RestoreWorkRealmInput = z.infer<typeof RestoreWorkRealmInputSchema>;\n\n// The `requireWorkProjectRetitle` / `requireWorkRealmRetitle` callables share this base\n// `{ reason }` shape and each `.extend(...)` it with its own id field at parse time.\nexport const RequireRetitleInputSchema = z.object({\n reason: z.string().min(1).max(MAX_REQUIRE_RETITLE_REASON_LENGTH),\n}).strict();\nexport type RequireRetitleInput = z.infer<typeof RequireRetitleInputSchema>;\n\n// --- Page-level \"Clear text (moderation)\" callables (per-field extension of the retitle family) ---\n\n// The clearable SHELL fields (raw doc field names) for the workProject + workRealm contexts.\n// Derived from the canonical clearable-field map — the two shell surfaces share the same fields.\nconst ModerationShellClearFieldSchema = z.enum(MODERATION_CLEARABLE_TEXT_FIELDS.workProject);\nexport type ModerationShellClearField = z.infer<typeof ModerationShellClearFieldSchema>;\n\nexport const ClearWorkProjectTextInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n fields: z.array(ModerationShellClearFieldSchema).min(1),\n reason: z.string().trim().min(1).max(MAX_REQUIRE_RETITLE_REASON_LENGTH),\n}).strict();\nexport type ClearWorkProjectTextInput = z.infer<typeof ClearWorkProjectTextInputSchema>;\n\nexport const ClearWorkRealmTextInputSchema = z.object({\n workRealmId: z.string().min(1),\n fields: z.array(ModerationShellClearFieldSchema).min(1),\n reason: z.string().trim().min(1).max(MAX_REQUIRE_RETITLE_REASON_LENGTH),\n}).strict();\nexport type ClearWorkRealmTextInput = z.infer<typeof ClearWorkRealmTextInputSchema>;\n\n// The clearable TEXT fields across the whole hall content family — derived from the canonical\n// map (union of every hall surface's fields), never restated literals.\nconst HallClearFieldSchema = z.enum(HALL_CLEARABLE_TEXT_FIELD_NAMES);\nexport type HallClearField = z.infer<typeof HallClearFieldSchema>;\n\nexport const ClearHallContentTextInputSchema = z.object({\n hallItemId: hallItemIdSchema,\n workProjectType: workProjectTypeSchema,\n subItemId: z.string().min(1).optional(),\n fields: z.array(HallClearFieldSchema).min(1),\n reason: z.string().trim().min(1).max(MAX_REQUIRE_RETITLE_REASON_LENGTH),\n}).strict();\nexport type ClearHallContentTextInput = z.infer<typeof ClearHallContentTextInputSchema>;\n\n// --- getLatestHideCascade — resolve the latest hide-cascade id for a Work/Realm ---\n\nexport const GetLatestHideCascadeInputSchema = z.object({\n entityId: z.string().min(1),\n targetType: z.enum(['work-project', 'work-realm']),\n}).strict();\nexport type GetLatestHideCascadeInput = z.infer<typeof GetLatestHideCascadeInputSchema>;\n\n// --- moderateReportedContent — hide / restore / soft perma-remove an individual reported item ---\n\n// The single-item content-action target set (SUBSET of ReportableItemType — excludes the\n// close-out-only hall-library-sub-item).\nconst MODERATE_REPORTED_CONTENT_TARGET_TYPES = [\n 'square-streetz-post',\n 'audition',\n 'audition-entry',\n 'commission-listing',\n 'commission-proposal',\n 'work-asset',\n 'profile-picture',\n 'hall-library-item',\n 'craft-skill',\n // Conversation File — the hide/restore/remove action targets the file owner record +\n // its mediaAsset (the `work-asset` shape), never a chat message.\n 'conversation-file',\n] as const satisfies readonly ReportableItemType[];\n\nexport const ModerateReportedContentInputSchema = z.object({\n reportGroupId: z.string().min(1),\n targetType: z.enum(MODERATE_REPORTED_CONTENT_TARGET_TYPES),\n reportedItemId: z.string().min(1),\n parentItemId: z.string().min(1).optional(),\n action: z.enum(['hide', 'restore', 'remove']),\n // [EUAS-023] A destructive action (hide/remove) MUST carry a reason; restore is a reversal.\n reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH).optional(),\n})\n .strict()\n .superRefine((val, ctx) => {\n if ((val.action === 'hide' || val.action === 'remove') && !val.reason) {\n ctx.addIssue({\n code: 'custom',\n message: 'A reason is required to hide or remove content.',\n path: ['reason'],\n });\n }\n });\nexport type ModerateReportedContentInput = z.infer<typeof ModerateReportedContentInputSchema>;\n\n// --- resolveAdminTask — the ONE guided close-out for EVERY admin case type ---\n\n// [EUAS-005] The content-action target set ALSO accepts hall-library-sub-item (hide/restore only),\n// which routes to the dedicated `runSetHallSubItemHidden` core (not `runModerateReportedContent`).\nconst CONTENT_ACTION_TARGET_TYPES = [\n 'square-streetz-post',\n 'audition',\n 'audition-entry',\n 'commission-listing',\n 'commission-proposal',\n 'work-asset',\n 'profile-picture',\n 'hall-library-item',\n 'craft-skill',\n 'hall-library-sub-item',\n // Conversation File — same content action as `work-asset`, routed at the file record.\n 'conversation-file',\n] as const satisfies readonly ReportableItemType[];\n\nconst ContentActionSchema = z\n .object({\n button: z.enum(['hideContent', 'restoreContent', 'permaRemoveContent']),\n targetType: z.enum(CONTENT_ACTION_TARGET_TYPES),\n reportedItemId: z.string().min(1),\n parentItemId: z.string().min(1).optional(),\n })\n .strict();\n\nconst WarnUserSchema = z\n .object({\n button: z.literal('warnUser'),\n userId: z.string().min(1),\n // A warning IS an admin dispatch (resolveAdminTask → runCreateAdminDispatchToUser),\n // so it shares the dispatch subject/body caps.\n subject: z.string().trim().min(1).max(MAX_ADMIN_DISPATCH_SUBJECT_LENGTH),\n message: z.string().trim().min(1).max(MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH),\n })\n .strict();\n\nconst SuspendOrBanSchema = z\n .object({\n button: z.enum(['suspendUser', 'banUser']),\n userId: z.string().min(1),\n reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH),\n })\n .strict();\n\nconst ReinstateUserSchema = z\n .object({ button: z.literal('reinstateUser'), userId: z.string().min(1), reason: z.string().trim().max(MAX_INTERNAL_REASON_LENGTH).optional() })\n .strict();\n\nconst ForceUsernameResetSchema = z\n .object({ button: z.literal('forceUsernameReset'), userId: z.string().min(1), reason: z.string().trim().min(1).max(MAX_INTERNAL_REASON_LENGTH).optional() })\n .strict();\n\n/** Whole-object Work/Realm remedies — `reportedItemId` is the workProjectId / workRealmId. */\nconst WorkObjectActionSchema = z\n .object({\n button: z.enum(['hideWorkObject', 'restoreWorkObject', 'forceRetitle']),\n targetType: z.enum(['work-project', 'work-realm']),\n reportedItemId: z.string().min(1),\n })\n .strict();\n\n// --- The in-flow clear-content disposition (staged counterpart of the page-level clear-text\n// callables) ---\n\n/** The three targets the in-flow text clear can neutralize — the Work/Realm shells plus a single\n * published hall sub-item. Compile-linked subset of the canonical reportable-item enum. */\nconst CLEAR_CONTENT_TEXT_TARGET_TYPES = [\n 'work-project',\n 'work-realm',\n 'hall-library-sub-item',\n] as const satisfies readonly ReportableItemType[];\nexport type ClearContentTextTargetType = (typeof CLEAR_CONTENT_TEXT_TARGET_TYPES)[number];\n\n/** Every field name the staged clear can carry across those three targets — the union of the two\n * canonical clearable owners (`MODERATION_CLEARABLE_TEXT_FIELDS` for the shells,\n * `HALL_CLEARABLE_TEXT_FIELD_NAMES` for the hall family), i.e. the same two sources\n * `ClearWorkProjectTextInputSchema` / `ClearHallContentTextInputSchema` derive from. No field\n * literal is restated here. */\nconst CLEAR_CONTENT_TEXT_FIELDS = [\n ...MODERATION_CLEARABLE_TEXT_FIELDS.workProject,\n ...HALL_CLEARABLE_TEXT_FIELD_NAMES,\n] as const;\nconst ClearContentTextFieldSchema = z.enum(CLEAR_CONTENT_TEXT_FIELDS);\nexport type ClearContentTextField = z.infer<typeof ClearContentTextFieldSchema>;\n\n/** Which fields each target legally accepts — projected from those same owners, so a\n * target/field mismatch is refused at the wire instead of reaching a clear runner that would\n * drop it. Enforced by the cross-field refinement on `StagedActionSchema` below. */\nconst CLEAR_CONTENT_TEXT_FIELDS_BY_TARGET = {\n 'work-project': MODERATION_CLEARABLE_TEXT_FIELDS.workProject,\n 'work-realm': MODERATION_CLEARABLE_TEXT_FIELDS.workRealm,\n 'hall-library-sub-item': HALL_CLEARABLE_TEXT_FIELD_NAMES,\n} as const satisfies Record<ClearContentTextTargetType, readonly ClearContentTextField[]>;\n\n/** Per-field text clear — the guided close-out's staged counterpart of the page-level\n * `clearWorkProjectText` / `clearWorkRealmText` / `clearHallContentText` callables (the\n * per-field extension of `forceRetitle`). `reportedItemId` is the workProjectId / workRealmId /\n * sub-item id; `parentItemId` is the parent hall item id, required only for the sub-item target.\n * `workProjectType` is deliberately NOT on the wire — the server re-reads it from the doc (the\n * hall hide-branch precedent). */\nconst ClearContentTextActionSchema = z\n .object({\n button: z.literal('clearContentText'),\n targetType: z.enum(CLEAR_CONTENT_TEXT_TARGET_TYPES),\n reportedItemId: z.string().min(1),\n parentItemId: z.string().min(1).optional(),\n fields: z.array(ClearContentTextFieldSchema).min(1),\n })\n .strict();\n\n/** Chat message tombstone — channel + seq from the report, revision from the live thread-read. */\nconst TombstoneChatSchema = z\n .object({\n button: z.literal('tombstoneChat'),\n channel: z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('channel'), workProjectId: z.string().min(1), guildChatChannelId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('invite'), guildInviteId: z.string().min(1) }).strict(),\n ]),\n messageSeq: z.number().int().nonnegative(),\n expectedMessageRevision: z.number().int().nonnegative(),\n })\n .strict();\n\nexport const StagedActionSchema = z\n .discriminatedUnion('button', [\n ContentActionSchema,\n WarnUserSchema,\n SuspendOrBanSchema,\n ReinstateUserSchema,\n ForceUsernameResetSchema,\n WorkObjectActionSchema,\n ClearContentTextActionSchema,\n TombstoneChatSchema,\n ])\n // The clearContentText arm's two cross-field rules, applied at the union (the\n // SafetyStagedActionSchema pattern below) because no other arm carries these fields:\n // every chosen field must belong to the chosen target's canonical clearable set, and the\n // hall sub-item target must name its parent hall item.\n .superRefine((value, ctx) => {\n if (value.button !== 'clearContentText') return;\n const clearable: readonly string[] = CLEAR_CONTENT_TEXT_FIELDS_BY_TARGET[value.targetType];\n value.fields.forEach((field, index) => {\n if (!clearable.includes(field)) {\n ctx.addIssue({\n code: 'custom',\n message: `Field '${field}' is not clearable on a '${value.targetType}' target.`,\n path: ['fields', index],\n });\n }\n });\n if (value.targetType === 'hall-library-sub-item' && !value.parentItemId) {\n ctx.addIssue({\n code: 'custom',\n message: 'parentItemId (the parent hall item id) is required for a hall sub-item target.',\n path: ['parentItemId'],\n });\n }\n });\nexport type StagedAction = z.infer<typeof StagedActionSchema>;\n\nexport const NormalReportInputSchema = z\n .object({\n caseType: z.literal('normalReport').default('normalReport'),\n taskId: z.string().min(1),\n outcome: z.enum(['founded', 'unfounded']),\n resolutionSummary: z.string().trim().min(1).max(MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH),\n actions: z.array(StagedActionSchema).max(16).default([]),\n userFacingReasonCode: z.string().trim().min(1).max(128).optional(),\n userFacingReasonDetail: z.string().trim().max(MAX_USER_FACING_REASON_DETAIL_LENGTH).optional(),\n adminNote: z.string().trim().max(MAX_SAFETY_ADMIN_NOTE_LENGTH).optional(),\n })\n .strict();\nexport type ResolveAdminTaskInput = z.infer<typeof NormalReportInputSchema>;\n\nconst SafetyDispositionActionSchema = z\n .object({\n button: z.literal('setReportDisposition'),\n // Derived from the ONE canonical disposition enum — 'undetermined' is the initial\n // state, never an operator-settable target, so it is excluded (not re-declared).\n disposition: ReportDispositionSchema.exclude(['undetermined']),\n dispositionReasonCode: ReportDispositionReasonCodeSchema,\n // Derived from the ONE receipts-cap constant (doc-schemas/safety/evidence.ts) — the same\n // bound the callable + the embedded SetReportDispositionInputV1Schema use. No field-level min:\n // the reportRequired⇒non-empty rule lives in the shared cross-field refinement below, so every\n // other disposition may legally stage this action with no evidence revealed.\n evidenceRefs: z.array(z.string().min(1)).max(MAX_MANIFEST_NCMEC_RECEIPTS),\n expectedRevision: z.number().int().nonnegative(),\n })\n .strict();\n\nconst QuarantineActionSchema = z.object({ button: z.literal('quarantinePreserveFile') }).strict();\n\n// [C-01/EUAS-002] No client-supplied requestId — the linked statutory request id(s) are derived\n// SERVER-SIDE from the case's `requestLinks` inside `enqueueNciiRemovalForCase`.\nconst HashRemoveActionSchema = z.object({ button: z.literal('hashRemoveFile') }).strict();\n\nconst SafetyAccountActionSchema = z\n .object({\n button: z.enum(['suspendUser', 'banUser', 'reinstateUser']),\n targetUid: z.string().min(1),\n reasonInternal: z.string().trim().min(4).max(MAX_INTERNAL_REASON_LENGTH),\n reasonUserFacing: z.string().trim().min(1).max(MAX_USER_FACING_REASON_LENGTH),\n role: ChildSafetyAccountRoleSchema,\n subjectDisposition: ChildSafetyAccountSubjectDispositionSchema,\n })\n .strict();\n\nexport const SafetyStagedActionSchema = z\n .discriminatedUnion('button', [\n SafetyDispositionActionSchema,\n QuarantineActionSchema,\n HashRemoveActionSchema,\n SafetyAccountActionSchema,\n ])\n // The setReportDisposition arm reuses the ONE canonical cross-field rules (foundation.ts) via the\n // shared refinements — never re-declaring them here: the disposition↔reason pairing AND the\n // reportRequired⇒evidence-present rule. Other arms carry no such fields.\n .superRefine((value, ctx) => {\n if (value.button === 'setReportDisposition') {\n refineReportDispositionReasonCode(value, ctx);\n refineReportDispositionEvidenceRefs(value, ctx);\n }\n });\nexport type SafetyStagedAction = z.infer<typeof SafetyStagedActionSchema>;\n\nexport const SafetyCaseInputSchema = z\n .object({\n caseType: z.enum(['csam', 'ncii']),\n caseId: z.string().min(1),\n outcome: z.enum(['founded', 'unfounded']),\n resolutionSummary: z.string().trim().min(1).max(MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH),\n actions: z.array(SafetyStagedActionSchema).max(16).default([]),\n adminNote: z.string().trim().max(MAX_SAFETY_ADMIN_NOTE_LENGTH).optional(),\n // [EUAS-017] Optimistic-concurrency token (`childSafetyCaseList.revision` / `nciiCases.revision`).\n // The close is rejected if the case changed since the operator loaded it — concurrent stale closes\n // can't silently overwrite. Optional for backward compatibility; the console always supplies it.\n expectedRevision: z.number().int().nonnegative().optional(),\n // Interim reauth: a single explicit typed confirmation for the privileged safety actions,\n // standing in for the passkey two-step until [H-17]. The callable is full-admin gated.\n confirmation: z.literal(SAFETY_ACTIONS_CONFIRMATION),\n })\n .strict();\nexport type SafetyCaseInput = z.infer<typeof SafetyCaseInputSchema>;\n\nexport const ReopenSafetyCaseInputSchema = z\n .object({\n caseType: z.enum(['csam', 'ncii']),\n caseId: z.string().min(1),\n reasonInternal: z.string().trim().min(4).max(MAX_INTERNAL_REASON_LENGTH),\n expectedRevision: z.number().int().nonnegative().optional(),\n confirmation: z.literal(SAFETY_CASE_REOPEN_CONFIRMATION),\n })\n .strict();\nexport type ReopenSafetyCaseInput = z.infer<typeof ReopenSafetyCaseInputSchema>;\n\n// ---------------------------------------------------------------------------\n// Dead-letter operations — adminReplayDeadLetter + getDeadLetters (Ops Repairs).\n// ---------------------------------------------------------------------------\n\n/** Every ledger the dead-letter replay callable supports. `hallSubItemEdgeSync`\n * rows live at a 4-segment nested path, so their docId IS the full document path\n * (the callable splits it); every other lane is the flat [collection, docId] tuple. */\nexport const DeadLetterCollectionSchema = z.enum([\n 'chatSyncEvents',\n 'chatAdminActionCommands',\n 'notificationDeliveries',\n 'chatMessageOutbox',\n 'squareAnnouncementJobs',\n 'chatSyncFanoutJobs',\n 'mediaAssets',\n 'quarantineSagaJobs',\n 'nciiRemovalJobs',\n 'safetyEvidenceJobs',\n 'accountActionCommands',\n 'activeReportGroups',\n 'hallSubItemEdgeSync',\n]);\nexport type DeadLetterCollection = z.infer<typeof DeadLetterCollectionSchema>;\n\nexport const AdminReplayDeadLetterInputSchema = z\n .object({\n collection: DeadLetterCollectionSchema,\n // Structural id bound (hallSubItemEdgeSync docIds are full nested paths).\n docId: z.string().min(1).max(200),\n reason: z.string().min(1).max(MAX_INTERNAL_REASON_LENGTH),\n dryRun: z.boolean().optional(),\n })\n .strict();\nexport type AdminReplayDeadLetterInput = z.infer<typeof AdminReplayDeadLetterInputSchema>;\n\nexport const GetDeadLettersInputSchema = z\n .object({\n /** Restrict to one ledger; absent = all supported ledgers. */\n collection: DeadLetterCollectionSchema.optional(),\n /** Per-ledger row cap (the callable's own ceiling applies regardless). */\n limit: z.number().int().min(1).max(200).optional(),\n })\n .strict()\n .nullish();\nexport type GetDeadLettersInput = z.infer<typeof GetDeadLettersInputSchema>;\n\n\n"]}
|
package/dist/schemas/atoms.d.ts
CHANGED
|
@@ -39,6 +39,16 @@ export declare const hallWingTypeSchema: z.ZodEnum<{
|
|
|
39
39
|
educational: "educational";
|
|
40
40
|
newsPolitical: "newsPolitical";
|
|
41
41
|
}>;
|
|
42
|
+
export declare const moderationClearableSurfaceSchema: z.ZodEnum<{
|
|
43
|
+
tale: "tale";
|
|
44
|
+
tune: "tune";
|
|
45
|
+
television: "television";
|
|
46
|
+
chapter: "chapter";
|
|
47
|
+
tuneTrack: "tuneTrack";
|
|
48
|
+
televisionEpisode: "televisionEpisode";
|
|
49
|
+
workRealm: "workRealm";
|
|
50
|
+
workProject: "workProject";
|
|
51
|
+
}>;
|
|
42
52
|
export declare const guildInviteConversationStatusSchema: z.ZodEnum<{
|
|
43
53
|
pending: "pending";
|
|
44
54
|
accepted: "accepted";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atoms.d.ts","sourceRoot":"","sources":["../../src/schemas/atoms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"atoms.d.ts","sourceRoot":"","sources":["../../src/schemas/atoms.ts"],"names":[],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gCAAgC;;;;;;;;;EAK5C,CAAC;AAOF,eAAO,MAAM,mCAAmC;;;;;;EAM9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAKhG,eAAO,MAAM,WAAW,aAAuD,CAAC"}
|
package/dist/schemas/atoms.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { MAX_WORK_PROJECT_TITLE_LENGTH } from '../constants/business.js';
|
|
3
3
|
import { WORK_PROJECT_TYPE_KEYS } from '../types/content.js';
|
|
4
|
+
import { MODERATION_CLEARABLE_TEXT_FIELDS, } from '../constants/business-content.js';
|
|
4
5
|
// ID atoms — every callable input that includes an ID field uses one of these.
|
|
5
6
|
// Kept as separate constants (not aliases of a generic `idSchema`) so consumers
|
|
6
7
|
// reading a callable's schema can see exactly which entity the field refers to.
|
|
@@ -35,6 +36,15 @@ export const addRemoveActionSchema = z.enum(['add', 'remove']);
|
|
|
35
36
|
// Derives from the ONE canonical WORK_PROJECT_TYPE_KEYS (types/content.ts) — never re-declared.
|
|
36
37
|
export const workProjectTypeSchema = z.enum(WORK_PROJECT_TYPE_KEYS);
|
|
37
38
|
export const hallWingTypeSchema = z.enum(['entertainment', 'educational', 'newsPolitical']);
|
|
39
|
+
// The moderation-clearable SURFACE atom (`workProject` | `workRealm` | `tale` | `tune` |
|
|
40
|
+
// `television` | `chapter` | `tuneTrack` | `televisionEpisode`). Derived from the KEYS of the
|
|
41
|
+
// canonical MODERATION_CLEARABLE_TEXT_FIELDS map (constants/business-content.ts) rather than
|
|
42
|
+
// restating them, so a surface added to that map is on the wire automatically and the enum can
|
|
43
|
+
// never drift from the field map a consumer indexes with the parsed value. The cast only supplies
|
|
44
|
+
// zod's non-empty-tuple shape — the runtime values ARE the map's keys, and `z.infer` is exactly
|
|
45
|
+
// `ModerationClearableSurface`. Lives here (a leaf module) because the constants layer is
|
|
46
|
+
// deliberately zod-free, mirroring `workProjectTypeSchema` above.
|
|
47
|
+
export const moderationClearableSurfaceSchema = z.enum(Object.keys(MODERATION_CLEARABLE_TEXT_FIELDS));
|
|
38
48
|
// The ONE canonical guild-invite conversation status set (state machine: pending →
|
|
39
49
|
// accepted (transient, trigger-consumed) → finalized, or pending → declined/cancelled).
|
|
40
50
|
// Lives here (a leaf module) because both the doc schema (doc-schemas/messaging.ts) and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atoms.js","sourceRoot":"","sources":["../../src/schemas/atoms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"atoms.js","sourceRoot":"","sources":["../../src/schemas/atoms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACL,gCAAgC,GAEjC,MAAM,kCAAkC,CAAC;AAE1C,+EAA+E;AAC/E,gFAAgF;AAChF,gFAAgF;AAChF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CA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AAC,eAAe,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC;AAE5F,yFAAyF;AACzF,8FAA8F;AAC9F,6FAA6F;AAC7F,+FAA+F;AAC/F,kGAAkG;AAClG,gGAAgG;AAChG,0FAA0F;AAC1F,kEAAkE;AAClE,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,IAAI,CACpD,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAG3C,CACF,CAAC;AAEF,mFAAmF;AACnF,wFAAwF;AACxF,wFAAwF;AACxF,yFAAyF;AACzF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC,IAAI,CAAC;IACxD,SAAS;IACT,UAAU;IACV,UAAU;IACV,WAAW;IACX,WAAW;CACZ,CAAC,CAAC;AAGH,kFAAkF;AAClF,qFAAqF;AACrF,gFAAgF;AAChF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { MAX_WORK_PROJECT_TITLE_LENGTH } from '../constants/business.js';\nimport { WORK_PROJECT_TYPE_KEYS } from '../types/content.js';\nimport {\n MODERATION_CLEARABLE_TEXT_FIELDS,\n type ModerationClearableSurface,\n} from '../constants/business-content.js';\n\n// ID atoms — every callable input that includes an ID field uses one of these.\n// Kept as separate constants (not aliases of a generic `idSchema`) so consumers\n// reading a callable's schema can see exactly which entity the field refers to.\nexport const workProjectIdSchema = z.string().min(1);\nexport const userIdSchema = z.string().min(1);\nexport const guildInviteIdSchema = z.string().min(1);\nexport const violationIdSchema = z.string().min(1);\nexport const auditionIdSchema = z.string().min(1);\nexport const commissionListingIdSchema = z.string().min(1);\nexport const commissionProposalIdSchema = z.string().min(1);\nexport const auditionEntryIdSchema = z.string().min(1);\nexport const guildChatChannelIdSchema = z.string().min(1);\nexport const workFileFolderIdSchema = z.string().min(1);\nexport const notificationFanoutJobIdSchema = z.string().min(1);\nexport const taleIdSchema = z.string().min(1);\nexport const tuneIdSchema = z.string().min(1);\nexport const televisionIdSchema = z.string().min(1);\nexport const chapterIdSchema = z.string().min(1);\nexport const trackIdSchema = z.string().min(1);\nexport const episodeIdSchema = z.string().min(1);\nexport const craftSkillIdSchema = z.string().min(1);\nexport const taskIdSchema = z.string().min(1);\nexport const adminDispatchIdSchema = z.string().min(1);\nexport const reportGroupIdSchema = z.string().min(1);\nexport const mediaAssetIdSchema = z.string().min(1);\nexport const hallItemIdSchema = z.string().min(1);\nexport const itemIdSchema = z.string().min(1);\nexport const thresholdItemIdSchema = z.string().min(1);\nexport const changeRequestIdSchema = z.string().min(1);\n\n// Action / enum atoms.\nexport const addRemoveActionSchema = z.enum(['add', 'remove']);\n// Derives from the ONE canonical WORK_PROJECT_TYPE_KEYS (types/content.ts) — never re-declared.\nexport const workProjectTypeSchema = z.enum(WORK_PROJECT_TYPE_KEYS);\nexport const hallWingTypeSchema = z.enum(['entertainment', 'educational', 'newsPolitical']);\n\n// The moderation-clearable SURFACE atom (`workProject` | `workRealm` | `tale` | `tune` |\n// `television` | `chapter` | `tuneTrack` | `televisionEpisode`). Derived from the KEYS of the\n// canonical MODERATION_CLEARABLE_TEXT_FIELDS map (constants/business-content.ts) rather than\n// restating them, so a surface added to that map is on the wire automatically and the enum can\n// never drift from the field map a consumer indexes with the parsed value. The cast only supplies\n// zod's non-empty-tuple shape — the runtime values ARE the map's keys, and `z.infer` is exactly\n// `ModerationClearableSurface`. Lives here (a leaf module) because the constants layer is\n// deliberately zod-free, mirroring `workProjectTypeSchema` above.\nexport const moderationClearableSurfaceSchema = z.enum(\n Object.keys(MODERATION_CLEARABLE_TEXT_FIELDS) as [\n ModerationClearableSurface,\n ...ModerationClearableSurface[],\n ],\n);\n\n// The ONE canonical guild-invite conversation status set (state machine: pending →\n// accepted (transient, trigger-consumed) → finalized, or pending → declined/cancelled).\n// Lives here (a leaf module) because both the doc schema (doc-schemas/messaging.ts) and\n// the list-invites input (work-project-management.ts) derive from it and those two files\n// import each other's siblings — never re-declare it inline.\nexport const guildInviteConversationStatusSchema = z.enum([\n 'pending',\n 'accepted',\n 'declined',\n 'cancelled',\n 'finalized',\n]);\nexport type GuildInviteConversationStatus = z.infer<typeof guildInviteConversationStatusSchema>;\n\n// String shape atoms. Length derives from the owning constant — every title alias\n// (tale/tune/tv/chapter/track/episode/commission) resolves to the same value, so the\n// UI counter, the Save guard, and this server bound are provably the same rule.\nexport const titleSchema = z.string().min(1).max(MAX_WORK_PROJECT_TITLE_LENGTH);\n\n\n"]}
|
package/dist/schemas/chat.d.ts
CHANGED
|
@@ -4,6 +4,11 @@ export declare const ArchiveGuildChatChannelInputSchema: z.ZodObject<{
|
|
|
4
4
|
guildChatChannelId: z.ZodString;
|
|
5
5
|
}, z.core.$strict>;
|
|
6
6
|
export type ArchiveGuildChatChannelInput = z.infer<typeof ArchiveGuildChatChannelInputSchema>;
|
|
7
|
+
export declare const UnarchiveGuildChatChannelInputSchema: z.ZodObject<{
|
|
8
|
+
workProjectId: z.ZodString;
|
|
9
|
+
guildChatChannelId: z.ZodString;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
export type UnarchiveGuildChatChannelInput = z.infer<typeof UnarchiveGuildChatChannelInputSchema>;
|
|
7
12
|
export declare const DeleteGuildChatChannelInputSchema: z.ZodObject<{
|
|
8
13
|
workProjectId: z.ZodString;
|
|
9
14
|
guildChatChannelId: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/schemas/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,eAAO,MAAM,kCAAkC;;;kBAGpC,CAAC;AACZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;
|
|
1
|
+
{"version":3,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C,CAAC,KAAK,CAAC,OAAO,6CAA6C,CAAC,CAAC;AAIpH,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;;kBAK7C,CAAC;AACZ,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2CAA2C,CAAC,CAAC;AAOhH,eAAO,MAAM,oBAAoB;;;;;;;;;4BAI/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,iCAAiC;;;;;;;kBAOnC,CAAC;AACZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAS5F,eAAO,MAAM,gCAAgC;;;;;;;4BAG3C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAK1F,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;kBAQrC,CAAC;AACZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAKhG,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;kBAOpC,CAAC;AACZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC"}
|
package/dist/schemas/chat.js
CHANGED
|
@@ -7,6 +7,14 @@ export const ArchiveGuildChatChannelInputSchema = z.object({
|
|
|
7
7
|
workProjectId: workProjectIdSchema,
|
|
8
8
|
guildChatChannelId: guildChatChannelIdSchema,
|
|
9
9
|
}).strict();
|
|
10
|
+
// Restore an archived guild chat channel — same input shape as archive. The callable clears
|
|
11
|
+
// `isArchived` and bumps configVersion; it is the inverse of archive, never a path to a deleted
|
|
12
|
+
// (tombstoned) channel. Declared as its OWN named schema per the delete precedent below: one
|
|
13
|
+
// named schema per callable, so a lane's input can diverge without touching its siblings.
|
|
14
|
+
export const UnarchiveGuildChatChannelInputSchema = z.object({
|
|
15
|
+
workProjectId: workProjectIdSchema,
|
|
16
|
+
guildChatChannelId: guildChatChannelIdSchema,
|
|
17
|
+
}).strict();
|
|
10
18
|
// Tombstone (delete) a guild chat channel — same input shape as archive. The callable marks the
|
|
11
19
|
// channel `isDeleted`, bumps configVersion, revokes grants, and re-projects members to `removed`;
|
|
12
20
|
// storage is retained (never a physical purge). See ttt-prod docs/design/chat-realtime-system.md.
|
package/dist/schemas/chat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/schemas/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,uBAAuB,EACvB,kCAAkC,EAClC,yCAAyC,GAC1C,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iCAAiC,EACjC,sCAAsC,EACtC,iCAAiC,GAClC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAE5E,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD,aAAa,EAAE,mBAAmB;IAClC,kBAAkB,EAAE,wBAAwB;CAC7C,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,gGAAgG;AAChG,kGAAkG;AAClG,kGAAkG;AAClG,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,aAAa,EAAE,mBAAmB;IAClC,kBAAkB,EAAE,wBAAwB;CAC7C,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,aAAa,EAAE,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AAC","sourcesContent":["import { z } from 'zod';\nimport {\n workProjectIdSchema,\n guildChatChannelIdSchema,\n guildInviteIdSchema,\n adminDispatchIdSchema,\n} from './atoms.js';\nimport {\n MAX_CHAT_MESSAGE_LENGTH,\n MAX_GUILD_CHAT_CHANNEL_NAME_LENGTH,\n MAX_GUILD_CHAT_CHANNEL_DESCRIPTION_LENGTH,\n} from '../constants/chat.js';\nimport {\n MAX_ADMIN_DISPATCH_SUBJECT_LENGTH,\n MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH,\n MAX_CHAT_MODERATION_REASON_LENGTH,\n} from '../constants/business.js';\nimport { AdminDispatchContextRefSchema } from '../doc-schemas/messaging.js';\n\nexport const ArchiveGuildChatChannelInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n guildChatChannelId: guildChatChannelIdSchema,\n}).strict();\nexport type ArchiveGuildChatChannelInput = z.infer<typeof ArchiveGuildChatChannelInputSchema>;\n\n// Tombstone (delete) a guild chat channel — same input shape as archive. The callable marks the\n// channel `isDeleted`, bumps configVersion, revokes grants, and re-projects members to `removed`;\n// storage is retained (never a physical purge). See ttt-prod docs/design/chat-realtime-system.md.\nexport const DeleteGuildChatChannelInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n guildChatChannelId: guildChatChannelIdSchema,\n}).strict();\nexport type DeleteGuildChatChannelInput = z.infer<typeof DeleteGuildChatChannelInputSchema>;\n\nexport const CreateGuildChatChannelInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n channelName: z.string().min(1).max(MAX_GUILD_CHAT_CHANNEL_NAME_LENGTH),\n description: z.string().max(MAX_GUILD_CHAT_CHANNEL_DESCRIPTION_LENGTH).optional(),\n requiredGuildStandings: z.array(z.string().min(1).max(64)).max(20),\n allowedUserIds: z.array(z.string().min(1).max(128)).max(500),\n}).strict();\nexport type CreateGuildChatChannelInput = z.infer<typeof CreateGuildChatChannelInputSchema>;\n\n// Guild channels + invite threads moved to the realtime chat (Cloudflare DOs), which\n// sends through the DO client — NOT this callable. The Firestore send path is retained\n// PERMANENTLY for admin-support threads only (ttt-prod docs/design/chat-realtime-system.md).\nexport const SendGuildChatMessageInputSchema = z.object({\n threadKind: z.literal('adminSupport'),\n adminDispatchId: adminDispatchIdSchema,\n isUserReply: z.boolean(),\n text: z.string().max(MAX_CHAT_MESSAGE_LENGTH),\n // No reply pointer: chat has no reply-authoring affordance, so a client could never\n // legitimately send one. `.strict()` therefore REJECTS a client-sent `replyTo`\n // (DJ ruling 2026-07-29).\n}).strict();\nexport type SendGuildChatMessageInput = z.infer<typeof SendGuildChatMessageInputSchema>;\n\n// Wire result contract for the sendGuildChatMessage callable — what the CLIENT relies on.\n// The backend core's internal result type extends this with composition-only\n// inline-materialize fields (backend↔backend contract; see runSendGuildChatMessage) —\n// those extra fields may appear on the wire and are not part of the client contract,\n// so this schema is deliberately non-strict.\nexport const SendGuildChatMessageResultSchema = z.object({\n success: z.literal(true),\n messageId: z.string().min(1),\n messageDocPath: z.string().min(1),\n});\nexport type SendGuildChatMessageResult = z.infer<typeof SendGuildChatMessageResultSchema>;\n\n// Subject/initial-text share the admin-dispatch caps (the \"contact admin\" composer\n// enforces them) — the old MAX_CHAT_MESSAGE_LENGTH bound let a 4000-char SUBJECT through.\nexport const StartAdminSupportThreadInputSchema = z.object({\n subject: z.string().min(1).max(MAX_ADMIN_DISPATCH_SUBJECT_LENGTH),\n initialMessage: z.string().min(1).max(MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH),\n}).strict();\nexport type StartAdminSupportThreadInput = z.infer<typeof StartAdminSupportThreadInputSchema>;\n\n// Authoritative result of startAdminSupportThread — both ids are minted inside the\n// creating transaction. Non-strict (server → client result posture).\nexport const StartAdminSupportThreadResultSchema = z.object({\n success: z.literal(true),\n adminDispatchId: z.string().min(1),\n /** Doc id of the initial conversation message. */\n messageId: z.string().min(1),\n});\nexport type StartAdminSupportThreadResult = z.infer<typeof StartAdminSupportThreadResultSchema>;\n\n// Member-initiated workProject → admin correspondence thread (party-generic dispatch,\n// partyKind 'workProject'). Initiating is a Work ACTION (`adminDispatch.start`, BACKEND-006);\n// the callable enforces the one-open-work-initiated-thread spam guard. `contextRef` is\n// server-validated against the workProject before it is stored.\nexport const StartWorkProjectAdminSupportThreadInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n subject: z.string().min(1).max(MAX_ADMIN_DISPATCH_SUBJECT_LENGTH),\n initialMessage: z.string().min(1).max(MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH),\n contextRef: AdminDispatchContextRefSchema.optional(),\n}).strict();\nexport type StartWorkProjectAdminSupportThreadInput = z.infer<typeof StartWorkProjectAdminSupportThreadInputSchema>;\n\n// Admin-initiated dispatch to a workProject party (mirrors the admin→user dispatch:\n// lands unread for the work's active guildmates, creates NO admin task, uncapped).\nexport const CreateAdminDispatchToWorkProjectInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n subject: z.string().trim().min(1).max(MAX_ADMIN_DISPATCH_SUBJECT_LENGTH),\n message: z.string().trim().min(1).max(MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH),\n contextRef: AdminDispatchContextRefSchema.optional(),\n}).strict();\nexport type CreateAdminDispatchToWorkProjectInput = z.infer<typeof CreateAdminDispatchToWorkProjectInputSchema>;\n\n// CLIENT-CALLED wire contract for the `mintChatGrant` callable (Contract A; P3).\n// Crosses the backend↔frontend boundary — the web client (and any future mobile/TV\n// client) constructs this payload — so it lives here per the callable-validation\n// convention, not locally in the functions repo. The REAL Firestore authorization\n// check happens in the callable; this schema pins the scope shape.\nexport const ChatGrantInputSchema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('channel'), workProjectId: workProjectIdSchema, guildChatChannelId: guildChatChannelIdSchema }).strict(),\n z.object({ kind: z.literal('invite'), guildInviteId: guildInviteIdSchema }).strict(),\n z.object({ kind: z.literal('inbox') }).strict(),\n]);\nexport type ChatGrantInput = z.infer<typeof ChatGrantInputSchema>;\n\nexport const UpdateGuildChatChannelInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n guildChatChannelId: guildChatChannelIdSchema,\n channelName: z.string().min(1).max(MAX_GUILD_CHAT_CHANNEL_NAME_LENGTH).optional(),\n description: z.string().max(MAX_GUILD_CHAT_CHANNEL_DESCRIPTION_LENGTH).optional(),\n requiredGuildStandings: z.array(z.string().min(1).max(64)).max(20).optional(),\n allowedUserIds: z.array(z.string().min(1).max(128)).max(500).optional(),\n}).strict();\nexport type UpdateGuildChatChannelInput = z.infer<typeof UpdateGuildChatChannelInputSchema>;\n\n// --- Admin chat moderation callables (review-only; ttt-prod docs/design/chat-realtime-system.md) ---\n\n// The CLIENT-facing channel-ref for the admin chat-moderation callables\n// (`adminModerateChatMessage` / `adminReadChannelContext`). This is the WIRE shape, which\n// is `kind`-discriminated — NOT the internal `scope`-keyed `ChannelRefTupleSchema`\n// (@ttt-productions/chat-schemas), which the callables map to server-side AFTER parsing.\n// Mirrors the existing `TombstoneChatSchema.channel` union in schemas/admin.ts.\nexport const AdminChatModerationChannelSchema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('channel'), workProjectId: workProjectIdSchema, guildChatChannelId: guildChatChannelIdSchema }).strict(),\n z.object({ kind: z.literal('invite'), guildInviteId: guildInviteIdSchema }).strict(),\n]);\nexport type AdminChatModerationChannel = z.infer<typeof AdminChatModerationChannelSchema>;\n\n// `adminModerateChatMessage` — queue a DO-owned hide/delete command. A chat message carries\n// no media (files live in the conversation's Conversation Files list), so this is a text-only\n// hide/delete; `.strict()` rejects any asset-id field.\nexport const AdminModerateChatMessageInputSchema = z.object({\n requestId: z.string().min(1).max(200),\n action: z.enum(['hide', 'delete']),\n messageSeq: z.number().int().nonnegative(),\n expectedMessageRevision: z.number().int().nonnegative(),\n caseId: z.string().min(1).max(200),\n reason: z.string().min(1).max(MAX_CHAT_MODERATION_REASON_LENGTH),\n channel: AdminChatModerationChannelSchema,\n}).strict();\nexport type AdminModerateChatMessageInput = z.infer<typeof AdminModerateChatMessageInputSchema>;\n\n// `adminReadChannelContext` — case-bound admin read of a bounded (≤50 before / ≤50 after)\n// message window around a reported message. Requires a case id + reason; both request and\n// outcome are audited.\nexport const AdminReadChannelContextInputSchema = z.object({\n reportedSeq: z.number().int().nonnegative(),\n caseId: z.string().min(1).max(200),\n reason: z.string().min(1).max(MAX_CHAT_MODERATION_REASON_LENGTH),\n before: z.number().int().min(0).max(50).optional(),\n after: z.number().int().min(0).max(50).optional(),\n channel: AdminChatModerationChannelSchema,\n}).strict();\nexport type AdminReadChannelContextInput = z.infer<typeof AdminReadChannelContextInputSchema>;\n\n\n\n"]}
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/schemas/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,uBAAuB,EACvB,kCAAkC,EAClC,yCAAyC,GAC1C,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iCAAiC,EACjC,sCAAsC,EACtC,iCAAiC,GAClC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAE5E,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD,aAAa,EAAE,mBAAmB;IAClC,kBAAkB,EAAE,wBAAwB;CAC7C,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,4FAA4F;AAC5F,gGAAgG;AAChG,6FAA6F;AAC7F,0FAA0F;AAC1F,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3D,aAAa,EAAE,mBAAmB;IAClC,kBAAkB,EAAE,wBAAwB;CAC7C,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,gGAAgG;AAChG,kGAAkG;AAClG,kGAAkG;AAClG,MAAM,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,CAAC,CAAC,QAAQ,EAAE;IAClD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IACjD,OAAO,EAAE,gCAAgC;CAC1C,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n workProjectIdSchema,\n guildChatChannelIdSchema,\n guildInviteIdSchema,\n adminDispatchIdSchema,\n} from './atoms.js';\nimport {\n MAX_CHAT_MESSAGE_LENGTH,\n MAX_GUILD_CHAT_CHANNEL_NAME_LENGTH,\n MAX_GUILD_CHAT_CHANNEL_DESCRIPTION_LENGTH,\n} from '../constants/chat.js';\nimport {\n MAX_ADMIN_DISPATCH_SUBJECT_LENGTH,\n MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH,\n MAX_CHAT_MODERATION_REASON_LENGTH,\n} from '../constants/business.js';\nimport { AdminDispatchContextRefSchema } from '../doc-schemas/messaging.js';\n\nexport const ArchiveGuildChatChannelInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n guildChatChannelId: guildChatChannelIdSchema,\n}).strict();\nexport type ArchiveGuildChatChannelInput = z.infer<typeof ArchiveGuildChatChannelInputSchema>;\n\n// Restore an archived guild chat channel — same input shape as archive. The callable clears\n// `isArchived` and bumps configVersion; it is the inverse of archive, never a path to a deleted\n// (tombstoned) channel. Declared as its OWN named schema per the delete precedent below: one\n// named schema per callable, so a lane's input can diverge without touching its siblings.\nexport const UnarchiveGuildChatChannelInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n guildChatChannelId: guildChatChannelIdSchema,\n}).strict();\nexport type UnarchiveGuildChatChannelInput = z.infer<typeof UnarchiveGuildChatChannelInputSchema>;\n\n// Tombstone (delete) a guild chat channel — same input shape as archive. The callable marks the\n// channel `isDeleted`, bumps configVersion, revokes grants, and re-projects members to `removed`;\n// storage is retained (never a physical purge). See ttt-prod docs/design/chat-realtime-system.md.\nexport const DeleteGuildChatChannelInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n guildChatChannelId: guildChatChannelIdSchema,\n}).strict();\nexport type DeleteGuildChatChannelInput = z.infer<typeof DeleteGuildChatChannelInputSchema>;\n\nexport const CreateGuildChatChannelInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n channelName: z.string().min(1).max(MAX_GUILD_CHAT_CHANNEL_NAME_LENGTH),\n description: z.string().max(MAX_GUILD_CHAT_CHANNEL_DESCRIPTION_LENGTH).optional(),\n requiredGuildStandings: z.array(z.string().min(1).max(64)).max(20),\n allowedUserIds: z.array(z.string().min(1).max(128)).max(500),\n}).strict();\nexport type CreateGuildChatChannelInput = z.infer<typeof CreateGuildChatChannelInputSchema>;\n\n// Guild channels + invite threads moved to the realtime chat (Cloudflare DOs), which\n// sends through the DO client — NOT this callable. The Firestore send path is retained\n// PERMANENTLY for admin-support threads only (ttt-prod docs/design/chat-realtime-system.md).\nexport const SendGuildChatMessageInputSchema = z.object({\n threadKind: z.literal('adminSupport'),\n adminDispatchId: adminDispatchIdSchema,\n isUserReply: z.boolean(),\n text: z.string().max(MAX_CHAT_MESSAGE_LENGTH),\n // No reply pointer: chat has no reply-authoring affordance, so a client could never\n // legitimately send one. `.strict()` therefore REJECTS a client-sent `replyTo`\n // (DJ ruling 2026-07-29).\n}).strict();\nexport type SendGuildChatMessageInput = z.infer<typeof SendGuildChatMessageInputSchema>;\n\n// Wire result contract for the sendGuildChatMessage callable — what the CLIENT relies on.\n// The backend core's internal result type extends this with composition-only\n// inline-materialize fields (backend↔backend contract; see runSendGuildChatMessage) —\n// those extra fields may appear on the wire and are not part of the client contract,\n// so this schema is deliberately non-strict.\nexport const SendGuildChatMessageResultSchema = z.object({\n success: z.literal(true),\n messageId: z.string().min(1),\n messageDocPath: z.string().min(1),\n});\nexport type SendGuildChatMessageResult = z.infer<typeof SendGuildChatMessageResultSchema>;\n\n// Subject/initial-text share the admin-dispatch caps (the \"contact admin\" composer\n// enforces them) — the old MAX_CHAT_MESSAGE_LENGTH bound let a 4000-char SUBJECT through.\nexport const StartAdminSupportThreadInputSchema = z.object({\n subject: z.string().min(1).max(MAX_ADMIN_DISPATCH_SUBJECT_LENGTH),\n initialMessage: z.string().min(1).max(MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH),\n}).strict();\nexport type StartAdminSupportThreadInput = z.infer<typeof StartAdminSupportThreadInputSchema>;\n\n// Authoritative result of startAdminSupportThread — both ids are minted inside the\n// creating transaction. Non-strict (server → client result posture).\nexport const StartAdminSupportThreadResultSchema = z.object({\n success: z.literal(true),\n adminDispatchId: z.string().min(1),\n /** Doc id of the initial conversation message. */\n messageId: z.string().min(1),\n});\nexport type StartAdminSupportThreadResult = z.infer<typeof StartAdminSupportThreadResultSchema>;\n\n// Member-initiated workProject → admin correspondence thread (party-generic dispatch,\n// partyKind 'workProject'). Initiating is a Work ACTION (`adminDispatch.start`, BACKEND-006);\n// the callable enforces the one-open-work-initiated-thread spam guard. `contextRef` is\n// server-validated against the workProject before it is stored.\nexport const StartWorkProjectAdminSupportThreadInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n subject: z.string().min(1).max(MAX_ADMIN_DISPATCH_SUBJECT_LENGTH),\n initialMessage: z.string().min(1).max(MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH),\n contextRef: AdminDispatchContextRefSchema.optional(),\n}).strict();\nexport type StartWorkProjectAdminSupportThreadInput = z.infer<typeof StartWorkProjectAdminSupportThreadInputSchema>;\n\n// Admin-initiated dispatch to a workProject party (mirrors the admin→user dispatch:\n// lands unread for the work's active guildmates, creates NO admin task, uncapped).\nexport const CreateAdminDispatchToWorkProjectInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n subject: z.string().trim().min(1).max(MAX_ADMIN_DISPATCH_SUBJECT_LENGTH),\n message: z.string().trim().min(1).max(MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH),\n contextRef: AdminDispatchContextRefSchema.optional(),\n}).strict();\nexport type CreateAdminDispatchToWorkProjectInput = z.infer<typeof CreateAdminDispatchToWorkProjectInputSchema>;\n\n// CLIENT-CALLED wire contract for the `mintChatGrant` callable (Contract A; P3).\n// Crosses the backend↔frontend boundary — the web client (and any future mobile/TV\n// client) constructs this payload — so it lives here per the callable-validation\n// convention, not locally in the functions repo. The REAL Firestore authorization\n// check happens in the callable; this schema pins the scope shape.\nexport const ChatGrantInputSchema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('channel'), workProjectId: workProjectIdSchema, guildChatChannelId: guildChatChannelIdSchema }).strict(),\n z.object({ kind: z.literal('invite'), guildInviteId: guildInviteIdSchema }).strict(),\n z.object({ kind: z.literal('inbox') }).strict(),\n]);\nexport type ChatGrantInput = z.infer<typeof ChatGrantInputSchema>;\n\nexport const UpdateGuildChatChannelInputSchema = z.object({\n workProjectId: workProjectIdSchema,\n guildChatChannelId: guildChatChannelIdSchema,\n channelName: z.string().min(1).max(MAX_GUILD_CHAT_CHANNEL_NAME_LENGTH).optional(),\n description: z.string().max(MAX_GUILD_CHAT_CHANNEL_DESCRIPTION_LENGTH).optional(),\n requiredGuildStandings: z.array(z.string().min(1).max(64)).max(20).optional(),\n allowedUserIds: z.array(z.string().min(1).max(128)).max(500).optional(),\n}).strict();\nexport type UpdateGuildChatChannelInput = z.infer<typeof UpdateGuildChatChannelInputSchema>;\n\n// --- Admin chat moderation callables (review-only; ttt-prod docs/design/chat-realtime-system.md) ---\n\n// The CLIENT-facing channel-ref for the admin chat-moderation callables\n// (`adminModerateChatMessage` / `adminReadChannelContext`). This is the WIRE shape, which\n// is `kind`-discriminated — NOT the internal `scope`-keyed `ChannelRefTupleSchema`\n// (@ttt-productions/chat-schemas), which the callables map to server-side AFTER parsing.\n// Mirrors the existing `TombstoneChatSchema.channel` union in schemas/admin.ts.\nexport const AdminChatModerationChannelSchema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('channel'), workProjectId: workProjectIdSchema, guildChatChannelId: guildChatChannelIdSchema }).strict(),\n z.object({ kind: z.literal('invite'), guildInviteId: guildInviteIdSchema }).strict(),\n]);\nexport type AdminChatModerationChannel = z.infer<typeof AdminChatModerationChannelSchema>;\n\n// `adminModerateChatMessage` — queue a DO-owned hide/delete command. A chat message carries\n// no media (files live in the conversation's Conversation Files list), so this is a text-only\n// hide/delete; `.strict()` rejects any asset-id field.\nexport const AdminModerateChatMessageInputSchema = z.object({\n requestId: z.string().min(1).max(200),\n action: z.enum(['hide', 'delete']),\n messageSeq: z.number().int().nonnegative(),\n expectedMessageRevision: z.number().int().nonnegative(),\n caseId: z.string().min(1).max(200),\n reason: z.string().min(1).max(MAX_CHAT_MODERATION_REASON_LENGTH),\n channel: AdminChatModerationChannelSchema,\n}).strict();\nexport type AdminModerateChatMessageInput = z.infer<typeof AdminModerateChatMessageInputSchema>;\n\n// `adminReadChannelContext` — case-bound admin read of a bounded (≤50 before / ≤50 after)\n// message window around a reported message. Requires a case id + reason; both request and\n// outcome are audited.\nexport const AdminReadChannelContextInputSchema = z.object({\n reportedSeq: z.number().int().nonnegative(),\n caseId: z.string().min(1).max(200),\n reason: z.string().min(1).max(MAX_CHAT_MODERATION_REASON_LENGTH),\n before: z.number().int().min(0).max(50).optional(),\n after: z.number().int().min(0).max(50).optional(),\n channel: AdminChatModerationChannelSchema,\n}).strict();\nexport type AdminReadChannelContextInput = z.infer<typeof AdminReadChannelContextInputSchema>;\n\n\n\n"]}
|
package/dist/types/audit.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AuditEvent } from '@ttt-productions/audit-core';
|
|
2
|
-
export type AuditEventType = 'artisanCreator.grantedToUser' | 'user.accountRegistered' | 'user.statusChanged' | 'user.accountSuspended' | 'user.accountBanned' | 'user.accountUnbanned' | 'user.displayNameResetForced' | 'user.displayNameChanged' | 'user.nonUsArtisanInterestRecorded' | 'account.deletionRequested' | 'account.deletionCancelled' | 'account.erasureCompleted' | 'account.erasureParkedOnHold' | 'account.erasureSuperseded' | 'admin.systemRoleGranted' | 'admin.systemRoleRevoked' | 'admin.systemRoleSyncedFromDirectEdit' | 'admin.contentAppealReviewed' | 'admin.thresholdItemReviewed' | 'admin.futurePlansUpdated' | 'admin.rulesAndAgreementsUpdated' | 'admin.termsPageUpdated' | 'admin.privacyPageUpdated' | 'admin.takeItDownPageCopyUpdated' | 'admin.reservedUsernamesSeeded' | 'admin.blockedFranchiseNamesSeeded' | 'admin.rulesAndAgreementsSeeded' | 'admin.futurePlansSeeded' | 'admin.termsPageSeeded' | 'admin.privacyPageSeeded' | 'admin.takeItDownPageCopySeeded' | 'admin.dispatchDeleted' | 'admin.shortLinkDeleted' | 'admin.trademarkChecked' | 'content.parodyDisclaimerApplied' | 'workProject.created' | 'workProject.guildmateUserGuildStandingChanged' | 'workProject.guildmateUserTradeProfessionsChanged' | 'workProject.guildMemberDeparted' | 'workProject.publicDetailsUpdated' | 'workProject.workAssetDeleted' | 'workProject.fileFolderCreated' | 'workProject.fileFolderRenamed' | 'workProject.fileFolderAccessChanged' | 'workProject.fileFolderDeleted' | 'workProject.guildInviteSent' | 'workProject.guildInviteAccepted' | 'workProject.guildInviteDeclined' | 'workProject.guildInviteCancelled' | 'workProject.guildInviteStakeSharesUpdated' | 'workProject.commissionListingCreated' | 'workProject.commissionProposalCreated' | 'workProject.commissionClosed' | 'workProject.commissionDeleted' | 'workProject.commissionProposalSaveToggled' | 'workProject.commissionProposalRejected' | 'workProject.stakeSharesChanged' | 'workProject.stakeShares.created' | 'workProject.stakeShares.increased' | 'workProject.stakeShares.anomaly' | 'workFile.sharedToRealm' | 'workFile.realmCanonChanged' | 'workFile.unsharedFromRealm' | 'craftSkill.userCraftSkillDeleted' | 'craftSkill.hidden' | 'craftSkill.restored' | 'craftSkill.removed' | 'content.itemReported' | 'content.violationRecorded' | 'content.thresholdItemSubmitted' | 'content.thresholdItemWithdrawn' | 'content.hallItemPublished' | 'content.hallContentChangeRequestSubmitted' | 'admin.hallContentChangeRequestResolved' | 'content.appealSubmitted' | 'content.violationAccepted' | 'content.hidden' | 'content.restored' | 'content.removed' | 'content.taleDetailsUpdated' | 'content.taleWorkGenresUpdated' | 'content.chapterCreated' | 'content.chapterDetailsUpdated' | 'content.tuneDetailsUpdated' | 'content.tuneWorkGenresUpdated' | 'content.tuneTrackCreated' | 'content.tuneTrackDetailsUpdated' | 'content.televisionDetailsUpdated' | 'content.televisionWorkGenresUpdated' | 'content.televisionEpisodeCreated' | 'content.televisionEpisodeDetailsUpdated' | 'payment.sessionCreated' | 'payment.pledgePaymentCompleted' | 'payment.pledgePaymentAbandoned' | 'payment.pledgePaymentFailed' | 'payment.pledgePaymentQuarantined' | 'payment.pledgePaymentRefunded' | 'payment.pledgePaymentDisputeOpened' | 'payment.pledgePaymentDisputeClosed' | 'payment.pledgeRefundRequested' | 'payment.pledgeRefundRequestResolved' | 'payment.pledgeLedger.recorded' | 'payment.pledgeLedger.anomaly' | 'admin.taskCheckedOut' | 'admin.taskCheckedIn' | 'admin.taskReleased' | 'admin.taskAutoReleased' | 'admin.taskDeferredLater' | 'workProject.auditionCreated' | 'admin.auditionCreated' | 'audition.entryCreated' | 'audition.closedByUser' | 'audition.curatedBatchFailed' | 'system.manualIntervention' | 'system.appConfigUpdated' | 'admin.appModeFlipRecorded' | 'system.pendingMediaArchived' | 'system.orphanUploadsCleanedUp' | 'admin.profanityListSeeded' | 'admin.profanityListCurated' | 'social.squareStreetzPostLiked' | 'social.squareStreetzPostUnliked' | 'social.targetFollowed' | 'social.targetUnfollowed' | 'chat.guildChatChannelCreated' | 'chat.guildChatChannelUpdated' | 'chat.guildChatChannelArchived' | 'chat.guildChatChannelDeleted' | 'chat.adminThreadStarted' | 'chat.adminThreadStatusChanged' | 'conversationFile.deleted' | 'chat.moderationActionRequested' | 'chat.moderationActionApplied' | 'chat.moderationActionFailed' | 'chat.moderationContextRead' | 'notification.broadcastSent' | 'notification.adminArchived' | 'workProject.released' | 'workProject.hidden' | 'workProject.restored' | 'workProject.moderationPlaceholderApplied' | 'workProject.moderationRetitleCleared' | 'workRealm.created' | 'workRealm.released' | 'workRealm.detailsUpdated' | 'workRealm.hidden' | 'workRealm.restored' | 'workRealm.moderationPlaceholderApplied' | 'workRealm.moderationRetitleCleared' | 'hallItem.moderationPlaceholderApplied' | 'report.childSafetyCaseOpened' | 'report.nciiCaseOpened' | 'childSafety.reportDispositionSet' | 'childSafety.holdPlaced' | 'childSafety.holdReleased' | 'childSafety.accountActionApplied' | 'childSafety.accountActionReverted' | 'childSafety.evidenceManifestCreated' | 'childSafety.evidenceDisposed' | 'childSafety.quarantineCompleted' | 'childSafety.ncmecSubmissionCompleted' | 'childSafety.ncmecPortalReceiptArtifactRecorded' | 'childSafety.legalProcessRecorded' | 'childSafety.falsePositiveCorrected' | 'user.ageAttested' | 'user.ageUpgradedToAdult' | 'user.orphanAuthDeleted' | 'user.accountClosedUnder13' | 'user.safetyLocked' | 'ncii.requestReceived' | 'ncii.requestSupplemented' | 'ncii.completenessDetermined' | 'ncii.validityDecided' | 'ncii.tempHoldPlaced' | 'ncii.tempHoldReleased' | 'ncii.removalCompleted' | 'ncii.removalUnableToComplete' | 'ncii.evidenceMarked' | 'ncii.evidenceScanValidatedMatch' | 'ncii.hashBlockReversed' | 'ncii.requesterPiiScrubbed' | 'ncii.policyConfigUpdated' | 'ncii.minorAssessmentSet' | 'ncii.crossoverLegReconciled' | 'safety.privilegedReauthPerformed' | 'safety.privilegedRawLocatorRead' | 'safety.deadlineBreachRecorded' | 'safety.reviewerCapabilityGranted' | 'safety.reviewerCapabilityRevoked';
|
|
2
|
+
export type AuditEventType = 'artisanCreator.grantedToUser' | 'user.accountRegistered' | 'user.statusChanged' | 'user.accountSuspended' | 'user.accountBanned' | 'user.accountUnbanned' | 'user.displayNameResetForced' | 'user.displayNameChanged' | 'user.nonUsArtisanInterestRecorded' | 'account.deletionRequested' | 'account.deletionCancelled' | 'account.erasureCompleted' | 'account.erasureParkedOnHold' | 'account.erasureSuperseded' | 'admin.systemRoleGranted' | 'admin.systemRoleRevoked' | 'admin.systemRoleSyncedFromDirectEdit' | 'admin.contentAppealReviewed' | 'admin.thresholdItemReviewed' | 'admin.futurePlansUpdated' | 'admin.rulesAndAgreementsUpdated' | 'admin.termsPageUpdated' | 'admin.privacyPageUpdated' | 'admin.takeItDownPageCopyUpdated' | 'admin.reservedUsernamesSeeded' | 'admin.blockedFranchiseNamesSeeded' | 'admin.rulesAndAgreementsSeeded' | 'admin.futurePlansSeeded' | 'admin.termsPageSeeded' | 'admin.privacyPageSeeded' | 'admin.takeItDownPageCopySeeded' | 'admin.dispatchDeleted' | 'admin.shortLinkDeleted' | 'admin.trademarkChecked' | 'content.parodyDisclaimerApplied' | 'workProject.created' | 'workProject.guildmateUserGuildStandingChanged' | 'workProject.guildmateUserTradeProfessionsChanged' | 'workProject.guildMemberDeparted' | 'workProject.publicDetailsUpdated' | 'workProject.workAssetDeleted' | 'workProject.fileFolderCreated' | 'workProject.fileFolderRenamed' | 'workProject.fileFolderAccessChanged' | 'workProject.fileFolderDeleted' | 'workProject.guildInviteSent' | 'workProject.guildInviteAccepted' | 'workProject.guildInviteDeclined' | 'workProject.guildInviteCancelled' | 'workProject.guildInviteStakeSharesUpdated' | 'workProject.commissionListingCreated' | 'workProject.commissionProposalCreated' | 'workProject.commissionClosed' | 'workProject.commissionDeleted' | 'workProject.commissionProposalSaveToggled' | 'workProject.commissionProposalRejected' | 'workProject.stakeSharesChanged' | 'workProject.stakeShares.created' | 'workProject.stakeShares.increased' | 'workProject.stakeShares.anomaly' | 'workFile.sharedToRealm' | 'workFile.realmCanonChanged' | 'workFile.unsharedFromRealm' | 'craftSkill.userCraftSkillDeleted' | 'craftSkill.hidden' | 'craftSkill.restored' | 'craftSkill.removed' | 'content.itemReported' | 'content.violationRecorded' | 'content.thresholdItemSubmitted' | 'content.thresholdItemWithdrawn' | 'content.hallItemPublished' | 'content.hallContentChangeRequestSubmitted' | 'admin.hallContentChangeRequestResolved' | 'content.appealSubmitted' | 'content.violationAccepted' | 'content.hidden' | 'content.restored' | 'content.removed' | 'content.taleDetailsUpdated' | 'content.taleWorkGenresUpdated' | 'content.chapterCreated' | 'content.chapterDetailsUpdated' | 'content.tuneDetailsUpdated' | 'content.tuneWorkGenresUpdated' | 'content.tuneTrackCreated' | 'content.tuneTrackDetailsUpdated' | 'content.televisionDetailsUpdated' | 'content.televisionWorkGenresUpdated' | 'content.televisionEpisodeCreated' | 'content.televisionEpisodeDetailsUpdated' | 'payment.sessionCreated' | 'payment.pledgePaymentCompleted' | 'payment.pledgePaymentAbandoned' | 'payment.pledgePaymentFailed' | 'payment.pledgePaymentQuarantined' | 'payment.pledgePaymentRefunded' | 'payment.pledgePaymentDisputeOpened' | 'payment.pledgePaymentDisputeClosed' | 'payment.pledgeRefundRequested' | 'payment.pledgeRefundRequestResolved' | 'payment.pledgeLedger.recorded' | 'payment.pledgeLedger.anomaly' | 'admin.taskCheckedOut' | 'admin.taskCheckedIn' | 'admin.taskReleased' | 'admin.taskAutoReleased' | 'admin.taskDeferredLater' | 'workProject.auditionCreated' | 'admin.auditionCreated' | 'audition.entryCreated' | 'audition.closedByUser' | 'audition.curatedBatchFailed' | 'system.manualIntervention' | 'system.appConfigUpdated' | 'admin.appModeFlipRecorded' | 'system.pendingMediaArchived' | 'system.orphanUploadsCleanedUp' | 'admin.profanityListSeeded' | 'admin.profanityListCurated' | 'social.squareStreetzPostLiked' | 'social.squareStreetzPostUnliked' | 'social.targetFollowed' | 'social.targetUnfollowed' | 'chat.guildChatChannelCreated' | 'chat.guildChatChannelUpdated' | 'chat.guildChatChannelArchived' | 'chat.guildChatChannelUnarchived' | 'chat.guildChatChannelDeleted' | 'chat.adminThreadStarted' | 'chat.adminThreadStatusChanged' | 'conversationFile.deleted' | 'chat.moderationActionRequested' | 'chat.moderationActionApplied' | 'chat.moderationActionFailed' | 'chat.moderationContextRead' | 'notification.broadcastSent' | 'notification.adminArchived' | 'workProject.released' | 'workProject.hidden' | 'workProject.restored' | 'workProject.moderationPlaceholderApplied' | 'workProject.moderationRetitleCleared' | 'workRealm.created' | 'workRealm.released' | 'workRealm.detailsUpdated' | 'workRealm.hidden' | 'workRealm.restored' | 'workRealm.moderationPlaceholderApplied' | 'workRealm.moderationRetitleCleared' | 'hallItem.moderationPlaceholderApplied' | 'report.childSafetyCaseOpened' | 'report.nciiCaseOpened' | 'childSafety.reportDispositionSet' | 'childSafety.holdPlaced' | 'childSafety.holdReleased' | 'childSafety.accountActionApplied' | 'childSafety.accountActionReverted' | 'childSafety.evidenceManifestCreated' | 'childSafety.evidenceDisposed' | 'childSafety.quarantineCompleted' | 'childSafety.ncmecSubmissionCompleted' | 'childSafety.ncmecPortalReceiptArtifactRecorded' | 'childSafety.legalProcessRecorded' | 'childSafety.falsePositiveCorrected' | 'user.ageAttested' | 'user.ageUpgradedToAdult' | 'user.orphanAuthDeleted' | 'user.accountClosedUnder13' | 'user.safetyLocked' | 'ncii.requestReceived' | 'ncii.requestSupplemented' | 'ncii.completenessDetermined' | 'ncii.validityDecided' | 'ncii.tempHoldPlaced' | 'ncii.tempHoldReleased' | 'ncii.removalCompleted' | 'ncii.removalUnableToComplete' | 'ncii.evidenceMarked' | 'ncii.evidenceScanValidatedMatch' | 'ncii.hashBlockReversed' | 'ncii.requesterPiiScrubbed' | 'ncii.policyConfigUpdated' | 'ncii.minorAssessmentSet' | 'ncii.crossoverLegReconciled' | 'safety.privilegedReauthPerformed' | 'safety.privilegedRawLocatorRead' | 'safety.deadlineBreachRecorded' | 'safety.reviewerCapabilityGranted' | 'safety.reviewerCapabilityRevoked';
|
|
3
3
|
/**
|
|
4
4
|
* How the actor was acting when the audited action was performed. This is
|
|
5
5
|
* orthogonal to the event name — the same event type can be produced by
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/types/audit.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;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CAAA;CAAE,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,CACpC,cAAc,EACd,aAAa,EACb,cAAc,EACd,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CACxB,CAAC"}
|
package/dist/types/audit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/types/audit.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,oEAAoE;AACpE,yEAAyE;AACzE,sEAAsE;AACtE,4DAA4D;AAC5D,EAAE;AACF,wEAAwE;AACxE,qBAAqB","sourcesContent":["// TTT audit event catalog. The `AuditEventType` union is the canonical list\n// of all sensitive actions the system logs. The `TTTAuditActor` and\n// `TTTAuditTarget` shapes describe who performed the action and what was\n// affected. `TTTAuditEvent` specializes the generic `AuditEvent` from\n// @ttt-productions/audit-core with the TTT-specific shapes.\n//\n// Backend writers and future native/TV/console readers all consume this\n// catalog from here.\n\nimport type { AuditEvent } from '@ttt-productions/audit-core';\n\nexport type AuditEventType =\n // user status\n | 'artisanCreator.grantedToUser'\n | 'user.accountRegistered'\n | 'user.statusChanged'\n | 'user.accountSuspended'\n | 'user.accountBanned'\n | 'user.accountUnbanned'\n | 'user.displayNameResetForced'\n | 'user.displayNameChanged'\n | 'user.nonUsArtisanInterestRecorded'\n // account deletion / GDPR erasure (N3)\n | 'account.deletionRequested'\n | 'account.deletionCancelled'\n | 'account.erasureCompleted'\n | 'account.erasureParkedOnHold'\n | 'account.erasureSuperseded'\n // admin actions\n | 'admin.systemRoleGranted'\n | 'admin.systemRoleRevoked'\n | 'admin.systemRoleSyncedFromDirectEdit'\n | 'admin.contentAppealReviewed'\n | 'admin.thresholdItemReviewed'\n | 'admin.futurePlansUpdated'\n | 'admin.rulesAndAgreementsUpdated'\n // content-pages migration (DJ ruling 2026-07-06): per-page admin editors\n | 'admin.termsPageUpdated'\n | 'admin.privacyPageUpdated'\n | 'admin.takeItDownPageCopyUpdated'\n // admin launch-seed actions (Ready for Launch tab)\n | 'admin.reservedUsernamesSeeded'\n | 'admin.blockedFranchiseNamesSeeded'\n | 'admin.rulesAndAgreementsSeeded'\n | 'admin.futurePlansSeeded'\n | 'admin.termsPageSeeded'\n | 'admin.privacyPageSeeded'\n | 'admin.takeItDownPageCopySeeded'\n // admin direct-delete callables (replaced the last two direct-SDK admin-browser deletes):\n // deleteAdminDispatch (support thread + its conversationMessages) and deleteShortLink.\n | 'admin.dispatchDeleted'\n | 'admin.shortLinkDeleted'\n // trademark-assist (advisory check at approval) + parody/real-people disclaimer baked at approval\n | 'admin.trademarkChecked'\n | 'content.parodyDisclaimerApplied'\n // workProject\n | 'workProject.created'\n | 'workProject.guildmateUserGuildStandingChanged'\n | 'workProject.guildmateUserTradeProfessionsChanged'\n // Member self-leave (leaveWorkProject) — pre-publish voluntary exit, shares forfeited to the pool.\n | 'workProject.guildMemberDeparted'\n | 'workProject.publicDetailsUpdated'\n | 'workProject.workAssetDeleted'\n // work-file folders (S7). fileFolderAccessChanged is an ACL change (folder trade-profession\n // view/upload/delete lists gate custom-folder confidentiality) — audited with before/after lists.\n | 'workProject.fileFolderCreated'\n | 'workProject.fileFolderRenamed'\n | 'workProject.fileFolderAccessChanged'\n | 'workProject.fileFolderDeleted'\n | 'workProject.guildInviteSent'\n | 'workProject.guildInviteAccepted'\n | 'workProject.guildInviteDeclined'\n | 'workProject.guildInviteCancelled'\n | 'workProject.guildInviteStakeSharesUpdated'\n | 'workProject.commissionListingCreated'\n | 'workProject.commissionProposalCreated'\n | 'workProject.commissionClosed'\n | 'workProject.commissionDeleted'\n | 'workProject.commissionProposalSaveToggled'\n | 'workProject.commissionProposalRejected'\n | 'workProject.stakeSharesChanged'\n | 'workProject.stakeShares.created'\n | 'workProject.stakeShares.increased'\n | 'workProject.stakeShares.anomaly'\n // realm shared files — a work file promoted into its realm's shared pool + canon toggles + un-share\n | 'workFile.sharedToRealm'\n | 'workFile.realmCanonChanged'\n | 'workFile.unsharedFromRealm'\n // craft-skills\n | 'craftSkill.userCraftSkillDeleted'\n | 'craftSkill.hidden'\n | 'craftSkill.restored'\n | 'craftSkill.removed'\n // content\n | 'content.itemReported'\n | 'content.violationRecorded'\n | 'content.thresholdItemSubmitted'\n // Member-initiated pull-back of a still-pending threshold submission (withdraw callable —\n // deletes the threshold doc + admin task, flips the live sub-item back to unpublished).\n | 'content.thresholdItemWithdrawn'\n | 'content.hallItemPublished'\n // Published change requests (text-only at launch): a member proposes new text-field values\n // for a PUBLISHED hall item; an admin approves (server writes values in place) or denies.\n | 'content.hallContentChangeRequestSubmitted'\n | 'admin.hallContentChangeRequestResolved'\n | 'content.appealSubmitted'\n | 'content.violationAccepted'\n | 'content.hidden'\n | 'content.restored'\n | 'content.removed'\n // content (workProject content)\n | 'content.taleDetailsUpdated'\n | 'content.taleWorkGenresUpdated'\n | 'content.chapterCreated'\n | 'content.chapterDetailsUpdated'\n | 'content.tuneDetailsUpdated'\n | 'content.tuneWorkGenresUpdated'\n | 'content.tuneTrackCreated'\n | 'content.tuneTrackDetailsUpdated'\n | 'content.televisionDetailsUpdated'\n | 'content.televisionWorkGenresUpdated'\n | 'content.televisionEpisodeCreated'\n | 'content.televisionEpisodeDetailsUpdated'\n // money\n | 'payment.sessionCreated'\n | 'payment.pledgePaymentCompleted'\n | 'payment.pledgePaymentAbandoned'\n | 'payment.pledgePaymentFailed'\n | 'payment.pledgePaymentQuarantined'\n // money — refund + dispute lifecycle (post-launch handlers; types added now to avoid a\n // second package publish). Refund REQUESTS are the user-initiated ask; the refund itself is\n // the money movement. Disputes are Stripe-initiated (chargeback) open/close.\n | 'payment.pledgePaymentRefunded'\n | 'payment.pledgePaymentDisputeOpened'\n | 'payment.pledgePaymentDisputeClosed'\n | 'payment.pledgeRefundRequested'\n | 'payment.pledgeRefundRequestResolved'\n // money — independent ledger-integrity trigger (mirrors workProject.stakeShares.*)\n | 'payment.pledgeLedger.recorded'\n | 'payment.pledgeLedger.anomaly'\n // admin task lifecycle\n | 'admin.taskCheckedOut'\n | 'admin.taskCheckedIn'\n | 'admin.taskReleased'\n | 'admin.taskAutoReleased'\n | 'admin.taskDeferredLater'\n // audition\n | 'workProject.auditionCreated'\n | 'admin.auditionCreated'\n | 'audition.entryCreated'\n | 'audition.closedByUser'\n // system-actor event: a curated audition's option batch failed to assemble (media\n // rejection) and its curatedAssemblyStatus flipped to 'failed' (runFailCuratedAudition).\n | 'audition.curatedBatchFailed'\n // system\n | 'system.manualIntervention'\n | 'system.appConfigUpdated'\n // records (never controls) a charter↔full APP_MODE flip after deploy — written\n // by the idempotent recordAppModeFlip admin callable\n | 'admin.appModeFlipRecorded'\n | 'system.pendingMediaArchived'\n | 'system.orphanUploadsCleanedUp'\n | 'admin.profanityListSeeded'\n | 'admin.profanityListCurated'\n // social\n | 'social.squareStreetzPostLiked'\n | 'social.squareStreetzPostUnliked'\n | 'social.targetFollowed'\n | 'social.targetUnfollowed'\n // chat\n | 'chat.guildChatChannelCreated'\n | 'chat.guildChatChannelUpdated'\n | 'chat.guildChatChannelArchived'\n | 'chat.guildChatChannelDeleted'\n | 'chat.adminThreadStarted'\n | 'chat.adminThreadStatusChanged'\n // conversation files — every successful delete is audited with UID references and\n // canonical resource ids (the conversation ref, conversationFileId, mediaAssetId).\n | 'conversationFile.deleted'\n // chat moderation (DO-owned hide/delete via chatAdminActionCommands) — append-only,\n // deterministic ids hash('chat-moderation-{requested,applied,failed}', requestId, …).\n | 'chat.moderationActionRequested'\n | 'chat.moderationActionApplied'\n | 'chat.moderationActionFailed'\n // case-bound admin context read (read-on-demand, REVIEW-ONLY) — audits the request\n // AND outcome; one event per read keyed deterministically by the read's requestId.\n | 'chat.moderationContextRead'\n // notification (admin-only). Actor mode is always adminReview / adminOverride.\n // Payload shapes: NotificationBroadcastSentAuditMetadata /\n // NotificationAdminArchivedAuditMetadata in ../schemas/notification.ts.\n | 'notification.broadcastSent'\n | 'notification.adminArchived'\n // workProject\n | 'workProject.released'\n | 'workProject.hidden'\n | 'workProject.restored'\n | 'workProject.moderationPlaceholderApplied'\n | 'workProject.moderationRetitleCleared'\n | 'workRealm.created'\n | 'workRealm.released'\n | 'workRealm.detailsUpdated'\n | 'workRealm.hidden'\n | 'workRealm.restored'\n | 'workRealm.moderationPlaceholderApplied'\n | 'workRealm.moderationRetitleCleared'\n // hall-content moderation text-clear remedy (extends the workProject/workRealm placeholder\n // family across Tale/Tune/Television details + their chapter/track/episode sub-items and the\n // published Hall projections). Same past-tense placeholder-applied shape as the pair above.\n | 'hallItem.moderationPlaceholderApplied'\n // trust & safety — child safety / CSAM\n | 'report.childSafetyCaseOpened'\n | 'report.nciiCaseOpened'\n | 'childSafety.reportDispositionSet'\n | 'childSafety.holdPlaced'\n | 'childSafety.holdReleased'\n | 'childSafety.accountActionApplied'\n | 'childSafety.accountActionReverted'\n | 'childSafety.evidenceManifestCreated'\n | 'childSafety.evidenceDisposed'\n | 'childSafety.quarantineCompleted'\n | 'childSafety.ncmecSubmissionCompleted'\n | 'childSafety.ncmecPortalReceiptArtifactRecorded'\n | 'childSafety.legalProcessRecorded'\n | 'childSafety.falsePositiveCorrected'\n // trust & safety — age / registration\n | 'user.ageAttested'\n | 'user.ageUpgradedToAdult'\n | 'user.orphanAuthDeleted'\n | 'user.accountClosedUnder13'\n | 'user.safetyLocked'\n // trust & safety — NCII / TAKE IT DOWN\n | 'ncii.requestReceived'\n | 'ncii.requestSupplemented'\n | 'ncii.completenessDetermined'\n | 'ncii.validityDecided'\n | 'ncii.tempHoldPlaced'\n | 'ncii.tempHoldReleased'\n | 'ncii.removalCompleted'\n | 'ncii.removalUnableToComplete'\n // operator marks NCII evidence (e.g. flags/annotates an evidence item on the case) — a reviewed\n // evidence-handling action, audited like the other ncii evidence events.\n | 'ncii.evidenceMarked'\n | 'ncii.evidenceScanValidatedMatch'\n | 'ncii.hashBlockReversed'\n | 'ncii.requesterPiiScrubbed'\n | 'ncii.policyConfigUpdated'\n // operator sets the child-safety crossover minorAssessment on an NCII case (e.g. → possibleMinor):\n // routing action that opens/links a PARALLEL child-safety review + deny-serving + PhotoDNA, WITHOUT\n // touching the NCII removal clock and WITHOUT auto-NCMEC. Payload records from→to assessment.\n | 'ncii.minorAssessmentSet'\n // [H-2] a failed possible-minor crossover leg (serving-deny / PhotoDNA) was reconciled or replayed\n // by an operator/reconciler (crossoverLegs.<leg> failed → done). Payload records which leg + outcome.\n | 'ncii.crossoverLegReconciled'\n // trust & safety — operator security\n // Passkey enrollment/assertion reuses safety.privilegedReauthPerformed (the reauth catalog entry, as\n // the TOTP step-up enroll/confirm/verify phases already do) — no distinct passkey-registration type.\n | 'safety.privilegedReauthPerformed'\n // [P2-08] A privileged operator read of a TAKE IT DOWN request's RAW target locator (the\n // reveal-on-demand, review-only read of the sensitive locator itself — distinct from the\n // reveal reauth above, which is the step-up). One event per read. Mirrors the\n // chat.moderationContextRead privileged-read convention.\n | 'safety.privilegedRawLocatorRead'\n | 'safety.deadlineBreachRecorded'\n // [M-6] per-operator reviewer-capability grant lifecycle (privilegedReviewerCapabilityGrants/{uid}).\n // Granting/revoking a SafetyReviewerCapability is an authorization change — always audited.\n | 'safety.reviewerCapabilityGranted'\n | 'safety.reviewerCapabilityRevoked';\n\n/**\n * How the actor was acting when the audited action was performed. This is\n * orthogonal to the event name — the same event type can be produced by\n * different actor modes (e.g. a normal member vs. an admin override).\n *\n * - 'user' — authenticated action not tied to project membership\n * - 'projectMember' — acting through normal Work/project (guild standing) permissions\n * - 'adminReview' — admin queue/support work on admin surfaces (no project-permission concept)\n * - 'adminOverride' — system-admin authority superseding normal user/project permission\n * - 'system' — backend automation: trigger, scheduled job, migration, media pipeline\n */\nexport type TTTAuditActorMode =\n | 'user'\n | 'projectMember'\n | 'adminReview'\n | 'adminOverride'\n | 'system';\n\n/** Fields common to every audited actor regardless of mode. `isAdmin` is\n * claim-present metadata only — it records that the caller held an admin\n * claim at the time, NOT that the action was an override. */\nexport type TTTAuditActorBase = {\n uid: string | null;\n isAdmin: boolean;\n};\n\n/** TTT actor shape, discriminated on `actorMode`. The admin system role is\n * REQUIRED on admin modes (adminReview / adminOverride) and FORBIDDEN on\n * non-admin modes (user / projectMember / system) — so an admin action can\n * never be audited without recording full-vs-jr, and a non-admin action can\n * never carry a spurious role. */\nexport type TTTAuditActor =\n | (TTTAuditActorBase & {\n actorMode: 'user' | 'projectMember' | 'system';\n systemRole?: never;\n })\n | (TTTAuditActorBase & {\n actorMode: 'adminReview' | 'adminOverride';\n systemRole: 'admin' | 'jrAdmin';\n });\n\n/**\n * TTT target shape: the uid the audited action affects (if any), plus the\n * Firestore path of the affected document (if any).\n */\nexport type TTTAuditTarget = { uid: string | null; ref: string | null };\n\n/**\n * The canonical TTT audit event document shape. Specializes the generic\n * `AuditEvent` from @ttt-productions/audit-core with the TTT event-type\n * union, actor shape, target shape, and a generic metadata bag.\n */\nexport type TTTAuditEvent = AuditEvent<\n AuditEventType,\n TTTAuditActor,\n TTTAuditTarget,\n Record<string, unknown>\n>;\n\n"]}
|
|
1
|
+
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/types/audit.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,oEAAoE;AACpE,yEAAyE;AACzE,sEAAsE;AACtE,4DAA4D;AAC5D,EAAE;AACF,wEAAwE;AACxE,qBAAqB","sourcesContent":["// TTT audit event catalog. The `AuditEventType` union is the canonical list\n// of all sensitive actions the system logs. The `TTTAuditActor` and\n// `TTTAuditTarget` shapes describe who performed the action and what was\n// affected. `TTTAuditEvent` specializes the generic `AuditEvent` from\n// @ttt-productions/audit-core with the TTT-specific shapes.\n//\n// Backend writers and future native/TV/console readers all consume this\n// catalog from here.\n\nimport type { AuditEvent } from '@ttt-productions/audit-core';\n\nexport type AuditEventType =\n // user status\n | 'artisanCreator.grantedToUser'\n | 'user.accountRegistered'\n | 'user.statusChanged'\n | 'user.accountSuspended'\n | 'user.accountBanned'\n | 'user.accountUnbanned'\n | 'user.displayNameResetForced'\n | 'user.displayNameChanged'\n | 'user.nonUsArtisanInterestRecorded'\n // account deletion / GDPR erasure (N3)\n | 'account.deletionRequested'\n | 'account.deletionCancelled'\n | 'account.erasureCompleted'\n | 'account.erasureParkedOnHold'\n | 'account.erasureSuperseded'\n // admin actions\n | 'admin.systemRoleGranted'\n | 'admin.systemRoleRevoked'\n | 'admin.systemRoleSyncedFromDirectEdit'\n | 'admin.contentAppealReviewed'\n | 'admin.thresholdItemReviewed'\n | 'admin.futurePlansUpdated'\n | 'admin.rulesAndAgreementsUpdated'\n // content-pages migration (DJ ruling 2026-07-06): per-page admin editors\n | 'admin.termsPageUpdated'\n | 'admin.privacyPageUpdated'\n | 'admin.takeItDownPageCopyUpdated'\n // admin launch-seed actions (Ready for Launch tab)\n | 'admin.reservedUsernamesSeeded'\n | 'admin.blockedFranchiseNamesSeeded'\n | 'admin.rulesAndAgreementsSeeded'\n | 'admin.futurePlansSeeded'\n | 'admin.termsPageSeeded'\n | 'admin.privacyPageSeeded'\n | 'admin.takeItDownPageCopySeeded'\n // admin direct-delete callables (replaced the last two direct-SDK admin-browser deletes):\n // deleteAdminDispatch (support thread + its conversationMessages) and deleteShortLink.\n | 'admin.dispatchDeleted'\n | 'admin.shortLinkDeleted'\n // trademark-assist (advisory check at approval) + parody/real-people disclaimer baked at approval\n | 'admin.trademarkChecked'\n | 'content.parodyDisclaimerApplied'\n // workProject\n | 'workProject.created'\n | 'workProject.guildmateUserGuildStandingChanged'\n | 'workProject.guildmateUserTradeProfessionsChanged'\n // Member self-leave (leaveWorkProject) — pre-publish voluntary exit, shares forfeited to the pool.\n | 'workProject.guildMemberDeparted'\n | 'workProject.publicDetailsUpdated'\n | 'workProject.workAssetDeleted'\n // work-file folders (S7). fileFolderAccessChanged is an ACL change (folder trade-profession\n // view/upload/delete lists gate custom-folder confidentiality) — audited with before/after lists.\n | 'workProject.fileFolderCreated'\n | 'workProject.fileFolderRenamed'\n | 'workProject.fileFolderAccessChanged'\n | 'workProject.fileFolderDeleted'\n | 'workProject.guildInviteSent'\n | 'workProject.guildInviteAccepted'\n | 'workProject.guildInviteDeclined'\n | 'workProject.guildInviteCancelled'\n | 'workProject.guildInviteStakeSharesUpdated'\n | 'workProject.commissionListingCreated'\n | 'workProject.commissionProposalCreated'\n | 'workProject.commissionClosed'\n | 'workProject.commissionDeleted'\n | 'workProject.commissionProposalSaveToggled'\n | 'workProject.commissionProposalRejected'\n | 'workProject.stakeSharesChanged'\n | 'workProject.stakeShares.created'\n | 'workProject.stakeShares.increased'\n | 'workProject.stakeShares.anomaly'\n // realm shared files — a work file promoted into its realm's shared pool + canon toggles + un-share\n | 'workFile.sharedToRealm'\n | 'workFile.realmCanonChanged'\n | 'workFile.unsharedFromRealm'\n // craft-skills\n | 'craftSkill.userCraftSkillDeleted'\n | 'craftSkill.hidden'\n | 'craftSkill.restored'\n | 'craftSkill.removed'\n // content\n | 'content.itemReported'\n | 'content.violationRecorded'\n | 'content.thresholdItemSubmitted'\n // Member-initiated pull-back of a still-pending threshold submission (withdraw callable —\n // deletes the threshold doc + admin task, flips the live sub-item back to unpublished).\n | 'content.thresholdItemWithdrawn'\n | 'content.hallItemPublished'\n // Published change requests (text-only at launch): a member proposes new text-field values\n // for a PUBLISHED hall item; an admin approves (server writes values in place) or denies.\n | 'content.hallContentChangeRequestSubmitted'\n | 'admin.hallContentChangeRequestResolved'\n | 'content.appealSubmitted'\n | 'content.violationAccepted'\n | 'content.hidden'\n | 'content.restored'\n | 'content.removed'\n // content (workProject content)\n | 'content.taleDetailsUpdated'\n | 'content.taleWorkGenresUpdated'\n | 'content.chapterCreated'\n | 'content.chapterDetailsUpdated'\n | 'content.tuneDetailsUpdated'\n | 'content.tuneWorkGenresUpdated'\n | 'content.tuneTrackCreated'\n | 'content.tuneTrackDetailsUpdated'\n | 'content.televisionDetailsUpdated'\n | 'content.televisionWorkGenresUpdated'\n | 'content.televisionEpisodeCreated'\n | 'content.televisionEpisodeDetailsUpdated'\n // money\n | 'payment.sessionCreated'\n | 'payment.pledgePaymentCompleted'\n | 'payment.pledgePaymentAbandoned'\n | 'payment.pledgePaymentFailed'\n | 'payment.pledgePaymentQuarantined'\n // money — refund + dispute lifecycle (post-launch handlers; types added now to avoid a\n // second package publish). Refund REQUESTS are the user-initiated ask; the refund itself is\n // the money movement. Disputes are Stripe-initiated (chargeback) open/close.\n | 'payment.pledgePaymentRefunded'\n | 'payment.pledgePaymentDisputeOpened'\n | 'payment.pledgePaymentDisputeClosed'\n | 'payment.pledgeRefundRequested'\n | 'payment.pledgeRefundRequestResolved'\n // money — independent ledger-integrity trigger (mirrors workProject.stakeShares.*)\n | 'payment.pledgeLedger.recorded'\n | 'payment.pledgeLedger.anomaly'\n // admin task lifecycle\n | 'admin.taskCheckedOut'\n | 'admin.taskCheckedIn'\n | 'admin.taskReleased'\n | 'admin.taskAutoReleased'\n | 'admin.taskDeferredLater'\n // audition\n | 'workProject.auditionCreated'\n | 'admin.auditionCreated'\n | 'audition.entryCreated'\n | 'audition.closedByUser'\n // system-actor event: a curated audition's option batch failed to assemble (media\n // rejection) and its curatedAssemblyStatus flipped to 'failed' (runFailCuratedAudition).\n | 'audition.curatedBatchFailed'\n // system\n | 'system.manualIntervention'\n | 'system.appConfigUpdated'\n // records (never controls) a charter↔full APP_MODE flip after deploy — written\n // by the idempotent recordAppModeFlip admin callable\n | 'admin.appModeFlipRecorded'\n | 'system.pendingMediaArchived'\n | 'system.orphanUploadsCleanedUp'\n | 'admin.profanityListSeeded'\n | 'admin.profanityListCurated'\n // social\n | 'social.squareStreetzPostLiked'\n | 'social.squareStreetzPostUnliked'\n | 'social.targetFollowed'\n | 'social.targetUnfollowed'\n // chat\n | 'chat.guildChatChannelCreated'\n | 'chat.guildChatChannelUpdated'\n | 'chat.guildChatChannelArchived'\n | 'chat.guildChatChannelUnarchived'\n | 'chat.guildChatChannelDeleted'\n | 'chat.adminThreadStarted'\n | 'chat.adminThreadStatusChanged'\n // conversation files — every successful delete is audited with UID references and\n // canonical resource ids (the conversation ref, conversationFileId, mediaAssetId).\n | 'conversationFile.deleted'\n // chat moderation (DO-owned hide/delete via chatAdminActionCommands) — append-only,\n // deterministic ids hash('chat-moderation-{requested,applied,failed}', requestId, …).\n | 'chat.moderationActionRequested'\n | 'chat.moderationActionApplied'\n | 'chat.moderationActionFailed'\n // case-bound admin context read (read-on-demand, REVIEW-ONLY) — audits the request\n // AND outcome; one event per read keyed deterministically by the read's requestId.\n | 'chat.moderationContextRead'\n // notification (admin-only). Actor mode is always adminReview / adminOverride.\n // Payload shapes: NotificationBroadcastSentAuditMetadata /\n // NotificationAdminArchivedAuditMetadata in ../schemas/notification.ts.\n | 'notification.broadcastSent'\n | 'notification.adminArchived'\n // workProject\n | 'workProject.released'\n | 'workProject.hidden'\n | 'workProject.restored'\n | 'workProject.moderationPlaceholderApplied'\n | 'workProject.moderationRetitleCleared'\n | 'workRealm.created'\n | 'workRealm.released'\n | 'workRealm.detailsUpdated'\n | 'workRealm.hidden'\n | 'workRealm.restored'\n | 'workRealm.moderationPlaceholderApplied'\n | 'workRealm.moderationRetitleCleared'\n // hall-content moderation text-clear remedy (extends the workProject/workRealm placeholder\n // family across Tale/Tune/Television details + their chapter/track/episode sub-items and the\n // published Hall projections). Same past-tense placeholder-applied shape as the pair above.\n | 'hallItem.moderationPlaceholderApplied'\n // trust & safety — child safety / CSAM\n | 'report.childSafetyCaseOpened'\n | 'report.nciiCaseOpened'\n | 'childSafety.reportDispositionSet'\n | 'childSafety.holdPlaced'\n | 'childSafety.holdReleased'\n | 'childSafety.accountActionApplied'\n | 'childSafety.accountActionReverted'\n | 'childSafety.evidenceManifestCreated'\n | 'childSafety.evidenceDisposed'\n | 'childSafety.quarantineCompleted'\n | 'childSafety.ncmecSubmissionCompleted'\n | 'childSafety.ncmecPortalReceiptArtifactRecorded'\n | 'childSafety.legalProcessRecorded'\n | 'childSafety.falsePositiveCorrected'\n // trust & safety — age / registration\n | 'user.ageAttested'\n | 'user.ageUpgradedToAdult'\n | 'user.orphanAuthDeleted'\n | 'user.accountClosedUnder13'\n | 'user.safetyLocked'\n // trust & safety — NCII / TAKE IT DOWN\n | 'ncii.requestReceived'\n | 'ncii.requestSupplemented'\n | 'ncii.completenessDetermined'\n | 'ncii.validityDecided'\n | 'ncii.tempHoldPlaced'\n | 'ncii.tempHoldReleased'\n | 'ncii.removalCompleted'\n | 'ncii.removalUnableToComplete'\n // operator marks NCII evidence (e.g. flags/annotates an evidence item on the case) — a reviewed\n // evidence-handling action, audited like the other ncii evidence events.\n | 'ncii.evidenceMarked'\n | 'ncii.evidenceScanValidatedMatch'\n | 'ncii.hashBlockReversed'\n | 'ncii.requesterPiiScrubbed'\n | 'ncii.policyConfigUpdated'\n // operator sets the child-safety crossover minorAssessment on an NCII case (e.g. → possibleMinor):\n // routing action that opens/links a PARALLEL child-safety review + deny-serving + PhotoDNA, WITHOUT\n // touching the NCII removal clock and WITHOUT auto-NCMEC. Payload records from→to assessment.\n | 'ncii.minorAssessmentSet'\n // [H-2] a failed possible-minor crossover leg (serving-deny / PhotoDNA) was reconciled or replayed\n // by an operator/reconciler (crossoverLegs.<leg> failed → done). Payload records which leg + outcome.\n | 'ncii.crossoverLegReconciled'\n // trust & safety — operator security\n // Passkey enrollment/assertion reuses safety.privilegedReauthPerformed (the reauth catalog entry, as\n // the TOTP step-up enroll/confirm/verify phases already do) — no distinct passkey-registration type.\n | 'safety.privilegedReauthPerformed'\n // [P2-08] A privileged operator read of a TAKE IT DOWN request's RAW target locator (the\n // reveal-on-demand, review-only read of the sensitive locator itself — distinct from the\n // reveal reauth above, which is the step-up). One event per read. Mirrors the\n // chat.moderationContextRead privileged-read convention.\n | 'safety.privilegedRawLocatorRead'\n | 'safety.deadlineBreachRecorded'\n // [M-6] per-operator reviewer-capability grant lifecycle (privilegedReviewerCapabilityGrants/{uid}).\n // Granting/revoking a SafetyReviewerCapability is an authorization change — always audited.\n | 'safety.reviewerCapabilityGranted'\n | 'safety.reviewerCapabilityRevoked';\n\n/**\n * How the actor was acting when the audited action was performed. This is\n * orthogonal to the event name — the same event type can be produced by\n * different actor modes (e.g. a normal member vs. an admin override).\n *\n * - 'user' — authenticated action not tied to project membership\n * - 'projectMember' — acting through normal Work/project (guild standing) permissions\n * - 'adminReview' — admin queue/support work on admin surfaces (no project-permission concept)\n * - 'adminOverride' — system-admin authority superseding normal user/project permission\n * - 'system' — backend automation: trigger, scheduled job, migration, media pipeline\n */\nexport type TTTAuditActorMode =\n | 'user'\n | 'projectMember'\n | 'adminReview'\n | 'adminOverride'\n | 'system';\n\n/** Fields common to every audited actor regardless of mode. `isAdmin` is\n * claim-present metadata only — it records that the caller held an admin\n * claim at the time, NOT that the action was an override. */\nexport type TTTAuditActorBase = {\n uid: string | null;\n isAdmin: boolean;\n};\n\n/** TTT actor shape, discriminated on `actorMode`. The admin system role is\n * REQUIRED on admin modes (adminReview / adminOverride) and FORBIDDEN on\n * non-admin modes (user / projectMember / system) — so an admin action can\n * never be audited without recording full-vs-jr, and a non-admin action can\n * never carry a spurious role. */\nexport type TTTAuditActor =\n | (TTTAuditActorBase & {\n actorMode: 'user' | 'projectMember' | 'system';\n systemRole?: never;\n })\n | (TTTAuditActorBase & {\n actorMode: 'adminReview' | 'adminOverride';\n systemRole: 'admin' | 'jrAdmin';\n });\n\n/**\n * TTT target shape: the uid the audited action affects (if any), plus the\n * Firestore path of the affected document (if any).\n */\nexport type TTTAuditTarget = { uid: string | null; ref: string | null };\n\n/**\n * The canonical TTT audit event document shape. Specializes the generic\n * `AuditEvent` from @ttt-productions/audit-core with the TTT event-type\n * union, actor shape, target shape, and a generic metadata bag.\n */\nexport type TTTAuditEvent = AuditEvent<\n AuditEventType,\n TTTAuditActor,\n TTTAuditTarget,\n Record<string, unknown>\n>;\n\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttt-productions/ttt-core",
|
|
3
|
-
"version": "0.79.
|
|
3
|
+
"version": "0.79.11",
|
|
4
4
|
"description": "Core types, Firestore path constants, and shared constants for TTT Productions",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"@ttt-productions/edge-protocol-core": "^0.1.5",
|
|
118
118
|
"@ttt-productions/media-schemas": "^0.14.4",
|
|
119
119
|
"@ttt-productions/notification-core": "^0.15.5",
|
|
120
|
-
"@ttt-productions/report-core": "^0.16.
|
|
120
|
+
"@ttt-productions/report-core": "^0.16.7",
|
|
121
121
|
"zod": "^4.4.3"
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|