@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 CHANGED
@@ -1,5 +1,10 @@
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
+
3
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).
4
9
 
5
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.
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.21.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
@@ -3073,6 +3073,10 @@ var ProductsClient = class {
3073
3073
  ### Stock and variants
3074
3074
 
3075
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
3076
3080
  *
3077
3081
  * `GET /api/v1/products`
3078
3082
  */
@@ -3587,6 +3591,86 @@ var ProductsClient = class {
3587
3591
  ...mergeRequestOptions(requestOptions)
3588
3592
  });
3589
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
+ }
3590
3674
  /**
3591
3675
  * Queue Product Enrichment
3592
3676
  *