@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.
Files changed (58) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/accountGraph.js +13 -5
  3. package/dist/cjs/accountSubject.js +189 -0
  4. package/dist/cjs/agency.js +56 -4
  5. package/dist/cjs/agentKeys.js +67 -0
  6. package/dist/cjs/capabilityBindings.js +72 -0
  7. package/dist/cjs/index.js +60 -13
  8. package/dist/cjs/inference/economics.js +135 -0
  9. package/dist/cjs/products/access.js +60 -0
  10. package/dist/cjs/products/billing.js +32 -0
  11. package/dist/cjs/signIn.js +1 -1
  12. package/dist/esm/.tsbuildinfo +1 -1
  13. package/dist/esm/accountGraph.js +13 -5
  14. package/dist/esm/accountSubject.js +182 -0
  15. package/dist/esm/agency.js +55 -3
  16. package/dist/esm/agentKeys.js +63 -0
  17. package/dist/esm/capabilityBindings.js +67 -0
  18. package/dist/esm/index.js +10 -1
  19. package/dist/esm/inference/economics.js +132 -0
  20. package/dist/esm/products/access.js +57 -0
  21. package/dist/esm/products/billing.js +29 -0
  22. package/dist/esm/signIn.js +1 -1
  23. package/dist/types/.tsbuildinfo +1 -1
  24. package/dist/types/accountGraph.d.ts +23 -8
  25. package/dist/types/accountSubject.d.ts +210 -0
  26. package/dist/types/agency.d.ts +956 -190
  27. package/dist/types/agentKeys.d.ts +525 -0
  28. package/dist/types/capabilityBindings.d.ts +6 -0
  29. package/dist/types/deviceDirectory.d.ts +50 -50
  30. package/dist/types/deviceSession.d.ts +14 -14
  31. package/dist/types/externalIdentity.d.ts +4 -4
  32. package/dist/types/identity.d.ts +2 -2
  33. package/dist/types/index.d.ts +12 -2
  34. package/dist/types/inference/accountBilling.d.ts +30 -30
  35. package/dist/types/inference/aliaModelRelease.d.ts +83 -83
  36. package/dist/types/inference/catalogue.d.ts +180 -180
  37. package/dist/types/inference/economics.d.ts +376 -0
  38. package/dist/types/inference/entitlement.d.ts +47 -47
  39. package/dist/types/inference/inbox.d.ts +12 -12
  40. package/dist/types/inference/modelDocumentation.d.ts +231 -231
  41. package/dist/types/inference/priceVersion.d.ts +4 -4
  42. package/dist/types/inference/providerConnection.d.ts +38 -38
  43. package/dist/types/inference/realtime.d.ts +802 -802
  44. package/dist/types/inference/request.d.ts +844 -844
  45. package/dist/types/inference/routingPolicy.d.ts +4 -4
  46. package/dist/types/inference/scopedExecution.d.ts +38 -38
  47. package/dist/types/inference/streamEvents.d.ts +4 -4
  48. package/dist/types/inference/usage.d.ts +12 -12
  49. package/dist/types/keyRotation.d.ts +2 -2
  50. package/dist/types/notifications.d.ts +4 -4
  51. package/dist/types/oauth.d.ts +30 -30
  52. package/dist/types/products/access.d.ts +487 -0
  53. package/dist/types/products/billing.d.ts +563 -0
  54. package/dist/types/recommendations.d.ts +2 -2
  55. package/dist/types/sessionStatus.d.ts +10 -10
  56. package/dist/types/signIn.d.ts +6 -6
  57. package/dist/types/transparency.d.ts +2 -2
  58. package/package.json +1 -1
@@ -0,0 +1,487 @@
1
+ import { z } from 'zod';
2
+ /** Product ownership and audience are registered together; branding grants no trust. */
3
+ export declare const productDefinitionSchema: z.ZodObject<{
4
+ schemaVersion: z.ZodLiteral<1>;
5
+ id: z.ZodString;
6
+ ownerAccountId: z.ZodBranded<z.ZodString, "OxyAccountId">;
7
+ applicationId: z.ZodString;
8
+ }, "strict", z.ZodTypeAny, {
9
+ schemaVersion: 1;
10
+ ownerAccountId: string & z.BRAND<"OxyAccountId">;
11
+ id: string;
12
+ applicationId: string;
13
+ }, {
14
+ schemaVersion: 1;
15
+ ownerAccountId: string;
16
+ id: string;
17
+ applicationId: string;
18
+ }>;
19
+ export declare const subjectProductAccessQuerySchema: z.ZodObject<{
20
+ schemaVersion: z.ZodLiteral<1>;
21
+ subjectAccountId: z.ZodBranded<z.ZodString, "OxyAccountId">;
22
+ productId: z.ZodString;
23
+ }, "strict", z.ZodTypeAny, {
24
+ schemaVersion: 1;
25
+ subjectAccountId: string & z.BRAND<"OxyAccountId">;
26
+ productId: string;
27
+ }, {
28
+ schemaVersion: 1;
29
+ subjectAccountId: string;
30
+ productId: string;
31
+ }>;
32
+ /** Every quota declares its combination rule; there is no commercial default. */
33
+ export declare const productBenefitSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
34
+ kind: z.ZodLiteral<"capability">;
35
+ productId: z.ZodString;
36
+ key: z.ZodString;
37
+ }, "strict", z.ZodTypeAny, {
38
+ kind: "capability";
39
+ key: string;
40
+ productId: string;
41
+ }, {
42
+ kind: "capability";
43
+ key: string;
44
+ productId: string;
45
+ }>, z.ZodObject<{
46
+ kind: z.ZodLiteral<"quota">;
47
+ productId: z.ZodString;
48
+ key: z.ZodString;
49
+ unit: z.ZodString;
50
+ included: z.ZodNumber;
51
+ combination: z.ZodEnum<["maximum", "sum", "exclusive"]>;
52
+ }, "strict", z.ZodTypeAny, {
53
+ kind: "quota";
54
+ key: string;
55
+ unit: string;
56
+ included: number;
57
+ productId: string;
58
+ combination: "maximum" | "sum" | "exclusive";
59
+ }, {
60
+ kind: "quota";
61
+ key: string;
62
+ unit: string;
63
+ included: number;
64
+ productId: string;
65
+ combination: "maximum" | "sum" | "exclusive";
66
+ }>]>;
67
+ /** A version names a frozen offer. An empty bundle grants nothing. */
68
+ export declare const productOfferSchema: z.ZodEffects<z.ZodObject<{
69
+ schemaVersion: z.ZodLiteral<1>;
70
+ id: z.ZodString;
71
+ version: z.ZodNumber;
72
+ kind: z.ZodEnum<["individual", "bundle"]>;
73
+ benefits: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
74
+ kind: z.ZodLiteral<"capability">;
75
+ productId: z.ZodString;
76
+ key: z.ZodString;
77
+ }, "strict", z.ZodTypeAny, {
78
+ kind: "capability";
79
+ key: string;
80
+ productId: string;
81
+ }, {
82
+ kind: "capability";
83
+ key: string;
84
+ productId: string;
85
+ }>, z.ZodObject<{
86
+ kind: z.ZodLiteral<"quota">;
87
+ productId: z.ZodString;
88
+ key: z.ZodString;
89
+ unit: z.ZodString;
90
+ included: z.ZodNumber;
91
+ combination: z.ZodEnum<["maximum", "sum", "exclusive"]>;
92
+ }, "strict", z.ZodTypeAny, {
93
+ kind: "quota";
94
+ key: string;
95
+ unit: string;
96
+ included: number;
97
+ productId: string;
98
+ combination: "maximum" | "sum" | "exclusive";
99
+ }, {
100
+ kind: "quota";
101
+ key: string;
102
+ unit: string;
103
+ included: number;
104
+ productId: string;
105
+ combination: "maximum" | "sum" | "exclusive";
106
+ }>]>, "many">;
107
+ }, "strict", z.ZodTypeAny, {
108
+ kind: "bundle" | "individual";
109
+ schemaVersion: 1;
110
+ version: number;
111
+ id: string;
112
+ benefits: ({
113
+ kind: "capability";
114
+ key: string;
115
+ productId: string;
116
+ } | {
117
+ kind: "quota";
118
+ key: string;
119
+ unit: string;
120
+ included: number;
121
+ productId: string;
122
+ combination: "maximum" | "sum" | "exclusive";
123
+ })[];
124
+ }, {
125
+ kind: "bundle" | "individual";
126
+ schemaVersion: 1;
127
+ version: number;
128
+ id: string;
129
+ benefits: ({
130
+ kind: "capability";
131
+ key: string;
132
+ productId: string;
133
+ } | {
134
+ kind: "quota";
135
+ key: string;
136
+ unit: string;
137
+ included: number;
138
+ productId: string;
139
+ combination: "maximum" | "sum" | "exclusive";
140
+ })[];
141
+ }>, {
142
+ kind: "bundle" | "individual";
143
+ schemaVersion: 1;
144
+ version: number;
145
+ id: string;
146
+ benefits: ({
147
+ kind: "capability";
148
+ key: string;
149
+ productId: string;
150
+ } | {
151
+ kind: "quota";
152
+ key: string;
153
+ unit: string;
154
+ included: number;
155
+ productId: string;
156
+ combination: "maximum" | "sum" | "exclusive";
157
+ })[];
158
+ }, {
159
+ kind: "bundle" | "individual";
160
+ schemaVersion: 1;
161
+ version: number;
162
+ id: string;
163
+ benefits: ({
164
+ kind: "capability";
165
+ key: string;
166
+ productId: string;
167
+ } | {
168
+ kind: "quota";
169
+ key: string;
170
+ unit: string;
171
+ included: number;
172
+ productId: string;
173
+ combination: "maximum" | "sum" | "exclusive";
174
+ })[];
175
+ }>;
176
+ export declare const productSubscriptionSourceSchema: z.ZodObject<{
177
+ schemaVersion: z.ZodLiteral<1>;
178
+ id: z.ZodString;
179
+ beneficiaryAccountId: z.ZodBranded<z.ZodString, "OxyAccountId">;
180
+ payerAccountId: z.ZodBranded<z.ZodString, "OxyAccountId">;
181
+ provider: z.ZodEnum<["stripe", "peable"]>;
182
+ providerSubscriptionId: z.ZodString;
183
+ status: z.ZodEnum<["active", "trialing", "past_due", "unpaid", "canceled", "paused", "incomplete", "incomplete_expired"]>;
184
+ period: z.ZodEffects<z.ZodObject<{
185
+ start: z.ZodString;
186
+ end: z.ZodString;
187
+ }, "strict", z.ZodTypeAny, {
188
+ start: string;
189
+ end: string;
190
+ }, {
191
+ start: string;
192
+ end: string;
193
+ }>, {
194
+ start: string;
195
+ end: string;
196
+ }, {
197
+ start: string;
198
+ end: string;
199
+ }>;
200
+ cancelAtPeriodEnd: z.ZodBoolean;
201
+ }, "strict", z.ZodTypeAny, {
202
+ status: "active" | "incomplete" | "canceled" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid";
203
+ schemaVersion: 1;
204
+ id: string;
205
+ provider: "stripe" | "peable";
206
+ cancelAtPeriodEnd: boolean;
207
+ beneficiaryAccountId: string & z.BRAND<"OxyAccountId">;
208
+ payerAccountId: string & z.BRAND<"OxyAccountId">;
209
+ providerSubscriptionId: string;
210
+ period: {
211
+ start: string;
212
+ end: string;
213
+ };
214
+ }, {
215
+ status: "active" | "incomplete" | "canceled" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid";
216
+ schemaVersion: 1;
217
+ id: string;
218
+ provider: "stripe" | "peable";
219
+ cancelAtPeriodEnd: boolean;
220
+ beneficiaryAccountId: string;
221
+ payerAccountId: string;
222
+ providerSubscriptionId: string;
223
+ period: {
224
+ start: string;
225
+ end: string;
226
+ };
227
+ }>;
228
+ /** A frozen paid-period/offer segment; upgrades append, never rewrite it. */
229
+ export declare const productOfferSegmentSchema: z.ZodObject<{
230
+ schemaVersion: z.ZodLiteral<1>;
231
+ id: z.ZodString;
232
+ subscriptionId: z.ZodString;
233
+ beneficiaryAccountId: z.ZodBranded<z.ZodString, "OxyAccountId">;
234
+ offerId: z.ZodString;
235
+ offerVersion: z.ZodNumber;
236
+ origin: z.ZodEnum<["individual", "bundle"]>;
237
+ period: z.ZodEffects<z.ZodObject<{
238
+ start: z.ZodString;
239
+ end: z.ZodString;
240
+ }, "strict", z.ZodTypeAny, {
241
+ start: string;
242
+ end: string;
243
+ }, {
244
+ start: string;
245
+ end: string;
246
+ }>, {
247
+ start: string;
248
+ end: string;
249
+ }, {
250
+ start: string;
251
+ end: string;
252
+ }>;
253
+ }, "strict", z.ZodTypeAny, {
254
+ schemaVersion: 1;
255
+ id: string;
256
+ beneficiaryAccountId: string & z.BRAND<"OxyAccountId">;
257
+ period: {
258
+ start: string;
259
+ end: string;
260
+ };
261
+ subscriptionId: string;
262
+ offerId: string;
263
+ offerVersion: number;
264
+ origin: "bundle" | "individual";
265
+ }, {
266
+ schemaVersion: 1;
267
+ id: string;
268
+ beneficiaryAccountId: string;
269
+ period: {
270
+ start: string;
271
+ end: string;
272
+ };
273
+ subscriptionId: string;
274
+ offerId: string;
275
+ offerVersion: number;
276
+ origin: "bundle" | "individual";
277
+ }>;
278
+ /** Provenance survives cancellation: deactivate a source, never delete history. */
279
+ export declare const productAccessGrantSchema: z.ZodObject<{
280
+ schemaVersion: z.ZodLiteral<1>;
281
+ id: z.ZodString;
282
+ sourceSegmentId: z.ZodString;
283
+ beneficiaryAccountId: z.ZodBranded<z.ZodString, "OxyAccountId">;
284
+ offerId: z.ZodString;
285
+ offerVersion: z.ZodNumber;
286
+ origin: z.ZodEnum<["individual", "bundle"]>;
287
+ benefit: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
288
+ kind: z.ZodLiteral<"capability">;
289
+ productId: z.ZodString;
290
+ key: z.ZodString;
291
+ }, "strict", z.ZodTypeAny, {
292
+ kind: "capability";
293
+ key: string;
294
+ productId: string;
295
+ }, {
296
+ kind: "capability";
297
+ key: string;
298
+ productId: string;
299
+ }>, z.ZodObject<{
300
+ kind: z.ZodLiteral<"quota">;
301
+ productId: z.ZodString;
302
+ key: z.ZodString;
303
+ unit: z.ZodString;
304
+ included: z.ZodNumber;
305
+ combination: z.ZodEnum<["maximum", "sum", "exclusive"]>;
306
+ }, "strict", z.ZodTypeAny, {
307
+ kind: "quota";
308
+ key: string;
309
+ unit: string;
310
+ included: number;
311
+ productId: string;
312
+ combination: "maximum" | "sum" | "exclusive";
313
+ }, {
314
+ kind: "quota";
315
+ key: string;
316
+ unit: string;
317
+ included: number;
318
+ productId: string;
319
+ combination: "maximum" | "sum" | "exclusive";
320
+ }>]>;
321
+ period: z.ZodEffects<z.ZodObject<{
322
+ start: z.ZodString;
323
+ end: z.ZodString;
324
+ }, "strict", z.ZodTypeAny, {
325
+ start: string;
326
+ end: string;
327
+ }, {
328
+ start: string;
329
+ end: string;
330
+ }>, {
331
+ start: string;
332
+ end: string;
333
+ }, {
334
+ start: string;
335
+ end: string;
336
+ }>;
337
+ revokedAt: z.ZodNullable<z.ZodString>;
338
+ }, "strict", z.ZodTypeAny, {
339
+ schemaVersion: 1;
340
+ id: string;
341
+ revokedAt: string | null;
342
+ beneficiaryAccountId: string & z.BRAND<"OxyAccountId">;
343
+ period: {
344
+ start: string;
345
+ end: string;
346
+ };
347
+ offerId: string;
348
+ offerVersion: number;
349
+ origin: "bundle" | "individual";
350
+ sourceSegmentId: string;
351
+ benefit: {
352
+ kind: "capability";
353
+ key: string;
354
+ productId: string;
355
+ } | {
356
+ kind: "quota";
357
+ key: string;
358
+ unit: string;
359
+ included: number;
360
+ productId: string;
361
+ combination: "maximum" | "sum" | "exclusive";
362
+ };
363
+ }, {
364
+ schemaVersion: 1;
365
+ id: string;
366
+ revokedAt: string | null;
367
+ beneficiaryAccountId: string;
368
+ period: {
369
+ start: string;
370
+ end: string;
371
+ };
372
+ offerId: string;
373
+ offerVersion: number;
374
+ origin: "bundle" | "individual";
375
+ sourceSegmentId: string;
376
+ benefit: {
377
+ kind: "capability";
378
+ key: string;
379
+ productId: string;
380
+ } | {
381
+ kind: "quota";
382
+ key: string;
383
+ unit: string;
384
+ included: number;
385
+ productId: string;
386
+ combination: "maximum" | "sum" | "exclusive";
387
+ };
388
+ }>;
389
+ /** Access answers contain no payer, provider reference, price or account balance. */
390
+ export declare const subjectProductAccessSchema: z.ZodObject<{
391
+ schemaVersion: z.ZodLiteral<1>;
392
+ subjectAccountId: z.ZodBranded<z.ZodString, "OxyAccountId">;
393
+ productId: z.ZodString;
394
+ evaluatedAt: z.ZodString;
395
+ capabilities: z.ZodArray<z.ZodObject<{
396
+ key: z.ZodString;
397
+ grantIds: z.ZodArray<z.ZodString, "many">;
398
+ }, "strict", z.ZodTypeAny, {
399
+ key: string;
400
+ grantIds: string[];
401
+ }, {
402
+ key: string;
403
+ grantIds: string[];
404
+ }>, "many">;
405
+ quotas: z.ZodArray<z.ZodObject<{
406
+ key: z.ZodString;
407
+ unit: z.ZodString;
408
+ included: z.ZodNumber;
409
+ combination: z.ZodEnum<["maximum", "sum", "exclusive"]>;
410
+ grantIds: z.ZodArray<z.ZodString, "many">;
411
+ }, "strict", z.ZodTypeAny, {
412
+ key: string;
413
+ unit: string;
414
+ included: number;
415
+ combination: "maximum" | "sum" | "exclusive";
416
+ grantIds: string[];
417
+ }, {
418
+ key: string;
419
+ unit: string;
420
+ included: number;
421
+ combination: "maximum" | "sum" | "exclusive";
422
+ grantIds: string[];
423
+ }>, "many">;
424
+ conflicts: z.ZodArray<z.ZodObject<{
425
+ key: z.ZodString;
426
+ reason: z.ZodEnum<["combination_mismatch", "unit_mismatch", "exclusive_overlap", "unsafe_total"]>;
427
+ grantIds: z.ZodArray<z.ZodString, "many">;
428
+ }, "strict", z.ZodTypeAny, {
429
+ key: string;
430
+ reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
431
+ grantIds: string[];
432
+ }, {
433
+ key: string;
434
+ reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
435
+ grantIds: string[];
436
+ }>, "many">;
437
+ }, "strict", z.ZodTypeAny, {
438
+ schemaVersion: 1;
439
+ subjectAccountId: string & z.BRAND<"OxyAccountId">;
440
+ capabilities: {
441
+ key: string;
442
+ grantIds: string[];
443
+ }[];
444
+ evaluatedAt: string;
445
+ productId: string;
446
+ quotas: {
447
+ key: string;
448
+ unit: string;
449
+ included: number;
450
+ combination: "maximum" | "sum" | "exclusive";
451
+ grantIds: string[];
452
+ }[];
453
+ conflicts: {
454
+ key: string;
455
+ reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
456
+ grantIds: string[];
457
+ }[];
458
+ }, {
459
+ schemaVersion: 1;
460
+ subjectAccountId: string;
461
+ capabilities: {
462
+ key: string;
463
+ grantIds: string[];
464
+ }[];
465
+ evaluatedAt: string;
466
+ productId: string;
467
+ quotas: {
468
+ key: string;
469
+ unit: string;
470
+ included: number;
471
+ combination: "maximum" | "sum" | "exclusive";
472
+ grantIds: string[];
473
+ }[];
474
+ conflicts: {
475
+ key: string;
476
+ reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
477
+ grantIds: string[];
478
+ }[];
479
+ }>;
480
+ export type ProductBenefit = z.infer<typeof productBenefitSchema>;
481
+ export type ProductOffer = z.infer<typeof productOfferSchema>;
482
+ export type ProductSubscriptionSource = z.infer<typeof productSubscriptionSourceSchema>;
483
+ export type ProductOfferSegment = z.infer<typeof productOfferSegmentSchema>;
484
+ export type ProductAccessGrant = z.infer<typeof productAccessGrantSchema>;
485
+ export type SubjectProductAccess = z.infer<typeof subjectProductAccessSchema>;
486
+ export type ProductDefinition = z.infer<typeof productDefinitionSchema>;
487
+ export type SubjectProductAccessQuery = z.infer<typeof subjectProductAccessQuerySchema>;