@oxy.so/contracts 4.17.0 → 4.22.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/cjs/accountAccess.js +72 -0
- package/dist/cjs/agency.js +112 -1
- package/dist/cjs/applicationRoles.js +211 -0
- package/dist/cjs/client/check.js +9 -0
- package/dist/cjs/client/contentClaims.js +139 -0
- package/dist/cjs/client/index.js +37 -1
- package/dist/cjs/client/safety.js +183 -2
- package/dist/cjs/client/signIn.js +2 -0
- package/dist/cjs/contentClaims.js +246 -0
- package/dist/cjs/index.js +14 -3
- package/dist/cjs/safety.js +430 -1
- package/dist/cjs/serviceToken.js +14 -0
- package/dist/esm/accountAccess.js +69 -0
- package/dist/esm/agency.js +111 -0
- package/dist/esm/applicationRoles.js +207 -0
- package/dist/esm/client/check.js +8 -0
- package/dist/esm/client/contentClaims.js +134 -0
- package/dist/esm/client/index.js +2 -1
- package/dist/esm/client/safety.js +183 -2
- package/dist/esm/client/signIn.js +2 -0
- package/dist/esm/contentClaims.js +229 -0
- package/dist/esm/index.js +5 -1
- package/dist/esm/safety.js +423 -0
- package/dist/esm/serviceToken.js +11 -0
- package/dist/types/accountAccess.d.ts +128 -0
- package/dist/types/accountEmail.d.ts +2 -2
- package/dist/types/agency.d.ts +327 -2
- package/dist/types/agentKeys.d.ts +6 -6
- package/dist/types/applicationRoles.d.ts +438 -0
- package/dist/types/client/agentKeys.d.ts +2 -2
- package/dist/types/client/check.d.ts +3 -0
- package/dist/types/client/contentClaims.d.ts +106 -0
- package/dist/types/client/deviceSession.d.ts +1 -1
- package/dist/types/client/index.d.ts +2 -1
- package/dist/types/client/safety.d.ts +204 -4
- package/dist/types/client/signIn.d.ts +1 -1
- package/dist/types/contentClaims.d.ts +383 -0
- package/dist/types/deviceSession.d.ts +4 -4
- package/dist/types/email/messages.d.ts +4 -4
- package/dist/types/externalIdentity.d.ts +16 -16
- package/dist/types/index.d.ts +6 -2
- package/dist/types/inference/accountBilling.d.ts +2 -2
- package/dist/types/inference/aliaModelRelease.d.ts +8 -8
- package/dist/types/inference/catalogue.d.ts +26 -26
- package/dist/types/inference/inbox.d.ts +4 -4
- package/dist/types/inference/modelDocumentation.d.ts +16 -16
- package/dist/types/inference/providerConnection.d.ts +4 -4
- package/dist/types/inference/realtime.d.ts +74 -74
- package/dist/types/inference/request.d.ts +60 -60
- package/dist/types/inference/usage.d.ts +4 -4
- package/dist/types/products/access.d.ts +4 -4
- package/dist/types/safety.d.ts +2374 -2
- package/dist/types/serviceToken.d.ts +11 -0
- package/dist/types/sessionStatus.d.ts +4 -4
- package/dist/types/signIn.d.ts +5 -5
- package/dist/types/updates.d.ts +6 -6
- package/dist/types/userResponse.d.ts +8 -8
- package/package.json +5 -20
- package/dist/cjs/.tsbuildinfo +0 -1
- package/dist/esm/.tsbuildinfo +0 -1
- package/dist/types/.tsbuildinfo +0 -1
|
@@ -1,13 +1,213 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Safety and supervision checks, without Zod. Schemas: `../safety.ts`.
|
|
3
|
+
*
|
|
4
|
+
* Only what a browser or device sends and reads is here: the profile-access
|
|
5
|
+
* read, supervision management and the guardian's purchase review. The service
|
|
6
|
+
* decision lanes are server-only (`@oxy.so/core/server`) and parse with the
|
|
7
|
+
* Zod schemas directly.
|
|
3
8
|
*
|
|
4
9
|
* Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
|
|
5
10
|
*/
|
|
6
|
-
|
|
11
|
+
import { type Check } from './check';
|
|
12
|
+
/** Supervision is a personal-account safety policy, never a new login/account kind. */
|
|
13
|
+
export declare const SUPERVISED_ACTIONS: readonly ["profile", "messaging", "content", "purchases"];
|
|
14
|
+
export declare const SAFETY_POLICY_VERSION: "2";
|
|
15
|
+
export declare const SUPERVISION_CONSENT_VERSION: "1";
|
|
16
|
+
export declare const SUPERVISION_STATUSES: readonly ["active", "orphaned", "ended"];
|
|
17
|
+
export declare const SUPERVISION_INVITATION_STATUSES: readonly ["pending", "accepted", "cancelled"];
|
|
18
|
+
export declare const PURCHASE_APPROVAL_STATUSES: readonly ["pending", "approved", "rejected", "reserved", "confirmed", "cancelled"];
|
|
19
|
+
export declare const profileAccessInputCheck: Check<{
|
|
7
20
|
subjectAccountId: string;
|
|
8
21
|
}>;
|
|
9
|
-
export declare const profileAccessDecisionCheck:
|
|
22
|
+
export declare const profileAccessDecisionCheck: Check<{
|
|
10
23
|
allowed: boolean;
|
|
11
|
-
reason: "
|
|
24
|
+
reason: "owner" | "unavailable" | "blocked" | "private" | "public";
|
|
12
25
|
policyVersion: "1";
|
|
13
26
|
}>;
|
|
27
|
+
export declare const supervisionInvitationCheck: Check<{
|
|
28
|
+
status: "pending" | "accepted" | "cancelled";
|
|
29
|
+
createdAt: string;
|
|
30
|
+
id: string;
|
|
31
|
+
expiresAt: string;
|
|
32
|
+
childAccountId: string;
|
|
33
|
+
guardianAccountId: string;
|
|
34
|
+
consentVersion: "1";
|
|
35
|
+
}>;
|
|
36
|
+
export declare const supervisionStateCheck: Check<{
|
|
37
|
+
self: {
|
|
38
|
+
status: "active" | "orphaned" | "ended";
|
|
39
|
+
createdAt: string;
|
|
40
|
+
policyVersion: "2";
|
|
41
|
+
childAccountId: string;
|
|
42
|
+
guardianAccountId: string | null;
|
|
43
|
+
consentVersion: "1";
|
|
44
|
+
} | null;
|
|
45
|
+
children: {
|
|
46
|
+
status: "active" | "orphaned" | "ended";
|
|
47
|
+
createdAt: string;
|
|
48
|
+
policyVersion: "2";
|
|
49
|
+
childAccountId: string;
|
|
50
|
+
guardianAccountId: string | null;
|
|
51
|
+
consentVersion: "1";
|
|
52
|
+
}[];
|
|
53
|
+
invitations: {
|
|
54
|
+
status: "pending" | "accepted" | "cancelled";
|
|
55
|
+
createdAt: string;
|
|
56
|
+
id: string;
|
|
57
|
+
expiresAt: string;
|
|
58
|
+
childAccountId: string;
|
|
59
|
+
guardianAccountId: string;
|
|
60
|
+
consentVersion: "1";
|
|
61
|
+
}[];
|
|
62
|
+
}>;
|
|
63
|
+
export declare const supervisionContactsResponseCheck: Check<{
|
|
64
|
+
items: {
|
|
65
|
+
childAccountId: string;
|
|
66
|
+
contactAccountId: string;
|
|
67
|
+
approvedAt: string;
|
|
68
|
+
}[];
|
|
69
|
+
}>;
|
|
70
|
+
export declare const supervisionInviteInputCheck: Check<{
|
|
71
|
+
reauth: {
|
|
72
|
+
password?: string | undefined;
|
|
73
|
+
emailCode?: {
|
|
74
|
+
code: string;
|
|
75
|
+
verificationId: string;
|
|
76
|
+
} | undefined;
|
|
77
|
+
totpCode?: string | undefined;
|
|
78
|
+
};
|
|
79
|
+
guardianAccountId: string;
|
|
80
|
+
consentVersion: "1";
|
|
81
|
+
}>;
|
|
82
|
+
export declare const supervisionAcceptInputCheck: Check<{
|
|
83
|
+
reauth: {
|
|
84
|
+
password?: string | undefined;
|
|
85
|
+
emailCode?: {
|
|
86
|
+
code: string;
|
|
87
|
+
verificationId: string;
|
|
88
|
+
} | undefined;
|
|
89
|
+
totpCode?: string | undefined;
|
|
90
|
+
};
|
|
91
|
+
consentVersion: "1";
|
|
92
|
+
}>;
|
|
93
|
+
export declare const supervisionContactInputCheck: Check<{
|
|
94
|
+
reauth: {
|
|
95
|
+
password?: string | undefined;
|
|
96
|
+
emailCode?: {
|
|
97
|
+
code: string;
|
|
98
|
+
verificationId: string;
|
|
99
|
+
} | undefined;
|
|
100
|
+
totpCode?: string | undefined;
|
|
101
|
+
};
|
|
102
|
+
childAccountId: string;
|
|
103
|
+
contactAccountId: string;
|
|
104
|
+
}>;
|
|
105
|
+
export declare const supervisionReviewInputCheck: Check<{
|
|
106
|
+
evidenceReference: string;
|
|
107
|
+
reauth: {
|
|
108
|
+
password?: string | undefined;
|
|
109
|
+
emailCode?: {
|
|
110
|
+
code: string;
|
|
111
|
+
verificationId: string;
|
|
112
|
+
} | undefined;
|
|
113
|
+
totpCode?: string | undefined;
|
|
114
|
+
};
|
|
115
|
+
action: "end" | "transfer";
|
|
116
|
+
childAccountId: string;
|
|
117
|
+
guardianAccountId?: string | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
export declare const safetyPeopleInputCheck: Check<{
|
|
120
|
+
query: string;
|
|
121
|
+
} | {
|
|
122
|
+
accountIds: string[];
|
|
123
|
+
}>;
|
|
124
|
+
export declare const safetyPeopleResponseCheck: Check<{
|
|
125
|
+
items: {
|
|
126
|
+
accountId: string;
|
|
127
|
+
username: string | null;
|
|
128
|
+
displayName: string | null;
|
|
129
|
+
}[];
|
|
130
|
+
}>;
|
|
131
|
+
export declare const safetyOrganizationsInputCheck: Check<{
|
|
132
|
+
query: string;
|
|
133
|
+
limit?: number | undefined;
|
|
134
|
+
} | {
|
|
135
|
+
ids: string[];
|
|
136
|
+
}>;
|
|
137
|
+
export declare const safetyOrganizationsResponseCheck: Check<{
|
|
138
|
+
items: {
|
|
139
|
+
requestedAccountId: string;
|
|
140
|
+
organization: {
|
|
141
|
+
name: string;
|
|
142
|
+
organizationType: "business" | "nonprofit" | "public_body" | "community" | "other";
|
|
143
|
+
accountId: string;
|
|
144
|
+
username: string | null;
|
|
145
|
+
};
|
|
146
|
+
}[];
|
|
147
|
+
missingIds: string[];
|
|
148
|
+
}>;
|
|
149
|
+
export declare const purchaseApprovalCheck: Check<{
|
|
150
|
+
status: "pending" | "approved" | "rejected" | "cancelled" | "confirmed" | "reserved";
|
|
151
|
+
createdAt: string;
|
|
152
|
+
id: string;
|
|
153
|
+
expiresAt: string;
|
|
154
|
+
resourceId: string;
|
|
155
|
+
applicationId: string;
|
|
156
|
+
currency: string;
|
|
157
|
+
operationId: string;
|
|
158
|
+
summary: string;
|
|
159
|
+
childAccountId: string;
|
|
160
|
+
cartFingerprint: string;
|
|
161
|
+
merchantAccountIds: string[];
|
|
162
|
+
lineItems: {
|
|
163
|
+
title: string;
|
|
164
|
+
quantity: number;
|
|
165
|
+
itemReference: string;
|
|
166
|
+
optionsText: string;
|
|
167
|
+
merchantAccountId: string;
|
|
168
|
+
unitAmountMinor: number;
|
|
169
|
+
lineAmountMinor: number;
|
|
170
|
+
}[];
|
|
171
|
+
shippingMinor: number;
|
|
172
|
+
taxMinor: number;
|
|
173
|
+
discountMinor: number;
|
|
174
|
+
roundingAdjustmentMinor: number;
|
|
175
|
+
paymentFingerprint: string;
|
|
176
|
+
amountMinor: number;
|
|
177
|
+
receiptReference: string | null;
|
|
178
|
+
}>;
|
|
179
|
+
export declare const purchaseApprovalListCheck: Check<{
|
|
180
|
+
items: {
|
|
181
|
+
status: "pending" | "approved" | "rejected" | "cancelled" | "confirmed" | "reserved";
|
|
182
|
+
createdAt: string;
|
|
183
|
+
id: string;
|
|
184
|
+
expiresAt: string;
|
|
185
|
+
resourceId: string;
|
|
186
|
+
applicationId: string;
|
|
187
|
+
currency: string;
|
|
188
|
+
operationId: string;
|
|
189
|
+
summary: string;
|
|
190
|
+
childAccountId: string;
|
|
191
|
+
cartFingerprint: string;
|
|
192
|
+
merchantAccountIds: string[];
|
|
193
|
+
shippingMinor: number;
|
|
194
|
+
taxMinor: number;
|
|
195
|
+
discountMinor: number;
|
|
196
|
+
roundingAdjustmentMinor: number;
|
|
197
|
+
paymentFingerprint: string;
|
|
198
|
+
amountMinor: number;
|
|
199
|
+
receiptReference: string | null;
|
|
200
|
+
}[];
|
|
201
|
+
nextCursor: string | null;
|
|
202
|
+
}>;
|
|
203
|
+
export declare const purchaseReviewInputCheck: Check<{
|
|
204
|
+
decision: "approved" | "rejected";
|
|
205
|
+
reauth: {
|
|
206
|
+
password?: string | undefined;
|
|
207
|
+
emailCode?: {
|
|
208
|
+
code: string;
|
|
209
|
+
verificationId: string;
|
|
210
|
+
} | undefined;
|
|
211
|
+
totpCode?: string | undefined;
|
|
212
|
+
};
|
|
213
|
+
}>;
|
|
@@ -50,7 +50,7 @@ export declare function isEmailSignInChooseAccount(result: EmailSignInStepResult
|
|
|
50
50
|
* What a re-verification email code confirms. The code is bound to it: a code
|
|
51
51
|
* asked for one change never authorises another, and the email names it.
|
|
52
52
|
*/
|
|
53
|
-
export declare const REAUTH_ACTIONS: readonly ["change_password", "totp", "link_commons", "delete_account", "credentials_manage"];
|
|
53
|
+
export declare const REAUTH_ACTIONS: readonly ["change_password", "totp", "link_commons", "delete_account", "credentials_manage", "supervision", "supervision_purchase"];
|
|
54
54
|
export type ReauthAction = (typeof REAUTH_ACTIONS)[number];
|
|
55
55
|
/**
|
|
56
56
|
* Stable error codes (`error.code` in the API error body). Clients map these
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content claims (ADR 0043 D10): the public "Report content / rights claim"
|
|
3
|
+
* intake, `POST /content-claims`, and the staff review of a claim.
|
|
4
|
+
*
|
|
5
|
+
* {@link contentClaimSubmissionSchema} is the request body the API parses and
|
|
6
|
+
* the Oxy website validates its form with before posting, so the form cannot
|
|
7
|
+
* accept what the API would answer 400 to. Every validation message is a
|
|
8
|
+
* stable KEY under `contentClaim.errors.*` (filled with
|
|
9
|
+
* {@link CONTENT_CLAIM_LIMITS} by whoever shows it), never English: the website
|
|
10
|
+
* translates the key, and the API answers its own English sentence for it in
|
|
11
|
+
* `fields`.
|
|
12
|
+
*/
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
import { type ClaimantRelationship, type ContentClaimKind, type ContentClaimState } from './client/contentClaims';
|
|
15
|
+
export { CLAIMANT_RELATIONSHIPS, CLOSED_CONTENT_CLAIM_STATES, CONTENT_CLAIM_COUNTER_NOTICE_LIMITS, CONTENT_CLAIM_ERROR_CODES, CONTENT_CLAIM_KINDS, CONTENT_CLAIM_LIMITS, CONTENT_CLAIM_REFERENCE_PATTERN, CONTENT_CLAIM_STATES, COUNTER_NOTICE_STATEMENT_VERSION, COUNTER_NOTICE_STATEMENTS, ERASURE_REQUEST_DEADLINE_DAYS, OPEN_CONTENT_CLAIM_STATES, isErasureRequest, isRightsClaim, } from './client/contentClaims';
|
|
16
|
+
export type { ClaimantRelationship, ContentClaimErrorCode, ContentClaimKind, ContentClaimState, } from './client/contentClaims';
|
|
17
|
+
/** Every key a submission's validation can produce, under `contentClaim.errors.*`. */
|
|
18
|
+
export declare const CONTENT_CLAIM_VALIDATION_KEYS: readonly ["contentClaim.errors.kind", "contentClaim.errors.contentUrlsRequired", "contentClaim.errors.contentUrlsTooMany", "contentClaim.errors.contentUrlInvalid", "contentClaim.errors.descriptionShort", "contentClaim.errors.descriptionLong", "contentClaim.errors.originalWorkUrl", "contentClaim.errors.name", "contentClaim.errors.email", "contentClaim.errors.organization", "contentClaim.errors.relationship", "contentClaim.errors.goodFaith", "contentClaim.errors.accurate", "contentClaim.errors.signature"];
|
|
19
|
+
export type ContentClaimValidationKey = (typeof CONTENT_CLAIM_VALIDATION_KEYS)[number];
|
|
20
|
+
/**
|
|
21
|
+
* `POST /content-claims` — a claim, as the claimant sends it. Strict: an
|
|
22
|
+
* unknown key is refused rather than dropped.
|
|
23
|
+
*/
|
|
24
|
+
export declare const contentClaimSubmissionSchema: z.ZodObject<{
|
|
25
|
+
kind: z.ZodEnum<["copyright", "trademark", "privacy", "illegal_content", "other"]>;
|
|
26
|
+
contentUrls: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
27
|
+
description: z.ZodString;
|
|
28
|
+
originalWorkUrl: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
29
|
+
claimant: z.ZodObject<{
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
email: z.ZodString;
|
|
32
|
+
organization: z.ZodOptional<z.ZodString>;
|
|
33
|
+
relationship: z.ZodEnum<["rights_holder", "authorized_agent", "affected_person", "other"]>;
|
|
34
|
+
}, "strict", z.ZodTypeAny, {
|
|
35
|
+
name: string;
|
|
36
|
+
email: string;
|
|
37
|
+
relationship: "other" | "rights_holder" | "authorized_agent" | "affected_person";
|
|
38
|
+
organization?: string | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
name: string;
|
|
41
|
+
email: string;
|
|
42
|
+
relationship: "other" | "rights_holder" | "authorized_agent" | "affected_person";
|
|
43
|
+
organization?: string | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
statements: z.ZodObject<{
|
|
46
|
+
goodFaith: z.ZodLiteral<true>;
|
|
47
|
+
accurate: z.ZodLiteral<true>;
|
|
48
|
+
}, "strict", z.ZodTypeAny, {
|
|
49
|
+
goodFaith: true;
|
|
50
|
+
accurate: true;
|
|
51
|
+
}, {
|
|
52
|
+
goodFaith: true;
|
|
53
|
+
accurate: true;
|
|
54
|
+
}>;
|
|
55
|
+
signature: z.ZodString;
|
|
56
|
+
}, "strict", z.ZodTypeAny, {
|
|
57
|
+
kind: "other" | "copyright" | "trademark" | "privacy" | "illegal_content";
|
|
58
|
+
description: string;
|
|
59
|
+
signature: string;
|
|
60
|
+
contentUrls: string[];
|
|
61
|
+
claimant: {
|
|
62
|
+
name: string;
|
|
63
|
+
email: string;
|
|
64
|
+
relationship: "other" | "rights_holder" | "authorized_agent" | "affected_person";
|
|
65
|
+
organization?: string | undefined;
|
|
66
|
+
};
|
|
67
|
+
statements: {
|
|
68
|
+
goodFaith: true;
|
|
69
|
+
accurate: true;
|
|
70
|
+
};
|
|
71
|
+
originalWorkUrl?: string | undefined;
|
|
72
|
+
}, {
|
|
73
|
+
kind: "other" | "copyright" | "trademark" | "privacy" | "illegal_content";
|
|
74
|
+
description: string;
|
|
75
|
+
signature: string;
|
|
76
|
+
contentUrls: string[];
|
|
77
|
+
claimant: {
|
|
78
|
+
name: string;
|
|
79
|
+
email: string;
|
|
80
|
+
relationship: "other" | "rights_holder" | "authorized_agent" | "affected_person";
|
|
81
|
+
organization?: string | undefined;
|
|
82
|
+
};
|
|
83
|
+
statements: {
|
|
84
|
+
goodFaith: true;
|
|
85
|
+
accurate: true;
|
|
86
|
+
};
|
|
87
|
+
originalWorkUrl?: string | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
export type ContentClaimSubmission = z.infer<typeof contentClaimSubmissionSchema>;
|
|
90
|
+
/** `201` to a submission: the claim's id and the reference the claimant quotes. */
|
|
91
|
+
export interface ContentClaimSubmissionResponse {
|
|
92
|
+
id: string;
|
|
93
|
+
/** e.g. `OXY-7K3M-9Q2D`: what the claimant quotes when writing about the claim. */
|
|
94
|
+
reference: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* `400` to a submission: `error` is a sentence for the person, and `fields`
|
|
98
|
+
* maps a body path (`claimant.email`, `contentUrls.3`) to a sentence about it.
|
|
99
|
+
*/
|
|
100
|
+
export interface ContentClaimSubmissionError {
|
|
101
|
+
error: string;
|
|
102
|
+
code: string;
|
|
103
|
+
fields?: Record<string, string>;
|
|
104
|
+
}
|
|
105
|
+
/** How a target's URL was understood. */
|
|
106
|
+
export declare const CONTENT_CLAIM_TARGET_RESOLUTIONS: readonly ["file", "unresolved"];
|
|
107
|
+
export type ContentClaimTargetResolution = (typeof CONTENT_CLAIM_TARGET_RESOLUTIONS)[number];
|
|
108
|
+
/** Who added a target: the claimant's URL, or staff attaching a file by id. */
|
|
109
|
+
export declare const CONTENT_CLAIM_TARGET_SOURCES: readonly ["claimant", "staff"];
|
|
110
|
+
export type ContentClaimTargetSource = (typeof CONTENT_CLAIM_TARGET_SOURCES)[number];
|
|
111
|
+
/** What the audit trail records. */
|
|
112
|
+
export declare const CONTENT_CLAIM_EVENT_ACTIONS: readonly ["submitted", "review_started", "targets_attached", "targets_blocked", "rejected", "counter_notice_recorded", "counter_notice_submitted", "reinstated", "upheld", "note_added"];
|
|
113
|
+
export type ContentClaimEventAction = (typeof CONTENT_CLAIM_EVENT_ACTIONS)[number];
|
|
114
|
+
/** One target as staff see it. */
|
|
115
|
+
export interface ContentClaimTargetView {
|
|
116
|
+
id: string;
|
|
117
|
+
source: ContentClaimTargetSource;
|
|
118
|
+
url: string | null;
|
|
119
|
+
resolution: ContentClaimTargetResolution;
|
|
120
|
+
/** The file this target names, when it names one (null after the file's owner was deleted). */
|
|
121
|
+
fileId: string | null;
|
|
122
|
+
sha256: string | null;
|
|
123
|
+
/** The file as it stands now, or null when there is no such row any more. */
|
|
124
|
+
file: {
|
|
125
|
+
id: string;
|
|
126
|
+
status: 'active' | 'trash' | 'blocked' | 'deleted';
|
|
127
|
+
visibility: 'private' | 'public' | 'unlisted';
|
|
128
|
+
mime: string;
|
|
129
|
+
size: number;
|
|
130
|
+
ownerKind: 'account' | 'application' | 'platform';
|
|
131
|
+
ownerUserId: string | null;
|
|
132
|
+
ownerApplicationId: string | null;
|
|
133
|
+
} | null;
|
|
134
|
+
blockedAt: string | null;
|
|
135
|
+
unblockedAt: string | null;
|
|
136
|
+
createdAt: string;
|
|
137
|
+
}
|
|
138
|
+
/** One audit entry. */
|
|
139
|
+
export interface ContentClaimEventView {
|
|
140
|
+
id: string;
|
|
141
|
+
action: ContentClaimEventAction;
|
|
142
|
+
/** The staff member (or the signed-in claimant, for `submitted`); null when anonymous or deleted. */
|
|
143
|
+
actorUserId: string | null;
|
|
144
|
+
fromState: ContentClaimState | null;
|
|
145
|
+
toState: ContentClaimState | null;
|
|
146
|
+
/** Free text staff wrote (a rejection reason, a counter-notice summary, a note). */
|
|
147
|
+
note: string | null;
|
|
148
|
+
details: Record<string, unknown>;
|
|
149
|
+
createdAt: string;
|
|
150
|
+
}
|
|
151
|
+
/** A row of the queue. */
|
|
152
|
+
export interface ContentClaimSummaryView {
|
|
153
|
+
id: string;
|
|
154
|
+
reference: string;
|
|
155
|
+
kind: ContentClaimKind;
|
|
156
|
+
relationship: ClaimantRelationship;
|
|
157
|
+
state: ContentClaimState;
|
|
158
|
+
/** The statutory deadline (an erasure request), or null. */
|
|
159
|
+
deadlineAt: string | null;
|
|
160
|
+
targetCount: number;
|
|
161
|
+
blockedTargetCount: number;
|
|
162
|
+
receivedAt: string;
|
|
163
|
+
updatedAt: string;
|
|
164
|
+
closedAt: string | null;
|
|
165
|
+
}
|
|
166
|
+
/** A claim in full, for its detail page. */
|
|
167
|
+
export interface ContentClaimDetailView extends ContentClaimSummaryView {
|
|
168
|
+
submittedByUserId: string | null;
|
|
169
|
+
/** The claimant's statement; null once the retention period erased it. */
|
|
170
|
+
claimant: {
|
|
171
|
+
name: string;
|
|
172
|
+
email: string;
|
|
173
|
+
organization: string | null;
|
|
174
|
+
signature: string;
|
|
175
|
+
description: string;
|
|
176
|
+
originalWorkUrl: string | null;
|
|
177
|
+
} | null;
|
|
178
|
+
/** When the claimant's statement is erased (set when the claim closes). */
|
|
179
|
+
claimantExpiresAt: string | null;
|
|
180
|
+
targets: ContentClaimTargetView[];
|
|
181
|
+
events: ContentClaimEventView[];
|
|
182
|
+
/** The owners' own counter-notices, oldest first. */
|
|
183
|
+
counterNotices: ContentClaimCounterNoticeView[];
|
|
184
|
+
}
|
|
185
|
+
/** `GET /content-claims` */
|
|
186
|
+
export interface ContentClaimListResponse {
|
|
187
|
+
claims: ContentClaimSummaryView[];
|
|
188
|
+
/** Pass as `cursor` for the next page; null on the last. */
|
|
189
|
+
nextCursor: string | null;
|
|
190
|
+
}
|
|
191
|
+
/** Every key a counter-notice's validation can produce, under `contentClaim.counterNotice.errors.*`. */
|
|
192
|
+
export declare const CONTENT_CLAIM_COUNTER_NOTICE_VALIDATION_KEYS: readonly ["contentClaim.counterNotice.errors.claim", "contentClaim.counterNotice.errors.reference", "contentClaim.counterNotice.errors.claimId", "contentClaim.counterNotice.errors.fileIds", "contentClaim.counterNotice.errors.name", "contentClaim.counterNotice.errors.address", "contentClaim.counterNotice.errors.phone", "contentClaim.counterNotice.errors.email", "contentClaim.counterNotice.errors.materialDescription", "contentClaim.counterNotice.errors.materialLocation", "contentClaim.counterNotice.errors.explanation", "contentClaim.counterNotice.errors.perjury", "contentClaim.counterNotice.errors.jurisdiction", "contentClaim.counterNotice.errors.serviceOfProcess", "contentClaim.counterNotice.errors.disclosure", "contentClaim.counterNotice.errors.signature"];
|
|
193
|
+
export type ContentClaimCounterNoticeValidationKey = (typeof CONTENT_CLAIM_COUNTER_NOTICE_VALIDATION_KEYS)[number];
|
|
194
|
+
/**
|
|
195
|
+
* `POST /content-claims/counter-notices` — the owner of content a claim took
|
|
196
|
+
* down disputes it (17 U.S.C. § 512(g)(3)). Signed in: the API answers only
|
|
197
|
+
* for files the caller owns.
|
|
198
|
+
*
|
|
199
|
+
* Names the claim by its `reference` (the `OXY-XXXX-XXXX` the owner was
|
|
200
|
+
* emailed), its `claimId`, or the blocked `fileIds` — at least one. With
|
|
201
|
+
* `fileIds` the notice covers exactly those files; without, every one of the
|
|
202
|
+
* caller's files the claim blocked. Strict: an unknown key is refused.
|
|
203
|
+
*/
|
|
204
|
+
export declare const contentClaimCounterNoticeSchema: z.ZodEffects<z.ZodObject<{
|
|
205
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
206
|
+
claimId: z.ZodOptional<z.ZodString>;
|
|
207
|
+
fileIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
208
|
+
subscriber: z.ZodObject<{
|
|
209
|
+
name: z.ZodString;
|
|
210
|
+
address: z.ZodString;
|
|
211
|
+
phone: z.ZodString;
|
|
212
|
+
email: z.ZodString;
|
|
213
|
+
}, "strict", z.ZodTypeAny, {
|
|
214
|
+
name: string;
|
|
215
|
+
email: string;
|
|
216
|
+
address: string;
|
|
217
|
+
phone: string;
|
|
218
|
+
}, {
|
|
219
|
+
name: string;
|
|
220
|
+
email: string;
|
|
221
|
+
address: string;
|
|
222
|
+
phone: string;
|
|
223
|
+
}>;
|
|
224
|
+
material: z.ZodObject<{
|
|
225
|
+
/** What was removed. */
|
|
226
|
+
description: z.ZodString;
|
|
227
|
+
/** Where it appeared before it was removed (a URL, or where in an app). */
|
|
228
|
+
location: z.ZodString;
|
|
229
|
+
}, "strict", z.ZodTypeAny, {
|
|
230
|
+
description: string;
|
|
231
|
+
location: string;
|
|
232
|
+
}, {
|
|
233
|
+
description: string;
|
|
234
|
+
location: string;
|
|
235
|
+
}>;
|
|
236
|
+
/** Why it was a mistake or a misidentification, in the owner's words. */
|
|
237
|
+
explanation: z.ZodString;
|
|
238
|
+
/** Each of `COUNTER_NOTICE_STATEMENTS`, affirmed. */
|
|
239
|
+
statements: z.ZodObject<{
|
|
240
|
+
perjury: z.ZodLiteral<true>;
|
|
241
|
+
jurisdiction: z.ZodLiteral<true>;
|
|
242
|
+
serviceOfProcess: z.ZodLiteral<true>;
|
|
243
|
+
disclosure: z.ZodLiteral<true>;
|
|
244
|
+
}, "strict", z.ZodTypeAny, {
|
|
245
|
+
perjury: true;
|
|
246
|
+
jurisdiction: true;
|
|
247
|
+
serviceOfProcess: true;
|
|
248
|
+
disclosure: true;
|
|
249
|
+
}, {
|
|
250
|
+
perjury: true;
|
|
251
|
+
jurisdiction: true;
|
|
252
|
+
serviceOfProcess: true;
|
|
253
|
+
disclosure: true;
|
|
254
|
+
}>;
|
|
255
|
+
/** The owner's full legal name, typed as their signature. */
|
|
256
|
+
signature: z.ZodString;
|
|
257
|
+
}, "strict", z.ZodTypeAny, {
|
|
258
|
+
signature: string;
|
|
259
|
+
statements: {
|
|
260
|
+
perjury: true;
|
|
261
|
+
jurisdiction: true;
|
|
262
|
+
serviceOfProcess: true;
|
|
263
|
+
disclosure: true;
|
|
264
|
+
};
|
|
265
|
+
subscriber: {
|
|
266
|
+
name: string;
|
|
267
|
+
email: string;
|
|
268
|
+
address: string;
|
|
269
|
+
phone: string;
|
|
270
|
+
};
|
|
271
|
+
material: {
|
|
272
|
+
description: string;
|
|
273
|
+
location: string;
|
|
274
|
+
};
|
|
275
|
+
explanation: string;
|
|
276
|
+
reference?: string | undefined;
|
|
277
|
+
claimId?: string | undefined;
|
|
278
|
+
fileIds?: string[] | undefined;
|
|
279
|
+
}, {
|
|
280
|
+
signature: string;
|
|
281
|
+
statements: {
|
|
282
|
+
perjury: true;
|
|
283
|
+
jurisdiction: true;
|
|
284
|
+
serviceOfProcess: true;
|
|
285
|
+
disclosure: true;
|
|
286
|
+
};
|
|
287
|
+
subscriber: {
|
|
288
|
+
name: string;
|
|
289
|
+
email: string;
|
|
290
|
+
address: string;
|
|
291
|
+
phone: string;
|
|
292
|
+
};
|
|
293
|
+
material: {
|
|
294
|
+
description: string;
|
|
295
|
+
location: string;
|
|
296
|
+
};
|
|
297
|
+
explanation: string;
|
|
298
|
+
reference?: string | undefined;
|
|
299
|
+
claimId?: string | undefined;
|
|
300
|
+
fileIds?: string[] | undefined;
|
|
301
|
+
}>, {
|
|
302
|
+
signature: string;
|
|
303
|
+
statements: {
|
|
304
|
+
perjury: true;
|
|
305
|
+
jurisdiction: true;
|
|
306
|
+
serviceOfProcess: true;
|
|
307
|
+
disclosure: true;
|
|
308
|
+
};
|
|
309
|
+
subscriber: {
|
|
310
|
+
name: string;
|
|
311
|
+
email: string;
|
|
312
|
+
address: string;
|
|
313
|
+
phone: string;
|
|
314
|
+
};
|
|
315
|
+
material: {
|
|
316
|
+
description: string;
|
|
317
|
+
location: string;
|
|
318
|
+
};
|
|
319
|
+
explanation: string;
|
|
320
|
+
reference?: string | undefined;
|
|
321
|
+
claimId?: string | undefined;
|
|
322
|
+
fileIds?: string[] | undefined;
|
|
323
|
+
}, {
|
|
324
|
+
signature: string;
|
|
325
|
+
statements: {
|
|
326
|
+
perjury: true;
|
|
327
|
+
jurisdiction: true;
|
|
328
|
+
serviceOfProcess: true;
|
|
329
|
+
disclosure: true;
|
|
330
|
+
};
|
|
331
|
+
subscriber: {
|
|
332
|
+
name: string;
|
|
333
|
+
email: string;
|
|
334
|
+
address: string;
|
|
335
|
+
phone: string;
|
|
336
|
+
};
|
|
337
|
+
material: {
|
|
338
|
+
description: string;
|
|
339
|
+
location: string;
|
|
340
|
+
};
|
|
341
|
+
explanation: string;
|
|
342
|
+
reference?: string | undefined;
|
|
343
|
+
claimId?: string | undefined;
|
|
344
|
+
fileIds?: string[] | undefined;
|
|
345
|
+
}>;
|
|
346
|
+
export type ContentClaimCounterNotice = z.infer<typeof contentClaimCounterNoticeSchema>;
|
|
347
|
+
/** `201` to a counter-notice. */
|
|
348
|
+
export interface ContentClaimCounterNoticeResponse {
|
|
349
|
+
/** The counter-notice's id. */
|
|
350
|
+
id: string;
|
|
351
|
+
/** The claim it answers, as the owner was emailed it. */
|
|
352
|
+
reference: string;
|
|
353
|
+
/** Where the claim is now: `counter_noticed`. */
|
|
354
|
+
state: ContentClaimState;
|
|
355
|
+
/** The caller's blocked files the notice covers. */
|
|
356
|
+
fileIds: string[];
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* `400` to a counter-notice: `{ error, code: CONTENT_CLAIM_COUNTER_NOTICE_INVALID,
|
|
360
|
+
* fields }`, `fields` mapping each body path to a sentence.
|
|
361
|
+
*/
|
|
362
|
+
export type ContentClaimCounterNoticeError = ContentClaimSubmissionError;
|
|
363
|
+
/** An owner's counter-notice as staff see it on the claim. */
|
|
364
|
+
export interface ContentClaimCounterNoticeView {
|
|
365
|
+
id: string;
|
|
366
|
+
/** The account that sent it (null once that account is deleted). */
|
|
367
|
+
submittedByUserId: string | null;
|
|
368
|
+
fileIds: string[];
|
|
369
|
+
/** Which wording of `COUNTER_NOTICE_STATEMENTS` was affirmed. */
|
|
370
|
+
statementVersion: string;
|
|
371
|
+
/** What the owner wrote; null once the retention period erased it. */
|
|
372
|
+
statement: {
|
|
373
|
+
name: string;
|
|
374
|
+
address: string;
|
|
375
|
+
phone: string;
|
|
376
|
+
email: string;
|
|
377
|
+
materialDescription: string;
|
|
378
|
+
materialLocation: string;
|
|
379
|
+
explanation: string;
|
|
380
|
+
signature: string;
|
|
381
|
+
} | null;
|
|
382
|
+
createdAt: string;
|
|
383
|
+
}
|
|
@@ -342,13 +342,13 @@ export declare const deviceBackgroundCredentialResponseSchema: z.ZodObject<{
|
|
|
342
342
|
accountId: z.ZodString;
|
|
343
343
|
expiresAt: z.ZodString;
|
|
344
344
|
}, "strip", z.ZodTypeAny, {
|
|
345
|
-
expiresAt: string;
|
|
346
345
|
accountId: string;
|
|
346
|
+
expiresAt: string;
|
|
347
347
|
deviceId: string;
|
|
348
348
|
secret: string;
|
|
349
349
|
}, {
|
|
350
|
-
expiresAt: string;
|
|
351
350
|
accountId: string;
|
|
351
|
+
expiresAt: string;
|
|
352
352
|
deviceId: string;
|
|
353
353
|
secret: string;
|
|
354
354
|
}>;
|
|
@@ -387,12 +387,12 @@ export declare const deviceBackgroundTokenResponseSchema: z.ZodObject<{
|
|
|
387
387
|
expiresAt: z.ZodString;
|
|
388
388
|
accountId: z.ZodString;
|
|
389
389
|
}, "strip", z.ZodTypeAny, {
|
|
390
|
-
expiresAt: string;
|
|
391
390
|
accountId: string;
|
|
391
|
+
expiresAt: string;
|
|
392
392
|
accessToken: string;
|
|
393
393
|
}, {
|
|
394
|
-
expiresAt: string;
|
|
395
394
|
accountId: string;
|
|
395
|
+
expiresAt: string;
|
|
396
396
|
accessToken: string;
|
|
397
397
|
}>;
|
|
398
398
|
export type DeviceBackgroundCredentialResponse = z.infer<typeof deviceBackgroundCredentialResponseSchema>;
|
|
@@ -761,9 +761,9 @@ export declare const emailFilterSchema: z.ZodObject<{
|
|
|
761
761
|
id: string;
|
|
762
762
|
enabled: boolean;
|
|
763
763
|
userId: string;
|
|
764
|
+
matchAll: boolean;
|
|
764
765
|
_id: string;
|
|
765
766
|
order: number;
|
|
766
|
-
matchAll: boolean;
|
|
767
767
|
conditions: {
|
|
768
768
|
value: string;
|
|
769
769
|
field: "subject" | "from" | "size" | "to" | "has-attachment";
|
|
@@ -780,9 +780,9 @@ export declare const emailFilterSchema: z.ZodObject<{
|
|
|
780
780
|
id: string;
|
|
781
781
|
enabled: boolean;
|
|
782
782
|
userId: string;
|
|
783
|
+
matchAll: boolean;
|
|
783
784
|
_id: string;
|
|
784
785
|
order: number;
|
|
785
|
-
matchAll: boolean;
|
|
786
786
|
conditions: {
|
|
787
787
|
value: string;
|
|
788
788
|
field: "subject" | "from" | "size" | "to" | "has-attachment";
|
|
@@ -2190,11 +2190,11 @@ export declare const emailContactSchema: z.ZodObject<{
|
|
|
2190
2190
|
createdAt: z.ZodString;
|
|
2191
2191
|
updatedAt: z.ZodString;
|
|
2192
2192
|
}, "strip", z.ZodTypeAny, {
|
|
2193
|
-
email: string;
|
|
2194
2193
|
name: string;
|
|
2195
2194
|
createdAt: string;
|
|
2196
2195
|
updatedAt: string;
|
|
2197
2196
|
id: string;
|
|
2197
|
+
email: string;
|
|
2198
2198
|
userId: string;
|
|
2199
2199
|
_id: string;
|
|
2200
2200
|
starred: boolean;
|
|
@@ -2203,11 +2203,11 @@ export declare const emailContactSchema: z.ZodObject<{
|
|
|
2203
2203
|
autoCollected: boolean;
|
|
2204
2204
|
lastContactedAt: string | null;
|
|
2205
2205
|
}, {
|
|
2206
|
-
email: string;
|
|
2207
2206
|
name: string;
|
|
2208
2207
|
createdAt: string;
|
|
2209
2208
|
updatedAt: string;
|
|
2210
2209
|
id: string;
|
|
2210
|
+
email: string;
|
|
2211
2211
|
userId: string;
|
|
2212
2212
|
_id: string;
|
|
2213
2213
|
starred: boolean;
|