@omni-commerce/sdk 0.20.1 → 0.22.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 +7 -0
- package/dist/index.cjs +194 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5527 -3933
- package/dist/index.d.ts +5527 -3933
- package/dist/index.js +194 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @omni-commerce/sdk
|
|
2
2
|
|
|
3
|
+
SDK 0.22.0 adds duplicate discovery, master eligibility and server-side merge dry runs. Use `products.scanDuplicates`, `getDuplicateScan`,
|
|
4
|
+
`list({ status: "duplicates", duplicateType: "sku", detail: "full" })`,
|
|
5
|
+
`previewDuplicateMerge` and `mergeDuplicates`. Typed preview `masterSelections`
|
|
6
|
+
explains which master choices are allowed. See the [CLI and SDK workflow](https://docs.omnicommerce.sg/guides/merge-marketplace-listings).
|
|
7
|
+
|
|
8
|
+
SDK 0.21.0 adds server-side `catalog.query`, durable `bulk.start`/`status`/`results`, and asynchronous product verification. See [Catalog operations](https://docs.omnicommerce.sg/sdk/catalog-operations).
|
|
9
|
+
|
|
3
10
|
SDK 0.20.1 expands batch method documentation with submission limits, concurrency, partial-result handling and job verification guidance. Runtime API contracts are unchanged.
|
|
4
11
|
|
|
5
12
|
SDK 0.20.0 adds headless campaign import, validators, Full sync approval/run, lifecycle batches, and promotion publishing, modification, deletion and delivery checks. See [Campaign automation](https://docs.omnicommerce.sg/guides/campaign-automation). API clients can be explicitly named campaign approvers; browser cookies are unnecessary.
|
package/dist/index.cjs
CHANGED
|
@@ -35,7 +35,7 @@ function normalizeClientOptions(options = {}) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// src/version.ts
|
|
38
|
-
var SDK_VERSION = "0.
|
|
38
|
+
var SDK_VERSION = "0.22.0";
|
|
39
39
|
var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
|
|
40
40
|
|
|
41
41
|
// src/environments.ts
|
|
@@ -1480,6 +1480,79 @@ var BrandsgatewayClient = class {
|
|
|
1480
1480
|
});
|
|
1481
1481
|
}
|
|
1482
1482
|
};
|
|
1483
|
+
var BulkClient = class {
|
|
1484
|
+
constructor(_http) {
|
|
1485
|
+
__publicField(this, "_http", _http);
|
|
1486
|
+
}
|
|
1487
|
+
/**
|
|
1488
|
+
* List Catalog Operations for Session
|
|
1489
|
+
*
|
|
1490
|
+
* Read the latest 20 compact catalog-operation summaries linked to an authorized session. Requires catalog:read; product data scope is rechecked.
|
|
1491
|
+
*
|
|
1492
|
+
* `GET /api/v1/catalog/operations`
|
|
1493
|
+
*/
|
|
1494
|
+
listForSession(request, requestOptions) {
|
|
1495
|
+
const { organizationId, sessionId } = request ?? {};
|
|
1496
|
+
return this._http.request({
|
|
1497
|
+
method: "GET",
|
|
1498
|
+
path: "/api/v1/catalog/operations",
|
|
1499
|
+
query: { organizationId, sessionId },
|
|
1500
|
+
body: void 0,
|
|
1501
|
+
...mergeRequestOptions(requestOptions)
|
|
1502
|
+
});
|
|
1503
|
+
}
|
|
1504
|
+
/**
|
|
1505
|
+
* Start Catalog Operation
|
|
1506
|
+
*
|
|
1507
|
+
* Durable bulk price/cost updates for 1–2000 products or variants. Requires catalog:write. Identical duplicates collapse in requested order; conflicting duplicates fail. An idempotencyKey freezes the original targets and versions. Reusing it with changed input returns 409. expectedUpdatedAt guards reviewed values. Catalog cost never syncs to marketplaces. syncToMarketplaces queues existing canonical marketplace services for every applicable connected listing. A failed target does not stop other targets. The operation continues after the caller disconnects. Read aggregate status, then page failures through bulk.results. Optional sessionId links progress to the initiating user's existing session.
|
|
1508
|
+
*
|
|
1509
|
+
* `POST /api/v1/catalog/operations`
|
|
1510
|
+
*/
|
|
1511
|
+
start(request, requestOptions) {
|
|
1512
|
+
const { ...body } = request ?? {};
|
|
1513
|
+
return this._http.request({
|
|
1514
|
+
method: "POST",
|
|
1515
|
+
path: "/api/v1/catalog/operations",
|
|
1516
|
+
query: void 0,
|
|
1517
|
+
body,
|
|
1518
|
+
...mergeRequestOptions(requestOptions)
|
|
1519
|
+
});
|
|
1520
|
+
}
|
|
1521
|
+
/**
|
|
1522
|
+
* Get Catalog Operation Results
|
|
1523
|
+
*
|
|
1524
|
+
* Read ordered per-product receipts and verification evidence for up to 50 operationIds. Filter status=failed to inspect failures directly. At most 100 rows across the requested operations per page. Requires catalog:read.
|
|
1525
|
+
*
|
|
1526
|
+
* `POST /api/v1/catalog/operations/results`
|
|
1527
|
+
*/
|
|
1528
|
+
results(request, requestOptions) {
|
|
1529
|
+
const { ...body } = request ?? {};
|
|
1530
|
+
return this._http.request({
|
|
1531
|
+
method: "POST",
|
|
1532
|
+
path: "/api/v1/catalog/operations/results",
|
|
1533
|
+
query: void 0,
|
|
1534
|
+
body,
|
|
1535
|
+
...mergeRequestOptions(requestOptions)
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
/**
|
|
1539
|
+
* Get Catalog Operation Status
|
|
1540
|
+
*
|
|
1541
|
+
* Read compact progress for up to 50 operationIds in first-requested order. Pending is incomplete, and partial failures remain explicit. Requires catalog:read. Detailed receipts are returned only by the paginated report API.
|
|
1542
|
+
*
|
|
1543
|
+
* `POST /api/v1/catalog/operations/status`
|
|
1544
|
+
*/
|
|
1545
|
+
status(request, requestOptions) {
|
|
1546
|
+
const { ...body } = request ?? {};
|
|
1547
|
+
return this._http.request({
|
|
1548
|
+
method: "POST",
|
|
1549
|
+
path: "/api/v1/catalog/operations/status",
|
|
1550
|
+
query: void 0,
|
|
1551
|
+
body,
|
|
1552
|
+
...mergeRequestOptions(requestOptions)
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
};
|
|
1483
1556
|
var CampaignsClient = class {
|
|
1484
1557
|
constructor(_http) {
|
|
1485
1558
|
__publicField(this, "_http", _http);
|
|
@@ -1835,6 +1908,23 @@ var CatalogClient = class {
|
|
|
1835
1908
|
...mergeRequestOptions(requestOptions)
|
|
1836
1909
|
});
|
|
1837
1910
|
}
|
|
1911
|
+
/**
|
|
1912
|
+
* Query Catalog
|
|
1913
|
+
*
|
|
1914
|
+
* Filter and project simple products and variants on the server. Requires catalog:read. Defaults to active sellable SKUs, excluding parent containers. costComparison=above_price compares known cost in each product's catalog currency using valid recorded conversions; unknown costs or unavailable conversions do not match. Fields bound the response. Maximum 500 rows per page. Omit counts after the first page with includeCount=false. No SQL input is accepted.
|
|
1915
|
+
*
|
|
1916
|
+
* `POST /api/v1/catalog/query`
|
|
1917
|
+
*/
|
|
1918
|
+
query(request, requestOptions) {
|
|
1919
|
+
const { ...body } = request ?? {};
|
|
1920
|
+
return this._http.request({
|
|
1921
|
+
method: "POST",
|
|
1922
|
+
path: "/api/v1/catalog/query",
|
|
1923
|
+
query: void 0,
|
|
1924
|
+
body,
|
|
1925
|
+
...mergeRequestOptions(requestOptions)
|
|
1926
|
+
});
|
|
1927
|
+
}
|
|
1838
1928
|
};
|
|
1839
1929
|
var CheckoutSessionsClient = class {
|
|
1840
1930
|
constructor(_http) {
|
|
@@ -1997,6 +2087,23 @@ var CommerceClient = class {
|
|
|
1997
2087
|
...mergeRequestOptions(requestOptions)
|
|
1998
2088
|
});
|
|
1999
2089
|
}
|
|
2090
|
+
/**
|
|
2091
|
+
* Start Commerce Verification
|
|
2092
|
+
*
|
|
2093
|
+
* Queue durable fresh verification for up to 2000 products in the existing verification contract, under verification. Requires catalog:read. Returns immediately with operationIds. Read bulk.status and bulk.results; a client timeout does not discard work. Fulfillment correlations continue to use commerce.verifyState.
|
|
2094
|
+
*
|
|
2095
|
+
* `POST /api/v1/commerce/state/verify/jobs`
|
|
2096
|
+
*/
|
|
2097
|
+
startVerification(request, requestOptions) {
|
|
2098
|
+
const { ...body } = request ?? {};
|
|
2099
|
+
return this._http.request({
|
|
2100
|
+
method: "POST",
|
|
2101
|
+
path: "/api/v1/commerce/state/verify/jobs",
|
|
2102
|
+
query: void 0,
|
|
2103
|
+
body,
|
|
2104
|
+
...mergeRequestOptions(requestOptions)
|
|
2105
|
+
});
|
|
2106
|
+
}
|
|
2000
2107
|
};
|
|
2001
2108
|
var CompareClient = class {
|
|
2002
2109
|
constructor(_http) {
|
|
@@ -2966,6 +3073,10 @@ var ProductsClient = class {
|
|
|
2966
3073
|
### Stock and variants
|
|
2967
3074
|
|
|
2968
3075
|
Rows 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.
|
|
3076
|
+
|
|
3077
|
+
### Duplicate discovery and merge
|
|
3078
|
+
|
|
3079
|
+
Use status=duplicates, duplicateType=sku and detail=full for exact-SKU candidates. Each root ro
|
|
2969
3080
|
*
|
|
2970
3081
|
* `GET /api/v1/products`
|
|
2971
3082
|
*/
|
|
@@ -3480,6 +3591,86 @@ var ProductsClient = class {
|
|
|
3480
3591
|
...mergeRequestOptions(requestOptions)
|
|
3481
3592
|
});
|
|
3482
3593
|
}
|
|
3594
|
+
/**
|
|
3595
|
+
* Merge Duplicate Products
|
|
3596
|
+
*
|
|
3597
|
+
* Merge exact-SKU duplicate products into one master product per group. The master keeps its content, images, price and stock; the group's other products are archived into it, and orders, reviews, promotions and other catalog references move to the master.
|
|
3598
|
+
|
|
3599
|
+
All marketplace listings move to the master, including listings in other stores of the same marketplace. Different listing identities in the same store block the group. No marketplace listing is delisted, rewritten or republished.
|
|
3600
|
+
|
|
3601
|
+
Each group commits independently; the response lists every group's outcome. Sources with inventory history or immutable order composition snapshots must be reconciled before archiving so returns and stock replays keep their targets.
|
|
3602
|
+
|
|
3603
|
+
Supports every OmniCommerce marketplace. Variant families, bundles and product
|
|
3604
|
+
*
|
|
3605
|
+
* `POST /api/v1/products/duplicates/merge`
|
|
3606
|
+
*/
|
|
3607
|
+
mergeDuplicates(request, requestOptions) {
|
|
3608
|
+
const { ...body } = request ?? {};
|
|
3609
|
+
return this._http.request({
|
|
3610
|
+
method: "POST",
|
|
3611
|
+
path: "/api/v1/products/duplicates/merge",
|
|
3612
|
+
query: void 0,
|
|
3613
|
+
body,
|
|
3614
|
+
...mergeRequestOptions(requestOptions)
|
|
3615
|
+
});
|
|
3616
|
+
}
|
|
3617
|
+
/**
|
|
3618
|
+
* Preview Duplicate Product Merge
|
|
3619
|
+
*
|
|
3620
|
+
* Read-only preview of merging duplicate catalog products into one master product. Uses the same contract and rules as `POST /api/v1/products/duplicates/merge` and the assistant's Fix Listing Duplicates tool.
|
|
3621
|
+
|
|
3622
|
+
Products are grouped by exact SKU. Each group shows its master (first in `productIds`), every product's marketplace listings per store with live status. A blocked group reports its `error`; nothing is changed.
|
|
3623
|
+
|
|
3624
|
+
Supports every OmniCommerce marketplace. All marketplace listings are preserved. Different listing identities in the same store block that group; the merge never delists listings.
|
|
3625
|
+
|
|
3626
|
+
Discover candidates with `GET /api/v1/products?status=duplicates&duplicateType=sku&detail=full`. Refresh the saved scan through `POST /api/v1/products/duplicates/scan` when needed. Each group's `maste
|
|
3627
|
+
*
|
|
3628
|
+
* `POST /api/v1/products/duplicates/merge-preview`
|
|
3629
|
+
*/
|
|
3630
|
+
previewDuplicateMerge(request, requestOptions) {
|
|
3631
|
+
const { ...body } = request ?? {};
|
|
3632
|
+
return this._http.request({
|
|
3633
|
+
method: "POST",
|
|
3634
|
+
path: "/api/v1/products/duplicates/merge-preview",
|
|
3635
|
+
query: void 0,
|
|
3636
|
+
body,
|
|
3637
|
+
...mergeRequestOptions(requestOptions)
|
|
3638
|
+
});
|
|
3639
|
+
}
|
|
3640
|
+
/**
|
|
3641
|
+
* Get Duplicate Scan
|
|
3642
|
+
*
|
|
3643
|
+
* Read the same organization-scoped duplicate scan status as Products → Check duplicates. Requires catalog:read. queued/running means the durable scan is still in progress; failed includes errorMessage. completed exposes computedAt and the number of duplicate products. Results are read through products.list with status=duplicates and detail=full. The shared UI scan currently examines at most the 5,000 most recently updated non-archived root products; a completed scan is not proof that a larger catalog has been fully examined.
|
|
3644
|
+
*
|
|
3645
|
+
* `GET /api/v1/products/duplicates/scan`
|
|
3646
|
+
*/
|
|
3647
|
+
getDuplicateScan(request = {}, requestOptions) {
|
|
3648
|
+
const { organizationId } = request ?? {};
|
|
3649
|
+
return this._http.request({
|
|
3650
|
+
method: "GET",
|
|
3651
|
+
path: "/api/v1/products/duplicates/scan",
|
|
3652
|
+
query: { organizationId },
|
|
3653
|
+
body: void 0,
|
|
3654
|
+
...mergeRequestOptions(requestOptions)
|
|
3655
|
+
});
|
|
3656
|
+
}
|
|
3657
|
+
/**
|
|
3658
|
+
* Scan Duplicate Products
|
|
3659
|
+
*
|
|
3660
|
+
* Start the existing durable organization duplicate scan, equivalent to Products → Check duplicates. Requires catalog:write. An already queued/running scan is reused. This only refreshes duplicate evidence; it does not merge, publish or delist products. Read completion with products.getDuplicateScan, then list status=duplicates, duplicateType=sku, detail=full and page all matching results before previewing a merge. Uses the same 5,000-candidate scan limit as the UI.
|
|
3661
|
+
*
|
|
3662
|
+
* `POST /api/v1/products/duplicates/scan`
|
|
3663
|
+
*/
|
|
3664
|
+
scanDuplicates(request, requestOptions) {
|
|
3665
|
+
const { ...body } = request ?? {};
|
|
3666
|
+
return this._http.request({
|
|
3667
|
+
method: "POST",
|
|
3668
|
+
path: "/api/v1/products/duplicates/scan",
|
|
3669
|
+
query: void 0,
|
|
3670
|
+
body,
|
|
3671
|
+
...mergeRequestOptions(requestOptions)
|
|
3672
|
+
});
|
|
3673
|
+
}
|
|
3483
3674
|
/**
|
|
3484
3675
|
* Queue Product Enrichment
|
|
3485
3676
|
*
|
|
@@ -4880,6 +5071,7 @@ var OmniGeneratedClient = class {
|
|
|
4880
5071
|
__publicField(this, "api");
|
|
4881
5072
|
__publicField(this, "brandKits");
|
|
4882
5073
|
__publicField(this, "brandsgateway");
|
|
5074
|
+
__publicField(this, "bulk");
|
|
4883
5075
|
__publicField(this, "campaigns");
|
|
4884
5076
|
__publicField(this, "catalog");
|
|
4885
5077
|
__publicField(this, "checkoutSessions");
|
|
@@ -4920,6 +5112,7 @@ var OmniGeneratedClient = class {
|
|
|
4920
5112
|
this.api = new ApiClient(this._http);
|
|
4921
5113
|
this.brandKits = new BrandKitsClient(this._http);
|
|
4922
5114
|
this.brandsgateway = new BrandsgatewayClient(this._http);
|
|
5115
|
+
this.bulk = new BulkClient(this._http);
|
|
4923
5116
|
this.campaigns = new CampaignsClient(this._http);
|
|
4924
5117
|
this.catalog = new CatalogClient(this._http);
|
|
4925
5118
|
this.checkoutSessions = new CheckoutSessionsClient(this._http);
|