@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/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.20.1";
36
+ var SDK_VERSION = "0.22.0";
37
37
  var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
38
38
 
39
39
  // src/environments.ts
@@ -1478,6 +1478,79 @@ var BrandsgatewayClient = class {
1478
1478
  });
1479
1479
  }
1480
1480
  };
1481
+ var BulkClient = class {
1482
+ constructor(_http) {
1483
+ __publicField(this, "_http", _http);
1484
+ }
1485
+ /**
1486
+ * List Catalog Operations for Session
1487
+ *
1488
+ * Read the latest 20 compact catalog-operation summaries linked to an authorized session. Requires catalog:read; product data scope is rechecked.
1489
+ *
1490
+ * `GET /api/v1/catalog/operations`
1491
+ */
1492
+ listForSession(request, requestOptions) {
1493
+ const { organizationId, sessionId } = request ?? {};
1494
+ return this._http.request({
1495
+ method: "GET",
1496
+ path: "/api/v1/catalog/operations",
1497
+ query: { organizationId, sessionId },
1498
+ body: void 0,
1499
+ ...mergeRequestOptions(requestOptions)
1500
+ });
1501
+ }
1502
+ /**
1503
+ * Start Catalog Operation
1504
+ *
1505
+ * 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.
1506
+ *
1507
+ * `POST /api/v1/catalog/operations`
1508
+ */
1509
+ start(request, requestOptions) {
1510
+ const { ...body } = request ?? {};
1511
+ return this._http.request({
1512
+ method: "POST",
1513
+ path: "/api/v1/catalog/operations",
1514
+ query: void 0,
1515
+ body,
1516
+ ...mergeRequestOptions(requestOptions)
1517
+ });
1518
+ }
1519
+ /**
1520
+ * Get Catalog Operation Results
1521
+ *
1522
+ * 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.
1523
+ *
1524
+ * `POST /api/v1/catalog/operations/results`
1525
+ */
1526
+ results(request, requestOptions) {
1527
+ const { ...body } = request ?? {};
1528
+ return this._http.request({
1529
+ method: "POST",
1530
+ path: "/api/v1/catalog/operations/results",
1531
+ query: void 0,
1532
+ body,
1533
+ ...mergeRequestOptions(requestOptions)
1534
+ });
1535
+ }
1536
+ /**
1537
+ * Get Catalog Operation Status
1538
+ *
1539
+ * 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.
1540
+ *
1541
+ * `POST /api/v1/catalog/operations/status`
1542
+ */
1543
+ status(request, requestOptions) {
1544
+ const { ...body } = request ?? {};
1545
+ return this._http.request({
1546
+ method: "POST",
1547
+ path: "/api/v1/catalog/operations/status",
1548
+ query: void 0,
1549
+ body,
1550
+ ...mergeRequestOptions(requestOptions)
1551
+ });
1552
+ }
1553
+ };
1481
1554
  var CampaignsClient = class {
1482
1555
  constructor(_http) {
1483
1556
  __publicField(this, "_http", _http);
@@ -1833,6 +1906,23 @@ var CatalogClient = class {
1833
1906
  ...mergeRequestOptions(requestOptions)
1834
1907
  });
1835
1908
  }
1909
+ /**
1910
+ * Query Catalog
1911
+ *
1912
+ * 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.
1913
+ *
1914
+ * `POST /api/v1/catalog/query`
1915
+ */
1916
+ query(request, requestOptions) {
1917
+ const { ...body } = request ?? {};
1918
+ return this._http.request({
1919
+ method: "POST",
1920
+ path: "/api/v1/catalog/query",
1921
+ query: void 0,
1922
+ body,
1923
+ ...mergeRequestOptions(requestOptions)
1924
+ });
1925
+ }
1836
1926
  };
1837
1927
  var CheckoutSessionsClient = class {
1838
1928
  constructor(_http) {
@@ -1995,6 +2085,23 @@ var CommerceClient = class {
1995
2085
  ...mergeRequestOptions(requestOptions)
1996
2086
  });
1997
2087
  }
2088
+ /**
2089
+ * Start Commerce Verification
2090
+ *
2091
+ * 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.
2092
+ *
2093
+ * `POST /api/v1/commerce/state/verify/jobs`
2094
+ */
2095
+ startVerification(request, requestOptions) {
2096
+ const { ...body } = request ?? {};
2097
+ return this._http.request({
2098
+ method: "POST",
2099
+ path: "/api/v1/commerce/state/verify/jobs",
2100
+ query: void 0,
2101
+ body,
2102
+ ...mergeRequestOptions(requestOptions)
2103
+ });
2104
+ }
1998
2105
  };
1999
2106
  var CompareClient = class {
2000
2107
  constructor(_http) {
@@ -2964,6 +3071,10 @@ var ProductsClient = class {
2964
3071
  ### Stock and variants
2965
3072
 
2966
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
2967
3078
  *
2968
3079
  * `GET /api/v1/products`
2969
3080
  */
@@ -3478,6 +3589,86 @@ var ProductsClient = class {
3478
3589
  ...mergeRequestOptions(requestOptions)
3479
3590
  });
3480
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
+ }
3481
3672
  /**
3482
3673
  * Queue Product Enrichment
3483
3674
  *
@@ -4878,6 +5069,7 @@ var OmniGeneratedClient = class {
4878
5069
  __publicField(this, "api");
4879
5070
  __publicField(this, "brandKits");
4880
5071
  __publicField(this, "brandsgateway");
5072
+ __publicField(this, "bulk");
4881
5073
  __publicField(this, "campaigns");
4882
5074
  __publicField(this, "catalog");
4883
5075
  __publicField(this, "checkoutSessions");
@@ -4918,6 +5110,7 @@ var OmniGeneratedClient = class {
4918
5110
  this.api = new ApiClient(this._http);
4919
5111
  this.brandKits = new BrandKitsClient(this._http);
4920
5112
  this.brandsgateway = new BrandsgatewayClient(this._http);
5113
+ this.bulk = new BulkClient(this._http);
4921
5114
  this.campaigns = new CampaignsClient(this._http);
4922
5115
  this.catalog = new CatalogClient(this._http);
4923
5116
  this.checkoutSessions = new CheckoutSessionsClient(this._http);