@omni-commerce/cli 0.14.0 → 0.15.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/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # @omni-commerce/cli
2
2
 
3
- CLI 0.14.0 adds `omni products bulk-update`, `bulk-update-status`, and `bulk-update-options` for the same durable price and stock file workflow as Omni Bulk Update.
3
+ CLI 0.15.0 supports multiple order, return, and job IDs in batch flags and adds `omni returns upload-evidence`.
4
+
5
+ CLI 0.14.1 adds `omni products bulk-update`, `bulk-update-status`, and `bulk-update-options` for the same durable price and stock file workflow as Omni Bulk Update.
4
6
 
5
7
  CLI 0.13.0 adds duplicate discovery, master eligibility and server-side merge dry runs. Use `products scan-duplicates`, `get-duplicate-scan`,
6
8
  `list --status duplicates --duplicate-type sku --detail full`,
package/dist/index.js CHANGED
@@ -84,7 +84,7 @@ async function openBrowser(url) {
84
84
  }
85
85
 
86
86
  // src/version.ts
87
- var CLI_VERSION = "0.13.0";
87
+ var CLI_VERSION = "0.15.0";
88
88
 
89
89
  // src/browser-login.ts
90
90
  function loginOrigin(baseUrl) {
@@ -2419,7 +2419,8 @@ var COMMANDS = [
2419
2419
  name: "productIds",
2420
2420
  flag: "product-ids",
2421
2421
  required: false,
2422
- source: "query"
2422
+ source: "query",
2423
+ queryArray: true
2423
2424
  },
2424
2425
  {
2425
2426
  name: "query",
@@ -2431,25 +2432,29 @@ var COMMANDS = [
2431
2432
  name: "marketplace",
2432
2433
  flag: "marketplace",
2433
2434
  required: false,
2434
- source: "query"
2435
+ source: "query",
2436
+ queryArray: true
2435
2437
  },
2436
2438
  {
2437
2439
  name: "country",
2438
2440
  flag: "country",
2439
2441
  required: false,
2440
- source: "query"
2442
+ source: "query",
2443
+ queryArray: true
2441
2444
  },
2442
2445
  {
2443
2446
  name: "storeIds",
2444
2447
  flag: "store-ids",
2445
2448
  required: false,
2446
- source: "query"
2449
+ source: "query",
2450
+ queryArray: true
2447
2451
  },
2448
2452
  {
2449
2453
  name: "unlistedMarketplaces",
2450
2454
  flag: "unlisted-marketplaces",
2451
2455
  required: false,
2452
- source: "query"
2456
+ source: "query",
2457
+ queryArray: true
2453
2458
  },
2454
2459
  {
2455
2460
  name: "groupBy",
@@ -3031,7 +3036,7 @@ var COMMANDS = [
3031
3036
  httpMethod: "GET",
3032
3037
  path: "/api/v1/orders/{orderId}/action-options",
3033
3038
  summary: "Get Order Action Options",
3034
- description: "Ask the marketplace which choices an action needs, such as pickup or drop-off for `ship`. Requires `orders:write`.\n\nSend the chosen choice's `payload` with `POST /api/v1/orders/{orderId}/actions`.",
3039
+ description: "Read marketplace choices for this order, including seller cancellation reasons for `action=cancel`. Eligible orders can include orders awaiting carrier collection. Requires `orders:write`.\n\nReview the selected reason or fulfillment choice and send its exact `payload` with `POST /api/v1/orders/{orderId}/actions`.",
3035
3040
  flags: [
3036
3041
  {
3037
3042
  name: "orderId",
@@ -3063,7 +3068,7 @@ var COMMANDS = [
3063
3068
  httpMethod: "GET",
3064
3069
  path: "/api/v1/orders/{orderId}/actions",
3065
3070
  summary: "List Order Actions",
3066
- description: "The order's 20 most recent action jobs, newest first, plus its latest successful label job. Requires `orders:read`.\n\nPoll this after queueing an action. A succeeded `labels` job lists its label files in `labels`.",
3071
+ description: "The order's 20 most recent action jobs, newest first, plus its latest successful label job. Requires `orders:read`.\n\nAfter submission, find the returned job ID here. Read its status for the marketplace outcome and `errorMessage` for failures. A succeeded `labels` job lists its label files in `labels`.",
3067
3072
  flags: [
3068
3073
  {
3069
3074
  name: "orderId",
@@ -3089,7 +3094,7 @@ var COMMANDS = [
3089
3094
  httpMethod: "POST",
3090
3095
  path: "/api/v1/orders/{orderId}/actions",
3091
3096
  summary: "Queue Order Action",
3092
- description: "Ship, cancel, generate shipping labels for, or update tracking on a marketplace order. Requires `orders:write`.\n\nThe marketplace call runs in the background: the response is `202` with `jobId`; poll `GET /api/v1/orders/{orderId}/actions`. A repeated `idempotencyKey` returns `200` with the original job.",
3097
+ description: "Ship, cancel, generate shipping labels for, or update tracking on a marketplace order. Requires `orders:write`.\n\nFor `cancel`, send the exact payload of a reviewed cancellation reason from the action options endpoint. The marketplace call runs in the background. The `202` response provides a `jobId`. Poll `GET /api/v1/orders/{orderId}/actions` for its outcome. A repeated `idempotencyKey` with the same request returns `200` with the original job.",
3093
3098
  flags: [
3094
3099
  {
3095
3100
  name: "orderId",
@@ -3109,13 +3114,14 @@ var COMMANDS = [
3109
3114
  httpMethod: "GET",
3110
3115
  path: "/api/v1/orders/actions",
3111
3116
  summary: "Check Order Action Options",
3112
- description: "### Authorization\n\nRequires orders:write.\n\n### Choices\n\nRead current marketplace choices for ship, cancel, labels or update_tracking for 1\u201350 order UUIDs using repeated orderIds query parameters. The shared order service checks status, store connection and marketplace capability. Results preserve first-requested order, with explicit per-order errors. Use the exact choice payload and supply any fields marked requiresInput. An unsupported marketplace operation is an explicit failure, not a silently skipped order. Ship arranges shipment; labels generates printable files. Fulfillment behavior is identical to the existing single-order API and workspace UI.",
3117
+ description: "### Authorization\n\nRequires orders:write.\n\n### Choices\n\nRead marketplace choices for `ship`, `cancel`, `labels`, or `update_tracking` for 1\u201350 UUIDs using repeated `orderIds` parameters. Results preserve first-requested order and report any per-order eligibility or capability errors. For `cancel`, review an available reason for each order and use its exact `payload`. Orders awaiting collection can be eligible when the marketplace permits it. For other actions, supply any fields marked `requiresInput`.",
3113
3118
  flags: [
3114
3119
  {
3115
3120
  name: "orderIds",
3116
3121
  flag: "order-ids",
3117
3122
  required: true,
3118
- source: "query"
3123
+ source: "query",
3124
+ queryArray: true
3119
3125
  },
3120
3126
  {
3121
3127
  name: "action",
@@ -3141,7 +3147,7 @@ var COMMANDS = [
3141
3147
  httpMethod: "POST",
3142
3148
  path: "/api/v1/orders/actions",
3143
3149
  summary: "Process Order Actions",
3144
- description: "### Authorization\n\nRequires orders:write.\n\n### Batch submission\n\nQueue 1\u201350 distinct order operations with a UUID requestId. Each operation has orderId, action (ship, cancel, labels or update_tracking), and optional payload. Use exact marketplace choices from GET /api/v1/orders/actions and supply required carrier, tracking, pickup/drop-off or cancellation details. One operation per order is allowed in a batch; later stages such as labels after shipment require another submission. All targets are authorized before any enqueue. Per-order failures are isolated; results retain request order and include every accepted jobId. data.success means all submissions were accepted, not that marketplace processing finished.\n\n### Recovery and completion\n\nRetain requestId and unchanged operations for retries; a changed operation with a reused key fails that target. Follow links.poll or GET /api/v1/orders/actions/jobs with every returned jobId (orders:read). The durable worker rechecks initiating permissions before marketplace writes. Label jobs return download URLs after success; the API does not control a physical printer. Completed jobs and partial failures remain explicit.",
3150
+ description: "### Authorization\n\nRequires orders:write.\n\n### Batch submission\n\nQueue 1\u201350 distinct orders with a UUID `requestId` and one operation per order. Each operation carries an `orderId`, `action`, and any marketplace inputs in `payload`. For `cancel`, send the reviewed reason's exact payload from GET /api/v1/orders/actions. All targets are authorized before enqueue. Per-order results preserve request order and report acceptance or errors.\n\nRetain `requestId` and unchanged operations for retries. Follow `links.poll` with every returned job ID to check the marketplace outcomes. The worker rechecks permissions before each marketplace write.",
3145
3151
  flags: [],
3146
3152
  acceptsJsonBody: true,
3147
3153
  acceptsFile: false,
@@ -3154,13 +3160,14 @@ var COMMANDS = [
3154
3160
  httpMethod: "GET",
3155
3161
  path: "/api/v1/orders/actions/jobs",
3156
3162
  summary: "Get Order Action Jobs",
3157
- description: "### Authorization\n\nRequires orders:read.\n\n### Outcomes and labels\n\nRead every requested order action job in one batch of 1\u201350 UUIDs using repeated jobIds parameters. Results preserve first-requested order. data.success is true only when every requested job succeeded; failedCount includes failed and not_supported, while pendingCount includes queued and running. Successful label jobs contain downloadable files in labels[]. A missing or cross-organization job returns 404; current store restrictions apply to all targets. The top-level completed status describes the lookup, not job completion. No raw provider acknowledgements are exposed.",
3163
+ description: "### Authorization\n\nRequires orders:read.\n\n### Outcomes and labels\n\nRead 1\u201350 jobs using repeated `jobIds` parameters. Results preserve first-requested order. `data.success` requires every job to succeed. `pendingCount` includes queued and running jobs. `failedCount` includes failed and unsupported jobs. Amazon cancellations can stay running while its feed is processed. Successful label jobs return download links. A missing or cross-organization job returns 404. Current store restrictions apply.",
3158
3164
  flags: [
3159
3165
  {
3160
3166
  name: "jobIds",
3161
3167
  flag: "job-ids",
3162
3168
  required: true,
3163
- source: "query"
3169
+ source: "query",
3170
+ queryArray: true
3164
3171
  },
3165
3172
  {
3166
3173
  name: "organizationId",
@@ -3777,7 +3784,7 @@ var COMMANDS = [
3777
3784
  httpMethod: "GET",
3778
3785
  path: "/api/v1/products/bulk-update",
3779
3786
  summary: "Get Bulk Product Update Options",
3780
- description: "List the same active stock-file-capable sources as Omni Bulk Update, including manual warehouses and supported CSV sources. Requires catalog:read and inventory.read. Resolve a sourceId from this organization-scoped result before starting inventory/both updates; an ambiguous choice requires seller selection.",
3787
+ description: "List active stock-file sources used by Omni Bulk Update, including manual warehouses and supported CSV sources. Requires catalog:read and inventory.read.\n\nUse an eligible sourceId before starting inventory updates. Ask the seller to choose when multiple sources are eligible.",
3781
3788
  flags: [
3782
3789
  {
3783
3790
  name: "organizationId",
@@ -3797,7 +3804,7 @@ var COMMANDS = [
3797
3804
  httpMethod: "POST",
3798
3805
  path: "/api/v1/products/bulk-update",
3799
3806
  summary: "Bulk Update Product Prices and Stock",
3800
- description: "Update existing catalog SKUs from 1\u201310 uploaded CSV/Excel documentIds (up to 10,000 rows per file), using the same price and inventory import services as Omni Bulk Update. Requires catalog:write and the corresponding product/inventory capabilities. No product creation. Exact SKU matching rejects duplicate/ambiguous and unknown SKUs; zero values are preserved. Inventory requires an authorized manual/CSV sourceId or locationId. Explicit column names override detection. syncToMarketplaces defaults true; optional marketplaces restricts existing listing sync across supported platforms. Returns ordered per-document results and saved imports references. Updates continue through the durable file-update workflow beyond the caller lifetime; acceptance is not completion. Pass every returned reference to products.bulkUpdateStatus. Inventory apply means source balances saved and sync queued, not marketplace verification.",
3807
+ description: "Update existing catalog SKUs from 1\u201310 uploaded CSV or Excel documentIds, with up to 10,000 rows per file. Requires catalog:write and the corresponding product or inventory capabilities.\n\n### File and source selection\n\nExact SKU matching preserves zero values and rejects duplicate, ambiguous, or unknown SKUs. Inventory needs an authorized manual or CSV sourceId or locationId. Explicit column names override detection. syncToMarketplaces defaults to true. Use marketplaces to limit which existing listings are synced.\n\n### Track the results\n\nPass every saved import reference to products.bulkUpdateStatus. Results preserve document order. The workflow runs after the request returns. Applied inventory means source balances were saved and listing sync was queued.",
3801
3808
  flags: [],
3802
3809
  acceptsJsonBody: true,
3803
3810
  acceptsFile: false,
@@ -3810,7 +3817,7 @@ var COMMANDS = [
3810
3817
  httpMethod: "POST",
3811
3818
  path: "/api/v1/products/bulk-update/status",
3812
3819
  summary: "Get Bulk Product Update Status",
3813
- description: "Read up to 20 typed saved imports in requested order. Requires catalog:read and the corresponding product/inventory read capabilities. IDs are deduplicated by kind and importId. Pending imports are incomplete; invalid/unknown rows and missing organization-scoped imports remain explicit failures. Compact by default; includeRows returns at most 100 rows per import using rowOffset/rowLimit. Catalog stock apply does not certify marketplace state.",
3820
+ description: "Read up to 20 saved imports in request order. Requires catalog:read and the corresponding product or inventory read capabilities. Imports are deduplicated by kind and importId.\n\nPending imports are incomplete. Results report invalid or unknown rows and missing organization-scoped imports. Use includeRows with rowOffset and rowLimit for up to 100 rows per import. The result describes saved catalog stock.",
3814
3821
  flags: [],
3815
3822
  acceptsJsonBody: true,
3816
3823
  acceptsFile: false,
@@ -4563,6 +4570,32 @@ var COMMANDS = [
4563
4570
  acceptsFile: false,
4564
4571
  bodyRequired: false
4565
4572
  },
4573
+ {
4574
+ trail: ["returns", "upload-evidence"],
4575
+ resourcePath: ["returns"],
4576
+ methodName: "uploadEvidence",
4577
+ httpMethod: "POST",
4578
+ path: "/api/v1/returns/{returnId}/evidence",
4579
+ summary: "Upload Return Rejection Evidence",
4580
+ description: "Requires `orders:write`. For a rejection choice with `input.evidenceUpload: true`, upload one JPEG or PNG image up to 5 MB.\n\nUse the receipt and filename in `input.evidence` when submitting the reviewed rejection. A rejection can include up to six images. Each receipt is scoped to its return and expires after 24 hours.",
4581
+ flags: [
4582
+ {
4583
+ name: "returnId",
4584
+ flag: "return-id",
4585
+ required: true,
4586
+ source: "path"
4587
+ },
4588
+ {
4589
+ name: "organizationId",
4590
+ flag: "organization-id",
4591
+ required: false,
4592
+ source: "query"
4593
+ }
4594
+ ],
4595
+ acceptsJsonBody: true,
4596
+ acceptsFile: true,
4597
+ bodyRequired: true
4598
+ },
4566
4599
  {
4567
4600
  trail: ["returns", "list-actions"],
4568
4601
  resourcePath: ["returns"],
@@ -4576,7 +4609,8 @@ var COMMANDS = [
4576
4609
  name: "returnIds",
4577
4610
  flag: "return-ids",
4578
4611
  required: true,
4579
- source: "query"
4612
+ source: "query",
4613
+ queryArray: true
4580
4614
  },
4581
4615
  {
4582
4616
  name: "organizationId",
@@ -4615,7 +4649,8 @@ var COMMANDS = [
4615
4649
  name: "jobIds",
4616
4650
  flag: "job-ids",
4617
4651
  required: true,
4618
- source: "query"
4652
+ source: "query",
4653
+ queryArray: true
4619
4654
  },
4620
4655
  {
4621
4656
  name: "organizationId",
@@ -4641,7 +4676,8 @@ var COMMANDS = [
4641
4676
  name: "orderIds",
4642
4677
  flag: "order-ids",
4643
4678
  required: true,
4644
- source: "query"
4679
+ source: "query",
4680
+ queryArray: true
4645
4681
  },
4646
4682
  {
4647
4683
  name: "organizationId",
@@ -5538,7 +5574,8 @@ var COMMANDS = [
5538
5574
  name: "productSetIds",
5539
5575
  flag: "product-set-ids",
5540
5576
  required: true,
5541
- source: "query"
5577
+ source: "query",
5578
+ queryArray: true
5542
5579
  }
5543
5580
  ],
5544
5581
  acceptsJsonBody: false,
@@ -6854,7 +6891,8 @@ function printAuthHelp() {
6854
6891
  function printCommandHelp(command2) {
6855
6892
  const flags = command2.flags.map((flag) => {
6856
6893
  const req = flag.required ? "required" : "optional";
6857
- return ` --${flag.flag} <${flag.name}> ${req} ${flag.source}`;
6894
+ const input2 = flag.queryArray ? "value[,value...]" : flag.name;
6895
+ return ` --${flag.flag} <${input2}> ${req} ${flag.source}`;
6858
6896
  }).join("\n");
6859
6897
  const jsonLine = `${command2.acceptsFile ? " --file <path> required file to upload\n" : ""}${command2.acceptsJsonBody && !isCampaignCommand(command2) ? ` --json <object|-> ${command2.bodyRequired && !command2.acceptsFile ? "required" : "optional"} body
6860
6898
  ` : ""}`;
@@ -6916,7 +6954,7 @@ function buildRequest(command2, flags, body) {
6916
6954
  }
6917
6955
  continue;
6918
6956
  }
6919
- request[flag.name] = value;
6957
+ request[flag.name] = flag.queryArray ? value.split(",").map((item) => item.trim()) : value;
6920
6958
  }
6921
6959
  return request;
6922
6960
  }