@omni-commerce/sdk 0.11.0 → 0.13.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
@@ -77,7 +77,7 @@ await client.orders.get(
77
77
 
78
78
  ## Review actions
79
79
 
80
- Use `client.reviews.reply({ reviewIds, reply })` to submit supplied text. Set `generateWithAi: true` instead of `reply` for an AI-generated response; `submit: false` returns drafts, while `submit: true` sends them. Optional `instructions` guide the AI. Inspect each result's `submitted` flag. The separate `draftReply` and `actions` methods are removed.
80
+ Use `client.reviews.reply({ reviewId, reply })` to submit supplied text. Set `generateWithAi: true` instead of `reply` for an AI-generated response; `submit: false` returns a draft, while `submit: true` sends it. Optional `instructions` guide the AI. The review ID goes in the URL; inspect `data.submitted` for confirmation. The separate `draftReply` and `actions` methods are removed.
81
81
 
82
82
  ## Batch market price comparison
83
83
 
@@ -96,6 +96,20 @@ console.log(completed.result?.success, completed.result?.results);
96
96
 
97
97
  Omit `gl` to compare all recorded listing markets; `gl: "sg"` restricts research to Singapore. Global Zalora prices stay separate by country/currency. An India Shopify store selling in SGD is researched in Singapore. Read each product's `markets` array for its price evidence, research, comparison, and errors. Missing published price evidence is an explicit failure; a catalog fallback is never a verified listing price. Client timeouts leave the durable job running. [Full comparison guide](https://docs.omnicommerce.sg/sdk/typescript#market-price-comparison).
98
98
 
99
+ ## Publish selected fields
100
+
101
+ Choose marketplaces and publish only saved fields on existing listings, matching the publish popover:
102
+
103
+ ```ts
104
+ const publish = await client.products.publish({
105
+ productId: "prod_123",
106
+ marketplaces: ["shopee", "lazada"],
107
+ updateFields: ["name", "description", "images"],
108
+ });
109
+ ```
110
+
111
+ Omit marketplaces to use every enabled or listed marketplace; omit fields for full publishing. Selected-field updates preserve other fields and listing visibility. Inspect every target result for capability/connection errors and await every returned job ID and inventory correlation. See the [publishing guide](https://docs.omnicommerce.sg/sdk/typescript#publish-selected-fields).
112
+
99
113
  ## Resources
100
114
 
101
115
  | Client | Examples |
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.11.0";
38
+ var SDK_VERSION = "0.13.0";
39
39
  var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
40
40
 
41
41
  // src/environments.ts
@@ -2479,12 +2479,22 @@ var ProductsClient = class {
2479
2479
  });
2480
2480
  }
2481
2481
  /**
2482
- * Publish Product
2483
- *
2484
- * Queue marketplace publish jobs for a product by productId. OmniCommerce publishes to the marketplaces already enabled on the product and uses the product's store selection or a single/default connected store.
2485
- *
2486
- * `POST /api/v1/products/{productId}/publish`
2487
- */
2482
+ * Publish Product
2483
+ *
2484
+ * ### Publishing
2485
+
2486
+ Queue durable marketplace publish/update jobs for a product. Omit marketplaces to use every enabled or already listed marketplace, or name the marketplaces to target. Omit updateFields for a full publish with live/draft visibility. Set updateFields to update only saved values for those fields on existing listings with assigned stores; other fields and listing visibility stay unchanged. No new listing is created by a selected-field update.
2487
+
2488
+ ### Marketplace capabilities
2489
+
2490
+ SEO is Shopify-only; highlights support Lazada, TikTok and Amazon; attributes exclude WhatsApp. Category-only updates require a full publish on TikTok and Amazon. Unsupported combinations and missing listings/stores return explicit per-marketplace failures while valid targets continue.
2491
+
2492
+ ### Completion
2493
+
2494
+ Accept
2495
+ *
2496
+ * `POST /api/v1/products/{productId}/publish`
2497
+ */
2488
2498
  publish(request, requestOptions) {
2489
2499
  const { productId, ...body } = request ?? {};
2490
2500
  return this._http.request({
@@ -2918,19 +2928,19 @@ var ReviewsClient = class {
2918
2928
  });
2919
2929
  }
2920
2930
  /**
2921
- * Reply to Reviews
2931
+ * Reply to Review
2922
2932
  *
2923
- * Submit supplied seller reply text, or generate per-review replies with AI. Requires `reviews:write`. Pass 1–50 `reviewIds` with either `reply` or `generateWithAi: true`. `submit` defaults to true; set false with AI generation to return drafts only. Optional `instructions` guide AI writing. AI generation uses organization AI credits.
2933
+ * Reply to one review identified by its OmniCommerce UUID in the URL. Requires `reviews:write`. Supply `reply` or set `generateWithAi: true`. `submit` defaults to true; set false with AI generation to return a draft without posting. Optional `instructions` guide AI writing. AI generation uses organization AI credits.
2924
2934
 
2925
- Read `data.results[].submitted` for confirmed marketplace submissions and `submittedCount` for the total. Partial failures remain explicit, with generated text retained when submission fails. Unsupported marketplaces return their capability limitation. Duplicate IDs are processed once in first-requested order. Amazon review requests are separate. Check review state before retrying an unconfirmed submission.
2935
+ Read `data.submitted` for confirmed marketplace submission. Generated text is retained when submission fails. Unsupported marketplaces return their capability limitation. Check review state before retrying an unconfirmed submission. Amazon review requests are separate.
2926
2936
  *
2927
- * `POST /api/v1/reviews/reply`
2937
+ * `POST /api/v1/reviews/{reviewId}/reply`
2928
2938
  */
2929
2939
  reply(request, requestOptions) {
2930
- const { ...body } = request ?? {};
2940
+ const { reviewId, ...body } = request ?? {};
2931
2941
  return this._http.request({
2932
2942
  method: "POST",
2933
- path: "/api/v1/reviews/reply",
2943
+ path: `/api/v1/reviews/${encodePathParam("reviewId", reviewId)}/reply`,
2934
2944
  query: void 0,
2935
2945
  body,
2936
2946
  ...mergeRequestOptions(requestOptions)