@omni-commerce/cli 0.15.0 → 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 +2 -0
- package/dist/index.js +27 -10
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
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
|
+
|
|
3
5
|
CLI 0.15.0 supports multiple order, return, and job IDs in batch flags and adds `omni returns upload-evidence`.
|
|
4
6
|
|
|
5
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.
|
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,
|
|
@@ -2492,7 +2493,7 @@ var COMMANDS = [
|
|
|
2492
2493
|
httpMethod: "GET",
|
|
2493
2494
|
path: "/api/v1/jobs/{jobId}",
|
|
2494
2495
|
summary: "Get Developer Job Status",
|
|
2495
|
-
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.",
|
|
2496
2497
|
flags: [
|
|
2497
2498
|
{
|
|
2498
2499
|
name: "jobId",
|
|
@@ -3732,10 +3733,11 @@ var COMMANDS = [
|
|
|
3732
3733
|
httpMethod: "POST",
|
|
3733
3734
|
path: "/api/v1/products/bulk-import",
|
|
3734
3735
|
summary: "Bulk Import Products from JSON or CSV",
|
|
3735
|
-
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`.",
|
|
3736
3737
|
flags: [],
|
|
3737
3738
|
acceptsJsonBody: true,
|
|
3738
|
-
acceptsFile:
|
|
3739
|
+
acceptsFile: true,
|
|
3740
|
+
fileOptional: true,
|
|
3739
3741
|
bodyRequired: true
|
|
3740
3742
|
},
|
|
3741
3743
|
{
|
|
@@ -4069,7 +4071,20 @@ var COMMANDS = [
|
|
|
4069
4071
|
httpMethod: "POST",
|
|
4070
4072
|
path: "/api/v1/products/enrich",
|
|
4071
4073
|
summary: "Queue Product Enrichment",
|
|
4072
|
-
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.",
|
|
4073
4088
|
flags: [],
|
|
4074
4089
|
acceptsJsonBody: true,
|
|
4075
4090
|
acceptsFile: false,
|
|
@@ -6894,7 +6909,8 @@ function printCommandHelp(command2) {
|
|
|
6894
6909
|
const input2 = flag.queryArray ? "value[,value...]" : flag.name;
|
|
6895
6910
|
return ` --${flag.flag} <${input2}> ${req} ${flag.source}`;
|
|
6896
6911
|
}).join("\n");
|
|
6897
|
-
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
|
|
6898
6914
|
` : ""}`;
|
|
6899
6915
|
return `omni ${command2.trail.join(" ")}
|
|
6900
6916
|
|
|
@@ -7056,11 +7072,12 @@ ${unique.map((line) => ` omni ${line}`).join("\n")}
|
|
|
7056
7072
|
}
|
|
7057
7073
|
const body = await parseJsonBody(flagString(parsed.flags, "json"));
|
|
7058
7074
|
const filePath = command2.acceptsFile ? flagString(parsed.flags, "file") : void 0;
|
|
7059
|
-
if (command2.acceptsFile && !filePath) {
|
|
7075
|
+
if (command2.acceptsFile && !command2.fileOptional && !filePath) {
|
|
7060
7076
|
throw new Error(`omni ${command2.trail.join(" ")} requires --file <path>`);
|
|
7061
7077
|
}
|
|
7062
7078
|
if (command2.bodyRequired && !body && !filePath) {
|
|
7063
|
-
|
|
7079
|
+
const input2 = command2.fileOptional ? "--json or --file <path>" : "--json";
|
|
7080
|
+
throw new Error(`omni ${command2.trail.join(" ")} requires ${input2}`);
|
|
7064
7081
|
}
|
|
7065
7082
|
if (isCampaignCommand(command2) && body)
|
|
7066
7083
|
throw new Error(
|