@oxy.so/contracts 4.21.0 → 4.23.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/client/contentClaims.js +139 -0
- package/dist/cjs/client/index.js +21 -3
- package/dist/cjs/client/products.js +33 -11
- package/dist/cjs/contentClaims.js +246 -0
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/products/billing.js +1 -0
- package/dist/cjs/products/checkout.js +14 -1
- package/dist/cjs/products/plans.js +18 -2
- package/dist/cjs/userResponse.js +8 -1
- package/dist/esm/client/contentClaims.js +134 -0
- package/dist/esm/client/index.js +2 -1
- package/dist/esm/client/products.js +32 -10
- package/dist/esm/contentClaims.js +229 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/products/billing.js +1 -0
- package/dist/esm/products/checkout.js +13 -0
- package/dist/esm/products/plans.js +17 -1
- package/dist/esm/userResponse.js +8 -1
- package/dist/types/client/contentClaims.d.ts +106 -0
- package/dist/types/client/index.d.ts +2 -1
- package/dist/types/client/products.d.ts +43 -10
- package/dist/types/client/safety.d.ts +1 -1
- package/dist/types/contentClaims.d.ts +383 -0
- package/dist/types/email/messages.d.ts +2 -2
- package/dist/types/externalIdentity.d.ts +45 -12
- package/dist/types/index.d.ts +2 -1
- package/dist/types/inference/aliaModelRelease.d.ts +8 -8
- package/dist/types/inference/catalogue.d.ts +4 -4
- package/dist/types/inference/inbox.d.ts +4 -4
- package/dist/types/inference/modelDocumentation.d.ts +16 -16
- package/dist/types/products/billing.d.ts +8 -0
- package/dist/types/products/checkout.d.ts +36 -0
- package/dist/types/products/plans.d.ts +102 -5
- package/dist/types/safety.d.ts +77 -50
- package/dist/types/sessionStatus.d.ts +4 -4
- package/dist/types/updates.d.ts +6 -6
- package/dist/types/userResponse.d.ts +145 -9
- package/package.json +1 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content claims (ADR 0043 D10) — the constants of the public "Report content
|
|
3
|
+
* / rights claim" intake and of a claim's review, without Zod. Schemas:
|
|
4
|
+
* `../contentClaims.ts`.
|
|
5
|
+
*
|
|
6
|
+
* Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
|
|
7
|
+
*/
|
|
8
|
+
/** What a claim asserts. */
|
|
9
|
+
export declare const CONTENT_CLAIM_KINDS: readonly ["copyright", "trademark", "privacy", "illegal_content", "other"];
|
|
10
|
+
export type ContentClaimKind = (typeof CONTENT_CLAIM_KINDS)[number];
|
|
11
|
+
/** Who the claimant is to the content. */
|
|
12
|
+
export declare const CLAIMANT_RELATIONSHIPS: readonly ["rights_holder", "authorized_agent", "affected_person", "other"];
|
|
13
|
+
export type ClaimantRelationship = (typeof CLAIMANT_RELATIONSHIPS)[number];
|
|
14
|
+
/** The bounds of a submission. The website fills its validation messages from these. */
|
|
15
|
+
export declare const CONTENT_CLAIM_LIMITS: {
|
|
16
|
+
readonly minUrls: 1;
|
|
17
|
+
readonly maxUrls: 20;
|
|
18
|
+
readonly maxUrlLength: 2048;
|
|
19
|
+
readonly minDescription: 20;
|
|
20
|
+
readonly maxDescription: 5000;
|
|
21
|
+
readonly maxName: 200;
|
|
22
|
+
readonly maxOrganization: 200;
|
|
23
|
+
readonly maxEmail: 254;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Where a claim is in its review.
|
|
27
|
+
*
|
|
28
|
+
* `received → reviewing → actioned | rejected`; an actioned claim can be
|
|
29
|
+
* answered by the content's owner (`counter_noticed`), which ends either in
|
|
30
|
+
* `reinstated` (the content is served again) or `upheld` (it stays blocked).
|
|
31
|
+
* A claim can also be rejected straight from `received`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const CONTENT_CLAIM_STATES: readonly ["received", "reviewing", "actioned", "rejected", "counter_noticed", "reinstated", "upheld"];
|
|
34
|
+
export type ContentClaimState = (typeof CONTENT_CLAIM_STATES)[number];
|
|
35
|
+
/** The states in which a claim is still open: its evidence is kept and its blocks can change. */
|
|
36
|
+
export declare const OPEN_CONTENT_CLAIM_STATES: readonly ["received", "reviewing", "actioned", "counter_noticed"];
|
|
37
|
+
/** The states a claim ends in. */
|
|
38
|
+
export declare const CLOSED_CONTENT_CLAIM_STATES: readonly ["rejected", "reinstated", "upheld"];
|
|
39
|
+
/**
|
|
40
|
+
* The kinds whose claimant asserts a right in a work or a mark. Only these
|
|
41
|
+
* carry the link to the original — a privacy or illegal-content report
|
|
42
|
+
* asserts no ownership.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isRightsClaim(kind: ContentClaimKind): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* A request to erase the claimant's OWN personal data (GDPR art. 17): a
|
|
47
|
+
* privacy claim made by the person it is about. Oxy must answer it within one
|
|
48
|
+
* month (art. 12(3)); the claim carries that deadline.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isErasureRequest(kind: ContentClaimKind, relationship: ClaimantRelationship): boolean;
|
|
51
|
+
/** Days Oxy has to answer an erasure request ({@link isErasureRequest}). */
|
|
52
|
+
export declare const ERASURE_REQUEST_DEADLINE_DAYS = 30;
|
|
53
|
+
/**
|
|
54
|
+
* Stable error codes a takedown produces elsewhere in the API. A file whose
|
|
55
|
+
* bytes are on the blocklist cannot be uploaded, imported or copied by anyone
|
|
56
|
+
* (HTTP 451).
|
|
57
|
+
*/
|
|
58
|
+
export declare const CONTENT_CLAIM_ERROR_CODES: {
|
|
59
|
+
/** The submission failed validation; `fields` names each problem. */
|
|
60
|
+
readonly invalid: "CONTENT_CLAIM_INVALID";
|
|
61
|
+
/** These exact bytes were taken down after a claim and cannot be stored again. */
|
|
62
|
+
readonly contentBlocked: "CONTENT_BLOCKED";
|
|
63
|
+
/** A counter-notice failed validation; `fields` names each problem. */
|
|
64
|
+
readonly counterNoticeInvalid: "CONTENT_CLAIM_COUNTER_NOTICE_INVALID";
|
|
65
|
+
/** The files named are blocked by more than one claim: name the claim's reference. */
|
|
66
|
+
readonly counterNoticeAmbiguous: "CONTENT_CLAIM_COUNTER_NOTICE_AMBIGUOUS";
|
|
67
|
+
/** This account already sent a counter-notice for this claim. */
|
|
68
|
+
readonly counterNoticeExists: "CONTENT_CLAIM_COUNTER_NOTICE_EXISTS";
|
|
69
|
+
};
|
|
70
|
+
export type ContentClaimErrorCode = (typeof CONTENT_CLAIM_ERROR_CODES)[keyof typeof CONTENT_CLAIM_ERROR_CODES];
|
|
71
|
+
/**
|
|
72
|
+
* A claim's reference as the claimant and the owner are sent it:
|
|
73
|
+
* `OXY-XXXX-XXXX`, Crockford base32 (no I, L, O or U).
|
|
74
|
+
*/
|
|
75
|
+
export declare const CONTENT_CLAIM_REFERENCE_PATTERN: RegExp;
|
|
76
|
+
/** The bounds of an owner's counter-notice. The website fills its validation messages from these. */
|
|
77
|
+
export declare const CONTENT_CLAIM_COUNTER_NOTICE_LIMITS: {
|
|
78
|
+
readonly maxFileIds: 50;
|
|
79
|
+
readonly maxFileId: 64;
|
|
80
|
+
readonly maxName: 200;
|
|
81
|
+
readonly maxAddress: 500;
|
|
82
|
+
readonly minPhone: 5;
|
|
83
|
+
readonly maxPhone: 40;
|
|
84
|
+
readonly maxEmail: 254;
|
|
85
|
+
readonly minMaterial: 10;
|
|
86
|
+
readonly maxMaterial: 2000;
|
|
87
|
+
readonly maxLocation: 2048;
|
|
88
|
+
readonly minExplanation: 20;
|
|
89
|
+
readonly maxExplanation: 5000;
|
|
90
|
+
readonly maxSignature: 200;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* The statements an owner's counter-notice makes, word for word — what the
|
|
94
|
+
* form shows beside each box (17 U.S.C. § 512(g)(3)(C) and (D), and what Oxy
|
|
95
|
+
* does with the notice). The API records {@link COUNTER_NOTICE_STATEMENT_VERSION}
|
|
96
|
+
* with every notice, so the wording a person agreed to can always be told
|
|
97
|
+
* apart from a later one. Change the text only together with the version.
|
|
98
|
+
*/
|
|
99
|
+
export declare const COUNTER_NOTICE_STATEMENTS: {
|
|
100
|
+
readonly perjury: "I swear, under penalty of perjury, that I have a good faith belief that the material identified above was removed or disabled as a result of a mistake or misidentification of the material to be removed or disabled.";
|
|
101
|
+
readonly jurisdiction: "I consent to the jurisdiction of the Federal District Court for the judicial district in which my address is located or, if my address is outside of the United States, any judicial district in which Oxy may be found.";
|
|
102
|
+
readonly serviceOfProcess: "I will accept service of process from the person who provided the notification of the claimed infringement, or an agent of such person.";
|
|
103
|
+
readonly disclosure: "I understand that Oxy sends a copy of this counter-notice, including my name and contact details, to the person who made the claim, as the law requires.";
|
|
104
|
+
};
|
|
105
|
+
/** The version of {@link COUNTER_NOTICE_STATEMENTS} in force. */
|
|
106
|
+
export declare const COUNTER_NOTICE_STATEMENT_VERSION = "2026-10-16";
|
|
@@ -27,7 +27,7 @@ export { SESSION_ACCOUNTS_CHANGED_EVENT, activeTokenCheck, deviceBackgroundCrede
|
|
|
27
27
|
export { IDENTITY_LINK_QR_PREFIX, IDENTITY_LINK_STATUSES, buildIdentityLinkQrPayload, identityLinkCreateResponseCheck, identityLinkStateCheck, parseIdentityLinkQrPayload, } from './identityLink';
|
|
28
28
|
export { IDENTITY_ERROR_CODES, IDENTITY_PROOF_ACTIONS, IDENTITY_PROOF_ACTION_VALUES, IDENTITY_PROOF_AUDIENCE, IDENTITY_PROOF_CHALLENGE_TTL_MS, IDENTITY_PROOF_DOMAIN, IDENTITY_PROOF_VERSION, buildIdentityProofMessage, canonicalJson, } from './identityProof';
|
|
29
29
|
export { ORGANIZATION_ALIAS_KINDS, ORGANIZATION_CLAIM_DECISIONS, ORGANIZATION_CLAIM_STATUSES, ORGANIZATION_ERROR_CODES, ORGANIZATION_NAME_MAX_LENGTH, ORGANIZATION_STATUSES, ORGANIZATION_TYPES, createOrganizationCheck, organizationBatchCheck, organizationCheck, organizationClaimCheck, organizationClaimDetailCheck, organizationClaimInputCheck, organizationClaimListCheck, organizationClaimReviewCheck, organizationCurationResultCheck, organizationExternalCheck, organizationExternalResolutionCheck, organizationImportBatchResultCheck, organizationListCheck, organizationNameCheck, updateOrganizationCheck, } from './organizations';
|
|
30
|
-
export { cancelProductSubscriptionCheck, personalPlanCatalogueCheck, personalPlanCheckoutRequestCheck, personalPlanCheckoutResultCheck, productSubscriptionCancellationResultCheck, productSubscriptionsResponseCheck, subjectProductAccessCheck, subjectProductAccessQueryCheck, subscriptionCreditGrantsResponseCheck, } from './products';
|
|
30
|
+
export { cancelProductSubscriptionCheck, personalPlanCatalogueCheck, personalPlanCheckoutRequestCheck, personalPlanCheckoutResultCheck, productPlanCatalogueCheck, productPlanCheckoutRequestCheck, productSubscriptionCancellationResultCheck, productSubscriptionRenewalRequestCheck, productSubscriptionsResponseCheck, subjectProductAccessCheck, subjectProductAccessQueryCheck, subscriptionCreditGrantsResponseCheck, } from './products';
|
|
31
31
|
export { recommendationRequestCheck } from './recommendations';
|
|
32
32
|
export { isFullReputationBalance } from './reputation';
|
|
33
33
|
export { PURCHASE_APPROVAL_STATUSES, SAFETY_POLICY_VERSION, SUPERVISED_ACTIONS, SUPERVISION_CONSENT_VERSION, SUPERVISION_INVITATION_STATUSES, SUPERVISION_STATUSES, profileAccessDecisionCheck, profileAccessInputCheck, purchaseApprovalCheck, purchaseApprovalListCheck, purchaseReviewInputCheck, safetyOrganizationsInputCheck, safetyOrganizationsResponseCheck, safetyPeopleInputCheck, safetyPeopleResponseCheck, supervisionAcceptInputCheck, supervisionContactInputCheck, supervisionContactsResponseCheck, supervisionInvitationCheck, supervisionInviteInputCheck, supervisionReviewInputCheck, supervisionStateCheck, } from './safety';
|
|
@@ -35,3 +35,4 @@ export { publicApplicationCheck } from './sessionStatus';
|
|
|
35
35
|
export { EMAIL_ACCOUNTS_MAX, EMAIL_SIGNIN_CHOICE_TTL_MS, EMAIL_SIGNIN_LINK_TTL_MS, EMAIL_SIGNIN_LONG_CODE_ALPHABET, EMAIL_SIGNIN_LONG_CODE_LENGTH, PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, REAUTH_ACTIONS, SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS, SIGNIN_SECOND_FACTOR_TTL_MS, SIGN_IN_ERROR_CODES, TOTP_BACKUP_CODE_COUNT, TOTP_DIGITS, TOTP_PERIOD_SECONDS, emailSignInChooseAccountCheck, emailSignInLinkResponseCheck, emailSignInPendingCheck, emailSignInStartResponseCheck, isEmailSignInChooseAccount, isSecondFactorRequired, normalizeEmailSignInCode, reauthProofCheck, secondFactorRequiredCheck, signInMethodsCheck, totpBackupCodesResponseCheck, totpEnrollResponseCheck, } from './signIn';
|
|
36
36
|
export { BOT_USERNAME_INVALID_MESSAGE, BOT_USERNAME_SUFFIX, NUMERIC_USERNAME_MESSAGE, RESERVED_USERNAMES, RESERVED_USERNAME_MESSAGE, USERNAME_INVALID_MESSAGE, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, applyBotUsernameSuffix, botUsernameCheck, stripDisallowedUsernameCharacters, usernameCheck, usernameCheckForAccountKind, } from './username';
|
|
37
37
|
export { userNameCheck } from './userResponse';
|
|
38
|
+
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 './contentClaims';
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
import { type Check } from './check';
|
|
8
|
+
export declare const subjectProductAccessQueryCheck: Check<{
|
|
8
9
|
schemaVersion: 1;
|
|
9
10
|
subjectAccountId: string & import("zod").BRAND<"OxyAccountId">;
|
|
10
11
|
productId: string;
|
|
11
12
|
}>;
|
|
12
|
-
export declare const subjectProductAccessCheck:
|
|
13
|
+
export declare const subjectProductAccessCheck: Check<{
|
|
13
14
|
schemaVersion: 1;
|
|
14
15
|
subjectAccountId: string & import("zod").BRAND<"OxyAccountId">;
|
|
15
16
|
capabilities: {
|
|
@@ -31,10 +32,10 @@ export declare const subjectProductAccessCheck: import("./check").Check<{
|
|
|
31
32
|
grantIds: string[];
|
|
32
33
|
}[];
|
|
33
34
|
}>;
|
|
34
|
-
export declare const personalPlanCatalogueCheck:
|
|
35
|
+
export declare const personalPlanCatalogueCheck: Check<{
|
|
35
36
|
schemaVersion: 1;
|
|
36
37
|
state: "unconfigured" | "configured";
|
|
37
|
-
purchase: "unavailable";
|
|
38
|
+
purchase: "unavailable" | "available";
|
|
38
39
|
plans: {
|
|
39
40
|
kind: "oxy_one";
|
|
40
41
|
displayName: string;
|
|
@@ -66,13 +67,44 @@ export declare const personalPlanCatalogueCheck: import("./check").Check<{
|
|
|
66
67
|
} | undefined;
|
|
67
68
|
}[];
|
|
68
69
|
}>;
|
|
69
|
-
export declare const
|
|
70
|
+
export declare const productPlanCatalogueCheck: Check<{
|
|
71
|
+
schemaVersion: 1;
|
|
72
|
+
purchase: "unavailable" | "available";
|
|
73
|
+
productId: string;
|
|
74
|
+
plans: {
|
|
75
|
+
displayName: string;
|
|
76
|
+
price: {
|
|
77
|
+
currency: string;
|
|
78
|
+
amountMinorUnits: number;
|
|
79
|
+
interval: "year" | "month";
|
|
80
|
+
trial: "none";
|
|
81
|
+
taxTreatment: "inclusive";
|
|
82
|
+
merchantTotal: "final";
|
|
83
|
+
};
|
|
84
|
+
productId: string;
|
|
85
|
+
offerId: string;
|
|
86
|
+
offerVersion: number;
|
|
87
|
+
}[];
|
|
88
|
+
}>;
|
|
89
|
+
export declare const personalPlanCheckoutRequestCheck: Check<{
|
|
90
|
+
idempotencyKey: string;
|
|
91
|
+
offerId: string;
|
|
92
|
+
offerVersion: number;
|
|
93
|
+
expectedSubjectAccountId: string & import("zod").BRAND<"OxyAccountId">;
|
|
94
|
+
}>;
|
|
95
|
+
export declare const productPlanCheckoutRequestCheck: Check<{
|
|
70
96
|
idempotencyKey: string;
|
|
97
|
+
productId: string;
|
|
71
98
|
offerId: string;
|
|
72
99
|
offerVersion: number;
|
|
73
100
|
expectedSubjectAccountId: string & import("zod").BRAND<"OxyAccountId">;
|
|
74
101
|
}>;
|
|
75
|
-
export declare const
|
|
102
|
+
export declare const productSubscriptionRenewalRequestCheck: Check<{
|
|
103
|
+
sourceId: string;
|
|
104
|
+
idempotencyKey: string;
|
|
105
|
+
expectedSubjectAccountId: string & import("zod").BRAND<"OxyAccountId">;
|
|
106
|
+
}>;
|
|
107
|
+
export declare const personalPlanCheckoutResultCheck: Check<{
|
|
76
108
|
reason: "provider_unconfigured" | "offer_unconfigured" | "price_unconfigured";
|
|
77
109
|
state: "unconfigured";
|
|
78
110
|
} | {
|
|
@@ -86,7 +118,7 @@ export declare const personalPlanCheckoutResultCheck: import("./check").Check<{
|
|
|
86
118
|
state: "fulfilled";
|
|
87
119
|
intentId: string;
|
|
88
120
|
}>;
|
|
89
|
-
export declare const productSubscriptionsResponseCheck:
|
|
121
|
+
export declare const productSubscriptionsResponseCheck: Check<{
|
|
90
122
|
subscriptions: {
|
|
91
123
|
status: "active" | "incomplete" | "canceled" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid";
|
|
92
124
|
sourceId: string;
|
|
@@ -112,9 +144,10 @@ export declare const productSubscriptionsResponseCheck: import("./check").Check<
|
|
|
112
144
|
displayName: string;
|
|
113
145
|
}[];
|
|
114
146
|
}[];
|
|
147
|
+
canRenew?: boolean | undefined;
|
|
115
148
|
}[];
|
|
116
149
|
}>;
|
|
117
|
-
export declare const subscriptionCreditGrantsResponseCheck:
|
|
150
|
+
export declare const subscriptionCreditGrantsResponseCheck: Check<{
|
|
118
151
|
grants: {
|
|
119
152
|
createdAt: string;
|
|
120
153
|
id: string;
|
|
@@ -131,12 +164,12 @@ export declare const subscriptionCreditGrantsResponseCheck: import("./check").Ch
|
|
|
131
164
|
promotionId: string | null;
|
|
132
165
|
}[];
|
|
133
166
|
}>;
|
|
134
|
-
export declare const cancelProductSubscriptionCheck:
|
|
167
|
+
export declare const cancelProductSubscriptionCheck: Check<{
|
|
135
168
|
sourceId: string;
|
|
136
169
|
actionId?: string | undefined;
|
|
137
170
|
expectedSubjectAccountId?: (string & import("zod").BRAND<"OxyAccountId">) | undefined;
|
|
138
171
|
}>;
|
|
139
|
-
export declare const productSubscriptionCancellationResultCheck:
|
|
172
|
+
export declare const productSubscriptionCancellationResultCheck: Check<{
|
|
140
173
|
sourceId: string;
|
|
141
174
|
cancelAtPeriodEnd: true;
|
|
142
175
|
} | {
|
|
@@ -21,7 +21,7 @@ export declare const profileAccessInputCheck: Check<{
|
|
|
21
21
|
}>;
|
|
22
22
|
export declare const profileAccessDecisionCheck: Check<{
|
|
23
23
|
allowed: boolean;
|
|
24
|
-
reason: "owner" | "unavailable" | "
|
|
24
|
+
reason: "owner" | "unavailable" | "blocked" | "private" | "public";
|
|
25
25
|
policyVersion: "1";
|
|
26
26
|
}>;
|
|
27
27
|
export declare const supervisionInvitationCheck: Check<{
|
|
@@ -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
|
+
}
|
|
@@ -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";
|