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