@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.
Files changed (38) hide show
  1. package/dist/cjs/client/contentClaims.js +139 -0
  2. package/dist/cjs/client/index.js +21 -3
  3. package/dist/cjs/client/products.js +33 -11
  4. package/dist/cjs/contentClaims.js +246 -0
  5. package/dist/cjs/index.js +3 -1
  6. package/dist/cjs/products/billing.js +1 -0
  7. package/dist/cjs/products/checkout.js +14 -1
  8. package/dist/cjs/products/plans.js +18 -2
  9. package/dist/cjs/userResponse.js +8 -1
  10. package/dist/esm/client/contentClaims.js +134 -0
  11. package/dist/esm/client/index.js +2 -1
  12. package/dist/esm/client/products.js +32 -10
  13. package/dist/esm/contentClaims.js +229 -0
  14. package/dist/esm/index.js +2 -1
  15. package/dist/esm/products/billing.js +1 -0
  16. package/dist/esm/products/checkout.js +13 -0
  17. package/dist/esm/products/plans.js +17 -1
  18. package/dist/esm/userResponse.js +8 -1
  19. package/dist/types/client/contentClaims.d.ts +106 -0
  20. package/dist/types/client/index.d.ts +2 -1
  21. package/dist/types/client/products.d.ts +43 -10
  22. package/dist/types/client/safety.d.ts +1 -1
  23. package/dist/types/contentClaims.d.ts +383 -0
  24. package/dist/types/email/messages.d.ts +2 -2
  25. package/dist/types/externalIdentity.d.ts +45 -12
  26. package/dist/types/index.d.ts +2 -1
  27. package/dist/types/inference/aliaModelRelease.d.ts +8 -8
  28. package/dist/types/inference/catalogue.d.ts +4 -4
  29. package/dist/types/inference/inbox.d.ts +4 -4
  30. package/dist/types/inference/modelDocumentation.d.ts +16 -16
  31. package/dist/types/products/billing.d.ts +8 -0
  32. package/dist/types/products/checkout.d.ts +36 -0
  33. package/dist/types/products/plans.d.ts +102 -5
  34. package/dist/types/safety.d.ts +77 -50
  35. package/dist/types/sessionStatus.d.ts +4 -4
  36. package/dist/types/updates.d.ts +6 -6
  37. package/dist/types/userResponse.d.ts +145 -9
  38. package/package.json +1 -1
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ /**
3
+ * Content claims (ADR 0043 D10) — the constants of the public "Report content
4
+ * / rights claim" intake and of a claim's review, without Zod. Schemas:
5
+ * `../contentClaims.ts`.
6
+ *
7
+ * Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.COUNTER_NOTICE_STATEMENT_VERSION = exports.COUNTER_NOTICE_STATEMENTS = exports.CONTENT_CLAIM_COUNTER_NOTICE_LIMITS = exports.CONTENT_CLAIM_REFERENCE_PATTERN = exports.CONTENT_CLAIM_ERROR_CODES = exports.ERASURE_REQUEST_DEADLINE_DAYS = exports.CLOSED_CONTENT_CLAIM_STATES = exports.OPEN_CONTENT_CLAIM_STATES = exports.CONTENT_CLAIM_STATES = exports.CONTENT_CLAIM_LIMITS = exports.CLAIMANT_RELATIONSHIPS = exports.CONTENT_CLAIM_KINDS = void 0;
11
+ exports.isRightsClaim = isRightsClaim;
12
+ exports.isErasureRequest = isErasureRequest;
13
+ /** What a claim asserts. */
14
+ exports.CONTENT_CLAIM_KINDS = [
15
+ 'copyright',
16
+ 'trademark',
17
+ 'privacy',
18
+ 'illegal_content',
19
+ 'other',
20
+ ];
21
+ /** Who the claimant is to the content. */
22
+ exports.CLAIMANT_RELATIONSHIPS = [
23
+ 'rights_holder',
24
+ 'authorized_agent',
25
+ 'affected_person',
26
+ 'other',
27
+ ];
28
+ /** The bounds of a submission. The website fills its validation messages from these. */
29
+ exports.CONTENT_CLAIM_LIMITS = {
30
+ minUrls: 1,
31
+ maxUrls: 20,
32
+ maxUrlLength: 2048,
33
+ minDescription: 20,
34
+ maxDescription: 5000,
35
+ maxName: 200,
36
+ maxOrganization: 200,
37
+ maxEmail: 254,
38
+ };
39
+ /**
40
+ * Where a claim is in its review.
41
+ *
42
+ * `received → reviewing → actioned | rejected`; an actioned claim can be
43
+ * answered by the content's owner (`counter_noticed`), which ends either in
44
+ * `reinstated` (the content is served again) or `upheld` (it stays blocked).
45
+ * A claim can also be rejected straight from `received`.
46
+ */
47
+ exports.CONTENT_CLAIM_STATES = [
48
+ 'received',
49
+ 'reviewing',
50
+ 'actioned',
51
+ 'rejected',
52
+ 'counter_noticed',
53
+ 'reinstated',
54
+ 'upheld',
55
+ ];
56
+ /** The states in which a claim is still open: its evidence is kept and its blocks can change. */
57
+ exports.OPEN_CONTENT_CLAIM_STATES = [
58
+ 'received',
59
+ 'reviewing',
60
+ 'actioned',
61
+ 'counter_noticed',
62
+ ];
63
+ /** The states a claim ends in. */
64
+ exports.CLOSED_CONTENT_CLAIM_STATES = [
65
+ 'rejected',
66
+ 'reinstated',
67
+ 'upheld',
68
+ ];
69
+ /**
70
+ * The kinds whose claimant asserts a right in a work or a mark. Only these
71
+ * carry the link to the original — a privacy or illegal-content report
72
+ * asserts no ownership.
73
+ */
74
+ function isRightsClaim(kind) {
75
+ return kind === 'copyright' || kind === 'trademark';
76
+ }
77
+ /**
78
+ * A request to erase the claimant's OWN personal data (GDPR art. 17): a
79
+ * privacy claim made by the person it is about. Oxy must answer it within one
80
+ * month (art. 12(3)); the claim carries that deadline.
81
+ */
82
+ function isErasureRequest(kind, relationship) {
83
+ return kind === 'privacy' && relationship === 'affected_person';
84
+ }
85
+ /** Days Oxy has to answer an erasure request ({@link isErasureRequest}). */
86
+ exports.ERASURE_REQUEST_DEADLINE_DAYS = 30;
87
+ /**
88
+ * Stable error codes a takedown produces elsewhere in the API. A file whose
89
+ * bytes are on the blocklist cannot be uploaded, imported or copied by anyone
90
+ * (HTTP 451).
91
+ */
92
+ exports.CONTENT_CLAIM_ERROR_CODES = {
93
+ /** The submission failed validation; `fields` names each problem. */
94
+ invalid: 'CONTENT_CLAIM_INVALID',
95
+ /** These exact bytes were taken down after a claim and cannot be stored again. */
96
+ contentBlocked: 'CONTENT_BLOCKED',
97
+ /** A counter-notice failed validation; `fields` names each problem. */
98
+ counterNoticeInvalid: 'CONTENT_CLAIM_COUNTER_NOTICE_INVALID',
99
+ /** The files named are blocked by more than one claim: name the claim's reference. */
100
+ counterNoticeAmbiguous: 'CONTENT_CLAIM_COUNTER_NOTICE_AMBIGUOUS',
101
+ /** This account already sent a counter-notice for this claim. */
102
+ counterNoticeExists: 'CONTENT_CLAIM_COUNTER_NOTICE_EXISTS',
103
+ };
104
+ /**
105
+ * A claim's reference as the claimant and the owner are sent it:
106
+ * `OXY-XXXX-XXXX`, Crockford base32 (no I, L, O or U).
107
+ */
108
+ exports.CONTENT_CLAIM_REFERENCE_PATTERN = /^OXY-[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}$/;
109
+ /** The bounds of an owner's counter-notice. The website fills its validation messages from these. */
110
+ exports.CONTENT_CLAIM_COUNTER_NOTICE_LIMITS = {
111
+ maxFileIds: 50,
112
+ maxFileId: 64,
113
+ maxName: 200,
114
+ maxAddress: 500,
115
+ minPhone: 5,
116
+ maxPhone: 40,
117
+ maxEmail: 254,
118
+ minMaterial: 10,
119
+ maxMaterial: 2000,
120
+ maxLocation: 2048,
121
+ minExplanation: 20,
122
+ maxExplanation: 5000,
123
+ maxSignature: 200,
124
+ };
125
+ /**
126
+ * The statements an owner's counter-notice makes, word for word — what the
127
+ * form shows beside each box (17 U.S.C. § 512(g)(3)(C) and (D), and what Oxy
128
+ * does with the notice). The API records {@link COUNTER_NOTICE_STATEMENT_VERSION}
129
+ * with every notice, so the wording a person agreed to can always be told
130
+ * apart from a later one. Change the text only together with the version.
131
+ */
132
+ exports.COUNTER_NOTICE_STATEMENTS = {
133
+ 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.',
134
+ 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.',
135
+ serviceOfProcess: 'I will accept service of process from the person who provided the notification of the claimed infringement, or an agent of such person.',
136
+ 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.',
137
+ };
138
+ /** The version of {@link COUNTER_NOTICE_STATEMENTS} in force. */
139
+ exports.COUNTER_NOTICE_STATEMENT_VERSION = '2026-10-16';
@@ -17,9 +17,9 @@
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.deviceJoinCodeResponseCheck = exports.deviceBackgroundCredentialResponseCheck = exports.activeTokenCheck = exports.SESSION_ACCOUNTS_CHANGED_EVENT = exports.deviceDirectorySyncCheck = exports.deviceDirectoryCheck = exports.deviceActivateResponseCheck = exports.signedRecordEnvelopeCheck = exports.externalIdentityReferenceCheck = exports.loginResultCheck = exports.isLoopbackOrigin = exports.executeAgentKeyOperationCheck = exports.agentVerifyRequestCheck = exports.agentProofClaimsCheck = exports.agentKeyOperationResultCheck = exports.agentKeyOperationCheck = exports.agentKeyOperationChallengeCheck = exports.agentKeyListResponseCheck = exports.agentChallengeRequestCheck = exports.AGENT_PROOF_TTL_MS = exports.AGENT_PROOF_AUDIENCE = exports.AGENT_PROOF_ACTIONS = exports.ACCOUNT_AUTH_METHODS = exports.emailVerificationStartResponseCheck = exports.emailVerificationConfirmResponseCheck = exports.emailTicketCheck = exports.emailAddressCheck = exports.EMAIL_VERIFICATION_PURPOSES = exports.EMAIL_VERIFICATION_ERROR_CODES = exports.EMAIL_TICKET_TTL_MS = exports.EMAIL_CODE_TTL_MS = exports.EMAIL_CODE_MAX_ATTEMPTS = exports.EMAIL_CODE_LENGTH = exports.newlyAddedRetiredCategories = exports.kindAcceptsAccountCategories = exports.isSelectableAccountCategoryId = exports.isOperatorSwitchTargetKind = exports.isDelegatedActAsEligibleKind = exports.isAccountKind = exports.SELECTABLE_ACCOUNT_CATEGORY_IDS = exports.RETIRED_ACCOUNT_CATEGORY_IDS = exports.MAX_ACCOUNT_CATEGORIES = exports.CHILD_ACCOUNT_KINDS = exports.ACCOUNT_KINDS = exports.ACCOUNT_CATEGORY_KINDS = exports.ACCOUNT_CATEGORY_IDS = exports.parseContract = exports.formatCheckPath = exports.checkContract = exports.ContractCheckError = void 0;
20
- exports.subjectProductAccessCheck = exports.productSubscriptionsResponseCheck = exports.productSubscriptionCancellationResultCheck = exports.personalPlanCheckoutResultCheck = exports.personalPlanCheckoutRequestCheck = exports.personalPlanCatalogueCheck = exports.cancelProductSubscriptionCheck = exports.updateOrganizationCheck = exports.organizationNameCheck = exports.organizationListCheck = exports.organizationImportBatchResultCheck = exports.organizationExternalResolutionCheck = exports.organizationExternalCheck = exports.organizationCurationResultCheck = exports.organizationClaimReviewCheck = exports.organizationClaimListCheck = exports.organizationClaimInputCheck = exports.organizationClaimDetailCheck = exports.organizationClaimCheck = exports.organizationCheck = exports.organizationBatchCheck = exports.createOrganizationCheck = exports.ORGANIZATION_TYPES = exports.ORGANIZATION_STATUSES = exports.ORGANIZATION_NAME_MAX_LENGTH = exports.ORGANIZATION_ERROR_CODES = exports.ORGANIZATION_CLAIM_STATUSES = exports.ORGANIZATION_CLAIM_DECISIONS = exports.ORGANIZATION_ALIAS_KINDS = exports.canonicalJson = exports.buildIdentityProofMessage = exports.IDENTITY_PROOF_VERSION = exports.IDENTITY_PROOF_DOMAIN = exports.IDENTITY_PROOF_CHALLENGE_TTL_MS = exports.IDENTITY_PROOF_AUDIENCE = exports.IDENTITY_PROOF_ACTION_VALUES = exports.IDENTITY_PROOF_ACTIONS = exports.IDENTITY_ERROR_CODES = exports.parseIdentityLinkQrPayload = exports.identityLinkStateCheck = exports.identityLinkCreateResponseCheck = exports.buildIdentityLinkQrPayload = exports.IDENTITY_LINK_STATUSES = exports.IDENTITY_LINK_QR_PREFIX = exports.sessionAccountsChangedEventCheck = exports.deviceTokenMintResponseCheck = exports.deviceSessionSyncCheck = exports.deviceSessionStateCheck = exports.deviceRegisterResponseCheck = exports.deviceJoinResponseCheck = void 0;
21
- exports.secondFactorRequiredCheck = exports.reauthProofCheck = exports.normalizeEmailSignInCode = exports.isSecondFactorRequired = exports.isEmailSignInChooseAccount = exports.emailSignInStartResponseCheck = exports.emailSignInPendingCheck = exports.emailSignInLinkResponseCheck = exports.emailSignInChooseAccountCheck = exports.TOTP_PERIOD_SECONDS = exports.TOTP_DIGITS = exports.TOTP_BACKUP_CODE_COUNT = exports.SIGN_IN_ERROR_CODES = exports.SIGNIN_SECOND_FACTOR_TTL_MS = exports.SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS = exports.REAUTH_ACTIONS = exports.PASSWORD_MIN_LENGTH = exports.PASSWORD_MAX_LENGTH = exports.EMAIL_SIGNIN_LONG_CODE_LENGTH = exports.EMAIL_SIGNIN_LONG_CODE_ALPHABET = exports.EMAIL_SIGNIN_LINK_TTL_MS = exports.EMAIL_SIGNIN_CHOICE_TTL_MS = exports.EMAIL_ACCOUNTS_MAX = exports.publicApplicationCheck = exports.supervisionStateCheck = exports.supervisionReviewInputCheck = exports.supervisionInviteInputCheck = exports.supervisionInvitationCheck = exports.supervisionContactsResponseCheck = exports.supervisionContactInputCheck = exports.supervisionAcceptInputCheck = exports.safetyPeopleResponseCheck = exports.safetyPeopleInputCheck = exports.safetyOrganizationsResponseCheck = exports.safetyOrganizationsInputCheck = exports.purchaseReviewInputCheck = exports.purchaseApprovalListCheck = exports.purchaseApprovalCheck = exports.profileAccessInputCheck = exports.profileAccessDecisionCheck = exports.SUPERVISION_STATUSES = exports.SUPERVISION_INVITATION_STATUSES = exports.SUPERVISION_CONSENT_VERSION = exports.SUPERVISED_ACTIONS = exports.SAFETY_POLICY_VERSION = exports.PURCHASE_APPROVAL_STATUSES = exports.isFullReputationBalance = exports.recommendationRequestCheck = exports.subscriptionCreditGrantsResponseCheck = exports.subjectProductAccessQueryCheck = void 0;
22
- exports.userNameCheck = exports.usernameCheckForAccountKind = exports.usernameCheck = exports.stripDisallowedUsernameCharacters = exports.botUsernameCheck = exports.applyBotUsernameSuffix = exports.USERNAME_PATTERN_SOURCE = exports.USERNAME_MIN_LENGTH = exports.USERNAME_MAX_LENGTH = exports.USERNAME_INVALID_MESSAGE = exports.RESERVED_USERNAME_MESSAGE = exports.RESERVED_USERNAMES = exports.NUMERIC_USERNAME_MESSAGE = exports.BOT_USERNAME_SUFFIX = exports.BOT_USERNAME_INVALID_MESSAGE = exports.totpEnrollResponseCheck = exports.totpBackupCodesResponseCheck = exports.signInMethodsCheck = void 0;
20
+ exports.productSubscriptionCancellationResultCheck = exports.productPlanCheckoutRequestCheck = exports.productPlanCatalogueCheck = exports.personalPlanCheckoutResultCheck = exports.personalPlanCheckoutRequestCheck = exports.personalPlanCatalogueCheck = exports.cancelProductSubscriptionCheck = exports.updateOrganizationCheck = exports.organizationNameCheck = exports.organizationListCheck = exports.organizationImportBatchResultCheck = exports.organizationExternalResolutionCheck = exports.organizationExternalCheck = exports.organizationCurationResultCheck = exports.organizationClaimReviewCheck = exports.organizationClaimListCheck = exports.organizationClaimInputCheck = exports.organizationClaimDetailCheck = exports.organizationClaimCheck = exports.organizationCheck = exports.organizationBatchCheck = exports.createOrganizationCheck = exports.ORGANIZATION_TYPES = exports.ORGANIZATION_STATUSES = exports.ORGANIZATION_NAME_MAX_LENGTH = exports.ORGANIZATION_ERROR_CODES = exports.ORGANIZATION_CLAIM_STATUSES = exports.ORGANIZATION_CLAIM_DECISIONS = exports.ORGANIZATION_ALIAS_KINDS = exports.canonicalJson = exports.buildIdentityProofMessage = exports.IDENTITY_PROOF_VERSION = exports.IDENTITY_PROOF_DOMAIN = exports.IDENTITY_PROOF_CHALLENGE_TTL_MS = exports.IDENTITY_PROOF_AUDIENCE = exports.IDENTITY_PROOF_ACTION_VALUES = exports.IDENTITY_PROOF_ACTIONS = exports.IDENTITY_ERROR_CODES = exports.parseIdentityLinkQrPayload = exports.identityLinkStateCheck = exports.identityLinkCreateResponseCheck = exports.buildIdentityLinkQrPayload = exports.IDENTITY_LINK_STATUSES = exports.IDENTITY_LINK_QR_PREFIX = exports.sessionAccountsChangedEventCheck = exports.deviceTokenMintResponseCheck = exports.deviceSessionSyncCheck = exports.deviceSessionStateCheck = exports.deviceRegisterResponseCheck = exports.deviceJoinResponseCheck = void 0;
21
+ exports.isSecondFactorRequired = exports.isEmailSignInChooseAccount = exports.emailSignInStartResponseCheck = exports.emailSignInPendingCheck = exports.emailSignInLinkResponseCheck = exports.emailSignInChooseAccountCheck = exports.TOTP_PERIOD_SECONDS = exports.TOTP_DIGITS = exports.TOTP_BACKUP_CODE_COUNT = exports.SIGN_IN_ERROR_CODES = exports.SIGNIN_SECOND_FACTOR_TTL_MS = exports.SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS = exports.REAUTH_ACTIONS = exports.PASSWORD_MIN_LENGTH = exports.PASSWORD_MAX_LENGTH = exports.EMAIL_SIGNIN_LONG_CODE_LENGTH = exports.EMAIL_SIGNIN_LONG_CODE_ALPHABET = exports.EMAIL_SIGNIN_LINK_TTL_MS = exports.EMAIL_SIGNIN_CHOICE_TTL_MS = exports.EMAIL_ACCOUNTS_MAX = exports.publicApplicationCheck = exports.supervisionStateCheck = exports.supervisionReviewInputCheck = exports.supervisionInviteInputCheck = exports.supervisionInvitationCheck = exports.supervisionContactsResponseCheck = exports.supervisionContactInputCheck = exports.supervisionAcceptInputCheck = exports.safetyPeopleResponseCheck = exports.safetyPeopleInputCheck = exports.safetyOrganizationsResponseCheck = exports.safetyOrganizationsInputCheck = exports.purchaseReviewInputCheck = exports.purchaseApprovalListCheck = exports.purchaseApprovalCheck = exports.profileAccessInputCheck = exports.profileAccessDecisionCheck = exports.SUPERVISION_STATUSES = exports.SUPERVISION_INVITATION_STATUSES = exports.SUPERVISION_CONSENT_VERSION = exports.SUPERVISED_ACTIONS = exports.SAFETY_POLICY_VERSION = exports.PURCHASE_APPROVAL_STATUSES = exports.isFullReputationBalance = exports.recommendationRequestCheck = exports.subscriptionCreditGrantsResponseCheck = exports.subjectProductAccessQueryCheck = exports.subjectProductAccessCheck = exports.productSubscriptionsResponseCheck = exports.productSubscriptionRenewalRequestCheck = void 0;
22
+ exports.isRightsClaim = exports.isErasureRequest = exports.OPEN_CONTENT_CLAIM_STATES = exports.ERASURE_REQUEST_DEADLINE_DAYS = exports.COUNTER_NOTICE_STATEMENTS = exports.COUNTER_NOTICE_STATEMENT_VERSION = exports.CONTENT_CLAIM_STATES = exports.CONTENT_CLAIM_REFERENCE_PATTERN = exports.CONTENT_CLAIM_LIMITS = exports.CONTENT_CLAIM_KINDS = exports.CONTENT_CLAIM_ERROR_CODES = exports.CONTENT_CLAIM_COUNTER_NOTICE_LIMITS = exports.CLOSED_CONTENT_CLAIM_STATES = exports.CLAIMANT_RELATIONSHIPS = exports.userNameCheck = exports.usernameCheckForAccountKind = exports.usernameCheck = exports.stripDisallowedUsernameCharacters = exports.botUsernameCheck = exports.applyBotUsernameSuffix = exports.USERNAME_PATTERN_SOURCE = exports.USERNAME_MIN_LENGTH = exports.USERNAME_MAX_LENGTH = exports.USERNAME_INVALID_MESSAGE = exports.RESERVED_USERNAME_MESSAGE = exports.RESERVED_USERNAMES = exports.NUMERIC_USERNAME_MESSAGE = exports.BOT_USERNAME_SUFFIX = exports.BOT_USERNAME_INVALID_MESSAGE = exports.totpEnrollResponseCheck = exports.totpBackupCodesResponseCheck = exports.signInMethodsCheck = exports.secondFactorRequiredCheck = exports.reauthProofCheck = exports.normalizeEmailSignInCode = void 0;
23
23
  var check_1 = require("./check");
24
24
  Object.defineProperty(exports, "ContractCheckError", { enumerable: true, get: function () { return check_1.ContractCheckError; } });
25
25
  Object.defineProperty(exports, "checkContract", { enumerable: true, get: function () { return check_1.checkContract; } });
@@ -131,7 +131,10 @@ Object.defineProperty(exports, "cancelProductSubscriptionCheck", { enumerable: t
131
131
  Object.defineProperty(exports, "personalPlanCatalogueCheck", { enumerable: true, get: function () { return products_1.personalPlanCatalogueCheck; } });
132
132
  Object.defineProperty(exports, "personalPlanCheckoutRequestCheck", { enumerable: true, get: function () { return products_1.personalPlanCheckoutRequestCheck; } });
133
133
  Object.defineProperty(exports, "personalPlanCheckoutResultCheck", { enumerable: true, get: function () { return products_1.personalPlanCheckoutResultCheck; } });
134
+ Object.defineProperty(exports, "productPlanCatalogueCheck", { enumerable: true, get: function () { return products_1.productPlanCatalogueCheck; } });
135
+ Object.defineProperty(exports, "productPlanCheckoutRequestCheck", { enumerable: true, get: function () { return products_1.productPlanCheckoutRequestCheck; } });
134
136
  Object.defineProperty(exports, "productSubscriptionCancellationResultCheck", { enumerable: true, get: function () { return products_1.productSubscriptionCancellationResultCheck; } });
137
+ Object.defineProperty(exports, "productSubscriptionRenewalRequestCheck", { enumerable: true, get: function () { return products_1.productSubscriptionRenewalRequestCheck; } });
135
138
  Object.defineProperty(exports, "productSubscriptionsResponseCheck", { enumerable: true, get: function () { return products_1.productSubscriptionsResponseCheck; } });
136
139
  Object.defineProperty(exports, "subjectProductAccessCheck", { enumerable: true, get: function () { return products_1.subjectProductAccessCheck; } });
137
140
  Object.defineProperty(exports, "subjectProductAccessQueryCheck", { enumerable: true, get: function () { return products_1.subjectProductAccessQueryCheck; } });
@@ -209,3 +212,18 @@ Object.defineProperty(exports, "usernameCheck", { enumerable: true, get: functio
209
212
  Object.defineProperty(exports, "usernameCheckForAccountKind", { enumerable: true, get: function () { return username_1.usernameCheckForAccountKind; } });
210
213
  var userResponse_1 = require("./userResponse");
211
214
  Object.defineProperty(exports, "userNameCheck", { enumerable: true, get: function () { return userResponse_1.userNameCheck; } });
215
+ var contentClaims_1 = require("./contentClaims");
216
+ Object.defineProperty(exports, "CLAIMANT_RELATIONSHIPS", { enumerable: true, get: function () { return contentClaims_1.CLAIMANT_RELATIONSHIPS; } });
217
+ Object.defineProperty(exports, "CLOSED_CONTENT_CLAIM_STATES", { enumerable: true, get: function () { return contentClaims_1.CLOSED_CONTENT_CLAIM_STATES; } });
218
+ Object.defineProperty(exports, "CONTENT_CLAIM_COUNTER_NOTICE_LIMITS", { enumerable: true, get: function () { return contentClaims_1.CONTENT_CLAIM_COUNTER_NOTICE_LIMITS; } });
219
+ Object.defineProperty(exports, "CONTENT_CLAIM_ERROR_CODES", { enumerable: true, get: function () { return contentClaims_1.CONTENT_CLAIM_ERROR_CODES; } });
220
+ Object.defineProperty(exports, "CONTENT_CLAIM_KINDS", { enumerable: true, get: function () { return contentClaims_1.CONTENT_CLAIM_KINDS; } });
221
+ Object.defineProperty(exports, "CONTENT_CLAIM_LIMITS", { enumerable: true, get: function () { return contentClaims_1.CONTENT_CLAIM_LIMITS; } });
222
+ Object.defineProperty(exports, "CONTENT_CLAIM_REFERENCE_PATTERN", { enumerable: true, get: function () { return contentClaims_1.CONTENT_CLAIM_REFERENCE_PATTERN; } });
223
+ Object.defineProperty(exports, "CONTENT_CLAIM_STATES", { enumerable: true, get: function () { return contentClaims_1.CONTENT_CLAIM_STATES; } });
224
+ Object.defineProperty(exports, "COUNTER_NOTICE_STATEMENT_VERSION", { enumerable: true, get: function () { return contentClaims_1.COUNTER_NOTICE_STATEMENT_VERSION; } });
225
+ Object.defineProperty(exports, "COUNTER_NOTICE_STATEMENTS", { enumerable: true, get: function () { return contentClaims_1.COUNTER_NOTICE_STATEMENTS; } });
226
+ Object.defineProperty(exports, "ERASURE_REQUEST_DEADLINE_DAYS", { enumerable: true, get: function () { return contentClaims_1.ERASURE_REQUEST_DEADLINE_DAYS; } });
227
+ Object.defineProperty(exports, "OPEN_CONTENT_CLAIM_STATES", { enumerable: true, get: function () { return contentClaims_1.OPEN_CONTENT_CLAIM_STATES; } });
228
+ Object.defineProperty(exports, "isErasureRequest", { enumerable: true, get: function () { return contentClaims_1.isErasureRequest; } });
229
+ Object.defineProperty(exports, "isRightsClaim", { enumerable: true, get: function () { return contentClaims_1.isRightsClaim; } });
@@ -6,7 +6,7 @@
6
6
  * Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.productSubscriptionCancellationResultCheck = exports.cancelProductSubscriptionCheck = exports.subscriptionCreditGrantsResponseCheck = exports.productSubscriptionsResponseCheck = exports.personalPlanCheckoutResultCheck = exports.personalPlanCheckoutRequestCheck = exports.personalPlanCatalogueCheck = exports.subjectProductAccessCheck = exports.subjectProductAccessQueryCheck = void 0;
9
+ exports.productSubscriptionCancellationResultCheck = exports.cancelProductSubscriptionCheck = exports.subscriptionCreditGrantsResponseCheck = exports.productSubscriptionsResponseCheck = exports.personalPlanCheckoutResultCheck = exports.productSubscriptionRenewalRequestCheck = exports.productPlanCheckoutRequestCheck = exports.personalPlanCheckoutRequestCheck = exports.productPlanCatalogueCheck = exports.personalPlanCatalogueCheck = exports.subjectProductAccessCheck = exports.subjectProductAccessQueryCheck = void 0;
10
10
  const check_1 = require("./check");
11
11
  const identifier = (0, check_1.string)((0, check_1.minLength)(1), (0, check_1.maxLength)(160));
12
12
  const displayName = (0, check_1.string)((0, check_1.minLength)(1), (0, check_1.maxLength)(100));
@@ -16,6 +16,15 @@ const oxyAccountId = (0, check_1.branded)((0, check_1.string)((0, check_1.minLen
16
16
  const actionKey = (0, check_1.string)((0, check_1.minLength)(8), (0, check_1.maxLength)(160), (0, check_1.pattern)(/^[a-zA-Z0-9_-]+$/));
17
17
  const combination = (0, check_1.oneOf)(['maximum', 'sum', 'exclusive']);
18
18
  const origin = (0, check_1.oneOf)(['individual', 'bundle']);
19
+ const purchase = (0, check_1.oneOf)(['unavailable', 'available']);
20
+ const displayPrice = (interval) => (0, check_1.strictObject)({
21
+ currency: (0, check_1.string)((0, check_1.pattern)(/^[A-Z]{3}$/)),
22
+ amountMinorUnits: version,
23
+ interval,
24
+ trial: (0, check_1.literal)('none'),
25
+ taxTreatment: (0, check_1.literal)('inclusive'),
26
+ merchantTotal: (0, check_1.literal)('final'),
27
+ });
19
28
  const period = (message) => (0, check_1.refine)((0, check_1.strictObject)({ start: (0, check_1.string)(check_1.datetime), end: (0, check_1.string)(check_1.datetime) }), (value) => Date.parse(value.end) > Date.parse(value.start), message);
20
29
  const productBenefit = (0, check_1.discriminatedUnion)('kind', {
21
30
  capability: (0, check_1.strictObject)({ kind: (0, check_1.literal)('capability'), productId: identifier, key: identifier }),
@@ -60,29 +69,41 @@ exports.subjectProductAccessCheck = (0, check_1.exact)()((0, check_1.strictObjec
60
69
  exports.personalPlanCatalogueCheck = (0, check_1.exact)()((0, check_1.refine)((0, check_1.strictObject)({
61
70
  schemaVersion: (0, check_1.literal)(1),
62
71
  state: (0, check_1.oneOf)(['unconfigured', 'configured']),
63
- purchase: (0, check_1.literal)('unavailable'),
72
+ purchase,
64
73
  plans: (0, check_1.array)((0, check_1.strictObject)({
65
74
  offerId: identifier,
66
75
  offerVersion: version,
67
76
  displayName,
68
77
  audience: (0, check_1.literal)('personal'),
69
78
  kind: (0, check_1.literal)('oxy_one'),
70
- price: (0, check_1.optional)((0, check_1.strictObject)({
71
- currency: (0, check_1.string)((0, check_1.pattern)(/^[A-Z]{3}$/)),
72
- amountMinorUnits: version,
73
- interval: (0, check_1.literal)('month'),
74
- trial: (0, check_1.literal)('none'),
75
- taxTreatment: (0, check_1.literal)('inclusive'),
76
- merchantTotal: (0, check_1.literal)('final'),
77
- })),
79
+ price: (0, check_1.optional)(displayPrice((0, check_1.literal)('month'))),
78
80
  benefits: (0, check_1.array)((0, check_1.strictObject)({ displayName, benefit: productBenefit })),
79
81
  })),
80
82
  }), (value) => (value.state === 'unconfigured') === (value.plans.length === 0), 'Catalogue state must match published plans'));
81
- exports.personalPlanCheckoutRequestCheck = (0, check_1.exact)()((0, check_1.strictObject)({
83
+ exports.productPlanCatalogueCheck = (0, check_1.exact)()((0, check_1.strictObject)({
84
+ schemaVersion: (0, check_1.literal)(1),
85
+ productId: identifier,
86
+ purchase,
87
+ plans: (0, check_1.array)((0, check_1.strictObject)({
88
+ productId: identifier,
89
+ offerId: identifier,
90
+ offerVersion: version,
91
+ displayName,
92
+ price: displayPrice((0, check_1.oneOf)(['month', 'year'])),
93
+ })),
94
+ }));
95
+ const checkoutRequestShape = {
82
96
  expectedSubjectAccountId: oxyAccountId,
83
97
  offerId: identifier,
84
98
  offerVersion: version,
85
99
  idempotencyKey: actionKey,
100
+ };
101
+ exports.personalPlanCheckoutRequestCheck = (0, check_1.exact)()((0, check_1.strictObject)(checkoutRequestShape));
102
+ exports.productPlanCheckoutRequestCheck = (0, check_1.exact)()((0, check_1.strictObject)({ ...checkoutRequestShape, productId: identifier }));
103
+ exports.productSubscriptionRenewalRequestCheck = (0, check_1.exact)()((0, check_1.strictObject)({
104
+ expectedSubjectAccountId: oxyAccountId,
105
+ sourceId: identifier,
106
+ idempotencyKey: actionKey,
86
107
  }));
87
108
  exports.personalPlanCheckoutResultCheck = (0, check_1.exact)()((0, check_1.discriminatedUnion)('state', {
88
109
  unconfigured: (0, check_1.strictObject)({
@@ -114,6 +135,7 @@ exports.productSubscriptionsResponseCheck = (0, check_1.exact)()((0, check_1.str
114
135
  period: billingPeriod,
115
136
  cancelAtPeriodEnd: check_1.boolean,
116
137
  canCancel: check_1.boolean,
138
+ canRenew: (0, check_1.optional)(check_1.boolean),
117
139
  offers: (0, check_1.array)((0, check_1.strictObject)({
118
140
  segmentId: identifier,
119
141
  offerId: identifier,
@@ -0,0 +1,246 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.contentClaimCounterNoticeSchema = exports.CONTENT_CLAIM_COUNTER_NOTICE_VALIDATION_KEYS = exports.CONTENT_CLAIM_EVENT_ACTIONS = exports.CONTENT_CLAIM_TARGET_SOURCES = exports.CONTENT_CLAIM_TARGET_RESOLUTIONS = exports.contentClaimSubmissionSchema = exports.CONTENT_CLAIM_VALIDATION_KEYS = exports.isRightsClaim = exports.isErasureRequest = exports.OPEN_CONTENT_CLAIM_STATES = exports.ERASURE_REQUEST_DEADLINE_DAYS = exports.COUNTER_NOTICE_STATEMENTS = exports.COUNTER_NOTICE_STATEMENT_VERSION = exports.CONTENT_CLAIM_STATES = exports.CONTENT_CLAIM_REFERENCE_PATTERN = exports.CONTENT_CLAIM_LIMITS = exports.CONTENT_CLAIM_KINDS = exports.CONTENT_CLAIM_ERROR_CODES = exports.CONTENT_CLAIM_COUNTER_NOTICE_LIMITS = exports.CLOSED_CONTENT_CLAIM_STATES = exports.CLAIMANT_RELATIONSHIPS = void 0;
4
+ /**
5
+ * Content claims (ADR 0043 D10): the public "Report content / rights claim"
6
+ * intake, `POST /content-claims`, and the staff review of a claim.
7
+ *
8
+ * {@link contentClaimSubmissionSchema} is the request body the API parses and
9
+ * the Oxy website validates its form with before posting, so the form cannot
10
+ * accept what the API would answer 400 to. Every validation message is a
11
+ * stable KEY under `contentClaim.errors.*` (filled with
12
+ * {@link CONTENT_CLAIM_LIMITS} by whoever shows it), never English: the website
13
+ * translates the key, and the API answers its own English sentence for it in
14
+ * `fields`.
15
+ */
16
+ const zod_1 = require("zod");
17
+ // The Zod-free half of this contract lives in `./client/` (`@oxy.so/contracts/client`);
18
+ // it is re-exported here so the root entry carries the whole contract.
19
+ const contentClaims_1 = require("./client/contentClaims");
20
+ var contentClaims_2 = require("./client/contentClaims");
21
+ Object.defineProperty(exports, "CLAIMANT_RELATIONSHIPS", { enumerable: true, get: function () { return contentClaims_2.CLAIMANT_RELATIONSHIPS; } });
22
+ Object.defineProperty(exports, "CLOSED_CONTENT_CLAIM_STATES", { enumerable: true, get: function () { return contentClaims_2.CLOSED_CONTENT_CLAIM_STATES; } });
23
+ Object.defineProperty(exports, "CONTENT_CLAIM_COUNTER_NOTICE_LIMITS", { enumerable: true, get: function () { return contentClaims_2.CONTENT_CLAIM_COUNTER_NOTICE_LIMITS; } });
24
+ Object.defineProperty(exports, "CONTENT_CLAIM_ERROR_CODES", { enumerable: true, get: function () { return contentClaims_2.CONTENT_CLAIM_ERROR_CODES; } });
25
+ Object.defineProperty(exports, "CONTENT_CLAIM_KINDS", { enumerable: true, get: function () { return contentClaims_2.CONTENT_CLAIM_KINDS; } });
26
+ Object.defineProperty(exports, "CONTENT_CLAIM_LIMITS", { enumerable: true, get: function () { return contentClaims_2.CONTENT_CLAIM_LIMITS; } });
27
+ Object.defineProperty(exports, "CONTENT_CLAIM_REFERENCE_PATTERN", { enumerable: true, get: function () { return contentClaims_2.CONTENT_CLAIM_REFERENCE_PATTERN; } });
28
+ Object.defineProperty(exports, "CONTENT_CLAIM_STATES", { enumerable: true, get: function () { return contentClaims_2.CONTENT_CLAIM_STATES; } });
29
+ Object.defineProperty(exports, "COUNTER_NOTICE_STATEMENT_VERSION", { enumerable: true, get: function () { return contentClaims_2.COUNTER_NOTICE_STATEMENT_VERSION; } });
30
+ Object.defineProperty(exports, "COUNTER_NOTICE_STATEMENTS", { enumerable: true, get: function () { return contentClaims_2.COUNTER_NOTICE_STATEMENTS; } });
31
+ Object.defineProperty(exports, "ERASURE_REQUEST_DEADLINE_DAYS", { enumerable: true, get: function () { return contentClaims_2.ERASURE_REQUEST_DEADLINE_DAYS; } });
32
+ Object.defineProperty(exports, "OPEN_CONTENT_CLAIM_STATES", { enumerable: true, get: function () { return contentClaims_2.OPEN_CONTENT_CLAIM_STATES; } });
33
+ Object.defineProperty(exports, "isErasureRequest", { enumerable: true, get: function () { return contentClaims_2.isErasureRequest; } });
34
+ Object.defineProperty(exports, "isRightsClaim", { enumerable: true, get: function () { return contentClaims_2.isRightsClaim; } });
35
+ /** Every key a submission's validation can produce, under `contentClaim.errors.*`. */
36
+ exports.CONTENT_CLAIM_VALIDATION_KEYS = [
37
+ 'contentClaim.errors.kind',
38
+ 'contentClaim.errors.contentUrlsRequired',
39
+ 'contentClaim.errors.contentUrlsTooMany',
40
+ 'contentClaim.errors.contentUrlInvalid',
41
+ 'contentClaim.errors.descriptionShort',
42
+ 'contentClaim.errors.descriptionLong',
43
+ 'contentClaim.errors.originalWorkUrl',
44
+ 'contentClaim.errors.name',
45
+ 'contentClaim.errors.email',
46
+ 'contentClaim.errors.organization',
47
+ 'contentClaim.errors.relationship',
48
+ 'contentClaim.errors.goodFaith',
49
+ 'contentClaim.errors.accurate',
50
+ 'contentClaim.errors.signature',
51
+ ];
52
+ function isHttpsUrl(value) {
53
+ try {
54
+ const url = new URL(value);
55
+ return url.protocol === 'https:' && url.hostname.length > 0;
56
+ }
57
+ catch {
58
+ return false;
59
+ }
60
+ }
61
+ const httpsUrl = (message) => zod_1.z.string().trim().max(contentClaims_1.CONTENT_CLAIM_LIMITS.maxUrlLength, message).refine(isHttpsUrl, message);
62
+ /**
63
+ * `POST /content-claims` — a claim, as the claimant sends it. Strict: an
64
+ * unknown key is refused rather than dropped.
65
+ */
66
+ exports.contentClaimSubmissionSchema = zod_1.z
67
+ .object({
68
+ kind: zod_1.z.enum(contentClaims_1.CONTENT_CLAIM_KINDS, { message: 'contentClaim.errors.kind' }),
69
+ contentUrls: zod_1.z
70
+ .array(httpsUrl('contentClaim.errors.contentUrlInvalid'), {
71
+ message: 'contentClaim.errors.contentUrlsRequired',
72
+ })
73
+ .min(contentClaims_1.CONTENT_CLAIM_LIMITS.minUrls, 'contentClaim.errors.contentUrlsRequired')
74
+ .max(contentClaims_1.CONTENT_CLAIM_LIMITS.maxUrls, 'contentClaim.errors.contentUrlsTooMany'),
75
+ description: zod_1.z
76
+ .string({ message: 'contentClaim.errors.descriptionShort' })
77
+ .trim()
78
+ .min(contentClaims_1.CONTENT_CLAIM_LIMITS.minDescription, 'contentClaim.errors.descriptionShort')
79
+ .max(contentClaims_1.CONTENT_CLAIM_LIMITS.maxDescription, 'contentClaim.errors.descriptionLong'),
80
+ originalWorkUrl: httpsUrl('contentClaim.errors.originalWorkUrl').optional(),
81
+ claimant: zod_1.z
82
+ .object({
83
+ name: zod_1.z
84
+ .string({ message: 'contentClaim.errors.name' })
85
+ .trim()
86
+ .min(1, 'contentClaim.errors.name')
87
+ .max(contentClaims_1.CONTENT_CLAIM_LIMITS.maxName, 'contentClaim.errors.name'),
88
+ email: zod_1.z
89
+ .string({ message: 'contentClaim.errors.email' })
90
+ .trim()
91
+ .email('contentClaim.errors.email')
92
+ .max(contentClaims_1.CONTENT_CLAIM_LIMITS.maxEmail, 'contentClaim.errors.email'),
93
+ organization: zod_1.z
94
+ .string({ message: 'contentClaim.errors.organization' })
95
+ .trim()
96
+ .max(contentClaims_1.CONTENT_CLAIM_LIMITS.maxOrganization, 'contentClaim.errors.organization')
97
+ .optional(),
98
+ relationship: zod_1.z.enum(contentClaims_1.CLAIMANT_RELATIONSHIPS, {
99
+ message: 'contentClaim.errors.relationship',
100
+ }),
101
+ }, { message: 'contentClaim.errors.name' })
102
+ .strict(),
103
+ statements: zod_1.z
104
+ .object({
105
+ goodFaith: zod_1.z.literal(true, {
106
+ errorMap: () => ({ message: 'contentClaim.errors.goodFaith' }),
107
+ }),
108
+ accurate: zod_1.z.literal(true, {
109
+ errorMap: () => ({ message: 'contentClaim.errors.accurate' }),
110
+ }),
111
+ }, { message: 'contentClaim.errors.goodFaith' })
112
+ .strict(),
113
+ signature: zod_1.z
114
+ .string({ message: 'contentClaim.errors.signature' })
115
+ .trim()
116
+ .min(1, 'contentClaim.errors.signature')
117
+ .max(contentClaims_1.CONTENT_CLAIM_LIMITS.maxName, 'contentClaim.errors.signature'),
118
+ })
119
+ .strict();
120
+ // ---------------------------------------------------------------------------
121
+ // The staff review (`/content-claims` behind the `content:claims` capability)
122
+ // ---------------------------------------------------------------------------
123
+ /** How a target's URL was understood. */
124
+ exports.CONTENT_CLAIM_TARGET_RESOLUTIONS = [
125
+ /** An Oxy file: `cloud.oxy.so/<id>`, `/cdn/<id>`, `/assets/<id>…`, a stored key. */
126
+ 'file',
127
+ /** A page of an Oxy app or anything else: a person attaches the files it shows. */
128
+ 'unresolved',
129
+ ];
130
+ /** Who added a target: the claimant's URL, or staff attaching a file by id. */
131
+ exports.CONTENT_CLAIM_TARGET_SOURCES = ['claimant', 'staff'];
132
+ /** What the audit trail records. */
133
+ exports.CONTENT_CLAIM_EVENT_ACTIONS = [
134
+ 'submitted',
135
+ 'review_started',
136
+ 'targets_attached',
137
+ 'targets_blocked',
138
+ 'rejected',
139
+ 'counter_notice_recorded',
140
+ /** The owner of the blocked content sent a counter-notice themselves (`POST /content-claims/counter-notices`). */
141
+ 'counter_notice_submitted',
142
+ 'reinstated',
143
+ 'upheld',
144
+ 'note_added',
145
+ ];
146
+ // ---------------------------------------------------------------------------
147
+ // The owner's counter-notice (`POST /content-claims/counter-notices`)
148
+ // ---------------------------------------------------------------------------
149
+ /** Every key a counter-notice's validation can produce, under `contentClaim.counterNotice.errors.*`. */
150
+ exports.CONTENT_CLAIM_COUNTER_NOTICE_VALIDATION_KEYS = [
151
+ 'contentClaim.counterNotice.errors.claim',
152
+ 'contentClaim.counterNotice.errors.reference',
153
+ 'contentClaim.counterNotice.errors.claimId',
154
+ 'contentClaim.counterNotice.errors.fileIds',
155
+ 'contentClaim.counterNotice.errors.name',
156
+ 'contentClaim.counterNotice.errors.address',
157
+ 'contentClaim.counterNotice.errors.phone',
158
+ 'contentClaim.counterNotice.errors.email',
159
+ 'contentClaim.counterNotice.errors.materialDescription',
160
+ 'contentClaim.counterNotice.errors.materialLocation',
161
+ 'contentClaim.counterNotice.errors.explanation',
162
+ 'contentClaim.counterNotice.errors.perjury',
163
+ 'contentClaim.counterNotice.errors.jurisdiction',
164
+ 'contentClaim.counterNotice.errors.serviceOfProcess',
165
+ 'contentClaim.counterNotice.errors.disclosure',
166
+ 'contentClaim.counterNotice.errors.signature',
167
+ ];
168
+ const N = contentClaims_1.CONTENT_CLAIM_COUNTER_NOTICE_LIMITS;
169
+ const boundedText = (min, max, message) => zod_1.z.string({ message }).trim().min(min, message).max(max, message);
170
+ const affirmed = (message) => zod_1.z.literal(true, { errorMap: () => ({ message }) });
171
+ /**
172
+ * `POST /content-claims/counter-notices` — the owner of content a claim took
173
+ * down disputes it (17 U.S.C. § 512(g)(3)). Signed in: the API answers only
174
+ * for files the caller owns.
175
+ *
176
+ * Names the claim by its `reference` (the `OXY-XXXX-XXXX` the owner was
177
+ * emailed), its `claimId`, or the blocked `fileIds` — at least one. With
178
+ * `fileIds` the notice covers exactly those files; without, every one of the
179
+ * caller's files the claim blocked. Strict: an unknown key is refused.
180
+ */
181
+ exports.contentClaimCounterNoticeSchema = zod_1.z
182
+ .object({
183
+ reference: zod_1.z
184
+ .string({ message: 'contentClaim.counterNotice.errors.reference' })
185
+ .trim()
186
+ .toUpperCase()
187
+ .regex(contentClaims_1.CONTENT_CLAIM_REFERENCE_PATTERN, 'contentClaim.counterNotice.errors.reference')
188
+ .optional(),
189
+ claimId: zod_1.z
190
+ .string({ message: 'contentClaim.counterNotice.errors.claimId' })
191
+ .trim()
192
+ .uuid('contentClaim.counterNotice.errors.claimId')
193
+ .optional(),
194
+ fileIds: zod_1.z
195
+ .array(boundedText(1, N.maxFileId, 'contentClaim.counterNotice.errors.fileIds'), {
196
+ message: 'contentClaim.counterNotice.errors.fileIds',
197
+ })
198
+ .min(1, 'contentClaim.counterNotice.errors.fileIds')
199
+ .max(N.maxFileIds, 'contentClaim.counterNotice.errors.fileIds')
200
+ .optional(),
201
+ subscriber: zod_1.z
202
+ .object({
203
+ name: boundedText(1, N.maxName, 'contentClaim.counterNotice.errors.name'),
204
+ address: boundedText(1, N.maxAddress, 'contentClaim.counterNotice.errors.address'),
205
+ phone: boundedText(N.minPhone, N.maxPhone, 'contentClaim.counterNotice.errors.phone').regex(/^\+?[0-9 ().-]+$/, 'contentClaim.counterNotice.errors.phone'),
206
+ email: zod_1.z
207
+ .string({ message: 'contentClaim.counterNotice.errors.email' })
208
+ .trim()
209
+ .email('contentClaim.counterNotice.errors.email')
210
+ .max(N.maxEmail, 'contentClaim.counterNotice.errors.email'),
211
+ }, { message: 'contentClaim.counterNotice.errors.name' })
212
+ .strict(),
213
+ material: zod_1.z
214
+ .object({
215
+ /** What was removed. */
216
+ description: boundedText(N.minMaterial, N.maxMaterial, 'contentClaim.counterNotice.errors.materialDescription'),
217
+ /** Where it appeared before it was removed (a URL, or where in an app). */
218
+ location: boundedText(1, N.maxLocation, 'contentClaim.counterNotice.errors.materialLocation'),
219
+ }, { message: 'contentClaim.counterNotice.errors.materialDescription' })
220
+ .strict(),
221
+ /** Why it was a mistake or a misidentification, in the owner's words. */
222
+ explanation: boundedText(N.minExplanation, N.maxExplanation, 'contentClaim.counterNotice.errors.explanation'),
223
+ /** Each of `COUNTER_NOTICE_STATEMENTS`, affirmed. */
224
+ statements: zod_1.z
225
+ .object({
226
+ perjury: affirmed('contentClaim.counterNotice.errors.perjury'),
227
+ jurisdiction: affirmed('contentClaim.counterNotice.errors.jurisdiction'),
228
+ serviceOfProcess: affirmed('contentClaim.counterNotice.errors.serviceOfProcess'),
229
+ disclosure: affirmed('contentClaim.counterNotice.errors.disclosure'),
230
+ }, { message: 'contentClaim.counterNotice.errors.perjury' })
231
+ .strict(),
232
+ /** The owner's full legal name, typed as their signature. */
233
+ signature: boundedText(1, N.maxSignature, 'contentClaim.counterNotice.errors.signature'),
234
+ })
235
+ .strict()
236
+ .superRefine((value, ctx) => {
237
+ if (value.reference === undefined &&
238
+ value.claimId === undefined &&
239
+ value.fileIds === undefined) {
240
+ ctx.addIssue({
241
+ code: zod_1.z.ZodIssueCode.custom,
242
+ path: ['reference'],
243
+ message: 'contentClaim.counterNotice.errors.claim',
244
+ });
245
+ }
246
+ });
package/dist/cjs/index.js CHANGED
@@ -39,7 +39,7 @@ exports.kaanaCredentialRotateMutationSchema = exports.kaanaCredentialCreateMutat
39
39
  exports.payAsYouGoEntitlementSchema = exports.productPlanSchema = exports.planAllowanceSchema = exports.LIVE_PRODUCT_PLAN_STATUSES = exports.productPlanStatusSchema = exports.PRODUCT_PLAN_STATUSES = exports.reconciliationReportSchema = exports.reconciliationRunSchema = exports.reconciliationDiscrepancySchema = exports.reconciliationRunStatusSchema = exports.RECONCILIATION_RUN_STATUSES = exports.reconciliationDiscrepancyKindSchema = exports.RECONCILIATION_DISCREPANCY_KINDS = exports.autoRechargeAttemptSchema = exports.autoRechargeStatusSchema = exports.AUTO_RECHARGE_STATUSES = exports.externalPaymentSchema = exports.externalPaymentKindSchema = exports.EXTERNAL_PAYMENT_KINDS = exports.externalPaymentProviderSchema = exports.EXTERNAL_PAYMENT_PROVIDERS = exports.billingInvoiceSchema = exports.billingInvoiceStatusSchema = exports.BILLING_INVOICE_STATUSES = exports.accountBillingStateSchema = exports.billingProfileSchema = exports.autoRechargeSchema = exports.billingProfileStatusSchema = exports.BILLING_PROFILE_STATUSES = exports.billingModeSchema = exports.BILLING_MODES = exports.providerConnectionSchema = exports.providerConnectionStatusSchema = exports.providerConnectionValidationSchema = exports.providerCredentialCustodyStateSchema = exports.providerCredentialValidationDeploymentSchema = exports.providerCredentialValidationOperationSchema = exports.kaanaCredentialValidationOutcomeSchema = exports.kaanaCredentialValidationFailureCodeSchema = exports.kaanaCredentialValidationOutcomeStateSchema = exports.kaanaCredentialValidationTaskSchema = exports.kaanaCredentialOutcomeSchema = exports.kaanaCredentialConflictOutcomeSchema = exports.kaanaCredentialAppliedOutcomeSchema = exports.kaanaCredentialOutcomeRequestSchema = exports.kaanaCredentialRevokeOutcomeRequestSchema = exports.kaanaCredentialRotateOutcomeRequestSchema = exports.kaanaCredentialCreateOutcomeRequestSchema = exports.kaanaCredentialMutationSchema = exports.kaanaCredentialRevokeMutationSchema = void 0;
40
40
  exports.resolveCatalogInvocation = exports.matchCatalogInvocation = exports.findOverlappingCatalogInvocations = exports.catalogInvocationTemplatesEquivalent = exports.catalogInvocationsOverlap = exports.catalogInvocationPathParameters = exports.normalizedAppEventSchema = exports.catalogRegistrationSchema = exports.appCapabilityCatalogSchema = exports.CATALOG_INTERNAL_TRANSPORTS = exports.catalogFeatureSchema = exports.catalogEventSchema = exports.catalogToolSchema = exports.auditEventSchema = exports.auditResultSchema = exports.policyDecisionSchema = exports.invocationPrincipalSchema = exports.capabilityTicketClaimsSchema = exports.automationDefinitionSchema = exports.automationDataFlowSchema = exports.automationActorSelectionSchema = exports.automationTriggerSchema = exports.agentRequesterCeilingSchema = exports.agentRequesterCeilingWriteSchema = exports.AGENT_REQUESTER_CEILING_AUTONOMY = exports.delegationGrantSchema = exports.capabilityTicketRequestSchema = exports.capabilityCoordinatorSchema = exports.executionAuthorizationRefSchema = exports.capabilityCatalogBindingSchema = exports.grantLimitSchema = exports.toolGrantOverrideSchema = exports.resourceRefSchema = exports.foregroundExecutionAuthorizationInputSchema = exports.executionActorRefSchema = exports.actorRefSchema = exports.capabilityPackageSchema = exports.autonomyLevelSchema = exports.CAPABILITY_PACKAGES = exports.AUTONOMY_LEVELS = exports.costCenterUsageSchema = exports.providerCostSourceSchema = exports.PROVIDER_COST_SOURCES = exports.inferenceEconomicTreatmentSchema = exports.INFERENCE_ECONOMIC_TREATMENTS = exports.productEntitlementSchema = exports.costCenterSpendSchema = exports.costCenterSchema = exports.costCenterStatusSchema = exports.COST_CENTER_STATUSES = void 0;
41
41
  exports.subjectProductGrantSnapshotSchema = exports.productAccessGrantSchema = exports.productSubscriptionSourceSchema = exports.productOfferSchema = exports.productBenefitSchema = exports.subjectProductAccessQuerySchema = exports.productDefinitionSchema = exports.privateAutoInferenceRequestSchema = exports.privateAutoOperationId = exports.privateAutoInputSchema = exports.privateAutoExecutionSchema = exports.privateAutoSourceApprovalSchema = exports.privateAutoPrincipalSchema = exports.PRIVATE_AUTO_QUESTION = exports.PRIVATE_AUTO_INSTRUCTIONS = exports.PRIVATE_AUTO_LIMITS = exports.PRIVATE_AUTO_REQUEST_ENVELOPE_VERSION = exports.PRIVATE_AUTO_EXECUTION_CONTRACT_VERSION = exports.scopedInferenceRequestSchema = exports.canonicalScopedExecutionJson = exports.scopedExecutionSchema = exports.scopedExecutionAudienceSchema = exports.SCOPED_REQUEST_ENVELOPE_VERSION = exports.SCOPED_EXECUTION_CONTRACT_VERSION = exports.decisionAnswersMatch = exports.decisionFitsGateway = exports.decisionInputBudget = exports.decisionFailureSchema = exports.decisionSuccessSchema = exports.decisionResultSchema = exports.decisionAnswerSchema = exports.decisionRequestSchema = exports.decisionInputSchema = exports.decisionQuestionSchema = exports.decisionEffortSchema = exports.inboxInferenceStreamEventSchema = exports.inboxThreadSummaryResponseSchema = exports.inboxSmartRepliesResponseSchema = exports.inboxNaturalSearchResponseSchema = exports.inboxInferenceTextResponseSchema = exports.inboxMessageInferenceParamsSchema = exports.inboxNaturalSearchRequestSchema = exports.INBOX_DAILY_BRIEF_SECTIONS = exports.inboxDailyBriefResponseSchema = exports.inboxDailyBriefRequestSchema = exports.inboxComposeRequestSchema = exports.emailAgentContextSchema = exports.emailContextMessageSchema = exports.emailContextMailboxSchema = exports.emailContextAddressSchema = void 0;
42
- exports.serviceTokenOptionsSchema = exports.serviceTokenScopesSchema = exports.personalPlanCatalogueSchema = exports.personalPlanDisplayPriceSchema = exports.productSubscriptionCancellationResultSchema = exports.cancelProductSubscriptionSchema = exports.subscriptionCreditGrantsResponseSchema = exports.subscriptionCreditGrantSchema = exports.productSubscriptionsResponseSchema = exports.productSubscriptionSummarySchema = exports.isLoopbackOrigin = exports.inputSatisfiesCapabilityLimits = exports.canonicalCapabilityJson = exports.meteredGenerationSchema = exports.subjectProductAccessSchema = exports.productOfferSegmentSchema = void 0;
42
+ exports.serviceTokenOptionsSchema = exports.serviceTokenScopesSchema = exports.productPlanCatalogueSchema = exports.personalPlanCatalogueSchema = exports.personalPlanDisplayPriceSchema = exports.productSubscriptionCancellationResultSchema = exports.cancelProductSubscriptionSchema = exports.subscriptionCreditGrantsResponseSchema = exports.subscriptionCreditGrantSchema = exports.productSubscriptionsResponseSchema = exports.productSubscriptionSummarySchema = exports.isLoopbackOrigin = exports.inputSatisfiesCapabilityLimits = exports.canonicalCapabilityJson = exports.meteredGenerationSchema = exports.subjectProductAccessSchema = exports.productOfferSegmentSchema = void 0;
43
43
  var accountGraph_1 = require("./accountGraph");
44
44
  Object.defineProperty(exports, "ACCOUNT_KINDS", { enumerable: true, get: function () { return accountGraph_1.ACCOUNT_KINDS; } });
45
45
  Object.defineProperty(exports, "accountKindSchema", { enumerable: true, get: function () { return accountGraph_1.accountKindSchema; } });
@@ -892,6 +892,7 @@ Object.defineProperty(exports, "productSubscriptionCancellationResultSchema", {
892
892
  var plans_1 = require("./products/plans");
893
893
  Object.defineProperty(exports, "personalPlanDisplayPriceSchema", { enumerable: true, get: function () { return plans_1.personalPlanDisplayPriceSchema; } });
894
894
  Object.defineProperty(exports, "personalPlanCatalogueSchema", { enumerable: true, get: function () { return plans_1.personalPlanCatalogueSchema; } });
895
+ Object.defineProperty(exports, "productPlanCatalogueSchema", { enumerable: true, get: function () { return plans_1.productPlanCatalogueSchema; } });
895
896
  __exportStar(require("./products/checkout"), exports);
896
897
  __exportStar(require("./organizations"), exports);
897
898
  __exportStar(require("./safety"), exports);
@@ -899,3 +900,4 @@ var serviceToken_1 = require("./serviceToken");
899
900
  Object.defineProperty(exports, "serviceTokenScopesSchema", { enumerable: true, get: function () { return serviceToken_1.serviceTokenScopesSchema; } });
900
901
  Object.defineProperty(exports, "serviceTokenOptionsSchema", { enumerable: true, get: function () { return serviceToken_1.serviceTokenOptionsSchema; } });
901
902
  __exportStar(require("./applicationRoles"), exports);
903
+ __exportStar(require("./contentClaims"), exports);
@@ -27,6 +27,7 @@ exports.productSubscriptionSummarySchema = zod_1.z
27
27
  period,
28
28
  cancelAtPeriodEnd: zod_1.z.boolean(),
29
29
  canCancel: zod_1.z.boolean(),
30
+ canRenew: zod_1.z.boolean().optional(),
30
31
  offers: zod_1.z.array(zod_1.z
31
32
  .object({
32
33
  segmentId: id,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.personalPlanCheckoutResultSchema = exports.personalPlanCheckoutRequestSchema = void 0;
3
+ exports.productSubscriptionRenewalRequestSchema = exports.productPlanCheckoutRequestSchema = exports.personalPlanCheckoutResultSchema = exports.personalPlanCheckoutRequestSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const identifiers_1 = require("../inference/identifiers");
6
6
  exports.personalPlanCheckoutRequestSchema = zod_1.z
@@ -33,3 +33,16 @@ exports.personalPlanCheckoutResultSchema = zod_1.z.discriminatedUnion('state', [
33
33
  zod_1.z.object({ state: zod_1.z.literal('closed'), intentId: zod_1.z.string().min(1).max(160) }).strict(),
34
34
  zod_1.z.object({ state: zod_1.z.literal('fulfilled'), intentId: zod_1.z.string().min(1).max(160) }).strict(),
35
35
  ]);
36
+ /** Explicit individual product offer; still owned and paid through Oxy. */
37
+ exports.productPlanCheckoutRequestSchema = exports.personalPlanCheckoutRequestSchema
38
+ .extend({
39
+ productId: zod_1.z.string().min(1).max(160),
40
+ })
41
+ .strict();
42
+ exports.productSubscriptionRenewalRequestSchema = zod_1.z
43
+ .object({
44
+ expectedSubjectAccountId: identifiers_1.oxyAccountIdSchema,
45
+ sourceId: zod_1.z.string().min(1).max(160),
46
+ idempotencyKey: exports.personalPlanCheckoutRequestSchema.shape.idempotencyKey,
47
+ })
48
+ .strict();
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.personalPlanCatalogueSchema = exports.personalPlanDisplayPriceSchema = void 0;
3
+ exports.productPlanCatalogueSchema = exports.personalPlanCatalogueSchema = exports.personalPlanDisplayPriceSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const access_1 = require("./access");
6
6
  /** Approved display terms never identify or activate a billing-provider price. */
@@ -19,7 +19,7 @@ exports.personalPlanCatalogueSchema = zod_1.z
19
19
  .object({
20
20
  schemaVersion: zod_1.z.literal(1),
21
21
  state: zod_1.z.enum(['unconfigured', 'configured']),
22
- purchase: zod_1.z.literal('unavailable'),
22
+ purchase: zod_1.z.enum(['unavailable', 'available']),
23
23
  plans: zod_1.z.array(zod_1.z
24
24
  .object({
25
25
  offerId: zod_1.z.string().min(1).max(160),
@@ -36,3 +36,19 @@ exports.personalPlanCatalogueSchema = zod_1.z
36
36
  })
37
37
  .strict()
38
38
  .refine((value) => (value.state === 'unconfigured') === (value.plans.length === 0), 'Catalogue state must match published plans');
39
+ exports.productPlanCatalogueSchema = zod_1.z
40
+ .object({
41
+ schemaVersion: zod_1.z.literal(1),
42
+ productId: zod_1.z.string().min(1).max(160),
43
+ purchase: zod_1.z.enum(['unavailable', 'available']),
44
+ plans: zod_1.z.array(zod_1.z
45
+ .object({
46
+ productId: zod_1.z.string().min(1).max(160),
47
+ offerId: zod_1.z.string().min(1).max(160),
48
+ offerVersion: zod_1.z.number().int().positive().safe(),
49
+ displayName: zod_1.z.string().min(1).max(100),
50
+ price: exports.personalPlanDisplayPriceSchema.extend({ interval: zod_1.z.enum(['month', 'year']) }),
51
+ })
52
+ .strict()),
53
+ })
54
+ .strict();