@oxy.so/contracts 4.22.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/index.js +6 -3
- package/dist/cjs/client/products.js +33 -11
- package/dist/cjs/index.js +2 -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/index.js +1 -1
- package/dist/esm/client/products.js +32 -10
- package/dist/esm/index.js +1 -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/index.d.ts +1 -1
- package/dist/types/client/products.d.ts +43 -10
- package/dist/types/externalIdentity.d.ts +33 -0
- package/dist/types/index.d.ts +1 -1
- 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 +27 -0
- package/dist/types/userResponse.d.ts +139 -3
- package/package.json +1 -1
package/dist/cjs/client/index.js
CHANGED
|
@@ -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.
|
|
21
|
-
exports.
|
|
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 = 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; } });
|
|
@@ -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
|
|
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.
|
|
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.
|
|
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,
|
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);
|
|
@@ -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.
|
|
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();
|
package/dist/cjs/userResponse.js
CHANGED
|
@@ -246,6 +246,10 @@ exports.userResponseSchema = zod_1.z
|
|
|
246
246
|
* so it is present on the current-user DTO (`GET /users/me`,
|
|
247
247
|
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
248
248
|
*/
|
|
249
|
+
userPreferences: zod_1.z
|
|
250
|
+
.object({ displayCurrency: zod_1.z.enum(['USD', 'EUR', 'FAIR']).optional() })
|
|
251
|
+
.catchall(zod_1.z.unknown())
|
|
252
|
+
.optional(),
|
|
249
253
|
themePreference: exports.themePreferenceSchema.optional(),
|
|
250
254
|
personalization: zod_1.z
|
|
251
255
|
.object({
|
|
@@ -306,7 +310,10 @@ exports.userProfileUpdateSchema = zod_1.z
|
|
|
306
310
|
languages: zod_1.z.array(zod_1.z.string()).optional(),
|
|
307
311
|
accountExpiresAfterInactivityDays: zod_1.z.number().nullable().optional(),
|
|
308
312
|
notificationPreferences: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
309
|
-
userPreferences: zod_1.z
|
|
313
|
+
userPreferences: zod_1.z
|
|
314
|
+
.object({ displayCurrency: zod_1.z.enum(['USD', 'EUR', 'FAIR']).optional() })
|
|
315
|
+
.catchall(zod_1.z.unknown())
|
|
316
|
+
.optional(),
|
|
310
317
|
privacySettings: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
311
318
|
/**
|
|
312
319
|
* Portable theme preference. Written through the same `PUT /users/me`
|
package/dist/esm/client/index.js
CHANGED
|
@@ -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.js';
|
|
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.js';
|
|
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.js';
|
|
30
|
-
export { cancelProductSubscriptionCheck, personalPlanCatalogueCheck, personalPlanCheckoutRequestCheck, personalPlanCheckoutResultCheck, productSubscriptionCancellationResultCheck, productSubscriptionsResponseCheck, subjectProductAccessCheck, subjectProductAccessQueryCheck, subscriptionCreditGrantsResponseCheck, } from './products.js';
|
|
30
|
+
export { cancelProductSubscriptionCheck, personalPlanCatalogueCheck, personalPlanCheckoutRequestCheck, personalPlanCheckoutResultCheck, productPlanCatalogueCheck, productPlanCheckoutRequestCheck, productSubscriptionCancellationResultCheck, productSubscriptionRenewalRequestCheck, productSubscriptionsResponseCheck, subjectProductAccessCheck, subjectProductAccessQueryCheck, subscriptionCreditGrantsResponseCheck, } from './products.js';
|
|
31
31
|
export { recommendationRequestCheck } from './recommendations.js';
|
|
32
32
|
export { isFullReputationBalance } from './reputation.js';
|
|
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.js';
|
|
@@ -13,6 +13,15 @@ const oxyAccountId = branded(string(minLength(1), maxLength(64)));
|
|
|
13
13
|
const actionKey = string(minLength(8), maxLength(160), pattern(/^[a-zA-Z0-9_-]+$/));
|
|
14
14
|
const combination = oneOf(['maximum', 'sum', 'exclusive']);
|
|
15
15
|
const origin = oneOf(['individual', 'bundle']);
|
|
16
|
+
const purchase = oneOf(['unavailable', 'available']);
|
|
17
|
+
const displayPrice = (interval) => strictObject({
|
|
18
|
+
currency: string(pattern(/^[A-Z]{3}$/)),
|
|
19
|
+
amountMinorUnits: version,
|
|
20
|
+
interval,
|
|
21
|
+
trial: literal('none'),
|
|
22
|
+
taxTreatment: literal('inclusive'),
|
|
23
|
+
merchantTotal: literal('final'),
|
|
24
|
+
});
|
|
16
25
|
const period = (message) => refine(strictObject({ start: string(datetime), end: string(datetime) }), (value) => Date.parse(value.end) > Date.parse(value.start), message);
|
|
17
26
|
const productBenefit = discriminatedUnion('kind', {
|
|
18
27
|
capability: strictObject({ kind: literal('capability'), productId: identifier, key: identifier }),
|
|
@@ -57,29 +66,41 @@ export const subjectProductAccessCheck = exact()(strictObject({
|
|
|
57
66
|
export const personalPlanCatalogueCheck = exact()(refine(strictObject({
|
|
58
67
|
schemaVersion: literal(1),
|
|
59
68
|
state: oneOf(['unconfigured', 'configured']),
|
|
60
|
-
purchase
|
|
69
|
+
purchase,
|
|
61
70
|
plans: array(strictObject({
|
|
62
71
|
offerId: identifier,
|
|
63
72
|
offerVersion: version,
|
|
64
73
|
displayName,
|
|
65
74
|
audience: literal('personal'),
|
|
66
75
|
kind: literal('oxy_one'),
|
|
67
|
-
price: optional(
|
|
68
|
-
currency: string(pattern(/^[A-Z]{3}$/)),
|
|
69
|
-
amountMinorUnits: version,
|
|
70
|
-
interval: literal('month'),
|
|
71
|
-
trial: literal('none'),
|
|
72
|
-
taxTreatment: literal('inclusive'),
|
|
73
|
-
merchantTotal: literal('final'),
|
|
74
|
-
})),
|
|
76
|
+
price: optional(displayPrice(literal('month'))),
|
|
75
77
|
benefits: array(strictObject({ displayName, benefit: productBenefit })),
|
|
76
78
|
})),
|
|
77
79
|
}), (value) => (value.state === 'unconfigured') === (value.plans.length === 0), 'Catalogue state must match published plans'));
|
|
78
|
-
export const
|
|
80
|
+
export const productPlanCatalogueCheck = exact()(strictObject({
|
|
81
|
+
schemaVersion: literal(1),
|
|
82
|
+
productId: identifier,
|
|
83
|
+
purchase,
|
|
84
|
+
plans: array(strictObject({
|
|
85
|
+
productId: identifier,
|
|
86
|
+
offerId: identifier,
|
|
87
|
+
offerVersion: version,
|
|
88
|
+
displayName,
|
|
89
|
+
price: displayPrice(oneOf(['month', 'year'])),
|
|
90
|
+
})),
|
|
91
|
+
}));
|
|
92
|
+
const checkoutRequestShape = {
|
|
79
93
|
expectedSubjectAccountId: oxyAccountId,
|
|
80
94
|
offerId: identifier,
|
|
81
95
|
offerVersion: version,
|
|
82
96
|
idempotencyKey: actionKey,
|
|
97
|
+
};
|
|
98
|
+
export const personalPlanCheckoutRequestCheck = exact()(strictObject(checkoutRequestShape));
|
|
99
|
+
export const productPlanCheckoutRequestCheck = exact()(strictObject({ ...checkoutRequestShape, productId: identifier }));
|
|
100
|
+
export const productSubscriptionRenewalRequestCheck = exact()(strictObject({
|
|
101
|
+
expectedSubjectAccountId: oxyAccountId,
|
|
102
|
+
sourceId: identifier,
|
|
103
|
+
idempotencyKey: actionKey,
|
|
83
104
|
}));
|
|
84
105
|
export const personalPlanCheckoutResultCheck = exact()(discriminatedUnion('state', {
|
|
85
106
|
unconfigured: strictObject({
|
|
@@ -111,6 +132,7 @@ export const productSubscriptionsResponseCheck = exact()(strictObject({
|
|
|
111
132
|
period: billingPeriod,
|
|
112
133
|
cancelAtPeriodEnd: boolean,
|
|
113
134
|
canCancel: boolean,
|
|
135
|
+
canRenew: optional(boolean),
|
|
114
136
|
offers: array(strictObject({
|
|
115
137
|
segmentId: identifier,
|
|
116
138
|
offerId: identifier,
|
package/dist/esm/index.js
CHANGED
|
@@ -201,7 +201,7 @@ export { meteredGenerationSchema } from './inference/economics.js';
|
|
|
201
201
|
export { canonicalCapabilityJson, inputSatisfiesCapabilityLimits, isLoopbackOrigin, } from './capabilityBindings.js';
|
|
202
202
|
export * from './agentKeys.js';
|
|
203
203
|
export { productSubscriptionSummarySchema, productSubscriptionsResponseSchema, subscriptionCreditGrantSchema, subscriptionCreditGrantsResponseSchema, cancelProductSubscriptionSchema, productSubscriptionCancellationResultSchema, } from './products/billing.js';
|
|
204
|
-
export { personalPlanDisplayPriceSchema, personalPlanCatalogueSchema, } from './products/plans.js';
|
|
204
|
+
export { personalPlanDisplayPriceSchema, personalPlanCatalogueSchema, productPlanCatalogueSchema, } from './products/plans.js';
|
|
205
205
|
export * from './products/checkout.js';
|
|
206
206
|
export * from './organizations.js';
|
|
207
207
|
export * from './safety.js';
|
|
@@ -30,3 +30,16 @@ export const personalPlanCheckoutResultSchema = z.discriminatedUnion('state', [
|
|
|
30
30
|
z.object({ state: z.literal('closed'), intentId: z.string().min(1).max(160) }).strict(),
|
|
31
31
|
z.object({ state: z.literal('fulfilled'), intentId: z.string().min(1).max(160) }).strict(),
|
|
32
32
|
]);
|
|
33
|
+
/** Explicit individual product offer; still owned and paid through Oxy. */
|
|
34
|
+
export const productPlanCheckoutRequestSchema = personalPlanCheckoutRequestSchema
|
|
35
|
+
.extend({
|
|
36
|
+
productId: z.string().min(1).max(160),
|
|
37
|
+
})
|
|
38
|
+
.strict();
|
|
39
|
+
export const productSubscriptionRenewalRequestSchema = z
|
|
40
|
+
.object({
|
|
41
|
+
expectedSubjectAccountId: oxyAccountIdSchema,
|
|
42
|
+
sourceId: z.string().min(1).max(160),
|
|
43
|
+
idempotencyKey: personalPlanCheckoutRequestSchema.shape.idempotencyKey,
|
|
44
|
+
})
|
|
45
|
+
.strict();
|
|
@@ -16,7 +16,7 @@ export const personalPlanCatalogueSchema = z
|
|
|
16
16
|
.object({
|
|
17
17
|
schemaVersion: z.literal(1),
|
|
18
18
|
state: z.enum(['unconfigured', 'configured']),
|
|
19
|
-
purchase: z.
|
|
19
|
+
purchase: z.enum(['unavailable', 'available']),
|
|
20
20
|
plans: z.array(z
|
|
21
21
|
.object({
|
|
22
22
|
offerId: z.string().min(1).max(160),
|
|
@@ -33,3 +33,19 @@ export const personalPlanCatalogueSchema = z
|
|
|
33
33
|
})
|
|
34
34
|
.strict()
|
|
35
35
|
.refine((value) => (value.state === 'unconfigured') === (value.plans.length === 0), 'Catalogue state must match published plans');
|
|
36
|
+
export const productPlanCatalogueSchema = z
|
|
37
|
+
.object({
|
|
38
|
+
schemaVersion: z.literal(1),
|
|
39
|
+
productId: z.string().min(1).max(160),
|
|
40
|
+
purchase: z.enum(['unavailable', 'available']),
|
|
41
|
+
plans: z.array(z
|
|
42
|
+
.object({
|
|
43
|
+
productId: z.string().min(1).max(160),
|
|
44
|
+
offerId: z.string().min(1).max(160),
|
|
45
|
+
offerVersion: z.number().int().positive().safe(),
|
|
46
|
+
displayName: z.string().min(1).max(100),
|
|
47
|
+
price: personalPlanDisplayPriceSchema.extend({ interval: z.enum(['month', 'year']) }),
|
|
48
|
+
})
|
|
49
|
+
.strict()),
|
|
50
|
+
})
|
|
51
|
+
.strict();
|
package/dist/esm/userResponse.js
CHANGED
|
@@ -241,6 +241,10 @@ export const userResponseSchema = z
|
|
|
241
241
|
* so it is present on the current-user DTO (`GET /users/me`,
|
|
242
242
|
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
243
243
|
*/
|
|
244
|
+
userPreferences: z
|
|
245
|
+
.object({ displayCurrency: z.enum(['USD', 'EUR', 'FAIR']).optional() })
|
|
246
|
+
.catchall(z.unknown())
|
|
247
|
+
.optional(),
|
|
244
248
|
themePreference: themePreferenceSchema.optional(),
|
|
245
249
|
personalization: z
|
|
246
250
|
.object({
|
|
@@ -301,7 +305,10 @@ export const userProfileUpdateSchema = z
|
|
|
301
305
|
languages: z.array(z.string()).optional(),
|
|
302
306
|
accountExpiresAfterInactivityDays: z.number().nullable().optional(),
|
|
303
307
|
notificationPreferences: z.record(z.unknown()).optional(),
|
|
304
|
-
userPreferences: z
|
|
308
|
+
userPreferences: z
|
|
309
|
+
.object({ displayCurrency: z.enum(['USD', 'EUR', 'FAIR']).optional() })
|
|
310
|
+
.catchall(z.unknown())
|
|
311
|
+
.optional(),
|
|
305
312
|
privacySettings: z.record(z.unknown()).optional(),
|
|
306
313
|
/**
|
|
307
314
|
* Portable theme preference. Written through the same `PUT /users/me`
|
|
@@ -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';
|
|
@@ -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
|
} | {
|