@purveyors/sdk 0.28.0 → 0.29.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
@@ -537,6 +537,176 @@ interface paths {
537
537
  patch?: never;
538
538
  trace?: never;
539
539
  };
540
+ "/v1/webhooks/resend/market-brief": {
541
+ parameters: {
542
+ query?: never;
543
+ header?: never;
544
+ path?: never;
545
+ cookie?: never;
546
+ };
547
+ get?: never;
548
+ put?: never;
549
+ /**
550
+ * Receive verified Market Brief provider events
551
+ * @description Verifies the Resend Svix signature against the untouched raw body, then idempotently settles provider opt-out or suppression state under Parchment authority.
552
+ */
553
+ post: {
554
+ parameters: {
555
+ query?: never;
556
+ header: {
557
+ "svix-id": string;
558
+ "svix-timestamp": string;
559
+ "svix-signature": string;
560
+ };
561
+ path?: never;
562
+ cookie?: never;
563
+ };
564
+ requestBody?: never;
565
+ responses: {
566
+ /** @description The authentic delivery was settled or ignored */
567
+ 200: {
568
+ headers: {
569
+ [name: string]: unknown;
570
+ };
571
+ content: {
572
+ "application/json": {
573
+ /** @enum {boolean} */
574
+ received: true;
575
+ };
576
+ };
577
+ };
578
+ /** @description The signature or provider payload is invalid */
579
+ 400: {
580
+ headers: {
581
+ [name: string]: unknown;
582
+ };
583
+ content: {
584
+ "application/json": components["schemas"]["ErrorResponse"];
585
+ };
586
+ };
587
+ /** @description The provider payload exceeds the bounded body limit */
588
+ 413: {
589
+ headers: {
590
+ [name: string]: unknown;
591
+ };
592
+ content: {
593
+ "application/json": components["schemas"]["ErrorResponse"];
594
+ };
595
+ };
596
+ /** @description Provider configuration or durable settlement is unavailable */
597
+ 503: {
598
+ headers: {
599
+ [name: string]: unknown;
600
+ };
601
+ content: {
602
+ "application/json": components["schemas"]["ErrorResponse"];
603
+ };
604
+ };
605
+ };
606
+ };
607
+ delete?: never;
608
+ options?: never;
609
+ head?: never;
610
+ patch?: never;
611
+ trace?: never;
612
+ };
613
+ "/v1/market-brief/drafts": {
614
+ parameters: {
615
+ query?: never;
616
+ header?: never;
617
+ path?: never;
618
+ cookie?: never;
619
+ };
620
+ get?: never;
621
+ put?: never;
622
+ /**
623
+ * Accept or replay one deployed Market Brief draft
624
+ * @description Authenticates the dedicated coffee-app machine credential, verifies the exact deployed Market Brief projection, and creates or recovers one unsent provider draft under Parchment authority.
625
+ */
626
+ post: {
627
+ parameters: {
628
+ query?: never;
629
+ header?: never;
630
+ path?: never;
631
+ cookie?: never;
632
+ };
633
+ requestBody: {
634
+ content: {
635
+ "application/json": components["schemas"]["MarketBriefDraftInput"];
636
+ };
637
+ };
638
+ responses: {
639
+ /** @description The exact immutable draft already exists */
640
+ 200: {
641
+ headers: {
642
+ [name: string]: unknown;
643
+ };
644
+ content: {
645
+ "application/json": components["schemas"]["MarketBriefDraftResponse"];
646
+ };
647
+ };
648
+ /** @description Draft creation or ambiguity recovery remains durable */
649
+ 202: {
650
+ headers: {
651
+ [name: string]: unknown;
652
+ };
653
+ content: {
654
+ "application/json": components["schemas"]["MarketBriefDraftResponse"];
655
+ };
656
+ };
657
+ /** @description The submitted deployment or projection is invalid */
658
+ 400: {
659
+ headers: {
660
+ [name: string]: unknown;
661
+ };
662
+ content: {
663
+ "application/json": components["schemas"]["ErrorResponse"];
664
+ };
665
+ };
666
+ /** @description The dedicated machine credential is absent or invalid */
667
+ 401: {
668
+ headers: {
669
+ [name: string]: unknown;
670
+ };
671
+ content: {
672
+ "application/json": components["schemas"]["ErrorResponse"];
673
+ };
674
+ };
675
+ /** @description The deployment, immutable version, or provider draft conflicts with durable state */
676
+ 409: {
677
+ headers: {
678
+ [name: string]: unknown;
679
+ };
680
+ content: {
681
+ "application/json": components["schemas"]["ErrorResponse"];
682
+ };
683
+ };
684
+ /** @description The request body exceeds the bounded projection limit */
685
+ 413: {
686
+ headers: {
687
+ [name: string]: unknown;
688
+ };
689
+ content: {
690
+ "application/json": components["schemas"]["ErrorResponse"];
691
+ };
692
+ };
693
+ /** @description Draft admission, deployed verification, storage, or provider recovery is unavailable */
694
+ 503: {
695
+ headers: {
696
+ [name: string]: unknown;
697
+ };
698
+ content: {
699
+ "application/json": components["schemas"]["ErrorResponse"];
700
+ };
701
+ };
702
+ };
703
+ };
704
+ delete?: never;
705
+ options?: never;
706
+ head?: never;
707
+ patch?: never;
708
+ trace?: never;
709
+ };
540
710
  "/v1/billing/subscriptions": {
541
711
  parameters: {
542
712
  query?: never;
@@ -1521,6 +1691,67 @@ interface paths {
1521
1691
  patch?: never;
1522
1692
  trace?: never;
1523
1693
  };
1694
+ "/v1/email-subscriptions/market-read/unsubscribe": {
1695
+ parameters: {
1696
+ query?: never;
1697
+ header?: never;
1698
+ path?: never;
1699
+ cookie?: never;
1700
+ };
1701
+ get?: never;
1702
+ put?: never;
1703
+ /**
1704
+ * Unsubscribe from Market Read without a user session
1705
+ * @description Accepts an opaque account-lifetime capability and idempotently reduces Market Read consent. The response does not reveal whether the capability exists or whether consent changed.
1706
+ */
1707
+ post: {
1708
+ parameters: {
1709
+ query?: never;
1710
+ header?: never;
1711
+ path?: never;
1712
+ cookie?: never;
1713
+ };
1714
+ requestBody: {
1715
+ content: {
1716
+ "application/json": components["schemas"]["MarketReadUnsubscribeInput"];
1717
+ };
1718
+ };
1719
+ responses: {
1720
+ /** @description The unsubscribe request was accepted */
1721
+ 200: {
1722
+ headers: {
1723
+ [name: string]: unknown;
1724
+ };
1725
+ content: {
1726
+ "application/json": components["schemas"]["MarketReadUnsubscribeResponse"];
1727
+ };
1728
+ };
1729
+ /** @description Invalid unsubscribe request */
1730
+ 400: {
1731
+ headers: {
1732
+ [name: string]: unknown;
1733
+ };
1734
+ content: {
1735
+ "application/json": components["schemas"]["ErrorResponse"];
1736
+ };
1737
+ };
1738
+ /** @description Email preference storage is unavailable */
1739
+ 503: {
1740
+ headers: {
1741
+ [name: string]: unknown;
1742
+ };
1743
+ content: {
1744
+ "application/json": components["schemas"]["ErrorResponse"];
1745
+ };
1746
+ };
1747
+ };
1748
+ };
1749
+ delete?: never;
1750
+ options?: never;
1751
+ head?: never;
1752
+ patch?: never;
1753
+ trace?: never;
1754
+ };
1524
1755
  "/v1/cli-auth/requests": {
1525
1756
  parameters: {
1526
1757
  query?: never;
@@ -4169,7 +4400,7 @@ interface paths {
4169
4400
  patch?: never;
4170
4401
  trace?: never;
4171
4402
  };
4172
- "/v1/inventory/{id}": {
4403
+ "/v1/inventory/catalog-batches/reservations": {
4173
4404
  parameters: {
4174
4405
  query?: never;
4175
4406
  header?: never;
@@ -4178,29 +4409,30 @@ interface paths {
4178
4409
  };
4179
4410
  get?: never;
4180
4411
  put?: never;
4181
- post?: never;
4182
4412
  /**
4183
- * Delete an owner inventory item
4184
- * @description Delete one of the caller's own inventory rows. Returns 409 if dependent roast profiles or sales exist (no force-cascade). Requires an authenticated session, or an owner-bound API key carrying the exact inventory:write scope.
4413
+ * Reserve a catalog inventory batch
4414
+ * @description Durably accept complete canonical intent for 1–50 existing visible catalog coffees before mutation starts. After acceptance, clients retain only batchId. Requires an authenticated session, or an owner-bound API key carrying the exact inventory:write scope.
4185
4415
  */
4186
- delete: {
4416
+ post: {
4187
4417
  parameters: {
4188
4418
  query?: never;
4189
4419
  header?: never;
4190
- path: {
4191
- id: number;
4192
- };
4420
+ path?: never;
4193
4421
  cookie?: never;
4194
4422
  };
4195
- requestBody?: never;
4423
+ requestBody?: {
4424
+ content: {
4425
+ "application/json": components["schemas"]["CatalogInventoryBatchReserveRequest"];
4426
+ };
4427
+ };
4196
4428
  responses: {
4197
- /** @description The inventory row was deleted */
4198
- 200: {
4429
+ /** @description The durable accepted lifecycle */
4430
+ 201: {
4199
4431
  headers: {
4200
4432
  [name: string]: unknown;
4201
4433
  };
4202
4434
  content: {
4203
- "application/json": components["schemas"]["InventoryDeleteResponse"];
4435
+ "application/json": components["schemas"]["CatalogInventoryBatchLifecycleResponse"];
4204
4436
  };
4205
4437
  };
4206
4438
  /** @description Invalid query parameter */
@@ -4230,16 +4462,7 @@ interface paths {
4230
4462
  "application/json": components["schemas"]["ErrorResponse"];
4231
4463
  };
4232
4464
  };
4233
- /** @description No such inventory item owned by the caller */
4234
- 404: {
4235
- headers: {
4236
- [name: string]: unknown;
4237
- };
4238
- content: {
4239
- "application/json": components["schemas"]["ErrorResponse"];
4240
- };
4241
- };
4242
- /** @description Write conflict: dependent roast/sales rows exist, or an If-Match precondition failed */
4465
+ /** @description The batch UUID is already reserved for different canonical catalog inventory intent */
4243
4466
  409: {
4244
4467
  headers: {
4245
4468
  [name: string]: unknown;
@@ -4257,7 +4480,7 @@ interface paths {
4257
4480
  "application/json": components["schemas"]["ErrorResponse"];
4258
4481
  };
4259
4482
  };
4260
- /** @description Inventory writes are not enabled in this environment */
4483
+ /** @description Catalog inventory batch writes are disabled or lifecycle storage is temporarily unavailable */
4261
4484
  503: {
4262
4485
  headers: {
4263
4486
  [name: string]: unknown;
@@ -4268,24 +4491,301 @@ interface paths {
4268
4491
  };
4269
4492
  };
4270
4493
  };
4494
+ delete?: never;
4271
4495
  options?: never;
4272
4496
  head?: never;
4497
+ patch?: never;
4498
+ trace?: never;
4499
+ };
4500
+ "/v1/inventory/catalog-batches/{batchId}/commit": {
4501
+ parameters: {
4502
+ query?: never;
4503
+ header?: never;
4504
+ path?: never;
4505
+ cookie?: never;
4506
+ };
4507
+ get?: never;
4508
+ put?: never;
4273
4509
  /**
4274
- * Update an owner inventory item
4275
- * @description Update fields on one of the caller's own inventory rows. Optional `If-Match: <last_updated>` enables optimistic concurrency (409 on mismatch). Requires an authenticated session, or an owner-bound API key carrying the exact inventory:write scope.
4510
+ * Commit a reserved catalog inventory batch
4511
+ * @description Claim and atomically commit the server-owned request for a reserved batch UUID. Concurrent commits serialize through the durable lifecycle; callers may safely retry with no request body.
4276
4512
  */
4277
- patch: {
4513
+ post: {
4278
4514
  parameters: {
4279
4515
  query?: never;
4280
- header?: {
4281
- "if-match"?: string;
4282
- };
4516
+ header?: never;
4283
4517
  path: {
4284
- id: number;
4518
+ batchId: string;
4285
4519
  };
4286
4520
  cookie?: never;
4287
4521
  };
4288
- requestBody?: {
4522
+ requestBody?: never;
4523
+ responses: {
4524
+ /** @description The current identity-only lifecycle, including completion or terminal rejection */
4525
+ 200: {
4526
+ headers: {
4527
+ [name: string]: unknown;
4528
+ };
4529
+ content: {
4530
+ "application/json": components["schemas"]["CatalogInventoryBatchLifecycleResponse"];
4531
+ };
4532
+ };
4533
+ /** @description Invalid query parameter */
4534
+ 400: {
4535
+ headers: {
4536
+ [name: string]: unknown;
4537
+ };
4538
+ content: {
4539
+ "application/json": components["schemas"]["ErrorResponse"];
4540
+ };
4541
+ };
4542
+ /** @description Authentication required */
4543
+ 401: {
4544
+ headers: {
4545
+ [name: string]: unknown;
4546
+ };
4547
+ content: {
4548
+ "application/json": components["schemas"]["ErrorResponse"];
4549
+ };
4550
+ };
4551
+ /** @description Insufficient entitlement (plan or role) */
4552
+ 403: {
4553
+ headers: {
4554
+ [name: string]: unknown;
4555
+ };
4556
+ content: {
4557
+ "application/json": components["schemas"]["ErrorResponse"];
4558
+ };
4559
+ };
4560
+ /** @description No reserved catalog inventory batch exists for this owner and batch UUID */
4561
+ 404: {
4562
+ headers: {
4563
+ [name: string]: unknown;
4564
+ };
4565
+ content: {
4566
+ "application/json": components["schemas"]["ErrorResponse"];
4567
+ };
4568
+ };
4569
+ /** @description Per-user mutation throttle exceeded; retry after a short wait */
4570
+ 429: {
4571
+ headers: {
4572
+ [name: string]: unknown;
4573
+ };
4574
+ content: {
4575
+ "application/json": components["schemas"]["ErrorResponse"];
4576
+ };
4577
+ };
4578
+ /** @description Catalog inventory batch writes are disabled or lifecycle storage is temporarily unavailable */
4579
+ 503: {
4580
+ headers: {
4581
+ [name: string]: unknown;
4582
+ };
4583
+ content: {
4584
+ "application/json": components["schemas"]["ErrorResponse"];
4585
+ };
4586
+ };
4587
+ };
4588
+ };
4589
+ delete?: never;
4590
+ options?: never;
4591
+ head?: never;
4592
+ patch?: never;
4593
+ trace?: never;
4594
+ };
4595
+ "/v1/inventory/catalog-batches/{batchId}/status": {
4596
+ parameters: {
4597
+ query?: never;
4598
+ header?: never;
4599
+ path?: never;
4600
+ cookie?: never;
4601
+ };
4602
+ /**
4603
+ * Get catalog inventory batch lifecycle
4604
+ * @description Return unknown, accepted, in_progress, completed, or terminal_rejected for owner-scoped durable intent. Missing and cross-tenant UUIDs are the same nonterminal unknown state.
4605
+ */
4606
+ get: {
4607
+ parameters: {
4608
+ query?: never;
4609
+ header?: never;
4610
+ path: {
4611
+ batchId: string;
4612
+ };
4613
+ cookie?: never;
4614
+ };
4615
+ requestBody?: never;
4616
+ responses: {
4617
+ /** @description The identity-only catalog inventory batch lifecycle */
4618
+ 200: {
4619
+ headers: {
4620
+ [name: string]: unknown;
4621
+ };
4622
+ content: {
4623
+ "application/json": components["schemas"]["CatalogInventoryBatchLifecycleResponse"];
4624
+ };
4625
+ };
4626
+ /** @description Invalid query parameter */
4627
+ 400: {
4628
+ headers: {
4629
+ [name: string]: unknown;
4630
+ };
4631
+ content: {
4632
+ "application/json": components["schemas"]["ErrorResponse"];
4633
+ };
4634
+ };
4635
+ /** @description Authentication required */
4636
+ 401: {
4637
+ headers: {
4638
+ [name: string]: unknown;
4639
+ };
4640
+ content: {
4641
+ "application/json": components["schemas"]["ErrorResponse"];
4642
+ };
4643
+ };
4644
+ /** @description Insufficient entitlement (plan or role) */
4645
+ 403: {
4646
+ headers: {
4647
+ [name: string]: unknown;
4648
+ };
4649
+ content: {
4650
+ "application/json": components["schemas"]["ErrorResponse"];
4651
+ };
4652
+ };
4653
+ /** @description Catalog inventory batch writes are disabled or lifecycle storage is temporarily unavailable */
4654
+ 503: {
4655
+ headers: {
4656
+ [name: string]: unknown;
4657
+ };
4658
+ content: {
4659
+ "application/json": components["schemas"]["ErrorResponse"];
4660
+ };
4661
+ };
4662
+ };
4663
+ };
4664
+ put?: never;
4665
+ post?: never;
4666
+ delete?: never;
4667
+ options?: never;
4668
+ head?: never;
4669
+ patch?: never;
4670
+ trace?: never;
4671
+ };
4672
+ "/v1/inventory/{id}": {
4673
+ parameters: {
4674
+ query?: never;
4675
+ header?: never;
4676
+ path?: never;
4677
+ cookie?: never;
4678
+ };
4679
+ get?: never;
4680
+ put?: never;
4681
+ post?: never;
4682
+ /**
4683
+ * Delete an owner inventory item
4684
+ * @description Delete one of the caller's own inventory rows. Returns 409 if dependent roast profiles or sales exist (no force-cascade). Requires an authenticated session, or an owner-bound API key carrying the exact inventory:write scope.
4685
+ */
4686
+ delete: {
4687
+ parameters: {
4688
+ query?: never;
4689
+ header?: never;
4690
+ path: {
4691
+ id: number;
4692
+ };
4693
+ cookie?: never;
4694
+ };
4695
+ requestBody?: never;
4696
+ responses: {
4697
+ /** @description The inventory row was deleted */
4698
+ 200: {
4699
+ headers: {
4700
+ [name: string]: unknown;
4701
+ };
4702
+ content: {
4703
+ "application/json": components["schemas"]["InventoryDeleteResponse"];
4704
+ };
4705
+ };
4706
+ /** @description Invalid query parameter */
4707
+ 400: {
4708
+ headers: {
4709
+ [name: string]: unknown;
4710
+ };
4711
+ content: {
4712
+ "application/json": components["schemas"]["ErrorResponse"];
4713
+ };
4714
+ };
4715
+ /** @description Authentication required */
4716
+ 401: {
4717
+ headers: {
4718
+ [name: string]: unknown;
4719
+ };
4720
+ content: {
4721
+ "application/json": components["schemas"]["ErrorResponse"];
4722
+ };
4723
+ };
4724
+ /** @description Insufficient entitlement (plan or role) */
4725
+ 403: {
4726
+ headers: {
4727
+ [name: string]: unknown;
4728
+ };
4729
+ content: {
4730
+ "application/json": components["schemas"]["ErrorResponse"];
4731
+ };
4732
+ };
4733
+ /** @description No such inventory item owned by the caller */
4734
+ 404: {
4735
+ headers: {
4736
+ [name: string]: unknown;
4737
+ };
4738
+ content: {
4739
+ "application/json": components["schemas"]["ErrorResponse"];
4740
+ };
4741
+ };
4742
+ /** @description Write conflict: dependent roast/sales rows exist, or an If-Match precondition failed */
4743
+ 409: {
4744
+ headers: {
4745
+ [name: string]: unknown;
4746
+ };
4747
+ content: {
4748
+ "application/json": components["schemas"]["ErrorResponse"];
4749
+ };
4750
+ };
4751
+ /** @description Per-user mutation throttle exceeded; retry after a short wait */
4752
+ 429: {
4753
+ headers: {
4754
+ [name: string]: unknown;
4755
+ };
4756
+ content: {
4757
+ "application/json": components["schemas"]["ErrorResponse"];
4758
+ };
4759
+ };
4760
+ /** @description Inventory writes are not enabled in this environment */
4761
+ 503: {
4762
+ headers: {
4763
+ [name: string]: unknown;
4764
+ };
4765
+ content: {
4766
+ "application/json": components["schemas"]["ErrorResponse"];
4767
+ };
4768
+ };
4769
+ };
4770
+ };
4771
+ options?: never;
4772
+ head?: never;
4773
+ /**
4774
+ * Update an owner inventory item
4775
+ * @description Update fields on one of the caller's own inventory rows. Optional `If-Match: <last_updated>` enables optimistic concurrency (409 on mismatch). Requires an authenticated session, or an owner-bound API key carrying the exact inventory:write scope.
4776
+ */
4777
+ patch: {
4778
+ parameters: {
4779
+ query?: never;
4780
+ header?: {
4781
+ "if-match"?: string;
4782
+ };
4783
+ path: {
4784
+ id: number;
4785
+ };
4786
+ cookie?: never;
4787
+ };
4788
+ requestBody?: {
4289
4789
  content: {
4290
4790
  "application/json": components["schemas"]["InventoryUpdateRequest"];
4291
4791
  };
@@ -5877,6 +6377,34 @@ interface components {
5877
6377
  status: "accepted" | "attempting" | "published" | "settled" | "closed" | "conflict";
5878
6378
  clientSecret: string | null;
5879
6379
  };
6380
+ MarketBriefDraftState: {
6381
+ /** Format: uuid */
6382
+ draftId: string;
6383
+ edition: number;
6384
+ productionCommit: string;
6385
+ /** @enum {string} */
6386
+ status: "creating" | "uncertain" | "created" | "conflict";
6387
+ };
6388
+ MarketBriefDraftResponse: {
6389
+ data: components["schemas"]["MarketBriefDraftState"];
6390
+ };
6391
+ MarketBriefDraftInput: {
6392
+ /** @enum {number} */
6393
+ schemaVersion: 1;
6394
+ /** @enum {string} */
6395
+ publication: "market-brief";
6396
+ edition: number;
6397
+ slug: string;
6398
+ /** Format: uri */
6399
+ canonicalUrl: string;
6400
+ productionCommit: string;
6401
+ /** @enum {string} */
6402
+ rendererVersion: "market-brief-email-v1";
6403
+ projectionSha256: string;
6404
+ subject: string;
6405
+ html: string;
6406
+ text: string;
6407
+ };
5880
6408
  BillingSubscriptionOperation: {
5881
6409
  /** Format: uuid */
5882
6410
  operationId: string;
@@ -6024,6 +6552,16 @@ interface components {
6024
6552
  /** @enum {boolean} */
6025
6553
  subscribed: false;
6026
6554
  };
6555
+ MarketReadUnsubscribeResponse: {
6556
+ data: {
6557
+ /** @enum {boolean} */
6558
+ accepted: true;
6559
+ };
6560
+ };
6561
+ MarketReadUnsubscribeInput: {
6562
+ /** Format: uuid */
6563
+ capability: string;
6564
+ };
6027
6565
  CatalogAccessResponse: {
6028
6566
  visibility: {
6029
6567
  isPrivilegedSession: boolean;
@@ -7635,6 +8173,82 @@ interface components {
7635
8173
  notes?: string;
7636
8174
  items: components["schemas"]["ManualInventoryBatchItem"][];
7637
8175
  };
8176
+ CatalogInventoryBatchResult: {
8177
+ /** Format: uuid */
8178
+ batchId: string;
8179
+ items: {
8180
+ /** Format: uuid */
8181
+ rowId: string;
8182
+ inventoryId: number;
8183
+ }[];
8184
+ };
8185
+ CatalogInventoryBatchTerminalError: {
8186
+ code: string;
8187
+ message: string;
8188
+ };
8189
+ CatalogInventoryBatchLifecycle: {
8190
+ /** Format: uuid */
8191
+ batchId: string;
8192
+ /** @enum {string} */
8193
+ status: "unknown" | "accepted" | "in_progress" | "completed" | "terminal_rejected";
8194
+ result: components["schemas"]["CatalogInventoryBatchResult"] | null;
8195
+ error: components["schemas"]["CatalogInventoryBatchTerminalError"] | null;
8196
+ /** Format: date-time */
8197
+ updatedAt: string | null;
8198
+ };
8199
+ CatalogInventoryBatchLifecycleResponse: {
8200
+ data: components["schemas"]["CatalogInventoryBatchLifecycle"];
8201
+ meta: {
8202
+ /** @enum {string} */
8203
+ resource: "inventory-catalog-batch-lifecycle";
8204
+ /** @enum {string} */
8205
+ namespace: "/v1/inventory/catalog-batches";
8206
+ /** @enum {string} */
8207
+ version: "v1";
8208
+ auth: {
8209
+ /** @enum {string} */
8210
+ kind: "session" | "api-key";
8211
+ /** @enum {string|null} */
8212
+ role: "admin" | "member" | "viewer" | null;
8213
+ /** @enum {string|null} */
8214
+ apiPlan: "viewer" | "member" | "enterprise" | null;
8215
+ };
8216
+ };
8217
+ };
8218
+ CatalogInventoryBatchItem: {
8219
+ /**
8220
+ * Format: uuid
8221
+ * @description Stable client-generated row identity returned unchanged with the created inventory id.
8222
+ */
8223
+ rowId: string;
8224
+ /** @description Visible coffee_catalog.id to add to owner inventory. */
8225
+ catalogId: number;
8226
+ /** @description Purchased quantity in pounds. */
8227
+ qty: number;
8228
+ /** @description Total bean cost for this inventory lot. */
8229
+ cost?: number;
8230
+ /** @description Owner-assigned integer ranking for this inventory lot (PostgreSQL integer range). */
8231
+ rank?: number | null;
8232
+ /** @description Explicit stock-state override. When omitted, stock is derived from purchased quantity. */
8233
+ stocked?: boolean;
8234
+ /** @description Owner cupping data stored as JSON. */
8235
+ cuppingNotes?: string | number | boolean | unknown[] | {
8236
+ [key: string]: unknown;
8237
+ } | null;
8238
+ };
8239
+ CatalogInventoryBatchReserveRequest: {
8240
+ /**
8241
+ * Format: uuid
8242
+ * @description Stable client-generated batch identity. Persist only this UUID after reservation succeeds.
8243
+ */
8244
+ batchId: string;
8245
+ /** @description Purchase date (YYYY-MM-DD); defaults to today (UTC). */
8246
+ purchaseDate?: string;
8247
+ /** @description Shared tax and shipping total. Parchment normalizes exact cents before reservation and allocates them by input order. */
8248
+ taxShipTotal?: number;
8249
+ notes?: string;
8250
+ items: components["schemas"]["CatalogInventoryBatchItem"][];
8251
+ };
7638
8252
  InventoryItemResponse: {
7639
8253
  data: components["schemas"]["InventoryResource"];
7640
8254
  meta: {
@@ -8416,9 +9030,10 @@ interface ParchmentClientOptions {
8416
9030
  /** Base URL of the Parchment API, e.g. https://api.purveyors.io */
8417
9031
  baseUrl: string;
8418
9032
  /**
8419
- * Optional bearer token (a Supabase JWT or, later, an API key). Sent as
8420
- * `Authorization: Bearer <token>`. Auth is resolved server-side against the
8421
- * unified principal model; the SDK only forwards the credential.
9033
+ * Optional bearer token (a Supabase JWT, API key, or dedicated machine
9034
+ * credential). Sent as
9035
+ * `Authorization: Bearer <token>`. Auth is resolved server-side at the route
9036
+ * boundary; the SDK only forwards the credential.
8422
9037
  */
8423
9038
  token?: string;
8424
9039
  /** Override the fetch implementation (useful for tests or custom runtimes). */
@@ -8493,6 +9108,12 @@ type ManualInventoryCreateRequest = components["schemas"]["ManualInventoryCreate
8493
9108
  type ManualInventoryBatchCreateRequest = NonNullable<paths["/v1/inventory/manual-batches"]["post"]["requestBody"]>["content"]["application/json"];
8494
9109
  /** Request body for reserving durable server-owned manual-batch intent. */
8495
9110
  type ManualInventoryBatchReserveRequest = NonNullable<paths["/v1/inventory/manual-batches/reservations"]["post"]["requestBody"]>["content"]["application/json"];
9111
+ /** Complete canonical intent accepted by the catalog-batch reservation lane. */
9112
+ type CatalogInventoryBatchReserveRequest = NonNullable<paths["/v1/inventory/catalog-batches/reservations"]["post"]["requestBody"]>["content"]["application/json"];
9113
+ /** Durable catalog-batch state returned by reserve, commit, and status. */
9114
+ type CatalogInventoryBatchLifecycle = components["schemas"]["CatalogInventoryBatchLifecycle"];
9115
+ /** Identity-only terminal result; catalog resources remain a separate read. */
9116
+ type CatalogInventoryBatchResult = components["schemas"]["CatalogInventoryBatchResult"];
8496
9117
  /** Request body for {@link ParchmentClient.inventory.update}. */
8497
9118
  type InventoryUpdateRequest = NonNullable<paths["/v1/inventory/{id}"]["patch"]["requestBody"]>["content"]["application/json"];
8498
9119
  /** Query parameters for {@link ParchmentClient.roasts.list}. */
@@ -8533,6 +9154,10 @@ type OwnerApiUsageQuery = NonNullable<paths["/v1/api-usage"]["get"]["parameters"
8533
9154
  type OwnerApiUsage = components["schemas"]["OwnerApiUsageResponse"];
8534
9155
  /** Request body for {@link ParchmentClient.emailSubscriptions.setMarketRead}. */
8535
9156
  type MarketReadPreferenceRequest = NonNullable<paths["/v1/email-subscriptions/market-read"]["put"]["requestBody"]>["content"]["application/json"];
9157
+ /** Request body for {@link ParchmentClient.emailSubscriptions.unsubscribeMarketRead}. */
9158
+ type MarketReadUnsubscribeRequest = NonNullable<paths["/v1/email-subscriptions/market-read/unsubscribe"]["post"]["requestBody"]>["content"]["application/json"];
9159
+ /** Immutable deployed projection accepted by {@link ParchmentClient.marketBrief.drafts.create}. */
9160
+ type MarketBriefDraftCreateRequest = NonNullable<paths["/v1/market-brief/drafts"]["post"]["requestBody"]>["content"]["application/json"];
8536
9161
  /** Durable state returned by an account-deletion request. */
8537
9162
  type AccountDeletionOperation = components["schemas"]["AccountDeletionOperation"];
8538
9163
  /** Purpose-bound recent-reauthentication assertion for account deletion. */
@@ -9163,27 +9788,161 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9163
9788
  headers: {
9164
9789
  [name: string]: unknown;
9165
9790
  };
9166
- content: {
9167
- "application/json": components["schemas"]["ErrorResponse"];
9791
+ content: {
9792
+ "application/json": components["schemas"]["ErrorResponse"];
9793
+ };
9794
+ };
9795
+ 503: {
9796
+ headers: {
9797
+ [name: string]: unknown;
9798
+ };
9799
+ content: {
9800
+ "application/json": components["schemas"]["ErrorResponse"];
9801
+ };
9802
+ };
9803
+ };
9804
+ }, {
9805
+ body: {
9806
+ subscribed: true;
9807
+ consentSource: "account_settings" | "signup";
9808
+ } | {
9809
+ subscribed: false;
9810
+ };
9811
+ }, `${string}/${string}`>>;
9812
+ /** Idempotently unsubscribe using an opaque capability without requiring a session. */
9813
+ unsubscribeMarketRead: (body: MarketReadUnsubscribeRequest) => Promise<openapi_fetch.FetchResponse<{
9814
+ parameters: {
9815
+ query?: never;
9816
+ header?: never;
9817
+ path?: never;
9818
+ cookie?: never;
9819
+ };
9820
+ requestBody: {
9821
+ content: {
9822
+ "application/json": components["schemas"]["MarketReadUnsubscribeInput"];
9823
+ };
9824
+ };
9825
+ responses: {
9826
+ 200: {
9827
+ headers: {
9828
+ [name: string]: unknown;
9829
+ };
9830
+ content: {
9831
+ "application/json": components["schemas"]["MarketReadUnsubscribeResponse"];
9832
+ };
9833
+ };
9834
+ 400: {
9835
+ headers: {
9836
+ [name: string]: unknown;
9837
+ };
9838
+ content: {
9839
+ "application/json": components["schemas"]["ErrorResponse"];
9840
+ };
9841
+ };
9842
+ 503: {
9843
+ headers: {
9844
+ [name: string]: unknown;
9845
+ };
9846
+ content: {
9847
+ "application/json": components["schemas"]["ErrorResponse"];
9848
+ };
9849
+ };
9850
+ };
9851
+ }, {
9852
+ body: {
9853
+ capability: string;
9854
+ };
9855
+ }, `${string}/${string}`>>;
9856
+ };
9857
+ marketBrief: {
9858
+ drafts: {
9859
+ /** Accept, create, or recover one immutable deployed edition version. */
9860
+ create: (body: MarketBriefDraftCreateRequest) => Promise<openapi_fetch.FetchResponse<{
9861
+ parameters: {
9862
+ query?: never;
9863
+ header?: never;
9864
+ path?: never;
9865
+ cookie?: never;
9866
+ };
9867
+ requestBody: {
9868
+ content: {
9869
+ "application/json": components["schemas"]["MarketBriefDraftInput"];
9870
+ };
9871
+ };
9872
+ responses: {
9873
+ 200: {
9874
+ headers: {
9875
+ [name: string]: unknown;
9876
+ };
9877
+ content: {
9878
+ "application/json": components["schemas"]["MarketBriefDraftResponse"];
9879
+ };
9880
+ };
9881
+ 202: {
9882
+ headers: {
9883
+ [name: string]: unknown;
9884
+ };
9885
+ content: {
9886
+ "application/json": components["schemas"]["MarketBriefDraftResponse"];
9887
+ };
9888
+ };
9889
+ 400: {
9890
+ headers: {
9891
+ [name: string]: unknown;
9892
+ };
9893
+ content: {
9894
+ "application/json": components["schemas"]["ErrorResponse"];
9895
+ };
9896
+ };
9897
+ 401: {
9898
+ headers: {
9899
+ [name: string]: unknown;
9900
+ };
9901
+ content: {
9902
+ "application/json": components["schemas"]["ErrorResponse"];
9903
+ };
9904
+ };
9905
+ 409: {
9906
+ headers: {
9907
+ [name: string]: unknown;
9908
+ };
9909
+ content: {
9910
+ "application/json": components["schemas"]["ErrorResponse"];
9911
+ };
9168
9912
  };
9169
- };
9170
- 503: {
9171
- headers: {
9172
- [name: string]: unknown;
9913
+ 413: {
9914
+ headers: {
9915
+ [name: string]: unknown;
9916
+ };
9917
+ content: {
9918
+ "application/json": components["schemas"]["ErrorResponse"];
9919
+ };
9173
9920
  };
9174
- content: {
9175
- "application/json": components["schemas"]["ErrorResponse"];
9921
+ 503: {
9922
+ headers: {
9923
+ [name: string]: unknown;
9924
+ };
9925
+ content: {
9926
+ "application/json": components["schemas"]["ErrorResponse"];
9927
+ };
9176
9928
  };
9177
9929
  };
9178
- };
9179
- }, {
9180
- body: {
9181
- subscribed: true;
9182
- consentSource: "account_settings" | "signup";
9183
- } | {
9184
- subscribed: false;
9185
- };
9186
- }, `${string}/${string}`>>;
9930
+ }, {
9931
+ body: {
9932
+ schemaVersion: 1;
9933
+ publication: "market-brief";
9934
+ edition: number;
9935
+ slug: string;
9936
+ canonicalUrl: string;
9937
+ productionCommit: string;
9938
+ rendererVersion: "market-brief-email-v1";
9939
+ projectionSha256: string;
9940
+ subject: string;
9941
+ html: string;
9942
+ text: string;
9943
+ };
9944
+ }, `${string}/${string}`>>;
9945
+ };
9187
9946
  };
9188
9947
  accountDeletion: {
9189
9948
  /** Accept or replay deletion using a purpose-bound reauthentication assertion. */
@@ -9427,7 +10186,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9427
10186
  [name: string]: unknown;
9428
10187
  };
9429
10188
  content: {
9430
- "application/json": components["schemas"] /** Liveness and service identity. */["BillingCheckoutSession"];
10189
+ "application/json": components["schemas"]["BillingCheckoutSession"];
9431
10190
  };
9432
10191
  };
9433
10192
  401: {
@@ -9611,7 +10370,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9611
10370
  [name: string]: unknown;
9612
10371
  };
9613
10372
  content: {
9614
- "application/json": components["schemas"] /** List the caller's saved sourcing briefs. */["BillingSubscriptionOperation"];
10373
+ "application/json": components["schemas"]["BillingSubscriptionOperation"];
9615
10374
  };
9616
10375
  };
9617
10376
  202: {
@@ -9859,21 +10618,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
9859
10618
  setManual: (ownerId: string, body: BillingManualEntitlementsRequest) => Promise<openapi_fetch.FetchResponse<{
9860
10619
  parameters: {
9861
10620
  query?: never;
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;
10621
+ header?: never;
9877
10622
  path: {
9878
10623
  ownerId: string;
9879
10624
  };
@@ -12535,6 +13280,222 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
12535
13280
  };
12536
13281
  };
12537
13282
  }, `${string}/${string}`>>;
13283
+ /** Durably reserve canonical catalog-backed inventory intent. */
13284
+ reserveCatalogBatch: (body: CatalogInventoryBatchReserveRequest) => Promise<openapi_fetch.FetchResponse<{
13285
+ parameters: {
13286
+ query?: never;
13287
+ header?: never;
13288
+ path?: never;
13289
+ cookie?: never;
13290
+ };
13291
+ requestBody?: {
13292
+ content: {
13293
+ "application/json": components["schemas"]["CatalogInventoryBatchReserveRequest"];
13294
+ };
13295
+ };
13296
+ responses: {
13297
+ 201: {
13298
+ headers: {
13299
+ [name: string]: unknown;
13300
+ };
13301
+ content: {
13302
+ "application/json": components["schemas"]["CatalogInventoryBatchLifecycleResponse"];
13303
+ };
13304
+ };
13305
+ 400: {
13306
+ headers: {
13307
+ [name: string]: unknown;
13308
+ };
13309
+ content: {
13310
+ "application/json": components["schemas"]["ErrorResponse"];
13311
+ };
13312
+ };
13313
+ 401: {
13314
+ headers: {
13315
+ [name: string]: unknown;
13316
+ };
13317
+ content: {
13318
+ "application/json": components["schemas"]["ErrorResponse"];
13319
+ };
13320
+ };
13321
+ 403: {
13322
+ headers: {
13323
+ [name: string]: unknown;
13324
+ };
13325
+ content: {
13326
+ "application/json": components["schemas"]["ErrorResponse"];
13327
+ };
13328
+ };
13329
+ 409: {
13330
+ headers: {
13331
+ [name: string]: unknown;
13332
+ };
13333
+ content: {
13334
+ "application/json": components["schemas"]["ErrorResponse"];
13335
+ };
13336
+ };
13337
+ 429: {
13338
+ headers: {
13339
+ [name: string]: unknown;
13340
+ };
13341
+ content: {
13342
+ "application/json": components["schemas"]["ErrorResponse"];
13343
+ };
13344
+ };
13345
+ 503: {
13346
+ headers: {
13347
+ [name: string]: unknown;
13348
+ };
13349
+ content: {
13350
+ "application/json": components["schemas"]["ErrorResponse"];
13351
+ };
13352
+ };
13353
+ };
13354
+ }, {
13355
+ body: {
13356
+ batchId: string;
13357
+ purchaseDate?: string;
13358
+ taxShipTotal?: number;
13359
+ notes?: string;
13360
+ items: components["schemas"]["CatalogInventoryBatchItem"][];
13361
+ };
13362
+ }, `${string}/${string}`>>;
13363
+ /** Atomically commit a reserved catalog batch by UUID, with no body. */
13364
+ commitCatalogBatch: (batchId: string) => Promise<openapi_fetch.FetchResponse<{
13365
+ parameters: {
13366
+ query?: never;
13367
+ header?: never;
13368
+ path: {
13369
+ batchId: string;
13370
+ };
13371
+ cookie?: never;
13372
+ };
13373
+ requestBody?: never;
13374
+ responses: {
13375
+ 200: {
13376
+ headers: {
13377
+ [name: string]: unknown;
13378
+ };
13379
+ content: {
13380
+ "application/json": components["schemas"]["CatalogInventoryBatchLifecycleResponse"];
13381
+ };
13382
+ };
13383
+ 400: {
13384
+ headers: {
13385
+ [name: string]: unknown;
13386
+ };
13387
+ content: {
13388
+ "application/json": components["schemas"]["ErrorResponse"];
13389
+ };
13390
+ };
13391
+ 401: {
13392
+ headers: {
13393
+ [name: string]: unknown;
13394
+ };
13395
+ content: {
13396
+ "application/json": components["schemas"]["ErrorResponse"];
13397
+ };
13398
+ };
13399
+ 403: {
13400
+ headers: {
13401
+ [name: string]: unknown;
13402
+ };
13403
+ content: {
13404
+ "application/json": components["schemas"]["ErrorResponse"];
13405
+ };
13406
+ };
13407
+ 404: {
13408
+ headers: {
13409
+ [name: string]: unknown;
13410
+ };
13411
+ content: {
13412
+ "application/json": components["schemas"]["ErrorResponse"];
13413
+ };
13414
+ };
13415
+ 429: {
13416
+ headers: {
13417
+ [name: string]: unknown;
13418
+ };
13419
+ content: {
13420
+ "application/json": components["schemas"]["ErrorResponse"];
13421
+ };
13422
+ };
13423
+ 503: {
13424
+ headers: {
13425
+ [name: string]: unknown;
13426
+ };
13427
+ content: {
13428
+ "application/json": components["schemas"]["ErrorResponse"];
13429
+ };
13430
+ };
13431
+ };
13432
+ }, {
13433
+ params: {
13434
+ path: {
13435
+ batchId: string;
13436
+ };
13437
+ };
13438
+ }, `${string}/${string}`>>;
13439
+ /** Recover the owner-scoped lifecycle; missing batches remain unknown. */
13440
+ getCatalogBatchStatus: (batchId: string) => Promise<openapi_fetch.FetchResponse<{
13441
+ parameters: {
13442
+ query?: never;
13443
+ header?: never;
13444
+ path: {
13445
+ batchId: string;
13446
+ };
13447
+ cookie?: never;
13448
+ };
13449
+ requestBody?: never;
13450
+ responses: {
13451
+ 200: {
13452
+ headers: {
13453
+ [name: string]: unknown;
13454
+ };
13455
+ content: {
13456
+ "application/json": components["schemas"]["CatalogInventoryBatchLifecycleResponse"];
13457
+ };
13458
+ };
13459
+ 400: {
13460
+ headers: {
13461
+ [name: string]: unknown;
13462
+ };
13463
+ content: {
13464
+ "application/json": components["schemas"]["ErrorResponse"];
13465
+ };
13466
+ };
13467
+ 401: {
13468
+ headers: {
13469
+ [name: string]: unknown;
13470
+ };
13471
+ content: {
13472
+ "application/json": components["schemas"]["ErrorResponse"];
13473
+ };
13474
+ };
13475
+ 403: {
13476
+ headers: {
13477
+ [name: string]: unknown;
13478
+ };
13479
+ content: {
13480
+ "application/json": components["schemas"]["ErrorResponse"];
13481
+ };
13482
+ };
13483
+ 503: {
13484
+ headers: {
13485
+ [name: string]: unknown;
13486
+ };
13487
+ content: {
13488
+ "application/json": components["schemas"]["ErrorResponse"];
13489
+ };
13490
+ };
13491
+ };
13492
+ }, {
13493
+ params: {
13494
+ path: {
13495
+ batchId: string;
13496
+ };
13497
+ };
13498
+ }, `${string}/${string}`>>;
12538
13499
  /**
12539
13500
  * Update one of the caller's own inventory rows. Pass `ifMatch` (the
12540
13501
  * row's `last_updated`) to enable optimistic concurrency (409 on mismatch).
@@ -14192,4 +15153,4 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
14192
15153
  };
14193
15154
  type ParchmentClient = ReturnType<typeof createParchmentClient>;
14194
15155
 
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 };
15156
+ export { type AccountDeletionOperation, type AccountDeletionRequest, type BillingCheckoutCreateRequest, type BillingCheckoutSession, type BillingManualEntitlementsRequest, type BillingSubscriptionMutationRequest, type BillingSubscriptionOperation, type BriefMatchesQuery, type CatalogInventoryBatchLifecycle, type CatalogInventoryBatchReserveRequest, type CatalogInventoryBatchResult, 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 };