@omni-commerce/sdk 0.21.0 → 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 +5 -0
- package/dist/index.cjs +85 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +751 -1
- package/dist/index.d.ts +751 -1
- package/dist/index.js +85 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ function normalizeClientOptions(options = {}) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
// src/version.ts
|
|
36
|
-
var SDK_VERSION = "0.
|
|
36
|
+
var SDK_VERSION = "0.22.0";
|
|
37
37
|
var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
|
|
38
38
|
|
|
39
39
|
// src/environments.ts
|
|
@@ -3071,6 +3071,10 @@ var ProductsClient = class {
|
|
|
3071
3071
|
### Stock and variants
|
|
3072
3072
|
|
|
3073
3073
|
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.
|
|
3074
|
+
|
|
3075
|
+
### Duplicate discovery and merge
|
|
3076
|
+
|
|
3077
|
+
Use status=duplicates, duplicateType=sku and detail=full for exact-SKU candidates. Each root ro
|
|
3074
3078
|
*
|
|
3075
3079
|
* `GET /api/v1/products`
|
|
3076
3080
|
*/
|
|
@@ -3585,6 +3589,86 @@ var ProductsClient = class {
|
|
|
3585
3589
|
...mergeRequestOptions(requestOptions)
|
|
3586
3590
|
});
|
|
3587
3591
|
}
|
|
3592
|
+
/**
|
|
3593
|
+
* Merge Duplicate Products
|
|
3594
|
+
*
|
|
3595
|
+
* 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.
|
|
3596
|
+
|
|
3597
|
+
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.
|
|
3598
|
+
|
|
3599
|
+
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.
|
|
3600
|
+
|
|
3601
|
+
Supports every OmniCommerce marketplace. Variant families, bundles and product
|
|
3602
|
+
*
|
|
3603
|
+
* `POST /api/v1/products/duplicates/merge`
|
|
3604
|
+
*/
|
|
3605
|
+
mergeDuplicates(request, requestOptions) {
|
|
3606
|
+
const { ...body } = request ?? {};
|
|
3607
|
+
return this._http.request({
|
|
3608
|
+
method: "POST",
|
|
3609
|
+
path: "/api/v1/products/duplicates/merge",
|
|
3610
|
+
query: void 0,
|
|
3611
|
+
body,
|
|
3612
|
+
...mergeRequestOptions(requestOptions)
|
|
3613
|
+
});
|
|
3614
|
+
}
|
|
3615
|
+
/**
|
|
3616
|
+
* Preview Duplicate Product Merge
|
|
3617
|
+
*
|
|
3618
|
+
* 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.
|
|
3619
|
+
|
|
3620
|
+
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.
|
|
3621
|
+
|
|
3622
|
+
Supports every OmniCommerce marketplace. All marketplace listings are preserved. Different listing identities in the same store block that group; the merge never delists listings.
|
|
3623
|
+
|
|
3624
|
+
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
|
|
3625
|
+
*
|
|
3626
|
+
* `POST /api/v1/products/duplicates/merge-preview`
|
|
3627
|
+
*/
|
|
3628
|
+
previewDuplicateMerge(request, requestOptions) {
|
|
3629
|
+
const { ...body } = request ?? {};
|
|
3630
|
+
return this._http.request({
|
|
3631
|
+
method: "POST",
|
|
3632
|
+
path: "/api/v1/products/duplicates/merge-preview",
|
|
3633
|
+
query: void 0,
|
|
3634
|
+
body,
|
|
3635
|
+
...mergeRequestOptions(requestOptions)
|
|
3636
|
+
});
|
|
3637
|
+
}
|
|
3638
|
+
/**
|
|
3639
|
+
* Get Duplicate Scan
|
|
3640
|
+
*
|
|
3641
|
+
* 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.
|
|
3642
|
+
*
|
|
3643
|
+
* `GET /api/v1/products/duplicates/scan`
|
|
3644
|
+
*/
|
|
3645
|
+
getDuplicateScan(request = {}, requestOptions) {
|
|
3646
|
+
const { organizationId } = request ?? {};
|
|
3647
|
+
return this._http.request({
|
|
3648
|
+
method: "GET",
|
|
3649
|
+
path: "/api/v1/products/duplicates/scan",
|
|
3650
|
+
query: { organizationId },
|
|
3651
|
+
body: void 0,
|
|
3652
|
+
...mergeRequestOptions(requestOptions)
|
|
3653
|
+
});
|
|
3654
|
+
}
|
|
3655
|
+
/**
|
|
3656
|
+
* Scan Duplicate Products
|
|
3657
|
+
*
|
|
3658
|
+
* 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.
|
|
3659
|
+
*
|
|
3660
|
+
* `POST /api/v1/products/duplicates/scan`
|
|
3661
|
+
*/
|
|
3662
|
+
scanDuplicates(request, requestOptions) {
|
|
3663
|
+
const { ...body } = request ?? {};
|
|
3664
|
+
return this._http.request({
|
|
3665
|
+
method: "POST",
|
|
3666
|
+
path: "/api/v1/products/duplicates/scan",
|
|
3667
|
+
query: void 0,
|
|
3668
|
+
body,
|
|
3669
|
+
...mergeRequestOptions(requestOptions)
|
|
3670
|
+
});
|
|
3671
|
+
}
|
|
3588
3672
|
/**
|
|
3589
3673
|
* Queue Product Enrichment
|
|
3590
3674
|
*
|