@omni-commerce/cli 0.19.0 → 0.20.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 +1 -1
- package/dist/index.js +14 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ Edit campaign promotions and windows with typed flags:
|
|
|
40
40
|
```bash
|
|
41
41
|
omni campaigns update-offers --campaign-id C --expected-revision 4 --offer-ids OFFER_A,OFFER_B --discount-value 15
|
|
42
42
|
omni campaigns update-windows --campaign-id C --expected-revision 4 --window-ids WINDOW_A --ends-at 2027-08-04T00:00:00+08:00
|
|
43
|
-
omni products list --detail summary --
|
|
43
|
+
omni products list --q lamp --detail summary --format json
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
Campaign updates preserve omitted fields. Running changes remain proposals until
|
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.20.0";
|
|
88
88
|
|
|
89
89
|
// src/browser-login.ts
|
|
90
90
|
function loginOrigin(baseUrl) {
|
|
@@ -223,10 +223,12 @@ async function clearConfig() {
|
|
|
223
223
|
await rm(configPath(), { force: true });
|
|
224
224
|
}
|
|
225
225
|
async function resolveCredentials(input2) {
|
|
226
|
-
const
|
|
227
|
-
const
|
|
226
|
+
const explicitKey = input2.apiKey || process.env.OMNI_API_KEY;
|
|
227
|
+
const explicitBaseUrl = input2.baseUrl || process.env.OMNI_BASE_URL;
|
|
228
|
+
const file = explicitKey && explicitBaseUrl ? {} : await readConfig();
|
|
229
|
+
const apiKey = explicitKey || file.apiKey || void 0;
|
|
228
230
|
const source = input2.apiKey ? "flag" : process.env.OMNI_API_KEY ? "env" : file.apiKey ? "config" : "none";
|
|
229
|
-
const baseUrl =
|
|
231
|
+
const baseUrl = explicitBaseUrl || file.baseUrl || "https://omnicommerce.ai";
|
|
230
232
|
return { apiKey, baseUrl, source };
|
|
231
233
|
}
|
|
232
234
|
function maskSecret(value) {
|
|
@@ -3491,7 +3493,7 @@ var COMMANDS = [
|
|
|
3491
3493
|
httpMethod: "GET",
|
|
3492
3494
|
path: "/api/v1/products",
|
|
3493
3495
|
summary: "List Products",
|
|
3494
|
-
description: "List products for the authenticated organization with optional filters and pagination.
|
|
3496
|
+
description: "List products for the authenticated organization with optional filters and pagination. Requires `catalog:read`. The organization comes from the API key or OAuth bearer token.\n\n### Stock and variants\n\nRows are in `items`. Read catalog stock from `items[].stockQuantity`: parent rows already aggregate their non-deleted variants, and virtual bundles use component availability with any manual cap. Null means unknown, not zero. A row with `variantCount` above 0 has variants; fetch them from `GET /api/v1/products/{productId}`. List rows do not contain `inventoryQuantity`, `inventory.quantity`, or an embedded `variants` array.\n\n### Duplicate discovery and merge\n\nUse status=duplicates, duplicateType=sku and detail=full for exact-SKU candidates. Each root row includes duplicateMatches with peer productIds, names, SKUs and match reasons. Follow pagination; detail=summary omits this evidence. Start or refresh the saved scan with products.scanDuplicates and inspect products.getDuplicateScan. Combine each root ID with its exact_sku peer IDs, deduplicate, then call products.previewDuplicateMerge with 2\u201320 productIds. Inspect every group's masterSelections: a sole allowed product must stay master; multiple allowed products leave the content/price/stock choice to the seller. Preview again with masterProductIds, review all listings, then call products.mergeDuplicates with the reviewed expectedGroups. Content similarity alone is not permission to merge. See /guides/merge-marketplace-listings for CLI and SDK examples.",
|
|
3495
3497
|
flags: [
|
|
3496
3498
|
{
|
|
3497
3499
|
name: "status",
|
|
@@ -3541,12 +3543,6 @@ var COMMANDS = [
|
|
|
3541
3543
|
required: false,
|
|
3542
3544
|
source: "query"
|
|
3543
3545
|
},
|
|
3544
|
-
{
|
|
3545
|
-
name: "limit",
|
|
3546
|
-
flag: "limit",
|
|
3547
|
-
required: false,
|
|
3548
|
-
source: "query"
|
|
3549
|
-
},
|
|
3550
3546
|
{
|
|
3551
3547
|
name: "offset",
|
|
3552
3548
|
flag: "offset",
|
|
@@ -7246,7 +7242,7 @@ Global flags:
|
|
|
7246
7242
|
--help Show help
|
|
7247
7243
|
|
|
7248
7244
|
Examples:
|
|
7249
|
-
omni products list --q lamp
|
|
7245
|
+
omni products list --q lamp --detail summary
|
|
7250
7246
|
omni products get --product-id prod_123
|
|
7251
7247
|
omni products create --json '{"product":{"sku":"SKU-1","title":"Lamp"}}'
|
|
7252
7248
|
omni jobs wait --job-id prod_123
|
|
@@ -7429,6 +7425,12 @@ ${unique.map((line) => ` omni ${line}`).join("\n")}
|
|
|
7429
7425
|
`);
|
|
7430
7426
|
return 0;
|
|
7431
7427
|
}
|
|
7428
|
+
if (command2.httpMethod === "GET" && command2.path === "/api/v1/products" && Object.hasOwn(parsed.flags, "limit")) {
|
|
7429
|
+
process.stderr.write(
|
|
7430
|
+
"products list no longer accepts --limit. Follow pagination.nextCursor or pagination.nextOffset.\n"
|
|
7431
|
+
);
|
|
7432
|
+
return 1;
|
|
7433
|
+
}
|
|
7432
7434
|
const body = await parseJsonBody(flagString(parsed.flags, "json"));
|
|
7433
7435
|
const filePath = command2.acceptsFile ? flagString(parsed.flags, "file") : void 0;
|
|
7434
7436
|
if (command2.acceptsFile && !command2.fileOptional && !filePath) {
|