@omni-commerce/cli 0.14.1 → 0.16.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 +4 -0
- package/dist/index.js +87 -32
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# @omni-commerce/cli
|
|
2
2
|
|
|
3
|
+
CLI 0.16.0 supports marketplace-only bulk import and enrichment, including CSV uploads. Use `omni products assign-marketplace-stores` to save stores before publishing.
|
|
4
|
+
|
|
5
|
+
CLI 0.15.0 supports multiple order, return, and job IDs in batch flags and adds `omni returns upload-evidence`.
|
|
6
|
+
|
|
3
7
|
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
8
|
|
|
5
9
|
CLI 0.13.0 adds duplicate discovery, master eligibility and server-side merge dry runs. Use `products scan-duplicates`, `get-duplicate-scan`,
|
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.
|
|
87
|
+
var CLI_VERSION = "0.16.0";
|
|
88
88
|
|
|
89
89
|
// src/browser-login.ts
|
|
90
90
|
function loginOrigin(baseUrl) {
|
|
@@ -266,7 +266,8 @@ async function uploadBody(filePath, fields2) {
|
|
|
266
266
|
const type = UPLOAD_CONTENT_TYPES[extname(filePath).toLowerCase()] ?? "application/octet-stream";
|
|
267
267
|
form.append(
|
|
268
268
|
"file",
|
|
269
|
-
new
|
|
269
|
+
new Blob([await readFile2(filePath)], { type }),
|
|
270
|
+
basename(filePath)
|
|
270
271
|
);
|
|
271
272
|
for (const [key, value] of Object.entries(fields2)) {
|
|
272
273
|
if (value === void 0 || value === null) continue;
|
|
@@ -307,7 +308,7 @@ async function executeCommand(client, command2, request) {
|
|
|
307
308
|
for (const [key, value] of Object.entries(request)) {
|
|
308
309
|
if (!consumed.has(key)) body[key] = value;
|
|
309
310
|
}
|
|
310
|
-
if (command2.acceptsFile) {
|
|
311
|
+
if (command2.acceptsFile && (!command2.fileOptional || body.file !== void 0)) {
|
|
311
312
|
const { file, ...fields2 } = body;
|
|
312
313
|
return client.request({
|
|
313
314
|
method: command2.httpMethod,
|
|
@@ -2419,7 +2420,8 @@ var COMMANDS = [
|
|
|
2419
2420
|
name: "productIds",
|
|
2420
2421
|
flag: "product-ids",
|
|
2421
2422
|
required: false,
|
|
2422
|
-
source: "query"
|
|
2423
|
+
source: "query",
|
|
2424
|
+
queryArray: true
|
|
2423
2425
|
},
|
|
2424
2426
|
{
|
|
2425
2427
|
name: "query",
|
|
@@ -2431,25 +2433,29 @@ var COMMANDS = [
|
|
|
2431
2433
|
name: "marketplace",
|
|
2432
2434
|
flag: "marketplace",
|
|
2433
2435
|
required: false,
|
|
2434
|
-
source: "query"
|
|
2436
|
+
source: "query",
|
|
2437
|
+
queryArray: true
|
|
2435
2438
|
},
|
|
2436
2439
|
{
|
|
2437
2440
|
name: "country",
|
|
2438
2441
|
flag: "country",
|
|
2439
2442
|
required: false,
|
|
2440
|
-
source: "query"
|
|
2443
|
+
source: "query",
|
|
2444
|
+
queryArray: true
|
|
2441
2445
|
},
|
|
2442
2446
|
{
|
|
2443
2447
|
name: "storeIds",
|
|
2444
2448
|
flag: "store-ids",
|
|
2445
2449
|
required: false,
|
|
2446
|
-
source: "query"
|
|
2450
|
+
source: "query",
|
|
2451
|
+
queryArray: true
|
|
2447
2452
|
},
|
|
2448
2453
|
{
|
|
2449
2454
|
name: "unlistedMarketplaces",
|
|
2450
2455
|
flag: "unlisted-marketplaces",
|
|
2451
2456
|
required: false,
|
|
2452
|
-
source: "query"
|
|
2457
|
+
source: "query",
|
|
2458
|
+
queryArray: true
|
|
2453
2459
|
},
|
|
2454
2460
|
{
|
|
2455
2461
|
name: "groupBy",
|
|
@@ -2487,7 +2493,7 @@ var COMMANDS = [
|
|
|
2487
2493
|
httpMethod: "GET",
|
|
2488
2494
|
path: "/api/v1/jobs/{jobId}",
|
|
2489
2495
|
summary: "Get Developer Job Status",
|
|
2490
|
-
description: "Fetch shared async status for developer-platform operations, including product workflow jobs, bulk CSV import jobs, Look generation jobs, import jobs, enrichment jobs, price comparison jobs, and sync jobs.\n\nPrice comparison jobs expose partial progress in data.results and their final batch result in data.result; completed means processing finished, so inspect data.result.success for comparison failures.",
|
|
2496
|
+
description: "Fetch shared async status for developer-platform operations, including product workflow jobs, bulk CSV import jobs, Look generation jobs, import jobs, enrichment jobs, price comparison jobs, and sync jobs.\n\nMarketplace-only bulk imports expose data.deferStoreSelection: true. For imports with automatic publishing enabled, inspect data.publishing for per-store results.\n\nPrice comparison jobs expose partial progress in data.results and their final batch result in data.result; completed means processing finished, so inspect data.result.success for comparison failures.",
|
|
2491
2497
|
flags: [
|
|
2492
2498
|
{
|
|
2493
2499
|
name: "jobId",
|
|
@@ -3031,7 +3037,7 @@ var COMMANDS = [
|
|
|
3031
3037
|
httpMethod: "GET",
|
|
3032
3038
|
path: "/api/v1/orders/{orderId}/action-options",
|
|
3033
3039
|
summary: "Get Order Action Options",
|
|
3034
|
-
description: "
|
|
3040
|
+
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
3041
|
flags: [
|
|
3036
3042
|
{
|
|
3037
3043
|
name: "orderId",
|
|
@@ -3063,7 +3069,7 @@ var COMMANDS = [
|
|
|
3063
3069
|
httpMethod: "GET",
|
|
3064
3070
|
path: "/api/v1/orders/{orderId}/actions",
|
|
3065
3071
|
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\
|
|
3072
|
+
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
3073
|
flags: [
|
|
3068
3074
|
{
|
|
3069
3075
|
name: "orderId",
|
|
@@ -3089,7 +3095,7 @@ var COMMANDS = [
|
|
|
3089
3095
|
httpMethod: "POST",
|
|
3090
3096
|
path: "/api/v1/orders/{orderId}/actions",
|
|
3091
3097
|
summary: "Queue Order Action",
|
|
3092
|
-
description: "Ship, cancel, generate shipping labels for, or update tracking on a marketplace order. Requires `orders:write`.\n\
|
|
3098
|
+
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
3099
|
flags: [
|
|
3094
3100
|
{
|
|
3095
3101
|
name: "orderId",
|
|
@@ -3109,13 +3115,14 @@ var COMMANDS = [
|
|
|
3109
3115
|
httpMethod: "GET",
|
|
3110
3116
|
path: "/api/v1/orders/actions",
|
|
3111
3117
|
summary: "Check Order Action Options",
|
|
3112
|
-
description: "### Authorization\n\nRequires orders:write.\n\n### Choices\n\nRead
|
|
3118
|
+
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
3119
|
flags: [
|
|
3114
3120
|
{
|
|
3115
3121
|
name: "orderIds",
|
|
3116
3122
|
flag: "order-ids",
|
|
3117
3123
|
required: true,
|
|
3118
|
-
source: "query"
|
|
3124
|
+
source: "query",
|
|
3125
|
+
queryArray: true
|
|
3119
3126
|
},
|
|
3120
3127
|
{
|
|
3121
3128
|
name: "action",
|
|
@@ -3141,7 +3148,7 @@ var COMMANDS = [
|
|
|
3141
3148
|
httpMethod: "POST",
|
|
3142
3149
|
path: "/api/v1/orders/actions",
|
|
3143
3150
|
summary: "Process Order Actions",
|
|
3144
|
-
description: "### Authorization\n\nRequires orders:write.\n\n### Batch submission\n\nQueue 1\u201350 distinct
|
|
3151
|
+
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
3152
|
flags: [],
|
|
3146
3153
|
acceptsJsonBody: true,
|
|
3147
3154
|
acceptsFile: false,
|
|
@@ -3154,13 +3161,14 @@ var COMMANDS = [
|
|
|
3154
3161
|
httpMethod: "GET",
|
|
3155
3162
|
path: "/api/v1/orders/actions/jobs",
|
|
3156
3163
|
summary: "Get Order Action Jobs",
|
|
3157
|
-
description: "### Authorization\n\nRequires orders:read.\n\n### Outcomes and labels\n\nRead
|
|
3164
|
+
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
3165
|
flags: [
|
|
3159
3166
|
{
|
|
3160
3167
|
name: "jobIds",
|
|
3161
3168
|
flag: "job-ids",
|
|
3162
3169
|
required: true,
|
|
3163
|
-
source: "query"
|
|
3170
|
+
source: "query",
|
|
3171
|
+
queryArray: true
|
|
3164
3172
|
},
|
|
3165
3173
|
{
|
|
3166
3174
|
name: "organizationId",
|
|
@@ -3725,10 +3733,11 @@ var COMMANDS = [
|
|
|
3725
3733
|
httpMethod: "POST",
|
|
3726
3734
|
path: "/api/v1/products/bulk-import",
|
|
3727
3735
|
summary: "Bulk Import Products from JSON or CSV",
|
|
3728
|
-
description: "Queue a bulk product import for the authenticated organization.\n\nSupply explicit SKU options in each row's `variationAttributes` and native marketplace attributes in `marketplaceAttributes`. Enrichment never infers SKU options. At Zalora publish time, a missing required Size defaults to One Size only when valid for the selected category and supplied size system. Supplied sizes are preserved; missing or incompatible size systems and other required options block publishing. Each row remains a standalone product; no child variants are created for the default.\n\n### Input options\n\n- Upload a CSV (2 MiB) or JSON products file (8 MiB) using `multipart/form-data`.\n- Send JSON with a `products` array of 1\u20135,000 flat product objects (8 MiB request maximum).\n- Send JSON with inline `csvText`.\n- Send JSON referencing a stored `documentId`.\n\n### Asynchronous result\n\nThe API creates import rows, then queues draft creation and AI Review through Inngest. Completed import jobs expose `reviewBatchIds`, `reviewUrls`, and `reviewWarnings`. Set workflow.autoApplyHighConfidence=true with independent workflow.enrichmentAutoApplyThreshold and workflow.taxonomyAutoApplyThreshold (0.62\u20131) to apply qualifying proposals; image changes still require visual approval. autoApproveThreshold is a separate import-row setting, not a Review threshold. Set workflow.publish=true to queue publication to saved stores after every required scope for a product is approved and applied. Both automatic and manual approval resume publishing. Pending, rejected, failed and cancelled scopes block that product while eligible products continue. Poll GET /api/v1/jobs/{jobId}; publishing includes ordered per-product/store receipts and verified publish-job status. Import completed does not mean published.\n\nCancel an in-flight import with `POST /api/v1/jobs/{jobId}/cancel`.",
|
|
3736
|
+
description: "Queue a bulk product import for the authenticated organization.\n\n### Destinations\n\nSupply targetMarketplaces and marketplaceStoreSelections to prepare for specific connected stores. Set deferStoreSelection=true to choose marketplaces only and assign stores later with POST /api/v1/products/marketplace-stores. Omit marketplaceStoreSelections and leave workflow.publish off when deferring. Automatic publishing requires catalog:sync in addition to catalog:write.\n\nSupply explicit SKU options in each row's `variationAttributes` and native marketplace attributes in `marketplaceAttributes`. Enrichment never infers SKU options. At Zalora publish time, a missing required Size defaults to One Size only when valid for the selected category and supplied size system. Supplied sizes are preserved; missing or incompatible size systems and other required options block publishing. Each row remains a standalone product; no child variants are created for the default.\n\n### Input options\n\n- Upload a CSV (2 MiB) or JSON products file (8 MiB) using `multipart/form-data`.\n- Send JSON with a `products` array of 1\u20135,000 flat product objects (8 MiB request maximum).\n- Send JSON with inline `csvText`.\n- Send JSON referencing a stored `documentId`.\n\n### Asynchronous result\n\nThe API creates import rows, then queues draft creation and AI Review through Inngest. Completed import jobs expose `reviewBatchIds`, `reviewUrls`, and `reviewWarnings`. Set workflow.autoApplyHighConfidence=true with independent workflow.enrichmentAutoApplyThreshold and workflow.taxonomyAutoApplyThreshold (0.62\u20131) to apply qualifying proposals; image changes still require visual approval. autoApproveThreshold is a separate import-row setting, not a Review threshold. Set workflow.publish=true to queue publication to saved stores after every required scope for a product is approved and applied. Both automatic and manual approval resume publishing. Pending, rejected, failed and cancelled scopes block that product while eligible products continue. Poll GET /api/v1/jobs/{jobId}; publishing includes ordered per-product/store receipts and verified publish-job status. Import completed does not mean published.\n\nCancel an in-flight import with `POST /api/v1/jobs/{jobId}/cancel`.",
|
|
3729
3737
|
flags: [],
|
|
3730
3738
|
acceptsJsonBody: true,
|
|
3731
|
-
acceptsFile:
|
|
3739
|
+
acceptsFile: true,
|
|
3740
|
+
fileOptional: true,
|
|
3732
3741
|
bodyRequired: true
|
|
3733
3742
|
},
|
|
3734
3743
|
{
|
|
@@ -3777,7 +3786,7 @@ var COMMANDS = [
|
|
|
3777
3786
|
httpMethod: "GET",
|
|
3778
3787
|
path: "/api/v1/products/bulk-update",
|
|
3779
3788
|
summary: "Get Bulk Product Update Options",
|
|
3780
|
-
description: "List
|
|
3789
|
+
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
3790
|
flags: [
|
|
3782
3791
|
{
|
|
3783
3792
|
name: "organizationId",
|
|
@@ -3797,7 +3806,7 @@ var COMMANDS = [
|
|
|
3797
3806
|
httpMethod: "POST",
|
|
3798
3807
|
path: "/api/v1/products/bulk-update",
|
|
3799
3808
|
summary: "Bulk Update Product Prices and Stock",
|
|
3800
|
-
description: "Update existing catalog SKUs from 1\u201310 uploaded CSV
|
|
3809
|
+
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
3810
|
flags: [],
|
|
3802
3811
|
acceptsJsonBody: true,
|
|
3803
3812
|
acceptsFile: false,
|
|
@@ -3810,7 +3819,7 @@ var COMMANDS = [
|
|
|
3810
3819
|
httpMethod: "POST",
|
|
3811
3820
|
path: "/api/v1/products/bulk-update/status",
|
|
3812
3821
|
summary: "Get Bulk Product Update Status",
|
|
3813
|
-
description: "Read up to 20
|
|
3822
|
+
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
3823
|
flags: [],
|
|
3815
3824
|
acceptsJsonBody: true,
|
|
3816
3825
|
acceptsFile: false,
|
|
@@ -4062,7 +4071,20 @@ var COMMANDS = [
|
|
|
4062
4071
|
httpMethod: "POST",
|
|
4063
4072
|
path: "/api/v1/products/enrich",
|
|
4064
4073
|
summary: "Queue Product Enrichment",
|
|
4065
|
-
description: "Requires catalog:enrich. Queue content enrichment for 1\u20131,000 existing Omni product IDs across all supported marketplaces. Returns 202 after queue submission without awaiting AI completion or publication.\n\n### Enrichment options\n\nFields, instructions and auto-apply settings use the canonical enrichment service. Exclude name from selectedFields to preserve titles. Weight and dimensions are always included; images are not queued here. Optional marketplaceStoreSelections maps each marketplace to an array of connected store IDs. Multiple stores on one marketplace get independent category and attribute reviews in the same review group. Set includeListingCopy=false for taxonomy only. Store countries come from the authenticated organization connections.\n\nautoApplyHighConfidence defaults to false. Independent enrichmentAutoApplyThreshold and taxonomyAutoApplyThreshold accept 0.62\u20131; omitted thresholds use organization settings. Low-confidence or blocked proposals remain in Review. AI usage is billed to the authenticated organization.\n\n### Publishing after approval\n\nSet publish=true (default false) to queue publishing after every required Review scope is approved and applied. This additionally requires catalog:write. Automatic and manual approvals use the same durable continuation. Selected stores are captured at queue time; without explicit destinations the product's saved marketplace assignments are used. Pending, rejected, failed or cancelled scopes block that product while eligible products continue. Accepted publish jobs are distinct from successful marketplace publication. Open links.review to inspect reviews and per-store publishing receipts.",
|
|
4074
|
+
description: "Requires catalog:enrich. Queue content enrichment for 1\u20131,000 existing Omni product IDs across all supported marketplaces. Returns 202 after queue submission without awaiting AI completion or publication.\n\n### Enrichment options\n\nFields, instructions and auto-apply settings use the canonical enrichment service. Exclude name from selectedFields to preserve titles. Weight and dimensions are always included; images are not queued here. Optional marketplaceStoreSelections maps each marketplace to an array of connected store IDs. Multiple stores on one marketplace get independent category and attribute reviews in the same review group. Set includeListingCopy=false for taxonomy only. Store countries come from the authenticated organization connections. Use deferredMarketplaces to enrich product content and save marketplace drafts for later store assignment. This option excludes store-specific taxonomy and publish=true. Assign stores with POST /api/v1/products/marketplace-stores before publishing.\n\nautoApplyHighConfidence defaults to false. Independent enrichmentAutoApplyThreshold and taxonomyAutoApplyThreshold accept 0.62\u20131; omitted thresholds use organization settings. Low-confidence or blocked proposals remain in Review. AI usage is billed to the authenticated organization.\n\n### Publishing after approval\n\nSet publish=true (default false) to queue publishing after every required Review scope is approved and applied. This additionally requires catalog:write and catalog:sync. Automatic and manual approvals use the same durable continuation. Selected stores are captured at queue time; without explicit destinations the product's saved marketplace assignments are used. Pending, rejected, failed or cancelled scopes block that product while eligible products continue. Accepted publish jobs are distinct from successful marketplace publication. Open links.review to inspect reviews and per-store publishing receipts.",
|
|
4075
|
+
flags: [],
|
|
4076
|
+
acceptsJsonBody: true,
|
|
4077
|
+
acceptsFile: false,
|
|
4078
|
+
bodyRequired: true
|
|
4079
|
+
},
|
|
4080
|
+
{
|
|
4081
|
+
trail: ["products", "assign-marketplace-stores"],
|
|
4082
|
+
resourcePath: ["products"],
|
|
4083
|
+
methodName: "assignMarketplaceStores",
|
|
4084
|
+
httpMethod: "POST",
|
|
4085
|
+
path: "/api/v1/products/marketplace-stores",
|
|
4086
|
+
summary: "Assign Product Marketplace Stores",
|
|
4087
|
+
description: "Requires catalog:write. Assign one or more connected stores per marketplace to 1\u2013100 products, including marketplace-only drafts. Get exact store IDs and countries from GET /api/v1/marketplaces/connected.\n\n### Store selection\n\nEach product family is updated independently. Existing listings keep their remote identities. Reusing a store ID across countries requires storeCountries to identify the connection. Each product can use only one country per store ID. Copy compatible taxonomy from an existing sourceStoreId when supplied.\n\n### Publish assigned stores\n\nThe response includes exact data.storeTargets for publishing the successful products. HTTP 207 means at least one product failed. Inspect each result before passing those storeTargets to POST /api/v1/products/{productId}/publish.",
|
|
4066
4088
|
flags: [],
|
|
4067
4089
|
acceptsJsonBody: true,
|
|
4068
4090
|
acceptsFile: false,
|
|
@@ -4563,6 +4585,32 @@ var COMMANDS = [
|
|
|
4563
4585
|
acceptsFile: false,
|
|
4564
4586
|
bodyRequired: false
|
|
4565
4587
|
},
|
|
4588
|
+
{
|
|
4589
|
+
trail: ["returns", "upload-evidence"],
|
|
4590
|
+
resourcePath: ["returns"],
|
|
4591
|
+
methodName: "uploadEvidence",
|
|
4592
|
+
httpMethod: "POST",
|
|
4593
|
+
path: "/api/v1/returns/{returnId}/evidence",
|
|
4594
|
+
summary: "Upload Return Rejection Evidence",
|
|
4595
|
+
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.",
|
|
4596
|
+
flags: [
|
|
4597
|
+
{
|
|
4598
|
+
name: "returnId",
|
|
4599
|
+
flag: "return-id",
|
|
4600
|
+
required: true,
|
|
4601
|
+
source: "path"
|
|
4602
|
+
},
|
|
4603
|
+
{
|
|
4604
|
+
name: "organizationId",
|
|
4605
|
+
flag: "organization-id",
|
|
4606
|
+
required: false,
|
|
4607
|
+
source: "query"
|
|
4608
|
+
}
|
|
4609
|
+
],
|
|
4610
|
+
acceptsJsonBody: true,
|
|
4611
|
+
acceptsFile: true,
|
|
4612
|
+
bodyRequired: true
|
|
4613
|
+
},
|
|
4566
4614
|
{
|
|
4567
4615
|
trail: ["returns", "list-actions"],
|
|
4568
4616
|
resourcePath: ["returns"],
|
|
@@ -4576,7 +4624,8 @@ var COMMANDS = [
|
|
|
4576
4624
|
name: "returnIds",
|
|
4577
4625
|
flag: "return-ids",
|
|
4578
4626
|
required: true,
|
|
4579
|
-
source: "query"
|
|
4627
|
+
source: "query",
|
|
4628
|
+
queryArray: true
|
|
4580
4629
|
},
|
|
4581
4630
|
{
|
|
4582
4631
|
name: "organizationId",
|
|
@@ -4615,7 +4664,8 @@ var COMMANDS = [
|
|
|
4615
4664
|
name: "jobIds",
|
|
4616
4665
|
flag: "job-ids",
|
|
4617
4666
|
required: true,
|
|
4618
|
-
source: "query"
|
|
4667
|
+
source: "query",
|
|
4668
|
+
queryArray: true
|
|
4619
4669
|
},
|
|
4620
4670
|
{
|
|
4621
4671
|
name: "organizationId",
|
|
@@ -4641,7 +4691,8 @@ var COMMANDS = [
|
|
|
4641
4691
|
name: "orderIds",
|
|
4642
4692
|
flag: "order-ids",
|
|
4643
4693
|
required: true,
|
|
4644
|
-
source: "query"
|
|
4694
|
+
source: "query",
|
|
4695
|
+
queryArray: true
|
|
4645
4696
|
},
|
|
4646
4697
|
{
|
|
4647
4698
|
name: "organizationId",
|
|
@@ -5538,7 +5589,8 @@ var COMMANDS = [
|
|
|
5538
5589
|
name: "productSetIds",
|
|
5539
5590
|
flag: "product-set-ids",
|
|
5540
5591
|
required: true,
|
|
5541
|
-
source: "query"
|
|
5592
|
+
source: "query",
|
|
5593
|
+
queryArray: true
|
|
5542
5594
|
}
|
|
5543
5595
|
],
|
|
5544
5596
|
acceptsJsonBody: false,
|
|
@@ -6854,9 +6906,11 @@ function printAuthHelp() {
|
|
|
6854
6906
|
function printCommandHelp(command2) {
|
|
6855
6907
|
const flags = command2.flags.map((flag) => {
|
|
6856
6908
|
const req = flag.required ? "required" : "optional";
|
|
6857
|
-
|
|
6909
|
+
const input2 = flag.queryArray ? "value[,value...]" : flag.name;
|
|
6910
|
+
return ` --${flag.flag} <${input2}> ${req} ${flag.source}`;
|
|
6858
6911
|
}).join("\n");
|
|
6859
|
-
const jsonLine = `${command2.acceptsFile ?
|
|
6912
|
+
const jsonLine = `${command2.acceptsFile ? ` --file <path> ${command2.fileOptional ? "upload a file instead of JSON rows" : "required file to upload"}
|
|
6913
|
+
` : ""}${command2.acceptsJsonBody && !isCampaignCommand(command2) ? ` --json <object|-> ${command2.bodyRequired && !command2.acceptsFile ? "required" : "optional"} body
|
|
6860
6914
|
` : ""}`;
|
|
6861
6915
|
return `omni ${command2.trail.join(" ")}
|
|
6862
6916
|
|
|
@@ -6916,7 +6970,7 @@ function buildRequest(command2, flags, body) {
|
|
|
6916
6970
|
}
|
|
6917
6971
|
continue;
|
|
6918
6972
|
}
|
|
6919
|
-
request[flag.name] = value;
|
|
6973
|
+
request[flag.name] = flag.queryArray ? value.split(",").map((item) => item.trim()) : value;
|
|
6920
6974
|
}
|
|
6921
6975
|
return request;
|
|
6922
6976
|
}
|
|
@@ -7018,11 +7072,12 @@ ${unique.map((line) => ` omni ${line}`).join("\n")}
|
|
|
7018
7072
|
}
|
|
7019
7073
|
const body = await parseJsonBody(flagString(parsed.flags, "json"));
|
|
7020
7074
|
const filePath = command2.acceptsFile ? flagString(parsed.flags, "file") : void 0;
|
|
7021
|
-
if (command2.acceptsFile && !filePath) {
|
|
7075
|
+
if (command2.acceptsFile && !command2.fileOptional && !filePath) {
|
|
7022
7076
|
throw new Error(`omni ${command2.trail.join(" ")} requires --file <path>`);
|
|
7023
7077
|
}
|
|
7024
7078
|
if (command2.bodyRequired && !body && !filePath) {
|
|
7025
|
-
|
|
7079
|
+
const input2 = command2.fileOptional ? "--json or --file <path>" : "--json";
|
|
7080
|
+
throw new Error(`omni ${command2.trail.join(" ")} requires ${input2}`);
|
|
7026
7081
|
}
|
|
7027
7082
|
if (isCampaignCommand(command2) && body)
|
|
7028
7083
|
throw new Error(
|