@purveyors/sdk 0.27.0 → 0.28.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/index.d.ts CHANGED
@@ -125,8 +125,8 @@ interface paths {
125
125
  get?: never;
126
126
  put?: never;
127
127
  /**
128
- * Request deletion of the authenticated user's account
129
- * @description Idempotently creates or returns the durable deletion operation and quiesces owner writes. This destructive session-only route is dark-launched.
128
+ * Accept deletion of the authenticated account
129
+ * @description Cryptographically validates a recent purpose-bound coffee-app assertion and atomically creates or replays the permanent Parchment-owned deletion operation.
130
130
  */
131
131
  post: {
132
132
  parameters: {
@@ -135,9 +135,15 @@ interface paths {
135
135
  path?: never;
136
136
  cookie?: never;
137
137
  };
138
- requestBody?: never;
138
+ requestBody: {
139
+ content: {
140
+ "application/json": {
141
+ assertion: string;
142
+ };
143
+ };
144
+ };
139
145
  responses: {
140
- /** @description Durable deletion operation */
146
+ /** @description Existing accepted deletion operation */
141
147
  200: {
142
148
  headers: {
143
149
  /** @description Sensitive lifecycle responses are never cached */
@@ -148,6 +154,26 @@ interface paths {
148
154
  "application/json": components["schemas"]["AccountDeletionOperation"];
149
155
  };
150
156
  };
157
+ /** @description Deletion accepted; the durable worker owns convergence */
158
+ 202: {
159
+ headers: {
160
+ /** @description Sensitive lifecycle responses are never cached */
161
+ "Cache-Control"?: string;
162
+ [name: string]: unknown;
163
+ };
164
+ content: {
165
+ "application/json": components["schemas"]["AccountDeletionOperation"];
166
+ };
167
+ };
168
+ /** @description Malformed assertion request */
169
+ 400: {
170
+ headers: {
171
+ [name: string]: unknown;
172
+ };
173
+ content: {
174
+ "application/json": components["schemas"]["ErrorResponse"];
175
+ };
176
+ };
151
177
  /** @description A valid Supabase user session is required */
152
178
  401: {
153
179
  headers: {
@@ -157,8 +183,8 @@ interface paths {
157
183
  "application/json": components["schemas"]["ErrorResponse"];
158
184
  };
159
185
  };
160
- /** @description Account deletion is blocked by account or billing state */
161
- 409: {
186
+ /** @description Recent account-deletion reauthentication is invalid */
187
+ 403: {
162
188
  headers: {
163
189
  [name: string]: unknown;
164
190
  };
@@ -166,8 +192,8 @@ interface paths {
166
192
  "application/json": components["schemas"]["ErrorResponse"];
167
193
  };
168
194
  };
169
- /** @description The owner mutation throttle was exceeded */
170
- 429: {
195
+ /** @description Account deletion is blocked by deterministic local work */
196
+ 409: {
171
197
  headers: {
172
198
  [name: string]: unknown;
173
199
  };
@@ -175,7 +201,7 @@ interface paths {
175
201
  "application/json": components["schemas"]["ErrorResponse"];
176
202
  };
177
203
  };
178
- /** @description The lifecycle is disabled or storage is unavailable */
204
+ /** @description The activated lifecycle or storage is unavailable */
179
205
  503: {
180
206
  headers: {
181
207
  [name: string]: unknown;
@@ -192,7 +218,7 @@ interface paths {
192
218
  patch?: never;
193
219
  trace?: never;
194
220
  };
195
- "/v1/checkout-admissions": {
221
+ "/v1/billing/checkout-sessions": {
196
222
  parameters: {
197
223
  query?: never;
198
224
  header?: never;
@@ -201,10 +227,7 @@ interface paths {
201
227
  };
202
228
  get?: never;
203
229
  put?: never;
204
- /**
205
- * Acquire a durable Stripe Checkout admission
206
- * @description Session-only dark-launch boundary. Acquire before creating Stripe state; replay the same request id after an ambiguous client failure and use admissionId as the Stripe idempotency key.
207
- */
230
+ /** Create or replay an embedded Stripe Checkout Session */
208
231
  post: {
209
232
  parameters: {
210
233
  query?: never;
@@ -217,20 +240,27 @@ interface paths {
217
240
  "application/json": {
218
241
  /** Format: uuid */
219
242
  requestId: string;
243
+ purchaseItems: {
244
+ purchaseKey: string;
245
+ /** @default 1 */
246
+ quantity?: number;
247
+ }[];
220
248
  };
221
249
  };
222
250
  };
223
251
  responses: {
224
- /** @description Durable owner-bound Checkout admission */
252
+ /** @description Created or replayed Checkout Session */
225
253
  200: {
226
254
  headers: {
255
+ /** @description Billing responses are never shared-cacheable */
256
+ "Cache-Control"?: string;
227
257
  [name: string]: unknown;
228
258
  };
229
259
  content: {
230
- "application/json": components["schemas"]["CheckoutAdmission"];
260
+ "application/json": components["schemas"]["BillingCheckoutSession"];
231
261
  };
232
262
  };
233
- /** @description Malformed request */
263
+ /** @description Unknown product or definite provider rejection */
234
264
  400: {
235
265
  headers: {
236
266
  [name: string]: unknown;
@@ -248,7 +278,7 @@ interface paths {
248
278
  "application/json": components["schemas"]["ErrorResponse"];
249
279
  };
250
280
  };
251
- /** @description Checkout is fenced by account deletion */
281
+ /** @description The operation conflicts with current durable state */
252
282
  409: {
253
283
  headers: {
254
284
  [name: string]: unknown;
@@ -257,8 +287,8 @@ interface paths {
257
287
  "application/json": components["schemas"]["ErrorResponse"];
258
288
  };
259
289
  };
260
- /** @description The owner mutation throttle was exceeded */
261
- 429: {
290
+ /** @description The billing JSON request body exceeds the maximum size */
291
+ 413: {
262
292
  headers: {
263
293
  [name: string]: unknown;
264
294
  };
@@ -266,7 +296,7 @@ interface paths {
266
296
  "application/json": components["schemas"]["ErrorResponse"];
267
297
  };
268
298
  };
269
- /** @description Checkout admission storage is unavailable */
299
+ /** @description Billing storage or provider state is unavailable */
270
300
  503: {
271
301
  headers: {
272
302
  [name: string]: unknown;
@@ -283,54 +313,34 @@ interface paths {
283
313
  patch?: never;
284
314
  trace?: never;
285
315
  };
286
- "/v1/checkout-admissions/{admissionId}/publish": {
316
+ "/v1/billing/checkout-sessions/{admissionId}": {
287
317
  parameters: {
288
318
  query?: never;
289
319
  header?: never;
290
320
  path?: never;
291
321
  cookie?: never;
292
322
  };
293
- get?: never;
294
- put?: never;
295
- /**
296
- * Publish the Stripe session created for an admission
297
- * @description Dark-launch trusted coffee BFF boundary. Requires the owner session plus provider credential so an owner cannot attach an arbitrary Stripe Checkout Session to the admission ledger. Publication is idempotent for the same admission and Stripe session.
298
- */
299
- post: {
323
+ /** Read owner-bound Checkout admission state */
324
+ get: {
300
325
  parameters: {
301
326
  query?: never;
302
- header: {
303
- "x-account-deletion-provider-credential": string;
304
- };
327
+ header?: never;
305
328
  path: {
306
329
  admissionId: string;
307
330
  };
308
331
  cookie?: never;
309
332
  };
310
- requestBody: {
311
- content: {
312
- "application/json": {
313
- stripeSessionId: string;
314
- };
315
- };
316
- };
333
+ requestBody?: never;
317
334
  responses: {
318
- /** @description Published Checkout admission */
335
+ /** @description Checkout admission state */
319
336
  200: {
320
337
  headers: {
338
+ /** @description Billing responses are never shared-cacheable */
339
+ "Cache-Control"?: string;
321
340
  [name: string]: unknown;
322
341
  };
323
342
  content: {
324
- "application/json": components["schemas"]["CheckoutAdmission"];
325
- };
326
- };
327
- /** @description Malformed request */
328
- 400: {
329
- headers: {
330
- [name: string]: unknown;
331
- };
332
- content: {
333
- "application/json": components["schemas"]["ErrorResponse"];
343
+ "application/json": components["schemas"]["BillingCheckoutSession"];
334
344
  };
335
345
  };
336
346
  /** @description A valid Supabase user session is required */
@@ -342,15 +352,6 @@ interface paths {
342
352
  "application/json": components["schemas"]["ErrorResponse"];
343
353
  };
344
354
  };
345
- /** @description Trusted provider authorization is required */
346
- 403: {
347
- headers: {
348
- [name: string]: unknown;
349
- };
350
- content: {
351
- "application/json": components["schemas"]["ErrorResponse"];
352
- };
353
- };
354
355
  /** @description Admission not found */
355
356
  404: {
356
357
  headers: {
@@ -360,7 +361,7 @@ interface paths {
360
361
  "application/json": components["schemas"]["ErrorResponse"];
361
362
  };
362
363
  };
363
- /** @description Checkout is fenced by account deletion */
364
+ /** @description The operation conflicts with current durable state */
364
365
  409: {
365
366
  headers: {
366
367
  [name: string]: unknown;
@@ -369,16 +370,7 @@ interface paths {
369
370
  "application/json": components["schemas"]["ErrorResponse"];
370
371
  };
371
372
  };
372
- /** @description The owner mutation throttle was exceeded */
373
- 429: {
374
- headers: {
375
- [name: string]: unknown;
376
- };
377
- content: {
378
- "application/json": components["schemas"]["ErrorResponse"];
379
- };
380
- };
381
- /** @description Checkout admission storage is unavailable */
373
+ /** @description Billing storage or provider state is unavailable */
382
374
  503: {
383
375
  headers: {
384
376
  [name: string]: unknown;
@@ -389,13 +381,15 @@ interface paths {
389
381
  };
390
382
  };
391
383
  };
384
+ put?: never;
385
+ post?: never;
392
386
  delete?: never;
393
387
  options?: never;
394
388
  head?: never;
395
389
  patch?: never;
396
390
  trace?: never;
397
391
  };
398
- "/v1/checkout-admissions/{admissionId}/abandon": {
392
+ "/v1/billing/checkout-sessions/{admissionId}/reconcile": {
399
393
  parameters: {
400
394
  query?: never;
401
395
  header?: never;
@@ -404,46 +398,27 @@ interface paths {
404
398
  };
405
399
  get?: never;
406
400
  put?: never;
407
- /**
408
- * Resolve a Checkout admission with definite no-session evidence
409
- * @description Dark-launch trusted coffee BFF boundary. Requires the owner session plus provider credential. Call only after Stripe authoritatively proves no Checkout Session exists for the admission idempotency key; an ordinary user session cannot erase creating-state ambiguity.
410
- */
401
+ /** Authoritatively reconcile a Checkout admission */
411
402
  post: {
412
403
  parameters: {
413
404
  query?: never;
414
- header: {
415
- "x-account-deletion-provider-credential": string;
416
- };
405
+ header?: never;
417
406
  path: {
418
407
  admissionId: string;
419
408
  };
420
409
  cookie?: never;
421
410
  };
422
- requestBody: {
423
- content: {
424
- "application/json": {
425
- /** @enum {string} */
426
- evidence: "stripe_creation_definitively_absent";
427
- };
428
- };
429
- };
411
+ requestBody?: never;
430
412
  responses: {
431
- /** @description Closed Checkout admission */
413
+ /** @description Reconciled Checkout admission */
432
414
  200: {
433
415
  headers: {
416
+ /** @description Billing responses are never shared-cacheable */
417
+ "Cache-Control"?: string;
434
418
  [name: string]: unknown;
435
419
  };
436
420
  content: {
437
- "application/json": components["schemas"]["CheckoutAdmission"];
438
- };
439
- };
440
- /** @description Malformed request or evidence */
441
- 400: {
442
- headers: {
443
- [name: string]: unknown;
444
- };
445
- content: {
446
- "application/json": components["schemas"]["ErrorResponse"];
421
+ "application/json": components["schemas"]["BillingCheckoutSession"];
447
422
  };
448
423
  };
449
424
  /** @description A valid Supabase user session is required */
@@ -455,16 +430,7 @@ interface paths {
455
430
  "application/json": components["schemas"]["ErrorResponse"];
456
431
  };
457
432
  };
458
- /** @description Trusted provider authorization is required */
459
- 403: {
460
- headers: {
461
- [name: string]: unknown;
462
- };
463
- content: {
464
- "application/json": components["schemas"]["ErrorResponse"];
465
- };
466
- };
467
- /** @description Creating admission not found */
433
+ /** @description Admission not found */
468
434
  404: {
469
435
  headers: {
470
436
  [name: string]: unknown;
@@ -473,8 +439,8 @@ interface paths {
473
439
  "application/json": components["schemas"]["ErrorResponse"];
474
440
  };
475
441
  };
476
- /** @description The owner mutation throttle was exceeded */
477
- 429: {
442
+ /** @description The operation conflicts with current durable state */
443
+ 409: {
478
444
  headers: {
479
445
  [name: string]: unknown;
480
446
  };
@@ -482,7 +448,7 @@ interface paths {
482
448
  "application/json": components["schemas"]["ErrorResponse"];
483
449
  };
484
450
  };
485
- /** @description Checkout admission storage is unavailable */
451
+ /** @description Billing storage or provider state is unavailable */
486
452
  503: {
487
453
  headers: {
488
454
  [name: string]: unknown;
@@ -499,7 +465,7 @@ interface paths {
499
465
  patch?: never;
500
466
  trace?: never;
501
467
  };
502
- "/v1/checkout-admissions/provider-eligibility": {
468
+ "/v1/billing/stripe/webhook": {
503
469
  parameters: {
504
470
  query?: never;
505
471
  header?: never;
@@ -509,42 +475,34 @@ interface paths {
509
475
  get?: never;
510
476
  put?: never;
511
477
  /**
512
- * Check whether provider writes remain eligible
513
- * @description Dark-launch internal webhook boundary. Requires the shared provider-finalization credential and returns false for missing, closed, cross-owner, or deletion-fenced admissions.
478
+ * Receive verified Stripe billing deliveries
479
+ * @description Verifies the Stripe signature against the untouched raw body before parsing and settles through the canonical atomic billing RPC.
514
480
  */
515
481
  post: {
516
482
  parameters: {
517
483
  query?: never;
518
484
  header: {
519
- "x-account-deletion-provider-credential": string;
485
+ "stripe-signature": string;
520
486
  };
521
487
  path?: never;
522
488
  cookie?: never;
523
489
  };
524
- requestBody: {
525
- content: {
526
- "application/json": {
527
- /** Format: uuid */
528
- ownerId: string;
529
- /** Format: uuid */
530
- admissionId: string;
531
- stripeSessionId: string;
532
- };
533
- };
534
- };
490
+ requestBody?: never;
535
491
  responses: {
536
- /** @description Provider write eligibility */
492
+ /** @description Delivery settled or deterministically ignored */
537
493
  200: {
538
494
  headers: {
539
495
  [name: string]: unknown;
540
496
  };
541
497
  content: {
542
498
  "application/json": {
543
- eligible: boolean;
499
+ /** @enum {boolean} */
500
+ received: true;
501
+ outcome: string;
544
502
  };
545
503
  };
546
504
  };
547
- /** @description Malformed request */
505
+ /** @description Signature or provider payload is invalid */
548
506
  400: {
549
507
  headers: {
550
508
  [name: string]: unknown;
@@ -553,8 +511,8 @@ interface paths {
553
511
  "application/json": components["schemas"]["ErrorResponse"];
554
512
  };
555
513
  };
556
- /** @description Trusted provider authorization is required */
557
- 403: {
514
+ /** @description Provider payload exceeds the bounded webhook body limit */
515
+ 413: {
558
516
  headers: {
559
517
  [name: string]: unknown;
560
518
  };
@@ -562,7 +520,7 @@ interface paths {
562
520
  "application/json": components["schemas"]["ErrorResponse"];
563
521
  };
564
522
  };
565
- /** @description Eligibility storage is unavailable */
523
+ /** @description Retryable provider or storage failure */
566
524
  503: {
567
525
  headers: {
568
526
  [name: string]: unknown;
@@ -579,71 +537,50 @@ interface paths {
579
537
  patch?: never;
580
538
  trace?: never;
581
539
  };
582
- "/v1/checkout-admissions/provider-terminalization": {
540
+ "/v1/billing/subscriptions": {
583
541
  parameters: {
584
542
  query?: never;
585
543
  header?: never;
586
544
  path?: never;
587
545
  cookie?: never;
588
546
  };
589
- get?: never;
590
- put?: never;
591
- /**
592
- * Close a provider-terminal Checkout admission
593
- * @description Dark-launch trusted webhook boundary for an expired Checkout Session. Completed or paid sessions remain published until account deletion verifies their authoritative Stripe billing state.
594
- */
595
- post: {
547
+ /** List canonical subscription snapshots */
548
+ get: {
596
549
  parameters: {
597
550
  query?: never;
598
- header: {
599
- "x-account-deletion-provider-credential": string;
600
- };
551
+ header?: never;
601
552
  path?: never;
602
553
  cookie?: never;
603
554
  };
604
- requestBody: {
605
- content: {
606
- "application/json": {
607
- /** Format: uuid */
608
- ownerId: string;
609
- /** Format: uuid */
610
- admissionId: string;
611
- stripeSessionId: string;
612
- /** @enum {string} */
613
- terminalStatus: "expired";
614
- };
615
- };
616
- };
555
+ requestBody?: never;
617
556
  responses: {
618
- /** @description Closed provider-terminal Checkout admission */
557
+ /** @description Owner billing snapshots and bounded management state */
619
558
  200: {
620
559
  headers: {
560
+ /** @description Billing responses are never shared-cacheable */
561
+ "Cache-Control"?: string;
621
562
  [name: string]: unknown;
622
563
  };
623
564
  content: {
624
- "application/json": components["schemas"]["CheckoutAdmission"];
625
- };
626
- };
627
- /** @description Malformed request */
628
- 400: {
629
- headers: {
630
- [name: string]: unknown;
631
- };
632
- content: {
633
- "application/json": components["schemas"]["ErrorResponse"];
634
- };
635
- };
636
- /** @description Trusted provider authorization is required */
637
- 403: {
638
- headers: {
639
- [name: string]: unknown;
640
- };
641
- content: {
642
- "application/json": components["schemas"]["ErrorResponse"];
565
+ "application/json": {
566
+ subscriptions: {
567
+ subscriptionId: string;
568
+ status: string;
569
+ cancelAtPeriodEnd: boolean;
570
+ /** Format: date-time */
571
+ currentPeriodEnd: string | null;
572
+ items: {
573
+ subscriptionItemId: string;
574
+ priceId: string;
575
+ purchaseKey: string;
576
+ productFamily: string;
577
+ }[];
578
+ }[];
579
+ };
643
580
  };
644
581
  };
645
- /** @description Published admission not found */
646
- 404: {
582
+ /** @description A valid Supabase user session is required */
583
+ 401: {
647
584
  headers: {
648
585
  [name: string]: unknown;
649
586
  };
@@ -651,7 +588,7 @@ interface paths {
651
588
  "application/json": components["schemas"]["ErrorResponse"];
652
589
  };
653
590
  };
654
- /** @description Account deletion owns Checkout reconciliation */
591
+ /** @description The operation conflicts with current durable state */
655
592
  409: {
656
593
  headers: {
657
594
  [name: string]: unknown;
@@ -660,16 +597,7 @@ interface paths {
660
597
  "application/json": components["schemas"]["ErrorResponse"];
661
598
  };
662
599
  };
663
- /** @description The owner mutation throttle was exceeded */
664
- 429: {
665
- headers: {
666
- [name: string]: unknown;
667
- };
668
- content: {
669
- "application/json": components["schemas"]["ErrorResponse"];
670
- };
671
- };
672
- /** @description Checkout admission storage is unavailable */
600
+ /** @description Billing storage or provider state is unavailable */
673
601
  503: {
674
602
  headers: {
675
603
  [name: string]: unknown;
@@ -680,13 +608,15 @@ interface paths {
680
608
  };
681
609
  };
682
610
  };
611
+ put?: never;
612
+ post?: never;
683
613
  delete?: never;
684
614
  options?: never;
685
615
  head?: never;
686
616
  patch?: never;
687
617
  trace?: never;
688
618
  };
689
- "/v1/account-deletion/provider-finalization": {
619
+ "/v1/billing/subscriptions/{subscriptionId}": {
690
620
  parameters: {
691
621
  query?: never;
692
622
  header?: never;
@@ -695,46 +625,50 @@ interface paths {
695
625
  };
696
626
  get?: never;
697
627
  put?: never;
698
- /**
699
- * Publish provider-finalized account deletion work
700
- * @description Internal coffee-app BFF boundary. Requires the owner's Supabase session and a separately configured server credential. Missing and cross-owner operation ids are indistinguishable.
701
- */
702
- post: {
628
+ post?: never;
629
+ delete?: never;
630
+ options?: never;
631
+ head?: never;
632
+ /** Cancel or resume an owner subscription */
633
+ patch: {
703
634
  parameters: {
704
635
  query?: never;
705
- header: {
706
- "x-account-deletion-provider-credential": string;
636
+ header?: never;
637
+ path: {
638
+ subscriptionId: string;
707
639
  };
708
- path?: never;
709
640
  cookie?: never;
710
641
  };
711
642
  requestBody: {
712
643
  content: {
713
644
  "application/json": {
714
645
  /** Format: uuid */
715
- operationId: string;
646
+ requestId: string;
647
+ cancelAtPeriodEnd: boolean;
716
648
  };
717
649
  };
718
650
  };
719
651
  responses: {
720
- /** @description Owner-bound operation after provider finalization */
652
+ /** @description Succeeded, superseded, or replayed subscription operation */
721
653
  200: {
722
654
  headers: {
723
- /** @description Sensitive lifecycle responses are never cached */
655
+ /** @description Billing responses are never shared-cacheable */
724
656
  "Cache-Control"?: string;
725
657
  [name: string]: unknown;
726
658
  };
727
659
  content: {
728
- "application/json": components["schemas"]["AccountDeletionOperation"];
660
+ "application/json": components["schemas"]["BillingSubscriptionOperation"];
729
661
  };
730
662
  };
731
- /** @description The operation id is malformed */
732
- 400: {
663
+ /** @description Provider operation remains durable and unresolved */
664
+ 202: {
733
665
  headers: {
666
+ /** @description Billing responses are never shared-cacheable */
667
+ "Cache-Control"?: string;
734
668
  [name: string]: unknown;
735
669
  };
736
670
  content: {
737
- "application/json": components["schemas"]["ErrorResponse"];
671
+ "application/json": components["schemas"]["BillingSubscriptionOperation"];
738
672
  };
739
673
  };
740
674
  /** @description A valid Supabase user session is required */
@@ -746,16 +680,7 @@ interface paths {
746
680
  "application/json": components["schemas"]["ErrorResponse"];
747
681
  };
748
682
  };
749
- /** @description Trusted provider authorization is required */
750
- 403: {
751
- headers: {
752
- [name: string]: unknown;
753
- };
754
- content: {
755
- "application/json": components["schemas"]["ErrorResponse"];
756
- };
757
- };
758
- /** @description The owner-bound deletion operation was not found */
683
+ /** @description Subscription not found */
759
684
  404: {
760
685
  headers: {
761
686
  [name: string]: unknown;
@@ -764,7 +689,7 @@ interface paths {
764
689
  "application/json": components["schemas"]["ErrorResponse"];
765
690
  };
766
691
  };
767
- /** @description Account deletion is blocked by dependent account state */
692
+ /** @description The operation conflicts with current durable state */
768
693
  409: {
769
694
  headers: {
770
695
  [name: string]: unknown;
@@ -773,8 +698,8 @@ interface paths {
773
698
  "application/json": components["schemas"]["ErrorResponse"];
774
699
  };
775
700
  };
776
- /** @description The owner mutation throttle was exceeded */
777
- 429: {
701
+ /** @description The billing JSON request body exceeds the maximum size */
702
+ 413: {
778
703
  headers: {
779
704
  [name: string]: unknown;
780
705
  };
@@ -782,7 +707,7 @@ interface paths {
782
707
  "application/json": components["schemas"]["ErrorResponse"];
783
708
  };
784
709
  };
785
- /** @description The lifecycle is disabled or storage is unavailable */
710
+ /** @description Billing storage or provider state is unavailable */
786
711
  503: {
787
712
  headers: {
788
713
  [name: string]: unknown;
@@ -793,20 +718,16 @@ interface paths {
793
718
  };
794
719
  };
795
720
  };
796
- delete?: never;
797
- options?: never;
798
- head?: never;
799
- patch?: never;
800
721
  trace?: never;
801
722
  };
802
- "/v1/api-keys": {
723
+ "/v1/admin/billing-entitlement-discrepancies": {
803
724
  parameters: {
804
725
  query?: never;
805
726
  header?: never;
806
727
  path?: never;
807
728
  cookie?: never;
808
729
  };
809
- /** List API keys for the authenticated user */
730
+ /** Read billing entitlement discrepancies */
810
731
  get: {
811
732
  parameters: {
812
733
  query?: never;
@@ -816,25 +737,28 @@ interface paths {
816
737
  };
817
738
  requestBody?: never;
818
739
  responses: {
819
- /** @description API keys owned by the authenticated user */
740
+ /** @description Bounded discrepancy report */
820
741
  200: {
821
742
  headers: {
743
+ /** @description Billing responses are never shared-cacheable */
744
+ "Cache-Control"?: string;
822
745
  [name: string]: unknown;
823
746
  };
824
747
  content: {
825
- "application/json": components["schemas"]["ApiKeyListResponse"];
826
- };
827
- };
828
- /** @description Invalid API-key request */
829
- 400: {
830
- headers: {
831
- [name: string]: unknown;
832
- };
833
- content: {
834
- "application/json": components["schemas"]["ErrorResponse"];
748
+ "application/json": {
749
+ summary: {
750
+ totalDiscrepancies: number;
751
+ totalTrackedAccounts: number;
752
+ /** Format: date-time */
753
+ checkedAt: string;
754
+ };
755
+ discrepancies: {
756
+ [key: string]: unknown;
757
+ }[];
758
+ };
835
759
  };
836
760
  };
837
- /** @description Authentication required */
761
+ /** @description A valid Supabase user session is required */
838
762
  401: {
839
763
  headers: {
840
764
  [name: string]: unknown;
@@ -843,7 +767,7 @@ interface paths {
843
767
  "application/json": components["schemas"]["ErrorResponse"];
844
768
  };
845
769
  };
846
- /** @description Insufficient entitlement (plan or role) */
770
+ /** @description Parchment administrator role required */
847
771
  403: {
848
772
  headers: {
849
773
  [name: string]: unknown;
@@ -852,16 +776,7 @@ interface paths {
852
776
  "application/json": components["schemas"]["ErrorResponse"];
853
777
  };
854
778
  };
855
- /** @description API key not found for the authenticated user */
856
- 404: {
857
- headers: {
858
- [name: string]: unknown;
859
- };
860
- content: {
861
- "application/json": components["schemas"]["ErrorResponse"];
862
- };
863
- };
864
- /** @description API key storage is unavailable */
779
+ /** @description Billing storage or provider state is unavailable */
865
780
  503: {
866
781
  headers: {
867
782
  [name: string]: unknown;
@@ -873,16 +788,281 @@ interface paths {
873
788
  };
874
789
  };
875
790
  put?: never;
876
- /** Create an API key for the authenticated user */
791
+ post?: never;
792
+ delete?: never;
793
+ options?: never;
794
+ head?: never;
795
+ patch?: never;
796
+ trace?: never;
797
+ };
798
+ "/v1/admin/billing-entitlement-discrepancies/{ownerId}/recompute": {
799
+ parameters: {
800
+ query?: never;
801
+ header?: never;
802
+ path?: never;
803
+ cookie?: never;
804
+ };
805
+ get?: never;
806
+ put?: never;
807
+ /** Recompute billing contribution without changing manual grants */
877
808
  post: {
878
809
  parameters: {
879
810
  query?: never;
880
811
  header?: never;
881
- path?: never;
812
+ path: {
813
+ ownerId: string;
814
+ };
882
815
  cookie?: never;
883
816
  };
884
- requestBody: {
885
- content: {
817
+ requestBody?: never;
818
+ responses: {
819
+ /** @description Canonical resolved entitlement projection */
820
+ 200: {
821
+ headers: {
822
+ /** @description Billing responses are never shared-cacheable */
823
+ "Cache-Control"?: string;
824
+ [name: string]: unknown;
825
+ };
826
+ content: {
827
+ "application/json": {
828
+ [key: string]: unknown;
829
+ };
830
+ };
831
+ };
832
+ /** @description A valid Supabase user session is required */
833
+ 401: {
834
+ headers: {
835
+ [name: string]: unknown;
836
+ };
837
+ content: {
838
+ "application/json": components["schemas"]["ErrorResponse"];
839
+ };
840
+ };
841
+ /** @description Parchment administrator role required */
842
+ 403: {
843
+ headers: {
844
+ [name: string]: unknown;
845
+ };
846
+ content: {
847
+ "application/json": components["schemas"]["ErrorResponse"];
848
+ };
849
+ };
850
+ /** @description Owner not found */
851
+ 404: {
852
+ headers: {
853
+ [name: string]: unknown;
854
+ };
855
+ content: {
856
+ "application/json": components["schemas"]["ErrorResponse"];
857
+ };
858
+ };
859
+ /** @description The operation conflicts with current durable state */
860
+ 409: {
861
+ headers: {
862
+ [name: string]: unknown;
863
+ };
864
+ content: {
865
+ "application/json": components["schemas"]["ErrorResponse"];
866
+ };
867
+ };
868
+ /** @description Billing storage or provider state is unavailable */
869
+ 503: {
870
+ headers: {
871
+ [name: string]: unknown;
872
+ };
873
+ content: {
874
+ "application/json": components["schemas"]["ErrorResponse"];
875
+ };
876
+ };
877
+ };
878
+ };
879
+ delete?: never;
880
+ options?: never;
881
+ head?: never;
882
+ patch?: never;
883
+ trace?: never;
884
+ };
885
+ "/v1/admin/billing-entitlements/{ownerId}/manual": {
886
+ parameters: {
887
+ query?: never;
888
+ header?: never;
889
+ path?: never;
890
+ cookie?: never;
891
+ };
892
+ get?: never;
893
+ put?: never;
894
+ post?: never;
895
+ delete?: never;
896
+ options?: never;
897
+ head?: never;
898
+ /** Update the manual entitlement baseline and recompute */
899
+ patch: {
900
+ parameters: {
901
+ query?: never;
902
+ header?: never;
903
+ path: {
904
+ ownerId: string;
905
+ };
906
+ cookie?: never;
907
+ };
908
+ requestBody: {
909
+ content: {
910
+ "application/json": {
911
+ /** @enum {string} */
912
+ role: "viewer" | "member" | "admin";
913
+ /** @enum {string} */
914
+ apiPlan: "viewer" | "member" | "enterprise";
915
+ ppiAccess: boolean;
916
+ };
917
+ };
918
+ };
919
+ responses: {
920
+ /** @description Updated manual baseline and resolved projection */
921
+ 200: {
922
+ headers: {
923
+ /** @description Billing responses are never shared-cacheable */
924
+ "Cache-Control"?: string;
925
+ [name: string]: unknown;
926
+ };
927
+ content: {
928
+ "application/json": {
929
+ [key: string]: unknown;
930
+ };
931
+ };
932
+ };
933
+ /** @description A valid Supabase user session is required */
934
+ 401: {
935
+ headers: {
936
+ [name: string]: unknown;
937
+ };
938
+ content: {
939
+ "application/json": components["schemas"]["ErrorResponse"];
940
+ };
941
+ };
942
+ /** @description Parchment administrator role required */
943
+ 403: {
944
+ headers: {
945
+ [name: string]: unknown;
946
+ };
947
+ content: {
948
+ "application/json": components["schemas"]["ErrorResponse"];
949
+ };
950
+ };
951
+ /** @description Owner not found */
952
+ 404: {
953
+ headers: {
954
+ [name: string]: unknown;
955
+ };
956
+ content: {
957
+ "application/json": components["schemas"]["ErrorResponse"];
958
+ };
959
+ };
960
+ /** @description The operation conflicts with current durable state */
961
+ 409: {
962
+ headers: {
963
+ [name: string]: unknown;
964
+ };
965
+ content: {
966
+ "application/json": components["schemas"]["ErrorResponse"];
967
+ };
968
+ };
969
+ /** @description Billing storage or provider state is unavailable */
970
+ 503: {
971
+ headers: {
972
+ [name: string]: unknown;
973
+ };
974
+ content: {
975
+ "application/json": components["schemas"]["ErrorResponse"];
976
+ };
977
+ };
978
+ };
979
+ };
980
+ trace?: never;
981
+ };
982
+ "/v1/api-keys": {
983
+ parameters: {
984
+ query?: never;
985
+ header?: never;
986
+ path?: never;
987
+ cookie?: never;
988
+ };
989
+ /** List API keys for the authenticated user */
990
+ get: {
991
+ parameters: {
992
+ query?: never;
993
+ header?: never;
994
+ path?: never;
995
+ cookie?: never;
996
+ };
997
+ requestBody?: never;
998
+ responses: {
999
+ /** @description API keys owned by the authenticated user */
1000
+ 200: {
1001
+ headers: {
1002
+ [name: string]: unknown;
1003
+ };
1004
+ content: {
1005
+ "application/json": components["schemas"]["ApiKeyListResponse"];
1006
+ };
1007
+ };
1008
+ /** @description Invalid API-key request */
1009
+ 400: {
1010
+ headers: {
1011
+ [name: string]: unknown;
1012
+ };
1013
+ content: {
1014
+ "application/json": components["schemas"]["ErrorResponse"];
1015
+ };
1016
+ };
1017
+ /** @description Authentication required */
1018
+ 401: {
1019
+ headers: {
1020
+ [name: string]: unknown;
1021
+ };
1022
+ content: {
1023
+ "application/json": components["schemas"]["ErrorResponse"];
1024
+ };
1025
+ };
1026
+ /** @description Insufficient entitlement (plan or role) */
1027
+ 403: {
1028
+ headers: {
1029
+ [name: string]: unknown;
1030
+ };
1031
+ content: {
1032
+ "application/json": components["schemas"]["ErrorResponse"];
1033
+ };
1034
+ };
1035
+ /** @description API key not found for the authenticated user */
1036
+ 404: {
1037
+ headers: {
1038
+ [name: string]: unknown;
1039
+ };
1040
+ content: {
1041
+ "application/json": components["schemas"]["ErrorResponse"];
1042
+ };
1043
+ };
1044
+ /** @description API key storage is unavailable */
1045
+ 503: {
1046
+ headers: {
1047
+ [name: string]: unknown;
1048
+ };
1049
+ content: {
1050
+ "application/json": components["schemas"]["ErrorResponse"];
1051
+ };
1052
+ };
1053
+ };
1054
+ };
1055
+ put?: never;
1056
+ /** Create an API key for the authenticated user */
1057
+ post: {
1058
+ parameters: {
1059
+ query?: never;
1060
+ header?: never;
1061
+ path?: never;
1062
+ cookie?: never;
1063
+ };
1064
+ requestBody: {
1065
+ content: {
886
1066
  "application/json": {
887
1067
  name: string;
888
1068
  scopes?: ("catalog:read" | "inventory:read" | "roast:read" | "sales:read" | "tasting:read" | "portfolio:read" | "inventory:write" | "roast:write" | "sales:write" | "tasting:write" | "portfolio:write")[];
@@ -5682,7 +5862,7 @@ interface components {
5682
5862
  /** Format: uuid */
5683
5863
  operationId: string;
5684
5864
  /** @enum {string} */
5685
- status: "fencing_checkout" | "awaiting_provider_finalization" | "ready" | "processing" | "retryable" | "completed";
5865
+ status: "accepted" | "provider_deleting" | "local_cleaning" | "auth_deleting" | "post_auth_cleanup" | "retryable" | "conflict" | "completed";
5686
5866
  };
5687
5867
  ErrorResponse: {
5688
5868
  error: {
@@ -5690,12 +5870,23 @@ interface components {
5690
5870
  message: string;
5691
5871
  };
5692
5872
  };
5693
- CheckoutAdmission: {
5873
+ BillingCheckoutSession: {
5694
5874
  /** Format: uuid */
5695
5875
  admissionId: string;
5696
5876
  /** @enum {string} */
5697
- status: "creating" | "published" | "closed";
5698
- stripeSessionId: string | null;
5877
+ status: "accepted" | "attempting" | "published" | "settled" | "closed" | "conflict";
5878
+ clientSecret: string | null;
5879
+ };
5880
+ BillingSubscriptionOperation: {
5881
+ /** Format: uuid */
5882
+ operationId: string;
5883
+ /** Format: uuid */
5884
+ cutoverId: string;
5885
+ subscriptionId: string;
5886
+ cancelAtPeriodEnd: boolean;
5887
+ /** @enum {string} */
5888
+ status: "accepted" | "attempting" | "succeeded" | "superseded" | "conflict";
5889
+ reason: string | null;
5699
5890
  };
5700
5891
  ApiKeyRecord: {
5701
5892
  /** Format: uuid */
@@ -8344,14 +8535,18 @@ type OwnerApiUsage = components["schemas"]["OwnerApiUsageResponse"];
8344
8535
  type MarketReadPreferenceRequest = NonNullable<paths["/v1/email-subscriptions/market-read"]["put"]["requestBody"]>["content"]["application/json"];
8345
8536
  /** Durable state returned by an account-deletion request. */
8346
8537
  type AccountDeletionOperation = components["schemas"]["AccountDeletionOperation"];
8347
- /** Idempotency input for acquiring a durable Stripe Checkout admission. */
8348
- type CheckoutAdmissionAcquireRequest = NonNullable<paths["/v1/checkout-admissions"]["post"]["requestBody"]>["content"]["application/json"];
8349
- /** Stripe publication input for an acquired Checkout admission. */
8350
- type CheckoutAdmissionPublishRequest = NonNullable<paths["/v1/checkout-admissions/{admissionId}/publish"]["post"]["requestBody"]>["content"]["application/json"];
8351
- /** Trusted provider header required when publishing a Checkout admission. */
8352
- type CheckoutAdmissionPublishHeaders = NonNullable<paths["/v1/checkout-admissions/{admissionId}/publish"]["post"]["parameters"]["header"]>;
8353
- /** Durable state returned by Checkout admission mutations. */
8354
- type CheckoutAdmission = components["schemas"]["CheckoutAdmission"];
8538
+ /** Purpose-bound recent-reauthentication assertion for account deletion. */
8539
+ type AccountDeletionRequest = NonNullable<paths["/v1/account-deletion"]["post"]["requestBody"]>["content"]["application/json"];
8540
+ /** Purchase-key request for dormant direct Parchment Checkout creation/replay. */
8541
+ type BillingCheckoutCreateRequest = NonNullable<paths["/v1/billing/checkout-sessions"]["post"]["requestBody"]>["content"]["application/json"];
8542
+ /** Durable Checkout admission state; provider Session id stays server-side. */
8543
+ type BillingCheckoutSession = components["schemas"]["BillingCheckoutSession"];
8544
+ /** Durable cancellation/resume request. */
8545
+ type BillingSubscriptionMutationRequest = NonNullable<paths["/v1/billing/subscriptions/{subscriptionId}"]["patch"]["requestBody"]>["content"]["application/json"];
8546
+ /** Durable provider subscription-operation state. */
8547
+ type BillingSubscriptionOperation = components["schemas"]["BillingSubscriptionOperation"];
8548
+ /** Manual entitlement baseline update for administrators. */
8549
+ type BillingManualEntitlementsRequest = NonNullable<paths["/v1/admin/billing-entitlements/{ownerId}/manual"]["patch"]["requestBody"]>["content"]["application/json"];
8355
8550
  type CliAuthRequestCreate = NonNullable<paths["/v1/cli-auth/requests"]["post"]["requestBody"]>["content"]["application/json"];
8356
8551
  type CliAuthInspectRequest = NonNullable<paths["/v1/cli-auth/inspect"]["post"]["requestBody"]>["content"]["application/json"];
8357
8552
  type CliAuthApproveRequest = NonNullable<paths["/v1/cli-auth/approve"]["post"]["requestBody"]>["content"]["application/json"];
@@ -8449,12 +8644,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
8449
8644
  parameters: {
8450
8645
  query?: never;
8451
8646
  header?: never;
8452
- path? /**
8453
- * Replace the Artisan import data on one of the caller's existing roasts,
8454
- * re-deriving its curve, events, and computed metrics while preserving the
8455
- * roast's identity. Pass `ifMatch` (the roast's `last_updated`) to enable
8456
- * optimistic concurrency (409 on mismatch).
8457
- */: never;
8647
+ path?: never;
8458
8648
  cookie?: never;
8459
8649
  };
8460
8650
  requestBody?: never;
@@ -8512,12 +8702,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
8512
8702
  parameters: {
8513
8703
  query?: never;
8514
8704
  header?: never;
8515
- path? /**
8516
- * Replace the Artisan import data on one of the caller's existing roasts,
8517
- * re-deriving its curve, events, and computed metrics while preserving the
8518
- * roast's identity. Pass `ifMatch` (the roast's `last_updated`) to enable
8519
- * optimistic concurrency (409 on mismatch).
8520
- */: never;
8705
+ path?: never;
8521
8706
  cookie?: never;
8522
8707
  };
8523
8708
  requestBody?: never;
@@ -9001,19 +9186,21 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9001
9186
  }, `${string}/${string}`>>;
9002
9187
  };
9003
9188
  accountDeletion: {
9004
- /**
9005
- * Idempotently request deletion for the authenticated session owner.
9006
- * Provider finalization is intentionally available only through `raw`
9007
- * because it also requires a trusted BFF server credential.
9008
- */
9009
- request: () => Promise<openapi_fetch.FetchResponse<{
9189
+ /** Accept or replay deletion using a purpose-bound reauthentication assertion. */
9190
+ request: (body: AccountDeletionRequest) => Promise<openapi_fetch.FetchResponse<{
9010
9191
  parameters: {
9011
9192
  query?: never;
9012
9193
  header?: never;
9013
9194
  path?: never;
9014
9195
  cookie?: never;
9015
9196
  };
9016
- requestBody?: never;
9197
+ requestBody: {
9198
+ content: {
9199
+ "application/json": {
9200
+ assertion: string;
9201
+ };
9202
+ };
9203
+ };
9017
9204
  responses: {
9018
9205
  200: {
9019
9206
  headers: {
@@ -9024,15 +9211,16 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9024
9211
  "application/json": components["schemas"]["AccountDeletionOperation"];
9025
9212
  };
9026
9213
  };
9027
- 401: {
9214
+ 202: {
9028
9215
  headers: {
9216
+ "Cache-Control"?: string;
9029
9217
  [name: string]: unknown;
9030
9218
  };
9031
9219
  content: {
9032
- "application/json": components["schemas"]["ErrorResponse"];
9220
+ "application/json": components["schemas"]["AccountDeletionOperation"];
9033
9221
  };
9034
9222
  };
9035
- 409: {
9223
+ 400: {
9036
9224
  headers: {
9037
9225
  [name: string]: unknown;
9038
9226
  };
@@ -9040,7 +9228,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9040
9228
  "application/json": components["schemas"]["ErrorResponse"];
9041
9229
  };
9042
9230
  };
9043
- 429: {
9231
+ 401: {
9044
9232
  headers: {
9045
9233
  [name: string]: unknown;
9046
9234
  };
@@ -9048,7 +9236,23 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9048
9236
  "application/json": components["schemas"]["ErrorResponse"];
9049
9237
  };
9050
9238
  };
9051
- 503: {
9239
+ 403: {
9240
+ headers: {
9241
+ [name: string]: unknown;
9242
+ };
9243
+ content: {
9244
+ "application/json": components["schemas"]["ErrorResponse"];
9245
+ };
9246
+ };
9247
+ 409: {
9248
+ headers: {
9249
+ [name: string]: unknown;
9250
+ };
9251
+ content: {
9252
+ "application/json": components["schemas"]["ErrorResponse"];
9253
+ };
9254
+ };
9255
+ 503: {
9052
9256
  headers: {
9053
9257
  [name: string]: unknown;
9054
9258
  };
@@ -9057,7 +9261,425 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9057
9261
  };
9058
9262
  };
9059
9263
  };
9060
- }, openapi_fetch.FetchOptions<{
9264
+ }, {
9265
+ body: {
9266
+ assertion: string;
9267
+ };
9268
+ }, `${string}/${string}`>>;
9269
+ };
9270
+ billing: {
9271
+ checkout: {
9272
+ /** Create or replay an embedded Checkout Session after activation. */
9273
+ create: (body: BillingCheckoutCreateRequest) => Promise<openapi_fetch.FetchResponse<{
9274
+ parameters: {
9275
+ query?: never;
9276
+ header?: never;
9277
+ path?: never;
9278
+ cookie?: never;
9279
+ };
9280
+ requestBody: {
9281
+ content: {
9282
+ "application/json": {
9283
+ requestId: string;
9284
+ purchaseItems: {
9285
+ purchaseKey: string;
9286
+ quantity?: number;
9287
+ }[];
9288
+ };
9289
+ };
9290
+ };
9291
+ responses: {
9292
+ 200: {
9293
+ headers: {
9294
+ "Cache-Control"?: string;
9295
+ [name: string]: unknown;
9296
+ };
9297
+ content: {
9298
+ "application/json": components["schemas"]["BillingCheckoutSession"];
9299
+ };
9300
+ };
9301
+ 400: {
9302
+ headers: {
9303
+ [name: string]: unknown;
9304
+ };
9305
+ content: {
9306
+ "application/json": components["schemas"]["ErrorResponse"];
9307
+ };
9308
+ };
9309
+ 401: {
9310
+ headers: {
9311
+ [name: string]: unknown;
9312
+ };
9313
+ content: {
9314
+ "application/json": components["schemas"]["ErrorResponse"];
9315
+ };
9316
+ };
9317
+ 409: {
9318
+ headers: {
9319
+ [name: string]: unknown;
9320
+ };
9321
+ content: {
9322
+ "application/json": components["schemas"]["ErrorResponse"];
9323
+ };
9324
+ };
9325
+ 413: {
9326
+ headers: {
9327
+ [name: string]: unknown;
9328
+ };
9329
+ content: {
9330
+ "application/json": components["schemas"]["ErrorResponse"];
9331
+ };
9332
+ };
9333
+ 503: {
9334
+ headers: {
9335
+ [name: string]: unknown;
9336
+ };
9337
+ content: {
9338
+ "application/json": components["schemas"]["ErrorResponse"];
9339
+ };
9340
+ };
9341
+ };
9342
+ }, {
9343
+ body: {
9344
+ requestId: string;
9345
+ purchaseItems: {
9346
+ purchaseKey: string;
9347
+ quantity?: number;
9348
+ }[];
9349
+ };
9350
+ }, `${string}/${string}`>>;
9351
+ /** Read owner-bound durable admission state. */
9352
+ get: (admissionId: string) => Promise<openapi_fetch.FetchResponse<{
9353
+ parameters: {
9354
+ query?: never;
9355
+ header?: never;
9356
+ path: {
9357
+ admissionId: string;
9358
+ };
9359
+ cookie?: never;
9360
+ };
9361
+ requestBody?: never;
9362
+ responses: {
9363
+ 200: {
9364
+ headers: {
9365
+ "Cache-Control"?: string;
9366
+ [name: string]: unknown;
9367
+ };
9368
+ content: {
9369
+ "application/json": components["schemas"]["BillingCheckoutSession"];
9370
+ };
9371
+ };
9372
+ 401: {
9373
+ headers: {
9374
+ [name: string]: unknown;
9375
+ };
9376
+ content: {
9377
+ "application/json": components["schemas"]["ErrorResponse"];
9378
+ };
9379
+ };
9380
+ 404: {
9381
+ headers: {
9382
+ [name: string]: unknown;
9383
+ };
9384
+ content: {
9385
+ "application/json": components["schemas"]["ErrorResponse"];
9386
+ };
9387
+ };
9388
+ 409: {
9389
+ headers: {
9390
+ [name: string]: unknown;
9391
+ };
9392
+ content: {
9393
+ "application/json": components["schemas"]["ErrorResponse"];
9394
+ };
9395
+ };
9396
+ 503: {
9397
+ headers: {
9398
+ [name: string]: unknown;
9399
+ };
9400
+ content: {
9401
+ "application/json": components["schemas"]["ErrorResponse"];
9402
+ };
9403
+ };
9404
+ };
9405
+ }, {
9406
+ params: {
9407
+ path: {
9408
+ admissionId: string;
9409
+ };
9410
+ };
9411
+ }, `${string}/${string}`>>;
9412
+ /** Authoritatively reconcile an admission with Stripe. */
9413
+ reconcile: (admissionId: string) => Promise<openapi_fetch.FetchResponse<{
9414
+ parameters: {
9415
+ query?: never;
9416
+ header?: never;
9417
+ path: {
9418
+ admissionId: string;
9419
+ };
9420
+ cookie?: never;
9421
+ };
9422
+ requestBody?: never;
9423
+ responses: {
9424
+ 200: {
9425
+ headers: {
9426
+ "Cache-Control"?: string;
9427
+ [name: string]: unknown;
9428
+ };
9429
+ content: {
9430
+ "application/json": components["schemas"] /** Liveness and service identity. */["BillingCheckoutSession"];
9431
+ };
9432
+ };
9433
+ 401: {
9434
+ headers: {
9435
+ [name: string]: unknown;
9436
+ };
9437
+ content: {
9438
+ "application/json": components["schemas"]["ErrorResponse"];
9439
+ };
9440
+ };
9441
+ 404: {
9442
+ headers: {
9443
+ [name: string]: unknown;
9444
+ };
9445
+ content: {
9446
+ "application/json": components["schemas"]["ErrorResponse"];
9447
+ };
9448
+ };
9449
+ 409: {
9450
+ headers: {
9451
+ [name: string]: unknown;
9452
+ };
9453
+ content: {
9454
+ "application/json": components["schemas"]["ErrorResponse"];
9455
+ };
9456
+ };
9457
+ 503: {
9458
+ headers: {
9459
+ [name: string]: unknown;
9460
+ };
9461
+ content: {
9462
+ "application/json": components["schemas"]["ErrorResponse"];
9463
+ };
9464
+ };
9465
+ };
9466
+ }, {
9467
+ params: {
9468
+ path: {
9469
+ admissionId: string;
9470
+ };
9471
+ };
9472
+ }, `${string}/${string}`>>;
9473
+ };
9474
+ subscriptions: {
9475
+ /** List canonical owner subscription snapshots. */
9476
+ list: () => Promise<openapi_fetch.FetchResponse<{
9477
+ parameters: {
9478
+ query?: never;
9479
+ header?: never;
9480
+ path?: never;
9481
+ cookie?: never;
9482
+ };
9483
+ requestBody?: never;
9484
+ responses: {
9485
+ 200: {
9486
+ headers: {
9487
+ "Cache-Control"?: string;
9488
+ [name: string]: unknown;
9489
+ };
9490
+ content: {
9491
+ "application/json": {
9492
+ subscriptions: {
9493
+ subscriptionId: string;
9494
+ status: string;
9495
+ cancelAtPeriodEnd: boolean;
9496
+ currentPeriodEnd: string | null;
9497
+ items: {
9498
+ subscriptionItemId: string;
9499
+ priceId: string;
9500
+ purchaseKey: string;
9501
+ productFamily: string;
9502
+ }[];
9503
+ }[];
9504
+ };
9505
+ };
9506
+ };
9507
+ 401: {
9508
+ headers: {
9509
+ [name: string]: unknown;
9510
+ };
9511
+ content: {
9512
+ "application/json": components["schemas"]["ErrorResponse"];
9513
+ };
9514
+ };
9515
+ 409: {
9516
+ headers: {
9517
+ [name: string]: unknown;
9518
+ };
9519
+ content: {
9520
+ "application/json": components["schemas"]["ErrorResponse"];
9521
+ };
9522
+ };
9523
+ 503: {
9524
+ headers: {
9525
+ [name: string]: unknown;
9526
+ };
9527
+ content: {
9528
+ "application/json": components["schemas"]["ErrorResponse"];
9529
+ };
9530
+ };
9531
+ };
9532
+ }, openapi_fetch.FetchOptions<{
9533
+ parameters: {
9534
+ query?: never;
9535
+ header?: never;
9536
+ path?: never;
9537
+ cookie?: never;
9538
+ };
9539
+ requestBody?: never;
9540
+ responses: {
9541
+ 200: {
9542
+ headers: {
9543
+ "Cache-Control"?: string;
9544
+ [name: string]: unknown;
9545
+ };
9546
+ content: {
9547
+ "application/json": {
9548
+ subscriptions: {
9549
+ subscriptionId: string;
9550
+ status: string;
9551
+ cancelAtPeriodEnd: boolean;
9552
+ currentPeriodEnd: string | null;
9553
+ items: {
9554
+ subscriptionItemId: string;
9555
+ priceId: string;
9556
+ purchaseKey: string;
9557
+ productFamily: string;
9558
+ }[];
9559
+ }[];
9560
+ };
9561
+ };
9562
+ };
9563
+ 401: {
9564
+ headers: {
9565
+ [name: string]: unknown;
9566
+ };
9567
+ content: {
9568
+ "application/json": components["schemas"]["ErrorResponse"];
9569
+ };
9570
+ };
9571
+ 409: {
9572
+ headers: {
9573
+ [name: string]: unknown;
9574
+ };
9575
+ content: {
9576
+ "application/json": components["schemas"]["ErrorResponse"];
9577
+ };
9578
+ };
9579
+ 503: {
9580
+ headers: {
9581
+ [name: string]: unknown;
9582
+ };
9583
+ content: {
9584
+ "application/json": components["schemas"]["ErrorResponse"];
9585
+ };
9586
+ };
9587
+ };
9588
+ }> | undefined, `${string}/${string}`>>;
9589
+ /** Durably cancel or resume the complete provider subscription. */
9590
+ mutate: (subscriptionId: string, body: BillingSubscriptionMutationRequest) => Promise<openapi_fetch.FetchResponse<{
9591
+ parameters: {
9592
+ query?: never;
9593
+ header?: never;
9594
+ path: {
9595
+ subscriptionId: string;
9596
+ };
9597
+ cookie?: never;
9598
+ };
9599
+ requestBody: {
9600
+ content: {
9601
+ "application/json": {
9602
+ requestId: string;
9603
+ cancelAtPeriodEnd: boolean;
9604
+ };
9605
+ };
9606
+ };
9607
+ responses: {
9608
+ 200: {
9609
+ headers: {
9610
+ "Cache-Control"?: string;
9611
+ [name: string]: unknown;
9612
+ };
9613
+ content: {
9614
+ "application/json": components["schemas"] /** List the caller's saved sourcing briefs. */["BillingSubscriptionOperation"];
9615
+ };
9616
+ };
9617
+ 202: {
9618
+ headers: {
9619
+ "Cache-Control"?: string;
9620
+ [name: string]: unknown;
9621
+ };
9622
+ content: {
9623
+ "application/json": components["schemas"]["BillingSubscriptionOperation"];
9624
+ };
9625
+ };
9626
+ 401: {
9627
+ headers: {
9628
+ [name: string]: unknown;
9629
+ };
9630
+ content: {
9631
+ "application/json": components["schemas"]["ErrorResponse"];
9632
+ };
9633
+ };
9634
+ 404: {
9635
+ headers: {
9636
+ [name: string]: unknown;
9637
+ };
9638
+ content: {
9639
+ "application/json": components["schemas"]["ErrorResponse"];
9640
+ };
9641
+ };
9642
+ 409: {
9643
+ headers: {
9644
+ [name: string]: unknown;
9645
+ };
9646
+ content: {
9647
+ "application/json": components["schemas"]["ErrorResponse"];
9648
+ };
9649
+ };
9650
+ 413: {
9651
+ headers: {
9652
+ [name: string]: unknown;
9653
+ };
9654
+ content: {
9655
+ "application/json": components["schemas"]["ErrorResponse"];
9656
+ };
9657
+ };
9658
+ 503: {
9659
+ headers: {
9660
+ [name: string]: unknown;
9661
+ };
9662
+ content: {
9663
+ "application/json": components["schemas"]["ErrorResponse"];
9664
+ };
9665
+ };
9666
+ };
9667
+ }, {
9668
+ params: {
9669
+ path: {
9670
+ subscriptionId: string;
9671
+ };
9672
+ };
9673
+ body: {
9674
+ requestId: string;
9675
+ cancelAtPeriodEnd: boolean;
9676
+ };
9677
+ }, `${string}/${string}`>>;
9678
+ };
9679
+ };
9680
+ billingAdministration: {
9681
+ /** Read bounded canonical-entitlement discrepancies. */
9682
+ discrepancies: () => Promise<openapi_fetch.FetchResponse<{
9061
9683
  parameters: {
9062
9684
  query?: never;
9063
9685
  header?: never;
@@ -9072,7 +9694,16 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9072
9694
  [name: string]: unknown;
9073
9695
  };
9074
9696
  content: {
9075
- "application/json": components["schemas"]["AccountDeletionOperation"];
9697
+ "application/json": {
9698
+ summary: {
9699
+ totalDiscrepancies: number;
9700
+ totalTrackedAccounts: number;
9701
+ checkedAt: string;
9702
+ };
9703
+ discrepancies: {
9704
+ [key: string]: unknown;
9705
+ }[];
9706
+ };
9076
9707
  };
9077
9708
  };
9078
9709
  401: {
@@ -9083,7 +9714,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9083
9714
  "application/json": components["schemas"]["ErrorResponse"];
9084
9715
  };
9085
9716
  };
9086
- 409: {
9717
+ 403: {
9087
9718
  headers: {
9088
9719
  [name: string]: unknown;
9089
9720
  };
@@ -9091,7 +9722,51 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9091
9722
  "application/json": components["schemas"]["ErrorResponse"];
9092
9723
  };
9093
9724
  };
9094
- 429: {
9725
+ 503: {
9726
+ headers: {
9727
+ [name: string]: unknown;
9728
+ };
9729
+ content: {
9730
+ "application/json": components["schemas"]["ErrorResponse"];
9731
+ };
9732
+ };
9733
+ };
9734
+ }, openapi_fetch.FetchOptions<{
9735
+ parameters: {
9736
+ query?: never;
9737
+ header?: never;
9738
+ path?: never;
9739
+ cookie?: never;
9740
+ };
9741
+ requestBody?: never;
9742
+ responses: {
9743
+ 200: {
9744
+ headers: {
9745
+ "Cache-Control"?: string;
9746
+ [name: string]: unknown;
9747
+ };
9748
+ content: {
9749
+ "application/json": {
9750
+ summary: {
9751
+ totalDiscrepancies: number;
9752
+ totalTrackedAccounts: number;
9753
+ checkedAt: string;
9754
+ };
9755
+ discrepancies: {
9756
+ [key: string]: unknown;
9757
+ }[];
9758
+ };
9759
+ };
9760
+ };
9761
+ 401: {
9762
+ headers: {
9763
+ [name: string]: unknown;
9764
+ };
9765
+ content: {
9766
+ "application/json": components["schemas"]["ErrorResponse"];
9767
+ };
9768
+ };
9769
+ 403: {
9095
9770
  headers: {
9096
9771
  [name: string]: unknown;
9097
9772
  };
@@ -9109,35 +9784,30 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9109
9784
  };
9110
9785
  };
9111
9786
  }> | undefined, `${string}/${string}`>>;
9112
- };
9113
- checkoutAdmissions: {
9114
- /** Acquire or replay an owner-bound admission before creating Stripe state. */
9115
- acquire: (body: CheckoutAdmissionAcquireRequest) => Promise<openapi_fetch.FetchResponse<{
9787
+ /** Recompute billing contribution without changing manual grants. */
9788
+ recompute: (ownerId: string) => Promise<openapi_fetch.FetchResponse<{
9116
9789
  parameters: {
9117
9790
  query?: never;
9118
9791
  header?: never;
9119
- path?: never;
9120
- cookie?: never;
9121
- };
9122
- requestBody: {
9123
- content: {
9124
- "application/json": {
9125
- requestId: string;
9126
- };
9792
+ path: {
9793
+ ownerId: string;
9127
9794
  };
9795
+ cookie?: never;
9128
9796
  };
9797
+ requestBody?: never;
9129
9798
  responses: {
9130
9799
  200: {
9131
9800
  headers: {
9801
+ "Cache-Control"?: string;
9132
9802
  [name: string]: unknown;
9133
9803
  };
9134
9804
  content: {
9135
- "application/json":
9136
- /** Query parameters for {@link ParchmentClient.roasts.get}. */
9137
- components["schemas"]["CheckoutAdmission"];
9805
+ "application/json": {
9806
+ [key: string]: unknown;
9807
+ };
9138
9808
  };
9139
9809
  };
9140
- 400: {
9810
+ 401: {
9141
9811
  headers: {
9142
9812
  [name: string]: unknown;
9143
9813
  };
@@ -9145,7 +9815,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9145
9815
  "application/json": components["schemas"]["ErrorResponse"];
9146
9816
  };
9147
9817
  };
9148
- 401: {
9818
+ 403: {
9149
9819
  headers: {
9150
9820
  [name: string]: unknown;
9151
9821
  };
@@ -9153,7 +9823,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9153
9823
  "application/json": components["schemas"]["ErrorResponse"];
9154
9824
  };
9155
9825
  };
9156
- 409: {
9826
+ 404: {
9157
9827
  headers: {
9158
9828
  [name: string]: unknown;
9159
9829
  };
@@ -9161,7 +9831,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9161
9831
  "application/json": components["schemas"]["ErrorResponse"];
9162
9832
  };
9163
9833
  };
9164
- 429: {
9834
+ 409: {
9165
9835
  headers: {
9166
9836
  [name: string]: unknown;
9167
9837
  };
@@ -9179,44 +9849,55 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9179
9849
  };
9180
9850
  };
9181
9851
  }, {
9182
- body: {
9183
- requestId: string;
9852
+ params: {
9853
+ path: {
9854
+ ownerId: string;
9855
+ };
9184
9856
  };
9185
9857
  }, `${string}/${string}`>>;
9186
- /** Publish a provider-verified Stripe Checkout Session for an admission. */
9187
- publish: (admissionId: string, body: CheckoutAdmissionPublishRequest, headers: CheckoutAdmissionPublishHeaders) => Promise<openapi_fetch.FetchResponse<{
9858
+ /** Update the preserved manual entitlement baseline. */
9859
+ setManual: (ownerId: string, body: BillingManualEntitlementsRequest) => Promise<openapi_fetch.FetchResponse<{
9188
9860
  parameters: {
9189
9861
  query?: never;
9190
- header: {
9191
- "x-account-deletion-provider-credential": string;
9192
- };
9862
+ header
9863
+ /**
9864
+ * Record a sale against one of the caller's own green-coffee inventory
9865
+ * lots. Requires a session or an owner-bound API key carrying the exact
9866
+ * `sales:write` scope. Pass `idempotencyKey` to make retries safe: the
9867
+ * same key replays the original result, and a concurrent duplicate gets
9868
+ * 409 while the first is in flight.
9869
+ */
9870
+ ? /**
9871
+ * Record a sale against one of the caller's own green-coffee inventory
9872
+ * lots. Requires a session or an owner-bound API key carrying the exact
9873
+ * `sales:write` scope. Pass `idempotencyKey` to make retries safe: the
9874
+ * same key replays the original result, and a concurrent duplicate gets
9875
+ * 409 while the first is in flight.
9876
+ */: never;
9193
9877
  path: {
9194
- admissionId: string;
9878
+ ownerId: string;
9195
9879
  };
9196
9880
  cookie?: never;
9197
9881
  };
9198
9882
  requestBody: {
9199
9883
  content: {
9200
9884
  "application/json": {
9201
- stripeSessionId: string;
9885
+ role: "viewer" | "member" | "admin";
9886
+ apiPlan: "viewer" | "member" | "enterprise";
9887
+ ppiAccess: boolean;
9202
9888
  };
9203
9889
  };
9204
9890
  };
9205
9891
  responses: {
9206
9892
  200: {
9207
9893
  headers: {
9894
+ "Cache-Control"?: string;
9208
9895
  [name: string]: unknown;
9209
9896
  };
9210
9897
  content: {
9211
- "application/json": components["schemas"]["CheckoutAdmission"];
9212
- };
9213
- };
9214
- 400: {
9215
- headers: {
9216
- [name: string]: unknown;
9217
- };
9218
- content: {
9219
- "application/json": components["schemas"]["ErrorResponse"];
9898
+ "application/json": {
9899
+ [key: string]: unknown;
9900
+ };
9220
9901
  };
9221
9902
  };
9222
9903
  401: {
@@ -9251,14 +9932,6 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9251
9932
  "application/json": components["schemas"]["ErrorResponse"];
9252
9933
  };
9253
9934
  };
9254
- 429: {
9255
- headers: {
9256
- [name: string]: unknown;
9257
- };
9258
- content: {
9259
- "application/json": components["schemas"]["ErrorResponse"];
9260
- };
9261
- };
9262
9935
  503: {
9263
9936
  headers: {
9264
9937
  [name: string]: unknown;
@@ -9271,14 +9944,13 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9271
9944
  }, {
9272
9945
  params: {
9273
9946
  path: {
9274
- admissionId: string;
9275
- };
9276
- header: {
9277
- "x-account-deletion-provider-credential": string;
9947
+ ownerId: string;
9278
9948
  };
9279
9949
  };
9280
9950
  body: {
9281
- stripeSessionId: string;
9951
+ role: "viewer" | "member" | "admin";
9952
+ apiPlan: "viewer" | "member" | "enterprise";
9953
+ ppiAccess: boolean;
9282
9954
  };
9283
9955
  }, `${string}/${string}`>>;
9284
9956
  };
@@ -13520,4 +14192,4 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
13520
14192
  };
13521
14193
  type ParchmentClient = ReturnType<typeof createParchmentClient>;
13522
14194
 
13523
- export { type AccountDeletionOperation, type BriefMatchesQuery, type CatalogItem, type CatalogListQuery, type CatalogProofSummary, type CatalogSimilarQuery, type CheckoutAdmission, type CheckoutAdmissionAcquireRequest, type CheckoutAdmissionPublishRequest, type InventoryCreateRequest, type InventoryUpdateRequest, type MarketSignalsQuery, type MetadataIndexQuery, type OwnerApiUsage, type OwnerApiUsageQuery, type ParchmentClient, type ParchmentClientOptions, type PriceIndexQuery, type PriceIndexStatsQuery, type ProfitItem, type ProfitListQuery, type RoastChartDataQuery, type SalesCreateRequest, type SalesListQuery, type SalesUpdateRequest, type SourcingBriefCreateRequest, type TrackedLotMutation, type TrackedLotSummary, type TrackedLotsListQuery, type components, createParchmentClient, type paths };
14195
+ export { type AccountDeletionOperation, type AccountDeletionRequest, type BillingCheckoutCreateRequest, type BillingCheckoutSession, type BillingManualEntitlementsRequest, type BillingSubscriptionMutationRequest, type BillingSubscriptionOperation, type BriefMatchesQuery, type CatalogItem, type CatalogListQuery, type CatalogProofSummary, type CatalogSimilarQuery, type InventoryCreateRequest, type InventoryUpdateRequest, type MarketSignalsQuery, type MetadataIndexQuery, type OwnerApiUsage, type OwnerApiUsageQuery, type ParchmentClient, type ParchmentClientOptions, type PriceIndexQuery, type PriceIndexStatsQuery, type ProfitItem, type ProfitListQuery, type RoastChartDataQuery, type SalesCreateRequest, type SalesListQuery, type SalesUpdateRequest, type SourcingBriefCreateRequest, type TrackedLotMutation, type TrackedLotSummary, type TrackedLotsListQuery, type components, createParchmentClient, type paths };