@omni-commerce/sdk 0.18.0 → 0.19.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
@@ -317,3 +317,18 @@ yarn sdk:generate
317
317
  That refreshes `docs/openapi.json`, the OpenAPI TypeScript types, and `src/generated/resources.ts`.
318
318
 
319
319
  With SDK 0.8.1, website widgets load saved Storefront appearance by deployment ID. Install the generated deployment-only snippet once; saving an agent or design change updates the next website load. Explicit appearance options override saved values. The `ready` promise resolves after configuration loads, or rejects on an error reported to `onError`.
320
+
321
+ ## Commerce jobs and verification
322
+
323
+ SDK 0.19.0 adds the shared waiter and fresh marketplace state verifier. Pass every correlation returned by order/return submissions. Catalog jobs can join the wait batch; product state verification uses productIds/expected or per-product targets.
324
+
325
+ ```ts
326
+ const correlations = submitted.data.correlations;
327
+ const progress = await client.commerce.awaitJobs({
328
+ correlations,
329
+ timeoutMs: 30000,
330
+ });
331
+ const verified = await client.commerce.verifyState({ correlations });
332
+ ```
333
+
334
+ Inspect every result and pending/failed counts. Acceptance alone does not establish marketplace state; uncertain outcomes must not be automatically resubmitted. See [Commerce verification](https://docs.omnicommerce.sg/guides/commerce-verification).
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.18.0";
38
+ var SDK_VERSION = "0.19.0";
39
39
  var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
40
40
 
41
41
  // src/environments.ts
@@ -1752,6 +1752,45 @@ var CheckoutSessionsClient = class {
1752
1752
  });
1753
1753
  }
1754
1754
  };
1755
+ var CommerceClient = class {
1756
+ constructor(_http) {
1757
+ __publicField(this, "_http", _http);
1758
+ }
1759
+ /**
1760
+ * Await Commerce Jobs
1761
+ *
1762
+ * Wait for a mixed batch of returned commerce correlations: inventory_job, price_event, publish_job, delist_batch, store_switch, omni_delete, zalora_import, enrichment_batch, order_action and return_action. Maximum 50000 entries; IDs are trimmed and duplicates collapse by kind/id in first-requested order. timeoutMs=0 reads once; bounded waits allow up to 120000ms. Catalog jobs require catalog:read; order/return jobs require orders:read; mixed batches require both. Session callers include organizationId. Every job retains its target identity, status, errors and available label artifacts. Missing or inaccessible fulfillment jobs fail explicitly. needs_review is an uncertain outcome, never automatic success or authorization to resubmit. data.success describes completion; use state verification
1763
+ *
1764
+ * `POST /api/v1/commerce/jobs/await`
1765
+ */
1766
+ awaitJobs(request, requestOptions) {
1767
+ const { ...body } = request ?? {};
1768
+ return this._http.request({
1769
+ method: "POST",
1770
+ path: "/api/v1/commerce/jobs/await",
1771
+ query: void 0,
1772
+ body,
1773
+ ...mergeRequestOptions(requestOptions)
1774
+ });
1775
+ }
1776
+ /**
1777
+ * Verify Commerce State
1778
+ *
1779
+ * Perform fresh marketplace verification using the canonical services for every supported marketplace. For products provide productIds plus expected, or targets[{productId,expected}] for mixed values. For order and return operations provide their returned order_action/return_action correlations; product and fulfillment checks may share one request. Maximum 50000 entries per target array, with bounded concurrency. Catalog verification requires catalog:read; fulfillment verification requires orders:read; mixed batches require both. Session callers include organizationId. Missing, unauthorized, unsupported and unconfirmed targets fail explicitly. A return decision can be confirmed while later lifecycle steps remain pending. Labels confirm generated artifacts, not physical printing. Provider acc
1780
+ *
1781
+ * `POST /api/v1/commerce/state/verify`
1782
+ */
1783
+ verifyState(request, requestOptions) {
1784
+ const { ...body } = request ?? {};
1785
+ return this._http.request({
1786
+ method: "POST",
1787
+ path: "/api/v1/commerce/state/verify",
1788
+ query: void 0,
1789
+ body,
1790
+ ...mergeRequestOptions(requestOptions)
1791
+ });
1792
+ }
1793
+ };
1755
1794
  var CompareClient = class {
1756
1795
  constructor(_http) {
1757
1796
  __publicField(this, "_http", _http);
@@ -4204,6 +4243,7 @@ var OmniGeneratedClient = class {
4204
4243
  __publicField(this, "campaigns");
4205
4244
  __publicField(this, "catalog");
4206
4245
  __publicField(this, "checkoutSessions");
4246
+ __publicField(this, "commerce");
4207
4247
  __publicField(this, "compare");
4208
4248
  __publicField(this, "directory");
4209
4249
  __publicField(this, "documents");
@@ -4242,6 +4282,7 @@ var OmniGeneratedClient = class {
4242
4282
  this.campaigns = new CampaignsClient(this._http);
4243
4283
  this.catalog = new CatalogClient(this._http);
4244
4284
  this.checkoutSessions = new CheckoutSessionsClient(this._http);
4285
+ this.commerce = new CommerceClient(this._http);
4245
4286
  this.compare = new CompareClient(this._http);
4246
4287
  this.directory = new DirectoryClient(this._http);
4247
4288
  this.documents = new DocumentsClient(this._http);