@ttt-productions/ttt-core 0.26.0 → 0.28.0
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/doc-schemas/index.d.ts +0 -2
- package/dist/doc-schemas/index.d.ts.map +1 -1
- package/dist/doc-schemas/index.js +0 -2
- package/dist/doc-schemas/index.js.map +1 -1
- package/dist/doc-schemas/media-activation-jobs.d.ts +4 -0
- package/dist/doc-schemas/media-activation-jobs.d.ts.map +1 -1
- package/dist/doc-schemas/media-assets.d.ts +23 -5
- package/dist/doc-schemas/media-assets.d.ts.map +1 -1
- package/dist/doc-schemas/media-assets.js +16 -5
- package/dist/doc-schemas/media-assets.js.map +1 -1
- package/dist/doc-schemas/ncii/cases.d.ts +0 -21
- package/dist/doc-schemas/ncii/cases.d.ts.map +1 -1
- package/dist/doc-schemas/ncii/cases.js +3 -18
- package/dist/doc-schemas/ncii/cases.js.map +1 -1
- package/dist/doc-schemas/ncii/config.d.ts +1 -51
- package/dist/doc-schemas/ncii/config.d.ts.map +1 -1
- package/dist/doc-schemas/ncii/config.js +6 -72
- package/dist/doc-schemas/ncii/config.js.map +1 -1
- package/dist/doc-schemas/ncii/requests.d.ts +0 -9
- package/dist/doc-schemas/ncii/requests.d.ts.map +1 -1
- package/dist/doc-schemas/ncii/requests.js +1 -3
- package/dist/doc-schemas/ncii/requests.js.map +1 -1
- package/dist/doc-schemas/registry.d.ts +12 -183
- package/dist/doc-schemas/registry.d.ts.map +1 -1
- package/dist/doc-schemas/registry.js +2 -11
- package/dist/doc-schemas/registry.js.map +1 -1
- package/dist/doc-schemas/safety/foundation.d.ts +1 -36
- package/dist/doc-schemas/safety/foundation.d.ts.map +1 -1
- package/dist/doc-schemas/safety/foundation.js +1 -24
- package/dist/doc-schemas/safety/foundation.js.map +1 -1
- package/dist/doc-schemas/safety/holds.d.ts +3 -0
- package/dist/doc-schemas/safety/holds.d.ts.map +1 -1
- package/dist/doc-schemas/safety/holds.js +13 -0
- package/dist/doc-schemas/safety/holds.js.map +1 -1
- package/dist/doc-schemas/work-project.d.ts +1 -12
- package/dist/doc-schemas/work-project.d.ts.map +1 -1
- package/dist/doc-schemas/work-project.js +4 -9
- package/dist/doc-schemas/work-project.js.map +1 -1
- package/dist/paths/collections.d.ts +0 -4
- package/dist/paths/collections.d.ts.map +1 -1
- package/dist/paths/collections.js +1 -5
- package/dist/paths/collections.js.map +1 -1
- package/dist/paths/path-builders.d.ts +0 -7
- package/dist/paths/path-builders.d.ts.map +1 -1
- package/dist/paths/path-builders.js +0 -7
- package/dist/paths/path-builders.js.map +1 -1
- package/dist/types/audit.d.ts +1 -1
- package/dist/types/audit.d.ts.map +1 -1
- package/dist/types/work-project.d.ts +1 -1
- package/dist/types/work-project.d.ts.map +1 -1
- package/dist/types/work-project.js.map +1 -1
- package/dist/upload-variables/index.d.ts +0 -1
- package/dist/upload-variables/index.d.ts.map +1 -1
- package/dist/upload-variables/index.js +0 -1
- package/dist/upload-variables/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/doc-schemas/ncii/appeals.d.ts +0 -121
- package/dist/doc-schemas/ncii/appeals.d.ts.map +0 -1
- package/dist/doc-schemas/ncii/appeals.js +0 -132
- package/dist/doc-schemas/ncii/appeals.js.map +0 -1
- package/dist/doc-schemas/ncii/notices.d.ts +0 -109
- package/dist/doc-schemas/ncii/notices.d.ts.map +0 -1
- package/dist/doc-schemas/ncii/notices.js +0 -114
- package/dist/doc-schemas/ncii/notices.js.map +0 -1
- package/dist/upload-variables/upload-work-asset-variables.d.ts +0 -30
- package/dist/upload-variables/upload-work-asset-variables.d.ts.map +0 -1
- package/dist/upload-variables/upload-work-asset-variables.js +0 -10
- package/dist/upload-variables/upload-work-asset-variables.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/upload-variables/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/upload-variables/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/** The AUTHORITATIVE appeal state (`nciiCases.appealState` projects this). */
|
|
3
|
-
export declare const NciiAppealStateSchema: z.ZodEnum<{
|
|
4
|
-
underReview: "underReview";
|
|
5
|
-
denied: "denied";
|
|
6
|
-
submitted: "submitted";
|
|
7
|
-
granted: "granted";
|
|
8
|
-
withdrawn: "withdrawn";
|
|
9
|
-
}>;
|
|
10
|
-
export type NciiAppealState = z.infer<typeof NciiAppealStateSchema>;
|
|
11
|
-
/** Durable command/retry/dead-letter status for the reinstatement/denial effect. */
|
|
12
|
-
export declare const NciiAppealCommandStatusSchema: z.ZodEnum<{
|
|
13
|
-
pending: "pending";
|
|
14
|
-
deadLetter: "deadLetter";
|
|
15
|
-
applied: "applied";
|
|
16
|
-
executing: "executing";
|
|
17
|
-
}>;
|
|
18
|
-
export type NciiAppealCommandStatus = z.infer<typeof NciiAppealCommandStatusSchema>;
|
|
19
|
-
/** Durable command sub-record on the appeal — drives the reinstatement/denial
|
|
20
|
-
* effect with retry/dead-letter. */
|
|
21
|
-
export declare const NciiAppealCommandV1Schema: z.ZodObject<{
|
|
22
|
-
commandId: z.ZodString;
|
|
23
|
-
status: z.ZodEnum<{
|
|
24
|
-
pending: "pending";
|
|
25
|
-
deadLetter: "deadLetter";
|
|
26
|
-
applied: "applied";
|
|
27
|
-
executing: "executing";
|
|
28
|
-
}>;
|
|
29
|
-
attemptCount: z.ZodNumber;
|
|
30
|
-
nextAttemptAt: z.ZodOptional<z.ZodNumber>;
|
|
31
|
-
leaseOwner: z.ZodOptional<z.ZodString>;
|
|
32
|
-
leaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
33
|
-
lastErrorCode: z.ZodOptional<z.ZodString>;
|
|
34
|
-
}, z.core.$strict>;
|
|
35
|
-
export type NciiAppealCommandV1 = z.infer<typeof NciiAppealCommandV1Schema>;
|
|
36
|
-
/** `nciiAppeals/{appealId}` — durable, append-only uploader-removal appeal. Doc id
|
|
37
|
-
* `appealId` is deterministic:
|
|
38
|
-
* `sha256('ncii-appeal-v1:' + caseId + ':' + appellantUid + ':' + removalGeneration)`
|
|
39
|
-
* (a retried submit resolves to the same doc — idempotent). */
|
|
40
|
-
export declare const NciiAppealV1Schema: z.ZodObject<{
|
|
41
|
-
schemaVersion: z.ZodLiteral<1>;
|
|
42
|
-
appealId: z.ZodString;
|
|
43
|
-
caseId: z.ZodString;
|
|
44
|
-
requestIds: z.ZodArray<z.ZodString>;
|
|
45
|
-
appealKind: z.ZodLiteral<"uploaderRemovalAppeal">;
|
|
46
|
-
removalGeneration: z.ZodNumber;
|
|
47
|
-
appellantUid: z.ZodString;
|
|
48
|
-
idempotencyKey: z.ZodString;
|
|
49
|
-
state: z.ZodEnum<{
|
|
50
|
-
underReview: "underReview";
|
|
51
|
-
denied: "denied";
|
|
52
|
-
submitted: "submitted";
|
|
53
|
-
granted: "granted";
|
|
54
|
-
withdrawn: "withdrawn";
|
|
55
|
-
}>;
|
|
56
|
-
deadlineAt: z.ZodOptional<z.ZodNumber>;
|
|
57
|
-
command: z.ZodObject<{
|
|
58
|
-
commandId: z.ZodString;
|
|
59
|
-
status: z.ZodEnum<{
|
|
60
|
-
pending: "pending";
|
|
61
|
-
deadLetter: "deadLetter";
|
|
62
|
-
applied: "applied";
|
|
63
|
-
executing: "executing";
|
|
64
|
-
}>;
|
|
65
|
-
attemptCount: z.ZodNumber;
|
|
66
|
-
nextAttemptAt: z.ZodOptional<z.ZodNumber>;
|
|
67
|
-
leaseOwner: z.ZodOptional<z.ZodString>;
|
|
68
|
-
leaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
69
|
-
lastErrorCode: z.ZodOptional<z.ZodString>;
|
|
70
|
-
}, z.core.$strict>;
|
|
71
|
-
createdAt: z.ZodNumber;
|
|
72
|
-
updatedAt: z.ZodNumber;
|
|
73
|
-
decidedAt: z.ZodOptional<z.ZodNumber>;
|
|
74
|
-
}, z.core.$strict>;
|
|
75
|
-
export type NciiAppealV1 = z.infer<typeof NciiAppealV1Schema>;
|
|
76
|
-
/** Who created the submission. */
|
|
77
|
-
export declare const NciiAppealSubmissionAuthorSchema: z.ZodEnum<{
|
|
78
|
-
operator: "operator";
|
|
79
|
-
appellant: "appellant";
|
|
80
|
-
}>;
|
|
81
|
-
export type NciiAppealSubmissionAuthor = z.infer<typeof NciiAppealSubmissionAuthorSchema>;
|
|
82
|
-
/** `nciiAppeals/{appealId}/submissions/{submissionId}` — IMMUTABLE append-only
|
|
83
|
-
* record of the appellant's reason + evidence. Doc id `submissionId` is a
|
|
84
|
-
* deterministic/assigned id (z.string().min(1)). */
|
|
85
|
-
export declare const NciiAppealSubmissionV1Schema: z.ZodObject<{
|
|
86
|
-
schemaVersion: z.ZodLiteral<1>;
|
|
87
|
-
submissionId: z.ZodString;
|
|
88
|
-
sequence: z.ZodNumber;
|
|
89
|
-
receivedAt: z.ZodNumber;
|
|
90
|
-
appellantStatement: z.ZodString;
|
|
91
|
-
evidenceIds: z.ZodArray<z.ZodString>;
|
|
92
|
-
createdBy: z.ZodEnum<{
|
|
93
|
-
operator: "operator";
|
|
94
|
-
appellant: "appellant";
|
|
95
|
-
}>;
|
|
96
|
-
}, z.core.$strict>;
|
|
97
|
-
export type NciiAppealSubmissionV1 = z.infer<typeof NciiAppealSubmissionV1Schema>;
|
|
98
|
-
/** Appeal decision result. */
|
|
99
|
-
export declare const NciiAppealDecisionResultSchema: z.ZodEnum<{
|
|
100
|
-
denied: "denied";
|
|
101
|
-
granted: "granted";
|
|
102
|
-
}>;
|
|
103
|
-
export type NciiAppealDecisionResult = z.infer<typeof NciiAppealDecisionResultSchema>;
|
|
104
|
-
/** `nciiAppeals/{appealId}/decisions/{decisionId}` — IMMUTABLE append-only
|
|
105
|
-
* decision. ONLY `nciiAppealReviewer` may write a decision (capability pinned by
|
|
106
|
-
* literal). Doc id `decisionId` is a deterministic/assigned id (z.string().min(1)). */
|
|
107
|
-
export declare const NciiAppealDecisionV1Schema: z.ZodObject<{
|
|
108
|
-
schemaVersion: z.ZodLiteral<1>;
|
|
109
|
-
decisionId: z.ZodString;
|
|
110
|
-
result: z.ZodEnum<{
|
|
111
|
-
denied: "denied";
|
|
112
|
-
granted: "granted";
|
|
113
|
-
}>;
|
|
114
|
-
reviewerUid: z.ZodString;
|
|
115
|
-
capability: z.ZodLiteral<"nciiAppealReviewer">;
|
|
116
|
-
basisSubmissionIds: z.ZodArray<z.ZodString>;
|
|
117
|
-
rationaleRef: z.ZodString;
|
|
118
|
-
decidedAt: z.ZodNumber;
|
|
119
|
-
}, z.core.$strict>;
|
|
120
|
-
export type NciiAppealDecisionV1 = z.infer<typeof NciiAppealDecisionV1Schema>;
|
|
121
|
-
//# sourceMappingURL=appeals.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"appeals.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/ncii/appe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AC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
// Trust & Safety — durable uploader-removal appeal (Appendix A §A11 [H-09]).
|
|
2
|
-
//
|
|
3
|
-
// `nciiAppeals/{appealId}` — the `uploaderRemovalAppeal` is a first-class durable,
|
|
4
|
-
// append-only record exactly like every other NCII workflow object. The mutable
|
|
5
|
-
// `nciiCases.appealState` is a labeled NON-AUTHORITATIVE PROJECTION of this record,
|
|
6
|
-
// NEVER the authority.
|
|
7
|
-
//
|
|
8
|
-
// This schema is the UPLOADER appeal ONLY (`appealKind:'uploaderRemovalAppeal'`).
|
|
9
|
-
// The authenticated uploader whose content was removed appeals here; ONLY
|
|
10
|
-
// `nciiAppealReviewer` may grant it (reinstate content / reverse an NCII hash
|
|
11
|
-
// block), and a child-safety hold is NEVER reversible through it. A requester's
|
|
12
|
-
// `requesterValidityCorrection` (status-token supplement) is NOT an appeal, carries
|
|
13
|
-
// NO reinstatement power, and is NOT modeled by this schema.
|
|
14
|
-
//
|
|
15
|
-
// Deterministic `appealId = sha256('ncii-appeal-v1:' + caseId + ':' + appellantUid
|
|
16
|
-
// + ':' + removalGeneration)` (a retried submit resolves to the same doc —
|
|
17
|
-
// idempotent). The client-supplied ≥128-bit `idempotencyKey` together with the
|
|
18
|
-
// deterministic appealId guarantees one record per retry.
|
|
19
|
-
//
|
|
20
|
-
// Every shape here is transcribed verbatim from docs/code_changes_needed/
|
|
21
|
-
// trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A11 [H-09] — no invented
|
|
22
|
-
// values, no placeholders.
|
|
23
|
-
//
|
|
24
|
-
// Collection note: this cluster introduces a NEW Firestore collection (+ two
|
|
25
|
-
// append-only child subcollections); wiring collections.ts / path-builders.ts /
|
|
26
|
-
// registry.ts is deferred to the app leg (the orchestrator binds the schemas +
|
|
27
|
-
// path builders there); the deterministic doc-id shape is documented on each
|
|
28
|
-
// schema below. No shared enum is imported — the appeal kind/state/command/result
|
|
29
|
-
// vocabularies are appeal-local literals (the cross-cluster NciiAppealKind enum
|
|
30
|
-
// has two members; this schema pins the single literal it owns).
|
|
31
|
-
import { z } from 'zod';
|
|
32
|
-
// ===========================================================================
|
|
33
|
-
// §A11 [H-09] — appeal state + command vocabularies
|
|
34
|
-
// ===========================================================================
|
|
35
|
-
/** The AUTHORITATIVE appeal state (`nciiCases.appealState` projects this). */
|
|
36
|
-
export const NciiAppealStateSchema = z.enum([
|
|
37
|
-
'submitted',
|
|
38
|
-
'underReview',
|
|
39
|
-
'granted',
|
|
40
|
-
'denied',
|
|
41
|
-
'withdrawn',
|
|
42
|
-
]);
|
|
43
|
-
/** Durable command/retry/dead-letter status for the reinstatement/denial effect. */
|
|
44
|
-
export const NciiAppealCommandStatusSchema = z.enum([
|
|
45
|
-
'pending',
|
|
46
|
-
'executing',
|
|
47
|
-
'applied',
|
|
48
|
-
'deadLetter',
|
|
49
|
-
]);
|
|
50
|
-
/** Durable command sub-record on the appeal — drives the reinstatement/denial
|
|
51
|
-
* effect with retry/dead-letter. */
|
|
52
|
-
export const NciiAppealCommandV1Schema = z.object({
|
|
53
|
-
commandId: z.string().min(1),
|
|
54
|
-
status: NciiAppealCommandStatusSchema,
|
|
55
|
-
attemptCount: z.number(),
|
|
56
|
-
nextAttemptAt: z.number().optional(),
|
|
57
|
-
leaseOwner: z.string().min(1).optional(),
|
|
58
|
-
leaseExpiresAt: z.number().optional(),
|
|
59
|
-
lastErrorCode: z.string().optional(),
|
|
60
|
-
}).strict();
|
|
61
|
-
// ===========================================================================
|
|
62
|
-
// §A11 [H-09] — nciiAppeals/{appealId}
|
|
63
|
-
// ===========================================================================
|
|
64
|
-
/** `nciiAppeals/{appealId}` — durable, append-only uploader-removal appeal. Doc id
|
|
65
|
-
* `appealId` is deterministic:
|
|
66
|
-
* `sha256('ncii-appeal-v1:' + caseId + ':' + appellantUid + ':' + removalGeneration)`
|
|
67
|
-
* (a retried submit resolves to the same doc — idempotent). */
|
|
68
|
-
export const NciiAppealV1Schema = z.object({
|
|
69
|
-
schemaVersion: z.literal(1),
|
|
70
|
-
// = sha256('ncii-appeal-v1:' + caseId + ':' + appellantUid + ':' + removalGeneration)
|
|
71
|
-
appealId: z.string().min(1),
|
|
72
|
-
caseId: z.string().min(1),
|
|
73
|
-
// the request(s)/removal this appeal contests
|
|
74
|
-
requestIds: z.array(z.string().min(1)).max(16),
|
|
75
|
-
// this schema is the uploader appeal ONLY
|
|
76
|
-
appealKind: z.literal('uploaderRemovalAppeal'),
|
|
77
|
-
// ties the appeal to the specific NciiRemovalJobV1 generation that removed the content
|
|
78
|
-
removalGeneration: z.number(),
|
|
79
|
-
// the AUTHENTICATED uploader whose content was removed
|
|
80
|
-
appellantUid: z.string().min(1),
|
|
81
|
-
// client-supplied, ≥128-bit; together with the deterministic appealId guarantees one record per retry
|
|
82
|
-
idempotencyKey: z.string().min(1),
|
|
83
|
-
// the AUTHORITATIVE appeal state (appealState projects this)
|
|
84
|
-
state: NciiAppealStateSchema,
|
|
85
|
-
// per-appeal review SLA (NciiPolicyConfigV1.uploaderRemovalAppealWindowDays); UI-independent monitor may arm on it
|
|
86
|
-
deadlineAt: z.number().optional(),
|
|
87
|
-
// durable command/retry/dead-letter state for the reinstatement/denial effect
|
|
88
|
-
command: NciiAppealCommandV1Schema,
|
|
89
|
-
createdAt: z.number(),
|
|
90
|
-
updatedAt: z.number(),
|
|
91
|
-
decidedAt: z.number().optional(),
|
|
92
|
-
}).strict();
|
|
93
|
-
// ===========================================================================
|
|
94
|
-
// §A11 [H-09] — nciiAppeals/{appealId}/submissions/{submissionId}
|
|
95
|
-
// IMMUTABLE append-only — the appellant's reason + evidence.
|
|
96
|
-
// ===========================================================================
|
|
97
|
-
/** Who created the submission. */
|
|
98
|
-
export const NciiAppealSubmissionAuthorSchema = z.enum(['appellant', 'operator']);
|
|
99
|
-
/** `nciiAppeals/{appealId}/submissions/{submissionId}` — IMMUTABLE append-only
|
|
100
|
-
* record of the appellant's reason + evidence. Doc id `submissionId` is a
|
|
101
|
-
* deterministic/assigned id (z.string().min(1)). */
|
|
102
|
-
export const NciiAppealSubmissionV1Schema = z.object({
|
|
103
|
-
schemaVersion: z.literal(1),
|
|
104
|
-
submissionId: z.string().min(1),
|
|
105
|
-
sequence: z.number(),
|
|
106
|
-
receivedAt: z.number(),
|
|
107
|
-
appellantStatement: z.string(),
|
|
108
|
-
evidenceIds: z.array(z.string().min(1)).max(16),
|
|
109
|
-
createdBy: NciiAppealSubmissionAuthorSchema,
|
|
110
|
-
}).strict();
|
|
111
|
-
// ===========================================================================
|
|
112
|
-
// §A11 [H-09] — nciiAppeals/{appealId}/decisions/{decisionId}
|
|
113
|
-
// IMMUTABLE append-only — ONLY `nciiAppealReviewer` may write a decision; a
|
|
114
|
-
// `granted` decision drives the reinstatement command + a child-safety hold is
|
|
115
|
-
// NEVER reversible through it.
|
|
116
|
-
// ===========================================================================
|
|
117
|
-
/** Appeal decision result. */
|
|
118
|
-
export const NciiAppealDecisionResultSchema = z.enum(['granted', 'denied']);
|
|
119
|
-
/** `nciiAppeals/{appealId}/decisions/{decisionId}` — IMMUTABLE append-only
|
|
120
|
-
* decision. ONLY `nciiAppealReviewer` may write a decision (capability pinned by
|
|
121
|
-
* literal). Doc id `decisionId` is a deterministic/assigned id (z.string().min(1)). */
|
|
122
|
-
export const NciiAppealDecisionV1Schema = z.object({
|
|
123
|
-
schemaVersion: z.literal(1),
|
|
124
|
-
decisionId: z.string().min(1),
|
|
125
|
-
result: NciiAppealDecisionResultSchema,
|
|
126
|
-
reviewerUid: z.string().min(1),
|
|
127
|
-
capability: z.literal('nciiAppealReviewer'),
|
|
128
|
-
basisSubmissionIds: z.array(z.string().min(1)).max(16),
|
|
129
|
-
rationaleRef: z.string(),
|
|
130
|
-
decidedAt: z.number(),
|
|
131
|
-
}).strict();
|
|
132
|
-
//# sourceMappingURL=appeals.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app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;IAC7B,MAAM,EAAE,8BAA8B;IACtC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC3C,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IACtD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC,MAAM,EAAE,CAAC"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/** Notice delivery channel. */
|
|
3
|
-
export declare const NciiUploaderNoticeChannelSchema: z.ZodEnum<{
|
|
4
|
-
email: "email";
|
|
5
|
-
inApp: "inApp";
|
|
6
|
-
}>;
|
|
7
|
-
export type NciiUploaderNoticeChannel = z.infer<typeof NciiUploaderNoticeChannelSchema>;
|
|
8
|
-
/** Who the notice is for, snapshotted at decision time (NEVER re-resolved). */
|
|
9
|
-
export declare const NciiUploaderNoticeRecipientSnapshotSchema: z.ZodObject<{
|
|
10
|
-
uid: z.ZodString;
|
|
11
|
-
deliveryAddressRef: z.ZodString;
|
|
12
|
-
capturedAt: z.ZodNumber;
|
|
13
|
-
}, z.core.$strict>;
|
|
14
|
-
export type NciiUploaderNoticeRecipientSnapshot = z.infer<typeof NciiUploaderNoticeRecipientSnapshotSchema>;
|
|
15
|
-
/** Durable retry/dead-letter delivery command on the notice. */
|
|
16
|
-
export declare const NciiUploaderNoticeCommandV1Schema: z.ZodObject<{
|
|
17
|
-
commandId: z.ZodString;
|
|
18
|
-
attemptCount: z.ZodNumber;
|
|
19
|
-
nextAttemptAt: z.ZodOptional<z.ZodNumber>;
|
|
20
|
-
leaseOwner: z.ZodOptional<z.ZodString>;
|
|
21
|
-
leaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
22
|
-
lastErrorCode: z.ZodOptional<z.ZodString>;
|
|
23
|
-
}, z.core.$strict>;
|
|
24
|
-
export type NciiUploaderNoticeCommandV1 = z.infer<typeof NciiUploaderNoticeCommandV1Schema>;
|
|
25
|
-
/** `nciiCases/{caseId}/uploaderNotices/{noticeId}` — durable uploader-notice
|
|
26
|
-
* delivery record (OWNED by the notices cluster). Doc id `noticeId` is
|
|
27
|
-
* deterministic:
|
|
28
|
-
* `sha256('ncii-uploader-notice-v1:' + caseId + ':' + recipientUid + ':' + removalGeneration)`. */
|
|
29
|
-
export declare const NciiUploaderNoticeV1Schema: z.ZodObject<{
|
|
30
|
-
schemaVersion: z.ZodLiteral<1>;
|
|
31
|
-
noticeId: z.ZodString;
|
|
32
|
-
caseId: z.ZodString;
|
|
33
|
-
requestIds: z.ZodArray<z.ZodString>;
|
|
34
|
-
removalGeneration: z.ZodNumber;
|
|
35
|
-
recipientSnapshot: z.ZodObject<{
|
|
36
|
-
uid: z.ZodString;
|
|
37
|
-
deliveryAddressRef: z.ZodString;
|
|
38
|
-
capturedAt: z.ZodNumber;
|
|
39
|
-
}, z.core.$strict>;
|
|
40
|
-
channel: z.ZodEnum<{
|
|
41
|
-
email: "email";
|
|
42
|
-
inApp: "inApp";
|
|
43
|
-
}>;
|
|
44
|
-
templateId: z.ZodString;
|
|
45
|
-
templateVersion: z.ZodNumber;
|
|
46
|
-
status: z.ZodEnum<{
|
|
47
|
-
pending: "pending";
|
|
48
|
-
sent: "sent";
|
|
49
|
-
delayed: "delayed";
|
|
50
|
-
suppressed: "suppressed";
|
|
51
|
-
notApplicable: "notApplicable";
|
|
52
|
-
}>;
|
|
53
|
-
suppressionReason: z.ZodOptional<z.ZodEnum<{
|
|
54
|
-
victimSafetyRisk: "victimSafetyRisk";
|
|
55
|
-
retaliationRisk: "retaliationRisk";
|
|
56
|
-
extortionRisk: "extortionRisk";
|
|
57
|
-
lawEnforcementRequest: "lawEnforcementRequest";
|
|
58
|
-
childSafetyInvestigation: "childSafetyInvestigation";
|
|
59
|
-
evidencePreservationRisk: "evidencePreservationRisk";
|
|
60
|
-
legalRestriction: "legalRestriction";
|
|
61
|
-
otherApproved: "otherApproved";
|
|
62
|
-
}>>;
|
|
63
|
-
rationaleRef: z.ZodOptional<z.ZodString>;
|
|
64
|
-
decidedByUid: z.ZodOptional<z.ZodString>;
|
|
65
|
-
delayedUntil: z.ZodOptional<z.ZodNumber>;
|
|
66
|
-
idempotencyKey: z.ZodString;
|
|
67
|
-
command: z.ZodObject<{
|
|
68
|
-
commandId: z.ZodString;
|
|
69
|
-
attemptCount: z.ZodNumber;
|
|
70
|
-
nextAttemptAt: z.ZodOptional<z.ZodNumber>;
|
|
71
|
-
leaseOwner: z.ZodOptional<z.ZodString>;
|
|
72
|
-
leaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
73
|
-
lastErrorCode: z.ZodOptional<z.ZodString>;
|
|
74
|
-
}, z.core.$strict>;
|
|
75
|
-
verifiedDeliveredAt: z.ZodOptional<z.ZodNumber>;
|
|
76
|
-
createdAt: z.ZodNumber;
|
|
77
|
-
updatedAt: z.ZodNumber;
|
|
78
|
-
}, z.core.$strict>;
|
|
79
|
-
export type NciiUploaderNoticeV1 = z.infer<typeof NciiUploaderNoticeV1Schema>;
|
|
80
|
-
/** Per-attempt delivery result. */
|
|
81
|
-
export declare const NciiUploaderNoticeAttemptResultSchema: z.ZodEnum<{
|
|
82
|
-
queued: "queued";
|
|
83
|
-
failed: "failed";
|
|
84
|
-
deferred: "deferred";
|
|
85
|
-
sent: "sent";
|
|
86
|
-
}>;
|
|
87
|
-
export type NciiUploaderNoticeAttemptResult = z.infer<typeof NciiUploaderNoticeAttemptResultSchema>;
|
|
88
|
-
/** `nciiCases/{caseId}/uploaderNotices/{noticeId}/attempts/{attemptId}` —
|
|
89
|
-
* IMMUTABLE append-only per-attempt ledger. Doc id `attemptId` is a
|
|
90
|
-
* deterministic/assigned id (z.string().min(1)). */
|
|
91
|
-
export declare const NciiUploaderNoticeAttemptV1Schema: z.ZodObject<{
|
|
92
|
-
schemaVersion: z.ZodLiteral<1>;
|
|
93
|
-
attemptId: z.ZodString;
|
|
94
|
-
at: z.ZodNumber;
|
|
95
|
-
channel: z.ZodEnum<{
|
|
96
|
-
email: "email";
|
|
97
|
-
inApp: "inApp";
|
|
98
|
-
}>;
|
|
99
|
-
result: z.ZodEnum<{
|
|
100
|
-
queued: "queued";
|
|
101
|
-
failed: "failed";
|
|
102
|
-
deferred: "deferred";
|
|
103
|
-
sent: "sent";
|
|
104
|
-
}>;
|
|
105
|
-
providerRef: z.ZodOptional<z.ZodString>;
|
|
106
|
-
errorCode: z.ZodOptional<z.ZodString>;
|
|
107
|
-
}, z.core.$strict>;
|
|
108
|
-
export type NciiUploaderNoticeAttemptV1 = z.infer<typeof NciiUploaderNoticeAttemptV1Schema>;
|
|
109
|
-
//# sourceMappingURL=notices.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notices.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/ncii/notices.ts"],"names":[],"mappings":"AAqCA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,+BAA+B;AAC/B,eAAO,MAAM,+BAA+B;;;EAA6B,CAAC;AAC1E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,+EAA+E;AAC/E,eAAO,MAAM,yCAAyC;;;;kBAI3C,CAAC;AACZ,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC;AAE5G,gEAAgE;AAChE,eAAO,MAAM,iCAAiC;;;;;;;kBAOnC,CAAC;AACZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAM5F;;;mGAGmG;AACnG,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA6B5B,CAAC;AACZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAO9E,mCAAmC;AACnC,eAAO,MAAM,qCAAqC;;;;;EAAmD,CAAC;AACtG,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG;;oDAEoD;AACpD,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;kBAQnC,CAAC;AACZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
// Trust & Safety — durable uploader-notice delivery state machine (Appendix A
|
|
2
|
-
// §A11 [H-10]).
|
|
3
|
-
//
|
|
4
|
-
// `nciiCases/{caseId}/uploaderNotices/{noticeId}` — the uploader notice is a
|
|
5
|
-
// first-class durable delivery record like every other NCII workflow object (NOT
|
|
6
|
-
// just two bare enums). NOTE: this notices cluster OWNS the
|
|
7
|
-
// `nciiCases/{caseId}/uploaderNotices/{noticeId}` subcollection schema even though
|
|
8
|
-
// the `nciiCases` root doc itself is owned by the requests cluster.
|
|
9
|
-
//
|
|
10
|
-
// Deterministic `noticeId = sha256('ncii-uploader-notice-v1:' + caseId + ':' +
|
|
11
|
-
// recipientUid + ':' + removalGeneration)`. The client-supplied ≥128-bit
|
|
12
|
-
// `idempotencyKey` together with the deterministic noticeId guarantees one record
|
|
13
|
-
// per retry.
|
|
14
|
-
//
|
|
15
|
-
// TRANSITIONS [H-10]:
|
|
16
|
-
// pending → sent | delayed | suppressed | notApplicable
|
|
17
|
-
// delayed → sent (when `delayedUntil` elapses and no suppression applies)
|
|
18
|
-
// delayed → suppressed
|
|
19
|
-
// A failed delivery re-drives through `command` (retry/dead-letter), never silently
|
|
20
|
-
// drops. Each terminal/transition writes the matching NciiActionType
|
|
21
|
-
// (`uploaderNoticeSent` / `uploaderNoticeDelayed` / `uploaderNoticeSuppressed` /
|
|
22
|
-
// `uploaderNoticeNotApplicable`) to the request `actions` log.
|
|
23
|
-
//
|
|
24
|
-
// Every shape here is transcribed verbatim from docs/code_changes_needed/
|
|
25
|
-
// trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A11 [H-10] — no invented
|
|
26
|
-
// values, no placeholders.
|
|
27
|
-
//
|
|
28
|
-
// SHARED enums come from ../safety/foundation.js (the single source for every
|
|
29
|
-
// cross-cluster enum); they are NEVER redefined here. This cluster IMPORTS
|
|
30
|
-
// UploaderNoticeStatusSchema + UploaderNoticeReasonSchema.
|
|
31
|
-
//
|
|
32
|
-
// Collection note: this cluster owns a NEW subcollection of the requests-cluster
|
|
33
|
-
// `nciiCases` root (+ an append-only per-attempt ledger); wiring collections.ts /
|
|
34
|
-
// path-builders.ts / registry.ts is deferred to the app leg (the orchestrator
|
|
35
|
-
// binds the schemas + path builders there); the deterministic doc-id shape is
|
|
36
|
-
// documented on each schema below.
|
|
37
|
-
import { z } from 'zod';
|
|
38
|
-
import { UploaderNoticeStatusSchema, UploaderNoticeReasonSchema, } from '../safety/foundation.js';
|
|
39
|
-
// ===========================================================================
|
|
40
|
-
// §A11 [H-10] — delivery channel + embedded shapes
|
|
41
|
-
// ===========================================================================
|
|
42
|
-
/** Notice delivery channel. */
|
|
43
|
-
export const NciiUploaderNoticeChannelSchema = z.enum(['inApp', 'email']);
|
|
44
|
-
/** Who the notice is for, snapshotted at decision time (NEVER re-resolved). */
|
|
45
|
-
export const NciiUploaderNoticeRecipientSnapshotSchema = z.object({
|
|
46
|
-
uid: z.string().min(1),
|
|
47
|
-
deliveryAddressRef: z.string().min(1),
|
|
48
|
-
capturedAt: z.number(),
|
|
49
|
-
}).strict();
|
|
50
|
-
/** Durable retry/dead-letter delivery command on the notice. */
|
|
51
|
-
export const NciiUploaderNoticeCommandV1Schema = z.object({
|
|
52
|
-
commandId: z.string().min(1),
|
|
53
|
-
attemptCount: z.number(),
|
|
54
|
-
nextAttemptAt: z.number().optional(),
|
|
55
|
-
leaseOwner: z.string().min(1).optional(),
|
|
56
|
-
leaseExpiresAt: z.number().optional(),
|
|
57
|
-
lastErrorCode: z.string().optional(),
|
|
58
|
-
}).strict();
|
|
59
|
-
// ===========================================================================
|
|
60
|
-
// §A11 [H-10] — nciiCases/{caseId}/uploaderNotices/{noticeId}
|
|
61
|
-
// ===========================================================================
|
|
62
|
-
/** `nciiCases/{caseId}/uploaderNotices/{noticeId}` — durable uploader-notice
|
|
63
|
-
* delivery record (OWNED by the notices cluster). Doc id `noticeId` is
|
|
64
|
-
* deterministic:
|
|
65
|
-
* `sha256('ncii-uploader-notice-v1:' + caseId + ':' + recipientUid + ':' + removalGeneration)`. */
|
|
66
|
-
export const NciiUploaderNoticeV1Schema = z.object({
|
|
67
|
-
schemaVersion: z.literal(1),
|
|
68
|
-
noticeId: z.string().min(1),
|
|
69
|
-
caseId: z.string().min(1),
|
|
70
|
-
requestIds: z.array(z.string().min(1)).max(16),
|
|
71
|
-
removalGeneration: z.number(),
|
|
72
|
-
// who, snapshotted at decision time (never re-resolved)
|
|
73
|
-
recipientSnapshot: NciiUploaderNoticeRecipientSnapshotSchema,
|
|
74
|
-
channel: NciiUploaderNoticeChannelSchema,
|
|
75
|
-
// the notice template + version actually used
|
|
76
|
-
templateId: z.string().min(1),
|
|
77
|
-
templateVersion: z.number(),
|
|
78
|
-
// 'pending'|'sent'|'delayed'|'suppressed'|'notApplicable'
|
|
79
|
-
status: UploaderNoticeStatusSchema,
|
|
80
|
-
// present ONLY when status='suppressed' (+ restricted rationale via rationaleRef + reviewer identity)
|
|
81
|
-
suppressionReason: UploaderNoticeReasonSchema.optional(),
|
|
82
|
-
// suppression/delay rationale (restricted) + reviewer identity
|
|
83
|
-
rationaleRef: z.string().min(1).optional(),
|
|
84
|
-
decidedByUid: z.string().min(1).optional(),
|
|
85
|
-
// when status='delayed' — the scheduled re-evaluation time (delayed → sent transition)
|
|
86
|
-
delayedUntil: z.number().optional(),
|
|
87
|
-
// ≥128-bit; with the deterministic noticeId guarantees one record per retry
|
|
88
|
-
idempotencyKey: z.string().min(1),
|
|
89
|
-
// durable retry/dead-letter delivery command
|
|
90
|
-
command: NciiUploaderNoticeCommandV1Schema,
|
|
91
|
-
// proof of delivery (provider receipt / read marker), when available
|
|
92
|
-
verifiedDeliveredAt: z.number().optional(),
|
|
93
|
-
createdAt: z.number(),
|
|
94
|
-
updatedAt: z.number(),
|
|
95
|
-
}).strict();
|
|
96
|
-
// ===========================================================================
|
|
97
|
-
// §A11 [H-10] — nciiCases/{caseId}/uploaderNotices/{noticeId}/attempts/{attemptId}
|
|
98
|
-
// IMMUTABLE append-only per-attempt ledger.
|
|
99
|
-
// ===========================================================================
|
|
100
|
-
/** Per-attempt delivery result. */
|
|
101
|
-
export const NciiUploaderNoticeAttemptResultSchema = z.enum(['queued', 'sent', 'failed', 'deferred']);
|
|
102
|
-
/** `nciiCases/{caseId}/uploaderNotices/{noticeId}/attempts/{attemptId}` —
|
|
103
|
-
* IMMUTABLE append-only per-attempt ledger. Doc id `attemptId` is a
|
|
104
|
-
* deterministic/assigned id (z.string().min(1)). */
|
|
105
|
-
export const NciiUploaderNoticeAttemptV1Schema = z.object({
|
|
106
|
-
schemaVersion: z.literal(1),
|
|
107
|
-
attemptId: z.string().min(1),
|
|
108
|
-
at: z.number(),
|
|
109
|
-
channel: NciiUploaderNoticeChannelSchema,
|
|
110
|
-
result: NciiUploaderNoticeAttemptResultSchema,
|
|
111
|
-
providerRef: z.string().min(1).optional(),
|
|
112
|
-
errorCode: z.string().optional(),
|
|
113
|
-
}).strict();
|
|
114
|
-
//# sourceMappingURL=notices.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notices.js","sourceRoot":"","sources":["../../../src/doc-schemas/ncii/notices.ts"],"names":[],"mappings":"AAAA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,CAAC,CAAC,MAAM,EAAE,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const UploadWorkAssetVariablesSchema: z.ZodObject<{
|
|
3
|
-
workProjectId: z.ZodString;
|
|
4
|
-
file: z.ZodCustom<File, File>;
|
|
5
|
-
workAssets: z.ZodArray<z.ZodCustom<{
|
|
6
|
-
id: string;
|
|
7
|
-
name: string;
|
|
8
|
-
mediaAssetId: string;
|
|
9
|
-
createdAt: number;
|
|
10
|
-
size: number;
|
|
11
|
-
type: string;
|
|
12
|
-
createdBy: {
|
|
13
|
-
uid: string;
|
|
14
|
-
};
|
|
15
|
-
}, {
|
|
16
|
-
id: string;
|
|
17
|
-
name: string;
|
|
18
|
-
mediaAssetId: string;
|
|
19
|
-
createdAt: number;
|
|
20
|
-
size: number;
|
|
21
|
-
type: string;
|
|
22
|
-
createdBy: {
|
|
23
|
-
uid: string;
|
|
24
|
-
};
|
|
25
|
-
}>>;
|
|
26
|
-
onProgress: z.ZodOptional<z.ZodCustom<(state: import("@ttt-productions/media-schemas").UploadState | null) => void, (state: import("@ttt-productions/media-schemas").UploadState | null) => void>>;
|
|
27
|
-
signal: z.ZodOptional<z.ZodCustom<AbortSignal, AbortSignal>>;
|
|
28
|
-
}, z.core.$strict>;
|
|
29
|
-
export type UploadWorkAssetVariables = z.infer<typeof UploadWorkAssetVariablesSchema>;
|
|
30
|
-
//# sourceMappingURL=upload-work-asset-variables.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload-work-asset-variables.d.ts","sourceRoot":"","sources":["../../src/upload-variables/upload-work-asset-variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;kBAMhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { onProgressSchema } from './on-progress.js';
|
|
3
|
-
export const UploadWorkAssetVariablesSchema = z.object({
|
|
4
|
-
workProjectId: z.string().min(1),
|
|
5
|
-
file: z.instanceof(File),
|
|
6
|
-
workAssets: z.array(z.custom()),
|
|
7
|
-
onProgress: onProgressSchema,
|
|
8
|
-
signal: z.instanceof(AbortSignal).optional(),
|
|
9
|
-
}).strict();
|
|
10
|
-
//# sourceMappingURL=upload-work-asset-variables.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload-work-asset-variables.js","sourceRoot":"","sources":["../../src/upload-variables/upload-work-asset-variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIpD,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,IAAI,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;IACxB,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAa,CAAC;IAC1C,UAAU,EAAE,gBAAgB;IAC5B,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC,MAAM,EAAE,CAAC"}
|