@purveyors/sdk 0.58.0 → 0.59.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.js CHANGED
@@ -405,6 +405,39 @@ function createParchmentClient(options) {
405
405
  */
406
406
  delete: (id) => client.DELETE("/v1/inventory/{id}", { params: { path: { id } } })
407
407
  },
408
+ /**
409
+ * Roast batches: roasting sessions with their own id. Batch names may
410
+ * repeat, so roasts, sales, and deletes refer to a batch by id.
411
+ */
412
+ roastBatches: {
413
+ /** List the caller's batches, newest batch date first. */
414
+ list: (query) => client.GET("/v1/roast-batches", { params: { query } }),
415
+ /** Fetch one of the caller's batches with the ids of its roasts. */
416
+ get: (batchId) => client.GET("/v1/roast-batches/{batchId}", {
417
+ params: { path: { batchId } }
418
+ }),
419
+ /**
420
+ * Create a batch and, when `items` are given, its roasts, atomically.
421
+ * Always creates a new batch. Omit `items` to open a batch for a
422
+ * session, then pass its id as `batchId` when creating each roast.
423
+ */
424
+ create: (body, idempotencyKey) => client.POST("/v1/roast-batches", {
425
+ body,
426
+ params: { header: { "idempotency-key": idempotencyKey } }
427
+ }),
428
+ /** Rename or re-date a batch. The name carries to its roasts and sales. */
429
+ update: (batchId, body) => client.PATCH("/v1/roast-batches/{batchId}", {
430
+ params: { path: { batchId } },
431
+ body
432
+ }),
433
+ /**
434
+ * Delete one batch and the roasts in it. No other batch is touched,
435
+ * whatever its name. Sales keep their record and lose the link.
436
+ */
437
+ delete: (batchId) => client.DELETE("/v1/roast-batches/{batchId}", {
438
+ params: { path: { batchId } }
439
+ })
440
+ },
408
441
  roasts: {
409
442
  /** Match Artisan roast metadata to one of the supplied inventory rows. */
410
443
  classify: (body) => client.POST("/v1/roasts/classify", { body }),
@@ -432,6 +465,10 @@ function createParchmentClient(options) {
432
465
  /**
433
466
  * Create every profile in one named batch atomically. The required
434
467
  * payload-bound idempotency key makes transport retries safe.
468
+ *
469
+ * @deprecated Use {@link ParchmentClient.roastBatches.create}, which
470
+ * returns a batch id. This places the roasts in the batch with the same
471
+ * name on the roast date, starting it when none exists.
435
472
  */
436
473
  createBatch: (body, idempotencyKey) => client.POST("/v1/roasts/batches", {
437
474
  body,
@@ -450,7 +487,13 @@ function createParchmentClient(options) {
450
487
  }),
451
488
  /** Delete one of the caller's own roast profiles. */
452
489
  delete: (id) => client.DELETE("/v1/roasts/{id}", { params: { path: { id } } }),
453
- /** Delete every owner roast carrying one exact batch name. Session-only. */
490
+ /**
491
+ * Delete the one batch carrying an exact name. A name carried by several
492
+ * batches is refused with 409 `batch_name_ambiguous`, listing them.
493
+ * Session-only.
494
+ *
495
+ * @deprecated Use {@link ParchmentClient.roastBatches.delete}.
496
+ */
454
497
  deleteBatch: (batchName) => client.DELETE("/v1/roasts/batches/{batchName}", {
455
498
  params: { path: { batchName } }
456
499
  }),
@@ -931,6 +974,26 @@ var CHAT_AGENT_CAPABILITY_EXCLUSIONS = {
931
974
  reason: "write_not_agent_facing",
932
975
  note: "Destructive; no confirmed action."
933
976
  },
977
+ "roastBatches.list": {
978
+ reason: "read_not_wired",
979
+ note: "Roast tools return each roast's batch_id; a batch lookup tool follows with the sale-by-batch confirmed action."
980
+ },
981
+ "roastBatches.get": {
982
+ reason: "read_not_wired",
983
+ note: "Roast tools return each roast's batch_id; a batch lookup tool follows with the sale-by-batch confirmed action."
984
+ },
985
+ "roastBatches.create": {
986
+ reason: "write_not_agent_facing",
987
+ note: "Opens a batch for a roasting session; confirmed action create_roast_session creates single roasts."
988
+ },
989
+ "roastBatches.update": {
990
+ reason: "write_not_agent_facing",
991
+ note: "Renames a batch across its roasts and sales; no confirmed action."
992
+ },
993
+ "roastBatches.delete": {
994
+ reason: "write_not_agent_facing",
995
+ note: "Destructive; no confirmed action."
996
+ },
934
997
  "roasts.classify": {
935
998
  reason: "read_not_wired",
936
999
  note: "Artisan import matching helper for upload flows."
@@ -941,7 +1004,7 @@ var CHAT_AGENT_CAPABILITY_EXCLUSIONS = {
941
1004
  },
942
1005
  "roasts.createBatch": {
943
1006
  reason: "write_not_agent_facing",
944
- note: "Bulk roast creation; no confirmed action."
1007
+ note: "Deprecated name-based bulk roast creation; no confirmed action."
945
1008
  },
946
1009
  "roasts.update": {
947
1010
  reason: "confirmed_action_write",
@@ -953,7 +1016,7 @@ var CHAT_AGENT_CAPABILITY_EXCLUSIONS = {
953
1016
  },
954
1017
  "roasts.deleteBatch": {
955
1018
  reason: "write_not_agent_facing",
956
- note: "Destructive; no confirmed action."
1019
+ note: "Deprecated name-based delete; destructive; no confirmed action."
957
1020
  },
958
1021
  "roasts.replaceLiveCurve": {
959
1022
  reason: "write_not_agent_facing",