@omni-commerce/sdk 0.9.2 → 0.11.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 +4 -0
- package/dist/index.cjs +8 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20655 -19157
- package/dist/index.d.ts +20655 -19157
- package/dist/index.js +8 -27
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -75,6 +75,10 @@ await client.orders.get(
|
|
|
75
75
|
|
|
76
76
|
`await request.withRawResponse()` returns `{ data, rawResponse }` with status and headers.
|
|
77
77
|
|
|
78
|
+
## Review actions
|
|
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.
|
|
81
|
+
|
|
78
82
|
## Batch market price comparison
|
|
79
83
|
|
|
80
84
|
SDK 0.9.2 adds `products.comparePrices` and `products.getPriceComparison`. Submit up to 50 simple product or variant IDs with a `catalog:read` credential:
|
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.
|
|
38
|
+
var SDK_VERSION = "0.11.0";
|
|
39
39
|
var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
|
|
40
40
|
|
|
41
41
|
// src/environments.ts
|
|
@@ -2503,7 +2503,7 @@ var ProductsClient = class {
|
|
|
2503
2503
|
### Input options
|
|
2504
2504
|
|
|
2505
2505
|
- Upload a CSV (2 MiB) or JSON products file (8 MiB) using `multipart/form-data`.
|
|
2506
|
-
- Send JSON with a `products` array of 1–
|
|
2506
|
+
- Send JSON with a `products` array of 1–5,000 flat product objects (8 MiB request maximum).
|
|
2507
2507
|
- Send JSON with inline `csvText`.
|
|
2508
2508
|
- Send JSON referencing a stored `documentId`.
|
|
2509
2509
|
|
|
@@ -2918,38 +2918,19 @@ var ReviewsClient = class {
|
|
|
2918
2918
|
});
|
|
2919
2919
|
}
|
|
2920
2920
|
/**
|
|
2921
|
-
*
|
|
2921
|
+
* Reply to Reviews
|
|
2922
2922
|
*
|
|
2923
|
-
*
|
|
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.
|
|
2924
2924
|
|
|
2925
|
-
|
|
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.
|
|
2926
2926
|
*
|
|
2927
|
-
* `POST /api/v1/reviews/
|
|
2927
|
+
* `POST /api/v1/reviews/reply`
|
|
2928
2928
|
*/
|
|
2929
|
-
|
|
2930
|
-
const { reviewId, organizationId, ...body } = request ?? {};
|
|
2931
|
-
return this._http.request({
|
|
2932
|
-
method: "POST",
|
|
2933
|
-
path: `/api/v1/reviews/${encodePathParam("reviewId", reviewId)}/draft-reply`,
|
|
2934
|
-
query: { organizationId },
|
|
2935
|
-
body,
|
|
2936
|
-
...mergeRequestOptions(requestOptions)
|
|
2937
|
-
});
|
|
2938
|
-
}
|
|
2939
|
-
/**
|
|
2940
|
-
* Act on Reviews
|
|
2941
|
-
*
|
|
2942
|
-
* Reply to up to 50 reviews, or send Amazon review requests for solicitation rows. Requires `reviews:write`.
|
|
2943
|
-
|
|
2944
|
-
Each target succeeds or fails on its own; read `data.results`. `ok` is true only when every target succeeds.
|
|
2945
|
-
*
|
|
2946
|
-
* `POST /api/v1/reviews/actions`
|
|
2947
|
-
*/
|
|
2948
|
-
actions(request, requestOptions) {
|
|
2929
|
+
reply(request, requestOptions) {
|
|
2949
2930
|
const { ...body } = request ?? {};
|
|
2950
2931
|
return this._http.request({
|
|
2951
2932
|
method: "POST",
|
|
2952
|
-
path: "/api/v1/reviews/
|
|
2933
|
+
path: "/api/v1/reviews/reply",
|
|
2953
2934
|
query: void 0,
|
|
2954
2935
|
body,
|
|
2955
2936
|
...mergeRequestOptions(requestOptions)
|