@oxy.so/contracts 4.10.0 → 4.11.0-oxy-one.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.
@@ -7,13 +7,13 @@ export declare const productDefinitionSchema: z.ZodObject<{
7
7
  applicationId: z.ZodString;
8
8
  }, "strict", z.ZodTypeAny, {
9
9
  schemaVersion: 1;
10
- ownerAccountId: string & z.BRAND<"OxyAccountId">;
11
10
  id: string;
11
+ ownerAccountId: string & z.BRAND<"OxyAccountId">;
12
12
  applicationId: string;
13
13
  }, {
14
14
  schemaVersion: 1;
15
- ownerAccountId: string;
16
15
  id: string;
16
+ ownerAccountId: string;
17
17
  applicationId: string;
18
18
  }>;
19
19
  export declare const subjectProductAccessQuerySchema: z.ZodObject<{
@@ -35,13 +35,13 @@ export declare const productBenefitSchema: z.ZodDiscriminatedUnion<"kind", [z.Zo
35
35
  productId: z.ZodString;
36
36
  key: z.ZodString;
37
37
  }, "strict", z.ZodTypeAny, {
38
+ productId: string;
38
39
  kind: "capability";
39
40
  key: string;
40
- productId: string;
41
41
  }, {
42
+ productId: string;
42
43
  kind: "capability";
43
44
  key: string;
44
- productId: string;
45
45
  }>, z.ZodObject<{
46
46
  kind: z.ZodLiteral<"quota">;
47
47
  productId: z.ZodString;
@@ -50,18 +50,18 @@ export declare const productBenefitSchema: z.ZodDiscriminatedUnion<"kind", [z.Zo
50
50
  included: z.ZodNumber;
51
51
  combination: z.ZodEnum<["maximum", "sum", "exclusive"]>;
52
52
  }, "strict", z.ZodTypeAny, {
53
+ productId: string;
53
54
  kind: "quota";
54
55
  key: string;
55
56
  unit: string;
56
57
  included: number;
57
- productId: string;
58
58
  combination: "maximum" | "sum" | "exclusive";
59
59
  }, {
60
+ productId: string;
60
61
  kind: "quota";
61
62
  key: string;
62
63
  unit: string;
63
64
  included: number;
64
- productId: string;
65
65
  combination: "maximum" | "sum" | "exclusive";
66
66
  }>]>;
67
67
  /** A version names a frozen offer. An empty bundle grants nothing. */
@@ -75,13 +75,13 @@ export declare const productOfferSchema: z.ZodEffects<z.ZodObject<{
75
75
  productId: z.ZodString;
76
76
  key: z.ZodString;
77
77
  }, "strict", z.ZodTypeAny, {
78
+ productId: string;
78
79
  kind: "capability";
79
80
  key: string;
80
- productId: string;
81
81
  }, {
82
+ productId: string;
82
83
  kind: "capability";
83
84
  key: string;
84
- productId: string;
85
85
  }>, z.ZodObject<{
86
86
  kind: z.ZodLiteral<"quota">;
87
87
  productId: z.ZodString;
@@ -90,86 +90,86 @@ export declare const productOfferSchema: z.ZodEffects<z.ZodObject<{
90
90
  included: z.ZodNumber;
91
91
  combination: z.ZodEnum<["maximum", "sum", "exclusive"]>;
92
92
  }, "strict", z.ZodTypeAny, {
93
+ productId: string;
93
94
  kind: "quota";
94
95
  key: string;
95
96
  unit: string;
96
97
  included: number;
97
- productId: string;
98
98
  combination: "maximum" | "sum" | "exclusive";
99
99
  }, {
100
+ productId: string;
100
101
  kind: "quota";
101
102
  key: string;
102
103
  unit: string;
103
104
  included: number;
104
- productId: string;
105
105
  combination: "maximum" | "sum" | "exclusive";
106
106
  }>]>, "many">;
107
107
  }, "strict", z.ZodTypeAny, {
108
- kind: "bundle" | "individual";
109
108
  schemaVersion: 1;
110
- version: number;
111
109
  id: string;
110
+ kind: "individual" | "bundle";
111
+ version: number;
112
112
  benefits: ({
113
+ productId: string;
113
114
  kind: "capability";
114
115
  key: string;
115
- productId: string;
116
116
  } | {
117
+ productId: string;
117
118
  kind: "quota";
118
119
  key: string;
119
120
  unit: string;
120
121
  included: number;
121
- productId: string;
122
122
  combination: "maximum" | "sum" | "exclusive";
123
123
  })[];
124
124
  }, {
125
- kind: "bundle" | "individual";
126
125
  schemaVersion: 1;
127
- version: number;
128
126
  id: string;
127
+ kind: "individual" | "bundle";
128
+ version: number;
129
129
  benefits: ({
130
+ productId: string;
130
131
  kind: "capability";
131
132
  key: string;
132
- productId: string;
133
133
  } | {
134
+ productId: string;
134
135
  kind: "quota";
135
136
  key: string;
136
137
  unit: string;
137
138
  included: number;
138
- productId: string;
139
139
  combination: "maximum" | "sum" | "exclusive";
140
140
  })[];
141
141
  }>, {
142
- kind: "bundle" | "individual";
143
142
  schemaVersion: 1;
144
- version: number;
145
143
  id: string;
144
+ kind: "individual" | "bundle";
145
+ version: number;
146
146
  benefits: ({
147
+ productId: string;
147
148
  kind: "capability";
148
149
  key: string;
149
- productId: string;
150
150
  } | {
151
+ productId: string;
151
152
  kind: "quota";
152
153
  key: string;
153
154
  unit: string;
154
155
  included: number;
155
- productId: string;
156
156
  combination: "maximum" | "sum" | "exclusive";
157
157
  })[];
158
158
  }, {
159
- kind: "bundle" | "individual";
160
159
  schemaVersion: 1;
161
- version: number;
162
160
  id: string;
161
+ kind: "individual" | "bundle";
162
+ version: number;
163
163
  benefits: ({
164
+ productId: string;
164
165
  kind: "capability";
165
166
  key: string;
166
- productId: string;
167
167
  } | {
168
+ productId: string;
168
169
  kind: "quota";
169
170
  key: string;
170
171
  unit: string;
171
172
  included: number;
172
- productId: string;
173
173
  combination: "maximum" | "sum" | "exclusive";
174
174
  })[];
175
175
  }>;
@@ -199,31 +199,31 @@ export declare const productSubscriptionSourceSchema: z.ZodObject<{
199
199
  }>;
200
200
  cancelAtPeriodEnd: z.ZodBoolean;
201
201
  }, "strict", z.ZodTypeAny, {
202
- status: "active" | "incomplete" | "canceled" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid";
203
202
  schemaVersion: 1;
203
+ status: "active" | "trialing" | "past_due" | "unpaid" | "canceled" | "paused" | "incomplete" | "incomplete_expired";
204
204
  id: string;
205
- provider: "stripe" | "peable";
206
- cancelAtPeriodEnd: boolean;
207
205
  beneficiaryAccountId: string & z.BRAND<"OxyAccountId">;
208
206
  payerAccountId: string & z.BRAND<"OxyAccountId">;
207
+ provider: "stripe" | "peable";
209
208
  providerSubscriptionId: string;
210
209
  period: {
211
210
  start: string;
212
211
  end: string;
213
212
  };
213
+ cancelAtPeriodEnd: boolean;
214
214
  }, {
215
- status: "active" | "incomplete" | "canceled" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid";
216
215
  schemaVersion: 1;
216
+ status: "active" | "trialing" | "past_due" | "unpaid" | "canceled" | "paused" | "incomplete" | "incomplete_expired";
217
217
  id: string;
218
- provider: "stripe" | "peable";
219
- cancelAtPeriodEnd: boolean;
220
218
  beneficiaryAccountId: string;
221
219
  payerAccountId: string;
220
+ provider: "stripe" | "peable";
222
221
  providerSubscriptionId: string;
223
222
  period: {
224
223
  start: string;
225
224
  end: string;
226
225
  };
226
+ cancelAtPeriodEnd: boolean;
227
227
  }>;
228
228
  /** A frozen paid-period/offer segment; upgrades append, never rewrite it. */
229
229
  export declare const productOfferSegmentSchema: z.ZodObject<{
@@ -261,7 +261,7 @@ export declare const productOfferSegmentSchema: z.ZodObject<{
261
261
  subscriptionId: string;
262
262
  offerId: string;
263
263
  offerVersion: number;
264
- origin: "bundle" | "individual";
264
+ origin: "individual" | "bundle";
265
265
  }, {
266
266
  schemaVersion: 1;
267
267
  id: string;
@@ -273,7 +273,7 @@ export declare const productOfferSegmentSchema: z.ZodObject<{
273
273
  subscriptionId: string;
274
274
  offerId: string;
275
275
  offerVersion: number;
276
- origin: "bundle" | "individual";
276
+ origin: "individual" | "bundle";
277
277
  }>;
278
278
  /** Provenance survives cancellation: deactivate a source, never delete history. */
279
279
  export declare const productAccessGrantSchema: z.ZodObject<{
@@ -289,13 +289,13 @@ export declare const productAccessGrantSchema: z.ZodObject<{
289
289
  productId: z.ZodString;
290
290
  key: z.ZodString;
291
291
  }, "strict", z.ZodTypeAny, {
292
+ productId: string;
292
293
  kind: "capability";
293
294
  key: string;
294
- productId: string;
295
295
  }, {
296
+ productId: string;
296
297
  kind: "capability";
297
298
  key: string;
298
- productId: string;
299
299
  }>, z.ZodObject<{
300
300
  kind: z.ZodLiteral<"quota">;
301
301
  productId: z.ZodString;
@@ -304,18 +304,18 @@ export declare const productAccessGrantSchema: z.ZodObject<{
304
304
  included: z.ZodNumber;
305
305
  combination: z.ZodEnum<["maximum", "sum", "exclusive"]>;
306
306
  }, "strict", z.ZodTypeAny, {
307
+ productId: string;
307
308
  kind: "quota";
308
309
  key: string;
309
310
  unit: string;
310
311
  included: number;
311
- productId: string;
312
312
  combination: "maximum" | "sum" | "exclusive";
313
313
  }, {
314
+ productId: string;
314
315
  kind: "quota";
315
316
  key: string;
316
317
  unit: string;
317
318
  included: number;
318
- productId: string;
319
319
  combination: "maximum" | "sum" | "exclusive";
320
320
  }>]>;
321
321
  period: z.ZodEffects<z.ZodObject<{
@@ -338,7 +338,6 @@ export declare const productAccessGrantSchema: z.ZodObject<{
338
338
  }, "strict", z.ZodTypeAny, {
339
339
  schemaVersion: 1;
340
340
  id: string;
341
- revokedAt: string | null;
342
341
  beneficiaryAccountId: string & z.BRAND<"OxyAccountId">;
343
342
  period: {
344
343
  start: string;
@@ -346,24 +345,24 @@ export declare const productAccessGrantSchema: z.ZodObject<{
346
345
  };
347
346
  offerId: string;
348
347
  offerVersion: number;
349
- origin: "bundle" | "individual";
348
+ origin: "individual" | "bundle";
350
349
  sourceSegmentId: string;
351
350
  benefit: {
351
+ productId: string;
352
352
  kind: "capability";
353
353
  key: string;
354
- productId: string;
355
354
  } | {
355
+ productId: string;
356
356
  kind: "quota";
357
357
  key: string;
358
358
  unit: string;
359
359
  included: number;
360
- productId: string;
361
360
  combination: "maximum" | "sum" | "exclusive";
362
361
  };
362
+ revokedAt: string | null;
363
363
  }, {
364
364
  schemaVersion: 1;
365
365
  id: string;
366
- revokedAt: string | null;
367
366
  beneficiaryAccountId: string;
368
367
  period: {
369
368
  start: string;
@@ -371,20 +370,21 @@ export declare const productAccessGrantSchema: z.ZodObject<{
371
370
  };
372
371
  offerId: string;
373
372
  offerVersion: number;
374
- origin: "bundle" | "individual";
373
+ origin: "individual" | "bundle";
375
374
  sourceSegmentId: string;
376
375
  benefit: {
376
+ productId: string;
377
377
  kind: "capability";
378
378
  key: string;
379
- productId: string;
380
379
  } | {
380
+ productId: string;
381
381
  kind: "quota";
382
382
  key: string;
383
383
  unit: string;
384
384
  included: number;
385
- productId: string;
386
385
  combination: "maximum" | "sum" | "exclusive";
387
386
  };
387
+ revokedAt: string | null;
388
388
  }>;
389
389
  /** Access answers contain no payer, provider reference, price or account balance. */
390
390
  export declare const subjectProductAccessSchema: z.ZodObject<{
@@ -427,22 +427,22 @@ export declare const subjectProductAccessSchema: z.ZodObject<{
427
427
  grantIds: z.ZodArray<z.ZodString, "many">;
428
428
  }, "strict", z.ZodTypeAny, {
429
429
  key: string;
430
- reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
431
430
  grantIds: string[];
431
+ reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
432
432
  }, {
433
433
  key: string;
434
- reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
435
434
  grantIds: string[];
435
+ reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
436
436
  }>, "many">;
437
437
  }, "strict", z.ZodTypeAny, {
438
438
  schemaVersion: 1;
439
439
  subjectAccountId: string & z.BRAND<"OxyAccountId">;
440
+ productId: string;
441
+ evaluatedAt: string;
440
442
  capabilities: {
441
443
  key: string;
442
444
  grantIds: string[];
443
445
  }[];
444
- evaluatedAt: string;
445
- productId: string;
446
446
  quotas: {
447
447
  key: string;
448
448
  unit: string;
@@ -452,18 +452,18 @@ export declare const subjectProductAccessSchema: z.ZodObject<{
452
452
  }[];
453
453
  conflicts: {
454
454
  key: string;
455
- reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
456
455
  grantIds: string[];
456
+ reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
457
457
  }[];
458
458
  }, {
459
459
  schemaVersion: 1;
460
460
  subjectAccountId: string;
461
+ productId: string;
462
+ evaluatedAt: string;
461
463
  capabilities: {
462
464
  key: string;
463
465
  grantIds: string[];
464
466
  }[];
465
- evaluatedAt: string;
466
- productId: string;
467
467
  quotas: {
468
468
  key: string;
469
469
  unit: string;
@@ -473,8 +473,8 @@ export declare const subjectProductAccessSchema: z.ZodObject<{
473
473
  }[];
474
474
  conflicts: {
475
475
  key: string;
476
- reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
477
476
  grantIds: string[];
477
+ reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
478
478
  }[];
479
479
  }>;
480
480
  export type ProductBenefit = z.infer<typeof productBenefitSchema>;
@@ -485,3 +485,408 @@ export type ProductAccessGrant = z.infer<typeof productAccessGrantSchema>;
485
485
  export type SubjectProductAccess = z.infer<typeof subjectProductAccessSchema>;
486
486
  export type ProductDefinition = z.infer<typeof productDefinitionSchema>;
487
487
  export type SubjectProductAccessQuery = z.infer<typeof subjectProductAccessQuerySchema>;
488
+ /** Active grant periods for metering adapters; no financial/provider identity. */
489
+ export declare const subjectProductGrantSnapshotSchema: z.ZodEffects<z.ZodObject<{
490
+ schemaVersion: z.ZodLiteral<1>;
491
+ access: z.ZodObject<{
492
+ schemaVersion: z.ZodLiteral<1>;
493
+ subjectAccountId: z.ZodBranded<z.ZodString, "OxyAccountId">;
494
+ productId: z.ZodString;
495
+ evaluatedAt: z.ZodString;
496
+ capabilities: z.ZodArray<z.ZodObject<{
497
+ key: z.ZodString;
498
+ grantIds: z.ZodArray<z.ZodString, "many">;
499
+ }, "strict", z.ZodTypeAny, {
500
+ key: string;
501
+ grantIds: string[];
502
+ }, {
503
+ key: string;
504
+ grantIds: string[];
505
+ }>, "many">;
506
+ quotas: z.ZodArray<z.ZodObject<{
507
+ key: z.ZodString;
508
+ unit: z.ZodString;
509
+ included: z.ZodNumber;
510
+ combination: z.ZodEnum<["maximum", "sum", "exclusive"]>;
511
+ grantIds: z.ZodArray<z.ZodString, "many">;
512
+ }, "strict", z.ZodTypeAny, {
513
+ key: string;
514
+ unit: string;
515
+ included: number;
516
+ combination: "maximum" | "sum" | "exclusive";
517
+ grantIds: string[];
518
+ }, {
519
+ key: string;
520
+ unit: string;
521
+ included: number;
522
+ combination: "maximum" | "sum" | "exclusive";
523
+ grantIds: string[];
524
+ }>, "many">;
525
+ conflicts: z.ZodArray<z.ZodObject<{
526
+ key: z.ZodString;
527
+ reason: z.ZodEnum<["combination_mismatch", "unit_mismatch", "exclusive_overlap", "unsafe_total"]>;
528
+ grantIds: z.ZodArray<z.ZodString, "many">;
529
+ }, "strict", z.ZodTypeAny, {
530
+ key: string;
531
+ grantIds: string[];
532
+ reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
533
+ }, {
534
+ key: string;
535
+ grantIds: string[];
536
+ reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
537
+ }>, "many">;
538
+ }, "strict", z.ZodTypeAny, {
539
+ schemaVersion: 1;
540
+ subjectAccountId: string & z.BRAND<"OxyAccountId">;
541
+ productId: string;
542
+ evaluatedAt: string;
543
+ capabilities: {
544
+ key: string;
545
+ grantIds: string[];
546
+ }[];
547
+ quotas: {
548
+ key: string;
549
+ unit: string;
550
+ included: number;
551
+ combination: "maximum" | "sum" | "exclusive";
552
+ grantIds: string[];
553
+ }[];
554
+ conflicts: {
555
+ key: string;
556
+ grantIds: string[];
557
+ reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
558
+ }[];
559
+ }, {
560
+ schemaVersion: 1;
561
+ subjectAccountId: string;
562
+ productId: string;
563
+ evaluatedAt: string;
564
+ capabilities: {
565
+ key: string;
566
+ grantIds: string[];
567
+ }[];
568
+ quotas: {
569
+ key: string;
570
+ unit: string;
571
+ included: number;
572
+ combination: "maximum" | "sum" | "exclusive";
573
+ grantIds: string[];
574
+ }[];
575
+ conflicts: {
576
+ key: string;
577
+ grantIds: string[];
578
+ reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
579
+ }[];
580
+ }>;
581
+ grants: z.ZodArray<z.ZodObject<{
582
+ schemaVersion: z.ZodLiteral<1>;
583
+ id: z.ZodString;
584
+ sourceSegmentId: z.ZodString;
585
+ beneficiaryAccountId: z.ZodBranded<z.ZodString, "OxyAccountId">;
586
+ offerId: z.ZodString;
587
+ offerVersion: z.ZodNumber;
588
+ origin: z.ZodEnum<["individual", "bundle"]>;
589
+ benefit: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
590
+ kind: z.ZodLiteral<"capability">;
591
+ productId: z.ZodString;
592
+ key: z.ZodString;
593
+ }, "strict", z.ZodTypeAny, {
594
+ productId: string;
595
+ kind: "capability";
596
+ key: string;
597
+ }, {
598
+ productId: string;
599
+ kind: "capability";
600
+ key: string;
601
+ }>, z.ZodObject<{
602
+ kind: z.ZodLiteral<"quota">;
603
+ productId: z.ZodString;
604
+ key: z.ZodString;
605
+ unit: z.ZodString;
606
+ included: z.ZodNumber;
607
+ combination: z.ZodEnum<["maximum", "sum", "exclusive"]>;
608
+ }, "strict", z.ZodTypeAny, {
609
+ productId: string;
610
+ kind: "quota";
611
+ key: string;
612
+ unit: string;
613
+ included: number;
614
+ combination: "maximum" | "sum" | "exclusive";
615
+ }, {
616
+ productId: string;
617
+ kind: "quota";
618
+ key: string;
619
+ unit: string;
620
+ included: number;
621
+ combination: "maximum" | "sum" | "exclusive";
622
+ }>]>;
623
+ period: z.ZodEffects<z.ZodObject<{
624
+ start: z.ZodString;
625
+ end: z.ZodString;
626
+ }, "strict", z.ZodTypeAny, {
627
+ start: string;
628
+ end: string;
629
+ }, {
630
+ start: string;
631
+ end: string;
632
+ }>, {
633
+ start: string;
634
+ end: string;
635
+ }, {
636
+ start: string;
637
+ end: string;
638
+ }>;
639
+ revokedAt: z.ZodNullable<z.ZodString>;
640
+ }, "strict", z.ZodTypeAny, {
641
+ schemaVersion: 1;
642
+ id: string;
643
+ beneficiaryAccountId: string & z.BRAND<"OxyAccountId">;
644
+ period: {
645
+ start: string;
646
+ end: string;
647
+ };
648
+ offerId: string;
649
+ offerVersion: number;
650
+ origin: "individual" | "bundle";
651
+ sourceSegmentId: string;
652
+ benefit: {
653
+ productId: string;
654
+ kind: "capability";
655
+ key: string;
656
+ } | {
657
+ productId: string;
658
+ kind: "quota";
659
+ key: string;
660
+ unit: string;
661
+ included: number;
662
+ combination: "maximum" | "sum" | "exclusive";
663
+ };
664
+ revokedAt: string | null;
665
+ }, {
666
+ schemaVersion: 1;
667
+ id: string;
668
+ beneficiaryAccountId: string;
669
+ period: {
670
+ start: string;
671
+ end: string;
672
+ };
673
+ offerId: string;
674
+ offerVersion: number;
675
+ origin: "individual" | "bundle";
676
+ sourceSegmentId: string;
677
+ benefit: {
678
+ productId: string;
679
+ kind: "capability";
680
+ key: string;
681
+ } | {
682
+ productId: string;
683
+ kind: "quota";
684
+ key: string;
685
+ unit: string;
686
+ included: number;
687
+ combination: "maximum" | "sum" | "exclusive";
688
+ };
689
+ revokedAt: string | null;
690
+ }>, "many">;
691
+ }, "strict", z.ZodTypeAny, {
692
+ schemaVersion: 1;
693
+ access: {
694
+ schemaVersion: 1;
695
+ subjectAccountId: string & z.BRAND<"OxyAccountId">;
696
+ productId: string;
697
+ evaluatedAt: string;
698
+ capabilities: {
699
+ key: string;
700
+ grantIds: string[];
701
+ }[];
702
+ quotas: {
703
+ key: string;
704
+ unit: string;
705
+ included: number;
706
+ combination: "maximum" | "sum" | "exclusive";
707
+ grantIds: string[];
708
+ }[];
709
+ conflicts: {
710
+ key: string;
711
+ grantIds: string[];
712
+ reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
713
+ }[];
714
+ };
715
+ grants: {
716
+ schemaVersion: 1;
717
+ id: string;
718
+ beneficiaryAccountId: string & z.BRAND<"OxyAccountId">;
719
+ period: {
720
+ start: string;
721
+ end: string;
722
+ };
723
+ offerId: string;
724
+ offerVersion: number;
725
+ origin: "individual" | "bundle";
726
+ sourceSegmentId: string;
727
+ benefit: {
728
+ productId: string;
729
+ kind: "capability";
730
+ key: string;
731
+ } | {
732
+ productId: string;
733
+ kind: "quota";
734
+ key: string;
735
+ unit: string;
736
+ included: number;
737
+ combination: "maximum" | "sum" | "exclusive";
738
+ };
739
+ revokedAt: string | null;
740
+ }[];
741
+ }, {
742
+ schemaVersion: 1;
743
+ access: {
744
+ schemaVersion: 1;
745
+ subjectAccountId: string;
746
+ productId: string;
747
+ evaluatedAt: string;
748
+ capabilities: {
749
+ key: string;
750
+ grantIds: string[];
751
+ }[];
752
+ quotas: {
753
+ key: string;
754
+ unit: string;
755
+ included: number;
756
+ combination: "maximum" | "sum" | "exclusive";
757
+ grantIds: string[];
758
+ }[];
759
+ conflicts: {
760
+ key: string;
761
+ grantIds: string[];
762
+ reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
763
+ }[];
764
+ };
765
+ grants: {
766
+ schemaVersion: 1;
767
+ id: string;
768
+ beneficiaryAccountId: string;
769
+ period: {
770
+ start: string;
771
+ end: string;
772
+ };
773
+ offerId: string;
774
+ offerVersion: number;
775
+ origin: "individual" | "bundle";
776
+ sourceSegmentId: string;
777
+ benefit: {
778
+ productId: string;
779
+ kind: "capability";
780
+ key: string;
781
+ } | {
782
+ productId: string;
783
+ kind: "quota";
784
+ key: string;
785
+ unit: string;
786
+ included: number;
787
+ combination: "maximum" | "sum" | "exclusive";
788
+ };
789
+ revokedAt: string | null;
790
+ }[];
791
+ }>, {
792
+ schemaVersion: 1;
793
+ access: {
794
+ schemaVersion: 1;
795
+ subjectAccountId: string & z.BRAND<"OxyAccountId">;
796
+ productId: string;
797
+ evaluatedAt: string;
798
+ capabilities: {
799
+ key: string;
800
+ grantIds: string[];
801
+ }[];
802
+ quotas: {
803
+ key: string;
804
+ unit: string;
805
+ included: number;
806
+ combination: "maximum" | "sum" | "exclusive";
807
+ grantIds: string[];
808
+ }[];
809
+ conflicts: {
810
+ key: string;
811
+ grantIds: string[];
812
+ reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
813
+ }[];
814
+ };
815
+ grants: {
816
+ schemaVersion: 1;
817
+ id: string;
818
+ beneficiaryAccountId: string & z.BRAND<"OxyAccountId">;
819
+ period: {
820
+ start: string;
821
+ end: string;
822
+ };
823
+ offerId: string;
824
+ offerVersion: number;
825
+ origin: "individual" | "bundle";
826
+ sourceSegmentId: string;
827
+ benefit: {
828
+ productId: string;
829
+ kind: "capability";
830
+ key: string;
831
+ } | {
832
+ productId: string;
833
+ kind: "quota";
834
+ key: string;
835
+ unit: string;
836
+ included: number;
837
+ combination: "maximum" | "sum" | "exclusive";
838
+ };
839
+ revokedAt: string | null;
840
+ }[];
841
+ }, {
842
+ schemaVersion: 1;
843
+ access: {
844
+ schemaVersion: 1;
845
+ subjectAccountId: string;
846
+ productId: string;
847
+ evaluatedAt: string;
848
+ capabilities: {
849
+ key: string;
850
+ grantIds: string[];
851
+ }[];
852
+ quotas: {
853
+ key: string;
854
+ unit: string;
855
+ included: number;
856
+ combination: "maximum" | "sum" | "exclusive";
857
+ grantIds: string[];
858
+ }[];
859
+ conflicts: {
860
+ key: string;
861
+ grantIds: string[];
862
+ reason: "combination_mismatch" | "unit_mismatch" | "exclusive_overlap" | "unsafe_total";
863
+ }[];
864
+ };
865
+ grants: {
866
+ schemaVersion: 1;
867
+ id: string;
868
+ beneficiaryAccountId: string;
869
+ period: {
870
+ start: string;
871
+ end: string;
872
+ };
873
+ offerId: string;
874
+ offerVersion: number;
875
+ origin: "individual" | "bundle";
876
+ sourceSegmentId: string;
877
+ benefit: {
878
+ productId: string;
879
+ kind: "capability";
880
+ key: string;
881
+ } | {
882
+ productId: string;
883
+ kind: "quota";
884
+ key: string;
885
+ unit: string;
886
+ included: number;
887
+ combination: "maximum" | "sum" | "exclusive";
888
+ };
889
+ revokedAt: string | null;
890
+ }[];
891
+ }>;
892
+ export type SubjectProductGrantSnapshot = z.infer<typeof subjectProductGrantSnapshotSchema>;