@ttt-productions/ttt-core 0.19.0 → 0.19.2
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/chat-sync.d.ts +2 -2
- package/dist/doc-schemas/index.d.ts +19 -0
- package/dist/doc-schemas/index.d.ts.map +1 -1
- package/dist/doc-schemas/index.js +21 -0
- package/dist/doc-schemas/index.js.map +1 -1
- package/dist/doc-schemas/media-activation-jobs.d.ts +6 -6
- package/dist/doc-schemas/media-assets.d.ts +168 -14
- package/dist/doc-schemas/media-assets.d.ts.map +1 -1
- package/dist/doc-schemas/media-assets.js +60 -0
- package/dist/doc-schemas/media-assets.js.map +1 -1
- package/dist/doc-schemas/moderation.d.ts +6 -6
- package/dist/doc-schemas/ncii/allegations.d.ts +84 -0
- package/dist/doc-schemas/ncii/allegations.d.ts.map +1 -0
- package/dist/doc-schemas/ncii/allegations.js +45 -0
- package/dist/doc-schemas/ncii/allegations.js.map +1 -0
- package/dist/doc-schemas/ncii/appeals.d.ts +121 -0
- package/dist/doc-schemas/ncii/appeals.d.ts.map +1 -0
- package/dist/doc-schemas/ncii/appeals.js +132 -0
- package/dist/doc-schemas/ncii/appeals.js.map +1 -0
- package/dist/doc-schemas/ncii/cases.d.ts +158 -0
- package/dist/doc-schemas/ncii/cases.d.ts.map +1 -0
- package/dist/doc-schemas/ncii/cases.js +132 -0
- package/dist/doc-schemas/ncii/cases.js.map +1 -0
- package/dist/doc-schemas/ncii/config.d.ts +131 -0
- package/dist/doc-schemas/ncii/config.d.ts.map +1 -0
- package/dist/doc-schemas/ncii/config.js +227 -0
- package/dist/doc-schemas/ncii/config.js.map +1 -0
- package/dist/doc-schemas/ncii/holds.d.ts +84 -0
- package/dist/doc-schemas/ncii/holds.d.ts.map +1 -0
- package/dist/doc-schemas/ncii/holds.js +63 -0
- package/dist/doc-schemas/ncii/holds.js.map +1 -0
- package/dist/doc-schemas/ncii/notices.d.ts +109 -0
- package/dist/doc-schemas/ncii/notices.d.ts.map +1 -0
- package/dist/doc-schemas/ncii/notices.js +114 -0
- package/dist/doc-schemas/ncii/notices.js.map +1 -0
- package/dist/doc-schemas/ncii/removal.d.ts +222 -0
- package/dist/doc-schemas/ncii/removal.d.ts.map +1 -0
- package/dist/doc-schemas/ncii/removal.js +130 -0
- package/dist/doc-schemas/ncii/removal.js.map +1 -0
- package/dist/doc-schemas/ncii/requests.d.ts +372 -0
- package/dist/doc-schemas/ncii/requests.d.ts.map +1 -0
- package/dist/doc-schemas/ncii/requests.js +287 -0
- package/dist/doc-schemas/ncii/requests.js.map +1 -0
- package/dist/doc-schemas/ncii/scan.d.ts +59 -0
- package/dist/doc-schemas/ncii/scan.d.ts.map +1 -0
- package/dist/doc-schemas/ncii/scan.js +105 -0
- package/dist/doc-schemas/ncii/scan.js.map +1 -0
- package/dist/doc-schemas/notification-ledger.d.ts +1 -1
- package/dist/doc-schemas/payments.d.ts +2 -2
- package/dist/doc-schemas/registry.d.ts +1929 -96
- package/dist/doc-schemas/registry.d.ts.map +1 -1
- package/dist/doc-schemas/registry.js +86 -0
- package/dist/doc-schemas/registry.js.map +1 -1
- package/dist/doc-schemas/report-docs.d.ts +3 -3
- package/dist/doc-schemas/safety/age.d.ts +178 -0
- package/dist/doc-schemas/safety/age.d.ts.map +1 -0
- package/dist/doc-schemas/safety/age.js +222 -0
- package/dist/doc-schemas/safety/age.js.map +1 -0
- package/dist/doc-schemas/safety/case-aliases.d.ts +97 -0
- package/dist/doc-schemas/safety/case-aliases.d.ts.map +1 -0
- package/dist/doc-schemas/safety/case-aliases.js +110 -0
- package/dist/doc-schemas/safety/case-aliases.js.map +1 -0
- package/dist/doc-schemas/safety/case.d.ts +542 -0
- package/dist/doc-schemas/safety/case.d.ts.map +1 -0
- package/dist/doc-schemas/safety/case.js +339 -0
- package/dist/doc-schemas/safety/case.js.map +1 -0
- package/dist/doc-schemas/safety/evidence.d.ts +346 -0
- package/dist/doc-schemas/safety/evidence.d.ts.map +1 -0
- package/dist/doc-schemas/safety/evidence.js +273 -0
- package/dist/doc-schemas/safety/evidence.js.map +1 -0
- package/dist/doc-schemas/safety/foundation.d.ts +425 -0
- package/dist/doc-schemas/safety/foundation.d.ts.map +1 -0
- package/dist/doc-schemas/safety/foundation.js +349 -0
- package/dist/doc-schemas/safety/foundation.js.map +1 -0
- package/dist/doc-schemas/safety/holds.d.ts +152 -0
- package/dist/doc-schemas/safety/holds.d.ts.map +1 -0
- package/dist/doc-schemas/safety/holds.js +142 -0
- package/dist/doc-schemas/safety/holds.js.map +1 -0
- package/dist/doc-schemas/safety/monitors.d.ts +77 -0
- package/dist/doc-schemas/safety/monitors.d.ts.map +1 -0
- package/dist/doc-schemas/safety/monitors.js +87 -0
- package/dist/doc-schemas/safety/monitors.js.map +1 -0
- package/dist/doc-schemas/safety/provenance.d.ts +70 -0
- package/dist/doc-schemas/safety/provenance.d.ts.map +1 -0
- package/dist/doc-schemas/safety/provenance.js +76 -0
- package/dist/doc-schemas/safety/provenance.js.map +1 -0
- package/dist/doc-schemas/safety/report.d.ts +256 -0
- package/dist/doc-schemas/safety/report.d.ts.map +1 -0
- package/dist/doc-schemas/safety/report.js +116 -0
- package/dist/doc-schemas/safety/report.js.map +1 -0
- package/dist/doc-schemas/safety/sagas.d.ts +154 -0
- package/dist/doc-schemas/safety/sagas.d.ts.map +1 -0
- package/dist/doc-schemas/safety/sagas.js +162 -0
- package/dist/doc-schemas/safety/sagas.js.map +1 -0
- package/dist/doc-schemas/social.d.ts +3 -3
- package/dist/doc-schemas/user.d.ts +15 -0
- package/dist/doc-schemas/user.d.ts.map +1 -1
- package/dist/doc-schemas/user.js +9 -0
- package/dist/doc-schemas/user.js.map +1 -1
- package/dist/doc-schemas/work-project.d.ts +1 -1
- package/dist/media/atoms.d.ts +2 -2
- package/dist/media/domain-events-admin.d.ts +1 -1
- package/dist/media/domain-events.d.ts +1 -1
- package/dist/media/file-origin.d.ts +1 -1
- package/dist/media/index.d.ts +1 -0
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +1 -0
- package/dist/media/index.js.map +1 -1
- package/dist/media/pending-media.d.ts +25 -25
- package/dist/media/photodna-coverage.d.ts +46 -0
- package/dist/media/photodna-coverage.d.ts.map +1 -0
- package/dist/media/photodna-coverage.js +74 -0
- package/dist/media/photodna-coverage.js.map +1 -0
- package/dist/media/start-upload.d.ts +1 -1
- package/dist/media/target-info.d.ts +1 -1
- package/dist/paths/collections.d.ts +58 -0
- package/dist/paths/collections.d.ts.map +1 -1
- package/dist/paths/collections.js +77 -0
- package/dist/paths/collections.js.map +1 -1
- package/dist/paths/path-builders.d.ts +57 -0
- package/dist/paths/path-builders.d.ts.map +1 -1
- package/dist/paths/path-builders.js +75 -0
- package/dist/paths/path-builders.js.map +1 -1
- package/dist/schemas/social.d.ts +2 -2
- package/dist/types/audit.d.ts +1 -1
- package/dist/types/audit.d.ts.map +1 -1
- package/dist/upload-variables/square-streetz-post-variables.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type TakeItDownFieldCode, type TakeItDownRequesterRole } from '../safety/foundation.js';
|
|
3
|
+
export declare const TakeItDownRequestRootV1Schema: z.ZodObject<{
|
|
4
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
5
|
+
requestId: z.ZodString;
|
|
6
|
+
caseId: z.ZodOptional<z.ZodString>;
|
|
7
|
+
requesterRole: z.ZodEnum<{
|
|
8
|
+
depictedPerson: "depictedPerson";
|
|
9
|
+
authorizedRepresentative: "authorizedRepresentative";
|
|
10
|
+
}>;
|
|
11
|
+
targetLocatorSummary: z.ZodObject<{
|
|
12
|
+
kind: z.ZodEnum<{
|
|
13
|
+
username: "username";
|
|
14
|
+
audition: "audition";
|
|
15
|
+
mediaAsset: "mediaAsset";
|
|
16
|
+
hallItem: "hallItem";
|
|
17
|
+
squarePost: "squarePost";
|
|
18
|
+
profileImage: "profileImage";
|
|
19
|
+
craftSkill: "craftSkill";
|
|
20
|
+
commissionListing: "commissionListing";
|
|
21
|
+
auditionEntry: "auditionEntry";
|
|
22
|
+
guildInviteMessage: "guildInviteMessage";
|
|
23
|
+
chatAttachment: "chatAttachment";
|
|
24
|
+
url: "url";
|
|
25
|
+
additionalText: "additionalText";
|
|
26
|
+
}>;
|
|
27
|
+
surfaceLabel: z.ZodString;
|
|
28
|
+
hasResolvedTarget: z.ZodBoolean;
|
|
29
|
+
}, z.core.$strict>;
|
|
30
|
+
receivedAt: z.ZodNumber;
|
|
31
|
+
completenessStatus: z.ZodEnum<{
|
|
32
|
+
incomplete: "incomplete";
|
|
33
|
+
complete: "complete";
|
|
34
|
+
}>;
|
|
35
|
+
validityStatus: z.ZodEnum<{
|
|
36
|
+
pending: "pending";
|
|
37
|
+
valid: "valid";
|
|
38
|
+
invalid: "invalid";
|
|
39
|
+
unableToLocate: "unableToLocate";
|
|
40
|
+
}>;
|
|
41
|
+
invalidReasonCode: z.ZodOptional<z.ZodEnum<{
|
|
42
|
+
missingSignature: "missingSignature";
|
|
43
|
+
missingLocator: "missingLocator";
|
|
44
|
+
missingNonconsentStatement: "missingNonconsentStatement";
|
|
45
|
+
missingContactInformation: "missingContactInformation";
|
|
46
|
+
requesterNotDepictedPersonOrAuthorizedRepresentative: "requesterNotDepictedPersonOrAuthorizedRepresentative";
|
|
47
|
+
authorityNotEstablished: "authorityNotEstablished";
|
|
48
|
+
locatorNotResolvableAfterReasonableEffort: "locatorNotResolvableAfterReasonableEffort";
|
|
49
|
+
requestOutsideCoveredDepiction: "requestOutsideCoveredDepiction";
|
|
50
|
+
duplicateSuperseded: "duplicateSuperseded";
|
|
51
|
+
fraudulentOrBadFaith: "fraudulentOrBadFaith";
|
|
52
|
+
otherCounselApproved: "otherCounselApproved";
|
|
53
|
+
}>>;
|
|
54
|
+
completenessDeterminedAt: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
validityDeterminedAt: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
completedBySubmissionId: z.ZodOptional<z.ZodString>;
|
|
57
|
+
validRequestReceivedAt: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
removalDeadlineAt: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
publicStatus: z.ZodEnum<{
|
|
60
|
+
completed: "completed";
|
|
61
|
+
unableToLocate: "unableToLocate";
|
|
62
|
+
received: "received";
|
|
63
|
+
needsMoreInfo: "needsMoreInfo";
|
|
64
|
+
validInProgress: "validInProgress";
|
|
65
|
+
invalidGeneralReason: "invalidGeneralReason";
|
|
66
|
+
appealedCorrected: "appealedCorrected";
|
|
67
|
+
}>;
|
|
68
|
+
statusTokenHash: z.ZodString;
|
|
69
|
+
statusTokenVersion: z.ZodNumber;
|
|
70
|
+
statusTokenRevokedAt: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
statusTokenExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
requestClosedAt: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
removalCompletionAt: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
verifiedRemovalNoticeSentAt: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
appealWindowStartsAt: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
finalClosedAt: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
removalCompletionOutcome: z.ZodOptional<z.ZodEnum<{
|
|
78
|
+
completed: "completed";
|
|
79
|
+
completedWithApprovedException: "completedWithApprovedException";
|
|
80
|
+
unableToComplete: "unableToComplete";
|
|
81
|
+
}>>;
|
|
82
|
+
createdAt: z.ZodNumber;
|
|
83
|
+
updatedAt: z.ZodNumber;
|
|
84
|
+
}, z.core.$strict>;
|
|
85
|
+
export type TakeItDownRequestRootV1 = z.infer<typeof TakeItDownRequestRootV1Schema>;
|
|
86
|
+
/** electronicSignature.signatureMethod — typed vs drawn signature. */
|
|
87
|
+
export declare const TakeItDownSignatureMethodSchema: z.ZodEnum<{
|
|
88
|
+
typedName: "typedName";
|
|
89
|
+
drawnSignature: "drawnSignature";
|
|
90
|
+
}>;
|
|
91
|
+
export type TakeItDownSignatureMethod = z.infer<typeof TakeItDownSignatureMethodSchema>;
|
|
92
|
+
/** The statutory electronic signature block (embedded on the restricted subdoc). */
|
|
93
|
+
export declare const TakeItDownElectronicSignatureV1Schema: z.ZodObject<{
|
|
94
|
+
signedName: z.ZodString;
|
|
95
|
+
signedAt: z.ZodNumber;
|
|
96
|
+
signatureMethod: z.ZodEnum<{
|
|
97
|
+
typedName: "typedName";
|
|
98
|
+
drawnSignature: "drawnSignature";
|
|
99
|
+
}>;
|
|
100
|
+
}, z.core.$strict>;
|
|
101
|
+
export type TakeItDownElectronicSignatureV1 = z.infer<typeof TakeItDownElectronicSignatureV1Schema>;
|
|
102
|
+
/** The authorized-representative block — present only for an
|
|
103
|
+
* `authorizedRepresentative` requester. */
|
|
104
|
+
export declare const TakeItDownAuthorizedRepresentativeV1Schema: z.ZodObject<{
|
|
105
|
+
representedPersonName: z.ZodString;
|
|
106
|
+
authorityBasis: z.ZodString;
|
|
107
|
+
authorityEvidenceRef: z.ZodOptional<z.ZodString>;
|
|
108
|
+
}, z.core.$strict>;
|
|
109
|
+
export type TakeItDownAuthorizedRepresentativeV1 = z.infer<typeof TakeItDownAuthorizedRepresentativeV1Schema>;
|
|
110
|
+
/** `takeItDownRequests/{requestId}/private/requester` = TakeItDownRequesterPrivateV1.
|
|
111
|
+
* RESTRICTED — nciiRequestReviewer / nciiEvidenceReviewer only. Fixed doc id
|
|
112
|
+
* `requester`. */
|
|
113
|
+
export declare const TakeItDownRequesterPrivateV1Schema: z.ZodObject<{
|
|
114
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
115
|
+
requesterName: z.ZodString;
|
|
116
|
+
contactEmail: z.ZodString;
|
|
117
|
+
contactPhone: z.ZodOptional<z.ZodString>;
|
|
118
|
+
electronicSignature: z.ZodObject<{
|
|
119
|
+
signedName: z.ZodString;
|
|
120
|
+
signedAt: z.ZodNumber;
|
|
121
|
+
signatureMethod: z.ZodEnum<{
|
|
122
|
+
typedName: "typedName";
|
|
123
|
+
drawnSignature: "drawnSignature";
|
|
124
|
+
}>;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
authorizedRepresentative: z.ZodOptional<z.ZodObject<{
|
|
127
|
+
representedPersonName: z.ZodString;
|
|
128
|
+
authorityBasis: z.ZodString;
|
|
129
|
+
authorityEvidenceRef: z.ZodOptional<z.ZodString>;
|
|
130
|
+
}, z.core.$strict>>;
|
|
131
|
+
nonconsentStatement: z.ZodString;
|
|
132
|
+
supportingFacts: z.ZodString;
|
|
133
|
+
goodFaithCertification: z.ZodBoolean;
|
|
134
|
+
accuracyCertification: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
authorityCertification: z.ZodOptional<z.ZodBoolean>;
|
|
136
|
+
createdAt: z.ZodNumber;
|
|
137
|
+
updatedAt: z.ZodNumber;
|
|
138
|
+
}, z.core.$strict>;
|
|
139
|
+
export type TakeItDownRequesterPrivateV1 = z.infer<typeof TakeItDownRequesterPrivateV1Schema>;
|
|
140
|
+
/** Who created a submission. */
|
|
141
|
+
export declare const TakeItDownSubmissionCreatedBySchema: z.ZodEnum<{
|
|
142
|
+
system: "system";
|
|
143
|
+
requester: "requester";
|
|
144
|
+
operator: "operator";
|
|
145
|
+
}>;
|
|
146
|
+
export type TakeItDownSubmissionCreatedBy = z.infer<typeof TakeItDownSubmissionCreatedBySchema>;
|
|
147
|
+
/** `takeItDownRequests/{requestId}/submissions/{submissionId}` = TakeItDownSubmissionV1
|
|
148
|
+
* — IMMUTABLE append-only. Doc id `submissionId` is a deterministic/assigned id. */
|
|
149
|
+
export declare const TakeItDownSubmissionV1Schema: z.ZodObject<{
|
|
150
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
151
|
+
submissionId: z.ZodString;
|
|
152
|
+
sequence: z.ZodNumber;
|
|
153
|
+
receivedAt: z.ZodNumber;
|
|
154
|
+
suppliedFieldCodes: z.ZodArray<z.ZodEnum<{
|
|
155
|
+
requesterName: "requesterName";
|
|
156
|
+
contactEmail: "contactEmail";
|
|
157
|
+
contactPhone: "contactPhone";
|
|
158
|
+
requesterRole: "requesterRole";
|
|
159
|
+
electronicSignature: "electronicSignature";
|
|
160
|
+
authorityBasis: "authorityBasis";
|
|
161
|
+
authorityEvidence: "authorityEvidence";
|
|
162
|
+
targetLocator: "targetLocator";
|
|
163
|
+
nonconsentStatement: "nonconsentStatement";
|
|
164
|
+
supportingFacts: "supportingFacts";
|
|
165
|
+
goodFaithCertification: "goodFaithCertification";
|
|
166
|
+
}>>;
|
|
167
|
+
evidenceIds: z.ZodArray<z.ZodString>;
|
|
168
|
+
cumulativeRequestSnapshotHash: z.ZodString;
|
|
169
|
+
cumulativeCompleteness: z.ZodEnum<{
|
|
170
|
+
incomplete: "incomplete";
|
|
171
|
+
complete: "complete";
|
|
172
|
+
}>;
|
|
173
|
+
firstCompletedRequest: z.ZodBoolean;
|
|
174
|
+
supersedesSubmissionId: z.ZodOptional<z.ZodString>;
|
|
175
|
+
createdBy: z.ZodEnum<{
|
|
176
|
+
system: "system";
|
|
177
|
+
requester: "requester";
|
|
178
|
+
operator: "operator";
|
|
179
|
+
}>;
|
|
180
|
+
}, z.core.$strict>;
|
|
181
|
+
export type TakeItDownSubmissionV1 = z.infer<typeof TakeItDownSubmissionV1Schema>;
|
|
182
|
+
/** The validity-decision result. `incomplete` is a COMPLETENESS state, NEVER a
|
|
183
|
+
* validity result. */
|
|
184
|
+
export declare const TakeItDownValidityDecisionResultSchema: z.ZodEnum<{
|
|
185
|
+
valid: "valid";
|
|
186
|
+
invalid: "invalid";
|
|
187
|
+
unableToLocate: "unableToLocate";
|
|
188
|
+
}>;
|
|
189
|
+
export type TakeItDownValidityDecisionResult = z.infer<typeof TakeItDownValidityDecisionResultSchema>;
|
|
190
|
+
/** `takeItDownRequests/{requestId}/validityDecisions/{decisionId}` =
|
|
191
|
+
* TakeItDownValidityDecisionV1 — IMMUTABLE append-only. Doc id `decisionId` is a
|
|
192
|
+
* deterministic/assigned id. */
|
|
193
|
+
export declare const TakeItDownValidityDecisionV1Schema: z.ZodObject<{
|
|
194
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
195
|
+
decisionId: z.ZodString;
|
|
196
|
+
requestId: z.ZodString;
|
|
197
|
+
result: z.ZodEnum<{
|
|
198
|
+
valid: "valid";
|
|
199
|
+
invalid: "invalid";
|
|
200
|
+
unableToLocate: "unableToLocate";
|
|
201
|
+
}>;
|
|
202
|
+
basisSubmissionIds: z.ZodArray<z.ZodString>;
|
|
203
|
+
validFromSubmissionId: z.ZodOptional<z.ZodString>;
|
|
204
|
+
validRequestReceivedAt: z.ZodOptional<z.ZodNumber>;
|
|
205
|
+
reasonCode: z.ZodOptional<z.ZodEnum<{
|
|
206
|
+
missingSignature: "missingSignature";
|
|
207
|
+
missingLocator: "missingLocator";
|
|
208
|
+
missingNonconsentStatement: "missingNonconsentStatement";
|
|
209
|
+
missingContactInformation: "missingContactInformation";
|
|
210
|
+
requesterNotDepictedPersonOrAuthorizedRepresentative: "requesterNotDepictedPersonOrAuthorizedRepresentative";
|
|
211
|
+
authorityNotEstablished: "authorityNotEstablished";
|
|
212
|
+
locatorNotResolvableAfterReasonableEffort: "locatorNotResolvableAfterReasonableEffort";
|
|
213
|
+
requestOutsideCoveredDepiction: "requestOutsideCoveredDepiction";
|
|
214
|
+
duplicateSuperseded: "duplicateSuperseded";
|
|
215
|
+
fraudulentOrBadFaith: "fraudulentOrBadFaith";
|
|
216
|
+
otherCounselApproved: "otherCounselApproved";
|
|
217
|
+
}>>;
|
|
218
|
+
rationaleRef: z.ZodString;
|
|
219
|
+
decidedByUid: z.ZodString;
|
|
220
|
+
decidedAt: z.ZodNumber;
|
|
221
|
+
}, z.core.$strict>;
|
|
222
|
+
export type TakeItDownValidityDecisionV1 = z.infer<typeof TakeItDownValidityDecisionV1Schema>;
|
|
223
|
+
/** `takeItDownRequests/{requestId}/actions/{actionId}` — the [L1] closed-enum +
|
|
224
|
+
* detailRef row. Doc id `actionId` is a deterministic/assigned id. */
|
|
225
|
+
export declare const TakeItDownRequestActionV1Schema: z.ZodObject<{
|
|
226
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
227
|
+
actionId: z.ZodString;
|
|
228
|
+
at: z.ZodNumber;
|
|
229
|
+
actorId: z.ZodString;
|
|
230
|
+
capability: z.ZodEnum<{
|
|
231
|
+
nciiRequestReviewer: "nciiRequestReviewer";
|
|
232
|
+
nciiEvidenceReviewer: "nciiEvidenceReviewer";
|
|
233
|
+
nciiAppealReviewer: "nciiAppealReviewer";
|
|
234
|
+
childSafetyReviewer: "childSafetyReviewer";
|
|
235
|
+
legalDispositionAuthority: "legalDispositionAuthority";
|
|
236
|
+
}>;
|
|
237
|
+
actionType: z.ZodEnum<{
|
|
238
|
+
intakeReceived: "intakeReceived";
|
|
239
|
+
completenessDecided: "completenessDecided";
|
|
240
|
+
validityDecided: "validityDecided";
|
|
241
|
+
tempHoldPlaced: "tempHoldPlaced";
|
|
242
|
+
tempHoldReleased: "tempHoldReleased";
|
|
243
|
+
removalStarted: "removalStarted";
|
|
244
|
+
removalCompleted: "removalCompleted";
|
|
245
|
+
uploaderNoticeSent: "uploaderNoticeSent";
|
|
246
|
+
uploaderNoticeDelayed: "uploaderNoticeDelayed";
|
|
247
|
+
uploaderNoticeNotApplicable: "uploaderNoticeNotApplicable";
|
|
248
|
+
uploaderNoticeSuppressed: "uploaderNoticeSuppressed";
|
|
249
|
+
appealReceived: "appealReceived";
|
|
250
|
+
appealDecided: "appealDecided";
|
|
251
|
+
contentReinstated: "contentReinstated";
|
|
252
|
+
hashBlockReversed: "hashBlockReversed";
|
|
253
|
+
childSafetyCaseLinked: "childSafetyCaseLinked";
|
|
254
|
+
legalDispositionRecorded: "legalDispositionRecorded";
|
|
255
|
+
}>;
|
|
256
|
+
result: z.ZodEnum<{
|
|
257
|
+
succeeded: "succeeded";
|
|
258
|
+
failed: "failed";
|
|
259
|
+
deferred: "deferred";
|
|
260
|
+
rejected: "rejected";
|
|
261
|
+
}>;
|
|
262
|
+
summary: z.ZodString;
|
|
263
|
+
detailRef: z.ZodString;
|
|
264
|
+
}, z.core.$strict>;
|
|
265
|
+
export type TakeItDownRequestActionV1 = z.infer<typeof TakeItDownRequestActionV1Schema>;
|
|
266
|
+
/** The public status page's `nextAction` hint. */
|
|
267
|
+
export declare const TakeItDownPublicNextActionSchema: z.ZodEnum<{
|
|
268
|
+
none: "none";
|
|
269
|
+
submitSupplement: "submitSupplement";
|
|
270
|
+
checkLater: "checkLater";
|
|
271
|
+
appealAvailable: "appealAvailable";
|
|
272
|
+
}>;
|
|
273
|
+
export type TakeItDownPublicNextAction = z.infer<typeof TakeItDownPublicNextActionSchema>;
|
|
274
|
+
/** `takeItDownRequests/{requestId}/statusProjection/current` =
|
|
275
|
+
* TakeItDownPublicStatusV1. Fixed doc id `current`. */
|
|
276
|
+
export declare const TakeItDownPublicStatusV1Schema: z.ZodObject<{
|
|
277
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
278
|
+
requestReference: z.ZodString;
|
|
279
|
+
publicStatus: z.ZodEnum<{
|
|
280
|
+
completed: "completed";
|
|
281
|
+
unableToLocate: "unableToLocate";
|
|
282
|
+
received: "received";
|
|
283
|
+
needsMoreInfo: "needsMoreInfo";
|
|
284
|
+
validInProgress: "validInProgress";
|
|
285
|
+
invalidGeneralReason: "invalidGeneralReason";
|
|
286
|
+
appealedCorrected: "appealedCorrected";
|
|
287
|
+
}>;
|
|
288
|
+
publicReasonCode: z.ZodOptional<z.ZodEnum<{
|
|
289
|
+
needMoreInformation: "needMoreInformation";
|
|
290
|
+
couldNotVerifyRequesterRole: "couldNotVerifyRequesterRole";
|
|
291
|
+
couldNotLocateContent: "couldNotLocateContent";
|
|
292
|
+
outsideCoveredScope: "outsideCoveredScope";
|
|
293
|
+
duplicateOfExistingRequest: "duplicateOfExistingRequest";
|
|
294
|
+
removedSuccessfully: "removedSuccessfully";
|
|
295
|
+
underReview: "underReview";
|
|
296
|
+
closedSeeNotice: "closedSeeNotice";
|
|
297
|
+
}>>;
|
|
298
|
+
missingFieldCodes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
299
|
+
requesterName: "requesterName";
|
|
300
|
+
contactEmail: "contactEmail";
|
|
301
|
+
contactPhone: "contactPhone";
|
|
302
|
+
requesterRole: "requesterRole";
|
|
303
|
+
electronicSignature: "electronicSignature";
|
|
304
|
+
authorityBasis: "authorityBasis";
|
|
305
|
+
authorityEvidence: "authorityEvidence";
|
|
306
|
+
targetLocator: "targetLocator";
|
|
307
|
+
nonconsentStatement: "nonconsentStatement";
|
|
308
|
+
supportingFacts: "supportingFacts";
|
|
309
|
+
goodFaithCertification: "goodFaithCertification";
|
|
310
|
+
}>>>;
|
|
311
|
+
nextAction: z.ZodOptional<z.ZodEnum<{
|
|
312
|
+
none: "none";
|
|
313
|
+
submitSupplement: "submitSupplement";
|
|
314
|
+
checkLater: "checkLater";
|
|
315
|
+
appealAvailable: "appealAvailable";
|
|
316
|
+
}>>;
|
|
317
|
+
removalDeadlineAt: z.ZodOptional<z.ZodNumber>;
|
|
318
|
+
updatedAt: z.ZodNumber;
|
|
319
|
+
}, z.core.$strict>;
|
|
320
|
+
export type TakeItDownPublicStatusV1 = z.infer<typeof TakeItDownPublicStatusV1Schema>;
|
|
321
|
+
/** `takeItDownRequests/{requestId}/evidence/{evidenceId}` — the [F10] public
|
|
322
|
+
* evidence-upload record. Doc id `evidenceId` is a deterministic/assigned id.
|
|
323
|
+
* INVARIANT: this record NEVER sets `originatingUploaderUid` — enforcement / NCMEC
|
|
324
|
+
* attribution targets the ORIGINAL content's originatingUploaderUid (perpetrator)
|
|
325
|
+
* via MediaOriginLineageV1 (a correlation, not a merge). */
|
|
326
|
+
export declare const TakeItDownEvidenceV1Schema: z.ZodObject<{
|
|
327
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
328
|
+
evidenceId: z.ZodString;
|
|
329
|
+
requestId: z.ZodString;
|
|
330
|
+
uploadContext: z.ZodLiteral<"takeItDownEvidence">;
|
|
331
|
+
submitterUid: z.ZodOptional<z.ZodString>;
|
|
332
|
+
bucket: z.ZodString;
|
|
333
|
+
key: z.ZodString;
|
|
334
|
+
generation: z.ZodString;
|
|
335
|
+
contentType: z.ZodString;
|
|
336
|
+
sizeBytes: z.ZodNumber;
|
|
337
|
+
sha256: z.ZodString;
|
|
338
|
+
md5: z.ZodString;
|
|
339
|
+
capturedAt: z.ZodNumber;
|
|
340
|
+
createdAt: z.ZodNumber;
|
|
341
|
+
}, z.core.$strict>;
|
|
342
|
+
export type TakeItDownEvidenceV1 = z.infer<typeof TakeItDownEvidenceV1Schema>;
|
|
343
|
+
/** [C-02] Required field codes for a `depictedPerson` request (counsel-ratified). */
|
|
344
|
+
export declare const REQUIRED_FIELD_CODES_DEPICTED_PERSON: readonly ["requesterName", "requesterRole", "electronicSignature", "targetLocator", "nonconsentStatement", "goodFaithCertification"];
|
|
345
|
+
/** [C-02] Required field codes for an `authorizedRepresentative` request =
|
|
346
|
+
* depicted-person set ∪ { authorityBasis, authorityEvidence } (counsel-ratified). */
|
|
347
|
+
export declare const REQUIRED_FIELD_CODES_AUTHORIZED_REPRESENTATIVE: readonly ["requesterName", "requesterRole", "electronicSignature", "targetLocator", "nonconsentStatement", "goodFaithCertification", "authorityBasis", "authorityEvidence"];
|
|
348
|
+
/** [C-02] The contact one-of: at least ONE of these must be present (neither is
|
|
349
|
+
* individually required; either alone satisfies it). */
|
|
350
|
+
export declare const CONTACT_ONE_OF_FIELD_CODES: readonly ["contactEmail", "contactPhone"];
|
|
351
|
+
/** [C-02] `requiredFieldCodes(requesterRole)` — the counsel-ratified required set.
|
|
352
|
+
* `supportingFacts` is collected but is NOT a completeness gate; `contactEmail` /
|
|
353
|
+
* `contactPhone` are governed by the contact one-of (see CONTACT_ONE_OF_FIELD_CODES),
|
|
354
|
+
* never individually required. The implementer uses EXACTLY this set and never
|
|
355
|
+
* hard-requires `contactPhone` or the authorizedRepresentative block on a
|
|
356
|
+
* depicted-person request. */
|
|
357
|
+
export declare function requiredFieldCodes(requesterRole: TakeItDownRequesterRole): readonly TakeItDownFieldCode[];
|
|
358
|
+
/** [C-02] `computeCompleteness` — returns `complete` iff every code in
|
|
359
|
+
* `requiredFieldCodes(requesterRole)` is supplied AND the contact one-of holds;
|
|
360
|
+
* otherwise `incomplete` with the missing codes surfaced (those become
|
|
361
|
+
* `TakeItDownPublicStatusV1.missingFieldCodes`). The missing-set lists the role's
|
|
362
|
+
* unmet required codes, plus a `contactEmail`/`contactPhone` representative for an
|
|
363
|
+
* unmet contact one-of (the implementer/UI decides which contact code to surface;
|
|
364
|
+
* here we surface `contactEmail` as the canonical missing-contact marker). */
|
|
365
|
+
export declare function computeCompleteness(input: {
|
|
366
|
+
requesterRole: TakeItDownRequesterRole;
|
|
367
|
+
suppliedFieldCodes: readonly TakeItDownFieldCode[];
|
|
368
|
+
}): {
|
|
369
|
+
status: 'incomplete' | 'complete';
|
|
370
|
+
missingFieldCodes: TakeItDownFieldCode[];
|
|
371
|
+
};
|
|
372
|
+
//# sourceMappingURL=requests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/ncii/requests.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
// Trust & Safety — NCII statutory TAKE IT DOWN requests (Appendix A §A11, concept
|
|
2
|
+
// (2)) — the SPLIT model: a PII-free root + a restricted requester-PII subdoc +
|
|
3
|
+
// immutable submissions/validityDecisions + operator actions + a public-safe
|
|
4
|
+
// status projection + isolated public evidence uploads.
|
|
5
|
+
//
|
|
6
|
+
// Only a COMPLETE + VALID request can arm the 48h clock. The public no-login form
|
|
7
|
+
// CANNOT submit a "valid request" without the required fields; validation
|
|
8
|
+
// failures use the enumerated TakeItDownInvalidReasonCode. The root holds NO
|
|
9
|
+
// requester PII / narrative / signature / authority — those live in the restricted
|
|
10
|
+
// `/private/requester` subdoc. Status is shown publicly via an unguessable
|
|
11
|
+
// status-token hash (rotatable + revocable) + a public-safe projection — never via
|
|
12
|
+
// the root or any queue projection.
|
|
13
|
+
//
|
|
14
|
+
// Every shape here is transcribed verbatim from docs/code_changes_needed/
|
|
15
|
+
// trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A11 (2) + [C-02] + [F7] +
|
|
16
|
+
// [F10] — no invented values, no placeholders.
|
|
17
|
+
//
|
|
18
|
+
// SHARED enums + locator types come from ../safety/foundation.js (the single
|
|
19
|
+
// source for every cross-cluster enum); they are NEVER redefined here. This
|
|
20
|
+
// cluster IMPORTS TakeItDownRequesterRoleSchema, TargetLocatorSummaryV1Schema,
|
|
21
|
+
// TakeItDownCompletenessStatusSchema, TakeItDownValidityStatusSchema,
|
|
22
|
+
// TakeItDownInvalidReasonCodeSchema, TakeItDownPublicStatusSchema,
|
|
23
|
+
// NciiRemovalCompletionOutcomeSchema, NciiActionTypeSchema, NciiActionResultSchema,
|
|
24
|
+
// TakeItDownFieldCodeSchema, TakeItDownPublicReasonCodeSchema, and
|
|
25
|
+
// SafetyReviewerCapabilitySchema.
|
|
26
|
+
//
|
|
27
|
+
// Collection note: this cluster introduces a NEW Firestore collection plus several
|
|
28
|
+
// subcollections (private/requester, submissions, validityDecisions, actions,
|
|
29
|
+
// statusProjection/current, evidence). Wiring collections.ts / path-builders.ts /
|
|
30
|
+
// registry.ts is deferred to the app leg (the orchestrator binds the schemas +
|
|
31
|
+
// path builders there); the doc-id shapes (including the deterministic intake
|
|
32
|
+
// requestId [H-07]) are documented on each schema below.
|
|
33
|
+
import { z } from 'zod';
|
|
34
|
+
import { TakeItDownRequesterRoleSchema, TargetLocatorSummaryV1Schema, TakeItDownCompletenessStatusSchema, TakeItDownValidityStatusSchema, TakeItDownInvalidReasonCodeSchema, TakeItDownPublicStatusSchema, NciiRemovalCompletionOutcomeSchema, NciiActionTypeSchema, NciiActionResultSchema, TakeItDownFieldCodeSchema, TakeItDownPublicReasonCodeSchema, SafetyReviewerCapabilitySchema, } from '../safety/foundation.js';
|
|
35
|
+
// ===========================================================================
|
|
36
|
+
// §A11 (2) [H1] — ROOT takeItDownRequests/{requestId} = TakeItDownRequestRootV1
|
|
37
|
+
// (NO requester PII / narrative / signature / authority). [H-07] the intake
|
|
38
|
+
// `requestId` is the deterministic sha256('takeItDownRequest:v1:' +
|
|
39
|
+
// idempotencyKey + ':' + normalizedTargetKey) so retries resolve to one doc.
|
|
40
|
+
// ===========================================================================
|
|
41
|
+
export const TakeItDownRequestRootV1Schema = z.object({
|
|
42
|
+
schemaVersion: z.literal(1),
|
|
43
|
+
requestId: z.string().min(1),
|
|
44
|
+
caseId: z.string().min(1).optional(),
|
|
45
|
+
requesterRole: TakeItDownRequesterRoleSchema,
|
|
46
|
+
// privacy-safe summary ONLY — never the narrative
|
|
47
|
+
targetLocatorSummary: TargetLocatorSummaryV1Schema,
|
|
48
|
+
receivedAt: z.number(),
|
|
49
|
+
completenessStatus: TakeItDownCompletenessStatusSchema, // 'incomplete' | 'complete'
|
|
50
|
+
validityStatus: TakeItDownValidityStatusSchema, // 'pending' | 'valid' | 'invalid' | 'unableToLocate'
|
|
51
|
+
invalidReasonCode: TakeItDownInvalidReasonCodeSchema.optional(),
|
|
52
|
+
completenessDeterminedAt: z.number().optional(),
|
|
53
|
+
validityDeterminedAt: z.number().optional(),
|
|
54
|
+
completedBySubmissionId: z.string().min(1).optional(), // which immutable submission completed the request
|
|
55
|
+
validRequestReceivedAt: z.number().optional(), // [F3] EARLIEST complete+valid receipt — pins the clock
|
|
56
|
+
removalDeadlineAt: z.number().optional(), // = validRequestReceivedAt + 48h (non-authoritative projection; [H4])
|
|
57
|
+
publicStatus: TakeItDownPublicStatusSchema,
|
|
58
|
+
statusTokenHash: z.string().min(1), // sha256(token) ONLY — the raw token is never stored
|
|
59
|
+
statusTokenVersion: z.number(), // rotation
|
|
60
|
+
statusTokenRevokedAt: z.number().optional(), // revocation
|
|
61
|
+
statusTokenExpiresAt: z.number().optional(), // [M3] expires from FINAL request closure (statusTokenRetentionDays)
|
|
62
|
+
requestClosedAt: z.number().optional(), // when the request reached a terminal disposition
|
|
63
|
+
removalCompletionAt: z.number().optional(), // [M-01] set when removal verified-completes
|
|
64
|
+
verifiedRemovalNoticeSentAt: z.number().optional(), // [M-01] set when uploader removal notice verifiably sent; ABSENT when suppressed
|
|
65
|
+
appealWindowStartsAt: z.number().optional(), // [M-01] DETERMINISTIC formula in the M3 retention section
|
|
66
|
+
finalClosedAt: z.number().optional(), // [H-08] = appealWindowStartsAt + appealWindowDays; arms for EVERY terminal disposition
|
|
67
|
+
removalCompletionOutcome: NciiRemovalCompletionOutcomeSchema.optional(), // [H4] honest derived completion — NEVER 'completed' for a partial technical failure
|
|
68
|
+
createdAt: z.number(),
|
|
69
|
+
updatedAt: z.number(),
|
|
70
|
+
}).strict();
|
|
71
|
+
// ===========================================================================
|
|
72
|
+
// §A11 (2) [H1] / [F7] — RESTRICTED takeItDownRequests/{requestId}/private/requester
|
|
73
|
+
// = TakeItDownRequesterPrivateV1 (nciiRequestReviewer / nciiEvidenceReviewer only).
|
|
74
|
+
// Holds signature, full contact, narrative, certifications.
|
|
75
|
+
// ===========================================================================
|
|
76
|
+
/** electronicSignature.signatureMethod — typed vs drawn signature. */
|
|
77
|
+
export const TakeItDownSignatureMethodSchema = z.enum(['typedName', 'drawnSignature']);
|
|
78
|
+
/** The statutory electronic signature block (embedded on the restricted subdoc). */
|
|
79
|
+
export const TakeItDownElectronicSignatureV1Schema = z.object({
|
|
80
|
+
signedName: z.string(),
|
|
81
|
+
signedAt: z.number(),
|
|
82
|
+
signatureMethod: TakeItDownSignatureMethodSchema,
|
|
83
|
+
}).strict();
|
|
84
|
+
/** The authorized-representative block — present only for an
|
|
85
|
+
* `authorizedRepresentative` requester. */
|
|
86
|
+
export const TakeItDownAuthorizedRepresentativeV1Schema = z.object({
|
|
87
|
+
representedPersonName: z.string(),
|
|
88
|
+
authorityBasis: z.string(),
|
|
89
|
+
authorityEvidenceRef: z.string().min(1).optional(),
|
|
90
|
+
}).strict();
|
|
91
|
+
/** `takeItDownRequests/{requestId}/private/requester` = TakeItDownRequesterPrivateV1.
|
|
92
|
+
* RESTRICTED — nciiRequestReviewer / nciiEvidenceReviewer only. Fixed doc id
|
|
93
|
+
* `requester`. */
|
|
94
|
+
export const TakeItDownRequesterPrivateV1Schema = z.object({
|
|
95
|
+
schemaVersion: z.literal(1),
|
|
96
|
+
requesterName: z.string(),
|
|
97
|
+
contactEmail: z.string(),
|
|
98
|
+
contactPhone: z.string().optional(),
|
|
99
|
+
electronicSignature: TakeItDownElectronicSignatureV1Schema,
|
|
100
|
+
authorizedRepresentative: TakeItDownAuthorizedRepresentativeV1Schema.optional(),
|
|
101
|
+
nonconsentStatement: z.string(), // the statutory non-consent statement
|
|
102
|
+
supportingFacts: z.string(),
|
|
103
|
+
goodFaithCertification: z.boolean(),
|
|
104
|
+
accuracyCertification: z.boolean().optional(), // [H2] NOT a hard validity gate by default — counsel decides
|
|
105
|
+
authorityCertification: z.boolean().optional(), // [H2] NOT a hard validity gate by default — counsel decides
|
|
106
|
+
createdAt: z.number(),
|
|
107
|
+
updatedAt: z.number(),
|
|
108
|
+
}).strict();
|
|
109
|
+
// ===========================================================================
|
|
110
|
+
// §A11 (2) [H1] — IMMUTABLE takeItDownRequests/{requestId}/submissions/{submissionId}
|
|
111
|
+
// = TakeItDownSubmissionV1 (append-only; the earliest complete receipt is
|
|
112
|
+
// reconstructed from these, never from the mutable root).
|
|
113
|
+
// ===========================================================================
|
|
114
|
+
/** Who created a submission. */
|
|
115
|
+
export const TakeItDownSubmissionCreatedBySchema = z.enum(['requester', 'operator', 'system']);
|
|
116
|
+
/** `takeItDownRequests/{requestId}/submissions/{submissionId}` = TakeItDownSubmissionV1
|
|
117
|
+
* — IMMUTABLE append-only. Doc id `submissionId` is a deterministic/assigned id. */
|
|
118
|
+
export const TakeItDownSubmissionV1Schema = z.object({
|
|
119
|
+
schemaVersion: z.literal(1),
|
|
120
|
+
submissionId: z.string().min(1),
|
|
121
|
+
sequence: z.number(), // monotonic per request — append order
|
|
122
|
+
receivedAt: z.number(), // the immutable statutory receipt time of THIS submission
|
|
123
|
+
suppliedFieldCodes: z.array(TakeItDownFieldCodeSchema).max(16),
|
|
124
|
+
evidenceIds: z.array(z.string().min(1)).max(16),
|
|
125
|
+
cumulativeRequestSnapshotHash: z.string(), // hash of the cumulative request state as of this submission
|
|
126
|
+
cumulativeCompleteness: TakeItDownCompletenessStatusSchema, // 'incomplete' | 'complete'
|
|
127
|
+
firstCompletedRequest: z.boolean(), // true on the submission whose cumulative state FIRST became complete
|
|
128
|
+
supersedesSubmissionId: z.string().min(1).optional(),
|
|
129
|
+
createdBy: TakeItDownSubmissionCreatedBySchema,
|
|
130
|
+
}).strict();
|
|
131
|
+
// ===========================================================================
|
|
132
|
+
// §A11 (2) [H2] — IMMUTABLE takeItDownRequests/{requestId}/validityDecisions/{decisionId}
|
|
133
|
+
// = TakeItDownValidityDecisionV1 (append-only; the authoritative validity ruling —
|
|
134
|
+
// the root `validityStatus` is its projection). `incomplete` is NEVER a validity
|
|
135
|
+
// result.
|
|
136
|
+
// ===========================================================================
|
|
137
|
+
/** The validity-decision result. `incomplete` is a COMPLETENESS state, NEVER a
|
|
138
|
+
* validity result. */
|
|
139
|
+
export const TakeItDownValidityDecisionResultSchema = z.enum(['valid', 'invalid', 'unableToLocate']);
|
|
140
|
+
/** `takeItDownRequests/{requestId}/validityDecisions/{decisionId}` =
|
|
141
|
+
* TakeItDownValidityDecisionV1 — IMMUTABLE append-only. Doc id `decisionId` is a
|
|
142
|
+
* deterministic/assigned id. */
|
|
143
|
+
export const TakeItDownValidityDecisionV1Schema = z.object({
|
|
144
|
+
schemaVersion: z.literal(1),
|
|
145
|
+
decisionId: z.string().min(1),
|
|
146
|
+
requestId: z.string().min(1),
|
|
147
|
+
result: TakeItDownValidityDecisionResultSchema,
|
|
148
|
+
basisSubmissionIds: z.array(z.string().min(1)).max(16), // the submissions the decision relied on
|
|
149
|
+
validFromSubmissionId: z.string().min(1).optional(), // the EARLIEST submission whose cumulative snapshot satisfies the valid decision
|
|
150
|
+
validRequestReceivedAt: z.number().optional(), // = that submission's immutable receivedAt (the binding statutory time)
|
|
151
|
+
reasonCode: TakeItDownInvalidReasonCodeSchema.optional(),
|
|
152
|
+
rationaleRef: z.string(), // pointer to a restricted rationale row
|
|
153
|
+
decidedByUid: z.string().min(1),
|
|
154
|
+
decidedAt: z.number(),
|
|
155
|
+
}).strict();
|
|
156
|
+
// ===========================================================================
|
|
157
|
+
// §A11 (2) [L1] — takeItDownRequests/{requestId}/actions/{actionId} = the request
|
|
158
|
+
// action row (CLOSED enums + a detailRef to a RESTRICTED row, never an inline
|
|
159
|
+
// rationale blob).
|
|
160
|
+
// ===========================================================================
|
|
161
|
+
/** `takeItDownRequests/{requestId}/actions/{actionId}` — the [L1] closed-enum +
|
|
162
|
+
* detailRef row. Doc id `actionId` is a deterministic/assigned id. */
|
|
163
|
+
export const TakeItDownRequestActionV1Schema = z.object({
|
|
164
|
+
schemaVersion: z.literal(1),
|
|
165
|
+
actionId: z.string().min(1),
|
|
166
|
+
at: z.number(),
|
|
167
|
+
actorId: z.string().min(1),
|
|
168
|
+
capability: SafetyReviewerCapabilitySchema, // = the §[M4] matrix capability used
|
|
169
|
+
actionType: NciiActionTypeSchema,
|
|
170
|
+
result: NciiActionResultSchema,
|
|
171
|
+
summary: z.string().max(280), // BOUNDED ≤ 280 chars, non-sensitive
|
|
172
|
+
detailRef: z.string().min(1), // pointer to a RESTRICTED detail row holding any sensitive rationale
|
|
173
|
+
}).strict();
|
|
174
|
+
// ===========================================================================
|
|
175
|
+
// §A11 (2) [H3] — takeItDownRequests/{requestId}/statusProjection/current =
|
|
176
|
+
// TakeItDownPublicStatusV1 (public-safe ONLY — the single row the no-login status
|
|
177
|
+
// page reads). Routed on the OPAQUE requestReference, never the raw requestId.
|
|
178
|
+
// ===========================================================================
|
|
179
|
+
/** The public status page's `nextAction` hint. */
|
|
180
|
+
export const TakeItDownPublicNextActionSchema = z.enum([
|
|
181
|
+
'none',
|
|
182
|
+
'submitSupplement',
|
|
183
|
+
'checkLater',
|
|
184
|
+
'appealAvailable',
|
|
185
|
+
]);
|
|
186
|
+
/** `takeItDownRequests/{requestId}/statusProjection/current` =
|
|
187
|
+
* TakeItDownPublicStatusV1. Fixed doc id `current`. */
|
|
188
|
+
export const TakeItDownPublicStatusV1Schema = z.object({
|
|
189
|
+
schemaVersion: z.literal(1),
|
|
190
|
+
requestReference: z.string().min(1), // opaque public reference (NOT the requestId, NOT PII)
|
|
191
|
+
publicStatus: TakeItDownPublicStatusSchema,
|
|
192
|
+
publicReasonCode: TakeItDownPublicReasonCodeSchema.optional(),
|
|
193
|
+
missingFieldCodes: z.array(TakeItDownFieldCodeSchema).max(16).optional(),
|
|
194
|
+
nextAction: TakeItDownPublicNextActionSchema.optional(),
|
|
195
|
+
removalDeadlineAt: z.number().optional(),
|
|
196
|
+
updatedAt: z.number(),
|
|
197
|
+
}).strict();
|
|
198
|
+
// ===========================================================================
|
|
199
|
+
// §A11 (2) [F10] — takeItDownRequests/{requestId}/evidence/{evidenceId} = the
|
|
200
|
+
// public-evidence-upload record (account-less + in-app evidence lands in an
|
|
201
|
+
// ISOLATED admin-only Firebase Storage bucket, never R2, never served, no durable
|
|
202
|
+
// URL). Safety-scan state is tracked separately by NciiEvidenceSafetyScanV1 [H5]
|
|
203
|
+
// (owned by the removal cluster).
|
|
204
|
+
// ===========================================================================
|
|
205
|
+
/** `takeItDownRequests/{requestId}/evidence/{evidenceId}` — the [F10] public
|
|
206
|
+
* evidence-upload record. Doc id `evidenceId` is a deterministic/assigned id.
|
|
207
|
+
* INVARIANT: this record NEVER sets `originatingUploaderUid` — enforcement / NCMEC
|
|
208
|
+
* attribution targets the ORIGINAL content's originatingUploaderUid (perpetrator)
|
|
209
|
+
* via MediaOriginLineageV1 (a correlation, not a merge). */
|
|
210
|
+
export const TakeItDownEvidenceV1Schema = z.object({
|
|
211
|
+
schemaVersion: z.literal(1),
|
|
212
|
+
evidenceId: z.string().min(1),
|
|
213
|
+
requestId: z.string().min(1),
|
|
214
|
+
uploadContext: z.literal('takeItDownEvidence'), // LITERAL tag — never an ordinary content origin
|
|
215
|
+
submitterUid: z.string().min(1).optional(), // the submitter is NEVER auto-actioned for evidence they submit
|
|
216
|
+
bucket: z.string().min(1),
|
|
217
|
+
key: z.string().min(1),
|
|
218
|
+
generation: z.string().min(1),
|
|
219
|
+
contentType: z.string().min(1),
|
|
220
|
+
sizeBytes: z.number(),
|
|
221
|
+
sha256: z.string().min(1),
|
|
222
|
+
md5: z.string().min(1),
|
|
223
|
+
capturedAt: z.number(),
|
|
224
|
+
createdAt: z.number(),
|
|
225
|
+
}).strict();
|
|
226
|
+
// ===========================================================================
|
|
227
|
+
// §A11 [C-02] — conditional completeness predicate (`computeCompleteness`).
|
|
228
|
+
// requiredFieldCodes(requesterRole) + a contact one-of. These are EMBEDDED /
|
|
229
|
+
// NON-DOC shapes (not Firestore documents): the counsel-ratified required set + a
|
|
230
|
+
// documented predicate. Completeness is NOT "every TakeItDownFieldCode arrived".
|
|
231
|
+
// ===========================================================================
|
|
232
|
+
/** [C-02] Required field codes for a `depictedPerson` request (counsel-ratified). */
|
|
233
|
+
export const REQUIRED_FIELD_CODES_DEPICTED_PERSON = [
|
|
234
|
+
'requesterName',
|
|
235
|
+
'requesterRole',
|
|
236
|
+
'electronicSignature',
|
|
237
|
+
'targetLocator',
|
|
238
|
+
'nonconsentStatement',
|
|
239
|
+
'goodFaithCertification',
|
|
240
|
+
];
|
|
241
|
+
/** [C-02] Required field codes for an `authorizedRepresentative` request =
|
|
242
|
+
* depicted-person set ∪ { authorityBasis, authorityEvidence } (counsel-ratified). */
|
|
243
|
+
export const REQUIRED_FIELD_CODES_AUTHORIZED_REPRESENTATIVE = [
|
|
244
|
+
...REQUIRED_FIELD_CODES_DEPICTED_PERSON,
|
|
245
|
+
'authorityBasis',
|
|
246
|
+
'authorityEvidence',
|
|
247
|
+
];
|
|
248
|
+
/** [C-02] The contact one-of: at least ONE of these must be present (neither is
|
|
249
|
+
* individually required; either alone satisfies it). */
|
|
250
|
+
export const CONTACT_ONE_OF_FIELD_CODES = [
|
|
251
|
+
'contactEmail',
|
|
252
|
+
'contactPhone',
|
|
253
|
+
];
|
|
254
|
+
/** [C-02] `requiredFieldCodes(requesterRole)` — the counsel-ratified required set.
|
|
255
|
+
* `supportingFacts` is collected but is NOT a completeness gate; `contactEmail` /
|
|
256
|
+
* `contactPhone` are governed by the contact one-of (see CONTACT_ONE_OF_FIELD_CODES),
|
|
257
|
+
* never individually required. The implementer uses EXACTLY this set and never
|
|
258
|
+
* hard-requires `contactPhone` or the authorizedRepresentative block on a
|
|
259
|
+
* depicted-person request. */
|
|
260
|
+
export function requiredFieldCodes(requesterRole) {
|
|
261
|
+
return requesterRole === 'authorizedRepresentative'
|
|
262
|
+
? REQUIRED_FIELD_CODES_AUTHORIZED_REPRESENTATIVE
|
|
263
|
+
: REQUIRED_FIELD_CODES_DEPICTED_PERSON;
|
|
264
|
+
}
|
|
265
|
+
/** [C-02] `computeCompleteness` — returns `complete` iff every code in
|
|
266
|
+
* `requiredFieldCodes(requesterRole)` is supplied AND the contact one-of holds;
|
|
267
|
+
* otherwise `incomplete` with the missing codes surfaced (those become
|
|
268
|
+
* `TakeItDownPublicStatusV1.missingFieldCodes`). The missing-set lists the role's
|
|
269
|
+
* unmet required codes, plus a `contactEmail`/`contactPhone` representative for an
|
|
270
|
+
* unmet contact one-of (the implementer/UI decides which contact code to surface;
|
|
271
|
+
* here we surface `contactEmail` as the canonical missing-contact marker). */
|
|
272
|
+
export function computeCompleteness(input) {
|
|
273
|
+
const supplied = new Set(input.suppliedFieldCodes);
|
|
274
|
+
const missingFieldCodes = [];
|
|
275
|
+
for (const code of requiredFieldCodes(input.requesterRole)) {
|
|
276
|
+
if (!supplied.has(code))
|
|
277
|
+
missingFieldCodes.push(code);
|
|
278
|
+
}
|
|
279
|
+
const contactSatisfied = CONTACT_ONE_OF_FIELD_CODES.some((code) => supplied.has(code));
|
|
280
|
+
if (!contactSatisfied)
|
|
281
|
+
missingFieldCodes.push('contactEmail');
|
|
282
|
+
return {
|
|
283
|
+
status: missingFieldCodes.length === 0 ? 'complete' : 'incomplete',
|
|
284
|
+
missingFieldCodes,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
//# sourceMappingURL=requests.js.map
|