@oxy.so/contracts 4.7.0 → 4.9.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/.tsbuildinfo +1 -1
- package/dist/cjs/accountGraph.js +13 -5
- package/dist/cjs/accountSubject.js +189 -0
- package/dist/cjs/agency.js +56 -4
- package/dist/cjs/agentKeys.js +67 -0
- package/dist/cjs/capabilityBindings.js +72 -0
- package/dist/cjs/index.js +68 -13
- package/dist/cjs/inference/catalogue.js +5 -2
- package/dist/cjs/inference/economics.js +135 -0
- package/dist/cjs/inference/request.js +33 -1
- package/dist/cjs/inference/scopedExecution.js +87 -0
- package/dist/cjs/products/access.js +60 -0
- package/dist/cjs/products/billing.js +32 -0
- package/dist/cjs/signIn.js +1 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/accountGraph.js +13 -5
- package/dist/esm/accountSubject.js +182 -0
- package/dist/esm/agency.js +55 -3
- package/dist/esm/agentKeys.js +63 -0
- package/dist/esm/capabilityBindings.js +67 -0
- package/dist/esm/index.js +12 -1
- package/dist/esm/inference/catalogue.js +3 -0
- package/dist/esm/inference/economics.js +132 -0
- package/dist/esm/inference/request.js +32 -0
- package/dist/esm/inference/scopedExecution.js +83 -0
- package/dist/esm/products/access.js +57 -0
- package/dist/esm/products/billing.js +29 -0
- package/dist/esm/signIn.js +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/accountGraph.d.ts +23 -8
- package/dist/types/accountSubject.d.ts +210 -0
- package/dist/types/agency.d.ts +956 -190
- package/dist/types/agentKeys.d.ts +525 -0
- package/dist/types/capabilityBindings.d.ts +6 -0
- package/dist/types/deviceDirectory.d.ts +50 -50
- package/dist/types/deviceSession.d.ts +14 -14
- package/dist/types/externalIdentity.d.ts +4 -4
- package/dist/types/identity.d.ts +2 -2
- package/dist/types/index.d.ts +16 -2
- package/dist/types/inference/accountBilling.d.ts +30 -30
- package/dist/types/inference/aliaModelRelease.d.ts +4 -4
- package/dist/types/inference/catalogue.d.ts +200 -10
- package/dist/types/inference/economics.d.ts +376 -0
- package/dist/types/inference/entitlement.d.ts +47 -47
- package/dist/types/inference/inbox.d.ts +12 -12
- package/dist/types/inference/modelDocumentation.d.ts +8 -8
- package/dist/types/inference/priceVersion.d.ts +4 -4
- package/dist/types/inference/providerConnection.d.ts +38 -38
- package/dist/types/inference/realtime.d.ts +32 -32
- package/dist/types/inference/request.d.ts +2289 -16
- package/dist/types/inference/routingPolicy.d.ts +20 -20
- package/dist/types/inference/scopedExecution.d.ts +202 -0
- package/dist/types/inference/streamEvents.d.ts +4 -4
- package/dist/types/inference/usage.d.ts +12 -12
- package/dist/types/keyRotation.d.ts +2 -2
- package/dist/types/notifications.d.ts +4 -4
- package/dist/types/oauth.d.ts +30 -30
- package/dist/types/products/access.d.ts +487 -0
- package/dist/types/products/billing.d.ts +563 -0
- package/dist/types/recommendations.d.ts +2 -2
- package/dist/types/sessionStatus.d.ts +10 -10
- package/dist/types/signIn.d.ts +6 -6
- package/dist/types/transparency.d.ts +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subjectProductAccessSchema = exports.productAccessGrantSchema = exports.productOfferSegmentSchema = exports.productSubscriptionSourceSchema = exports.productOfferSchema = exports.productBenefitSchema = exports.subjectProductAccessQuerySchema = exports.productDefinitionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const identifiers_1 = require("../inference/identifiers");
|
|
6
|
+
const identifier = zod_1.z.string().min(1).max(160);
|
|
7
|
+
const count = zod_1.z.number().int().nonnegative().safe();
|
|
8
|
+
const period = zod_1.z.object({ start: zod_1.z.string().datetime(), end: zod_1.z.string().datetime() }).strict()
|
|
9
|
+
.refine(value => Date.parse(value.end) > Date.parse(value.start), 'period end must follow start');
|
|
10
|
+
/** Product ownership and audience are registered together; branding grants no trust. */
|
|
11
|
+
exports.productDefinitionSchema = zod_1.z.object({
|
|
12
|
+
schemaVersion: zod_1.z.literal(1), id: identifier, ownerAccountId: identifiers_1.oxyAccountIdSchema,
|
|
13
|
+
applicationId: identifiers_1.oxyApplicationIdSchema,
|
|
14
|
+
}).strict();
|
|
15
|
+
exports.subjectProductAccessQuerySchema = zod_1.z.object({
|
|
16
|
+
schemaVersion: zod_1.z.literal(1), subjectAccountId: identifiers_1.oxyAccountIdSchema, productId: identifier,
|
|
17
|
+
}).strict();
|
|
18
|
+
/** Every quota declares its combination rule; there is no commercial default. */
|
|
19
|
+
exports.productBenefitSchema = zod_1.z.discriminatedUnion('kind', [
|
|
20
|
+
zod_1.z.object({ kind: zod_1.z.literal('capability'), productId: identifier, key: identifier }).strict(),
|
|
21
|
+
zod_1.z.object({ kind: zod_1.z.literal('quota'), productId: identifier, key: identifier,
|
|
22
|
+
unit: identifier, included: count, combination: zod_1.z.enum(['maximum', 'sum', 'exclusive']) }).strict(),
|
|
23
|
+
]);
|
|
24
|
+
/** A version names a frozen offer. An empty bundle grants nothing. */
|
|
25
|
+
exports.productOfferSchema = zod_1.z.object({
|
|
26
|
+
schemaVersion: zod_1.z.literal(1), id: identifier, version: zod_1.z.number().int().positive().safe(),
|
|
27
|
+
kind: zod_1.z.enum(['individual', 'bundle']), benefits: zod_1.z.array(exports.productBenefitSchema),
|
|
28
|
+
}).strict().refine(value => value.kind === 'bundle' || new Set(value.benefits.map(benefit => benefit.productId)).size <= 1, 'individual offers cannot cover multiple products');
|
|
29
|
+
exports.productSubscriptionSourceSchema = zod_1.z.object({
|
|
30
|
+
schemaVersion: zod_1.z.literal(1), id: identifier,
|
|
31
|
+
beneficiaryAccountId: identifiers_1.oxyAccountIdSchema, payerAccountId: identifiers_1.oxyAccountIdSchema,
|
|
32
|
+
provider: zod_1.z.enum(['stripe', 'peable']), providerSubscriptionId: identifier,
|
|
33
|
+
status: zod_1.z.enum(['active', 'trialing', 'past_due', 'unpaid', 'canceled', 'paused', 'incomplete', 'incomplete_expired']),
|
|
34
|
+
period, cancelAtPeriodEnd: zod_1.z.boolean(),
|
|
35
|
+
}).strict();
|
|
36
|
+
/** A frozen paid-period/offer segment; upgrades append, never rewrite it. */
|
|
37
|
+
exports.productOfferSegmentSchema = zod_1.z.object({
|
|
38
|
+
schemaVersion: zod_1.z.literal(1), id: identifier, subscriptionId: identifier,
|
|
39
|
+
beneficiaryAccountId: identifiers_1.oxyAccountIdSchema, offerId: identifier,
|
|
40
|
+
offerVersion: zod_1.z.number().int().positive().safe(), origin: zod_1.z.enum(['individual', 'bundle']), period,
|
|
41
|
+
}).strict();
|
|
42
|
+
/** Provenance survives cancellation: deactivate a source, never delete history. */
|
|
43
|
+
exports.productAccessGrantSchema = zod_1.z.object({
|
|
44
|
+
schemaVersion: zod_1.z.literal(1), id: identifier, sourceSegmentId: identifier,
|
|
45
|
+
beneficiaryAccountId: identifiers_1.oxyAccountIdSchema, offerId: identifier,
|
|
46
|
+
offerVersion: zod_1.z.number().int().positive().safe(),
|
|
47
|
+
origin: zod_1.z.enum(['individual', 'bundle']), benefit: exports.productBenefitSchema,
|
|
48
|
+
period, revokedAt: zod_1.z.string().datetime().nullable(),
|
|
49
|
+
}).strict();
|
|
50
|
+
/** Access answers contain no payer, provider reference, price or account balance. */
|
|
51
|
+
exports.subjectProductAccessSchema = zod_1.z.object({
|
|
52
|
+
schemaVersion: zod_1.z.literal(1), subjectAccountId: identifiers_1.oxyAccountIdSchema, productId: identifier,
|
|
53
|
+
evaluatedAt: zod_1.z.string().datetime(),
|
|
54
|
+
capabilities: zod_1.z.array(zod_1.z.object({ key: identifier, grantIds: zod_1.z.array(identifier) }).strict()),
|
|
55
|
+
quotas: zod_1.z.array(zod_1.z.object({ key: identifier, unit: identifier, included: count,
|
|
56
|
+
combination: zod_1.z.enum(['maximum', 'sum', 'exclusive']), grantIds: zod_1.z.array(identifier) }).strict()),
|
|
57
|
+
conflicts: zod_1.z.array(zod_1.z.object({ key: identifier,
|
|
58
|
+
reason: zod_1.z.enum(['combination_mismatch', 'unit_mismatch', 'exclusive_overlap', 'unsafe_total']),
|
|
59
|
+
grantIds: zod_1.z.array(identifier) }).strict()),
|
|
60
|
+
}).strict();
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.productSubscriptionCancellationResultSchema = exports.cancelProductSubscriptionSchema = exports.subscriptionCreditGrantsResponseSchema = exports.subscriptionCreditGrantSchema = exports.productSubscriptionsResponseSchema = exports.productSubscriptionSummarySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const identifiers_1 = require("../inference/identifiers");
|
|
6
|
+
const id = zod_1.z.string().min(1).max(160);
|
|
7
|
+
const name = zod_1.z.string().min(1).max(100);
|
|
8
|
+
const count = zod_1.z.number().int().nonnegative().safe();
|
|
9
|
+
const period = zod_1.z.object({ start: zod_1.z.string().datetime(), end: zod_1.z.string().datetime() }).strict()
|
|
10
|
+
.refine(value => Date.parse(value.end) > Date.parse(value.start), 'Period end must follow start');
|
|
11
|
+
/** Self-service provenance; no payer/provider identifiers or balances in access metadata. */
|
|
12
|
+
exports.productSubscriptionSummarySchema = zod_1.z.object({ sourceId: id,
|
|
13
|
+
status: zod_1.z.enum(['active', 'trialing', 'past_due', 'unpaid', 'canceled', 'paused', 'incomplete', 'incomplete_expired']),
|
|
14
|
+
period, cancelAtPeriodEnd: zod_1.z.boolean(), canCancel: zod_1.z.boolean(),
|
|
15
|
+
offers: zod_1.z.array(zod_1.z.object({ segmentId: id, offerId: id, offerVersion: zod_1.z.number().int().positive().safe(),
|
|
16
|
+
displayName: name, origin: zod_1.z.enum(['individual', 'bundle']), period, current: zod_1.z.boolean(),
|
|
17
|
+
products: zod_1.z.array(zod_1.z.object({ id, displayName: name }).strict()),
|
|
18
|
+
}).strict()),
|
|
19
|
+
}).strict();
|
|
20
|
+
exports.productSubscriptionsResponseSchema = zod_1.z.object({ subscriptions: zod_1.z.array(exports.productSubscriptionSummarySchema) }).strict();
|
|
21
|
+
exports.subscriptionCreditGrantSchema = zod_1.z.object({ id, invoiceId: id,
|
|
22
|
+
origin: zod_1.z.enum(['subscription_payment', 'subscription_proration', 'subscription_promotional_grant']),
|
|
23
|
+
period, granted: count, consumed: count, clawed: count, remaining: count,
|
|
24
|
+
promotionId: id.nullable(), createdAt: zod_1.z.string().datetime(),
|
|
25
|
+
}).strict().refine(value => BigInt(value.consumed) + BigInt(value.clawed) + BigInt(value.remaining) === BigInt(value.granted), 'Grant conservation differs');
|
|
26
|
+
exports.subscriptionCreditGrantsResponseSchema = zod_1.z.object({ grants: zod_1.z.array(exports.subscriptionCreditGrantSchema) }).strict();
|
|
27
|
+
exports.cancelProductSubscriptionSchema = zod_1.z.object({ sourceId: id, expectedSubjectAccountId: identifiers_1.oxyAccountIdSchema.optional() }).strict();
|
|
28
|
+
/** Remote acceptance is distinct from completed local reconciliation. */
|
|
29
|
+
exports.productSubscriptionCancellationResultSchema = zod_1.z.union([
|
|
30
|
+
zod_1.z.object({ sourceId: id, cancelAtPeriodEnd: zod_1.z.literal(true) }).strict(),
|
|
31
|
+
zod_1.z.object({ sourceId: id, reconciliationPending: zod_1.z.literal(true) }).strict(),
|
|
32
|
+
]);
|
package/dist/cjs/signIn.js
CHANGED
|
@@ -199,7 +199,7 @@ function isSecondFactorRequired(result) {
|
|
|
199
199
|
* What a re-verification email code confirms. The code is bound to it: a code
|
|
200
200
|
* asked for one change never authorises another, and the email names it.
|
|
201
201
|
*/
|
|
202
|
-
exports.REAUTH_ACTIONS = ['change_password', 'totp', 'link_commons', 'delete_account'];
|
|
202
|
+
exports.REAUTH_ACTIONS = ['change_password', 'totp', 'link_commons', 'delete_account', 'credentials_manage'];
|
|
203
203
|
/** `POST /users/me/reauth/email` */
|
|
204
204
|
exports.reauthEmailStartRequestSchema = zod_1.z.object({ action: zod_1.z.enum(exports.REAUTH_ACTIONS) }).strict();
|
|
205
205
|
/**
|