@omni-commerce/sdk 0.10.0 → 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/dist/index.d.cts CHANGED
@@ -2082,7 +2082,7 @@ interface paths {
2082
2082
  patch?: never;
2083
2083
  trace?: never;
2084
2084
  };
2085
- "/api/v1/reviews/{reviewId}/draft-reply": {
2085
+ "/api/v1/reviews/reply": {
2086
2086
  parameters: {
2087
2087
  query?: never;
2088
2088
  header?: never;
@@ -2092,12 +2092,12 @@ interface paths {
2092
2092
  get?: never;
2093
2093
  put?: never;
2094
2094
  /**
2095
- * Draft Review Reply
2096
- * @description Draft a reply with AI from the review, the product, recent replies, and the brand kit. Uses AI credits. Requires `reviews:write`.
2095
+ * Reply to Reviews
2096
+ * @description 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.
2097
2097
  *
2098
- * Nothing is posted; review and send the draft from the workspace Reviews page.
2098
+ * 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.
2099
2099
  */
2100
- post: operations["post_v1_reviews_by_reviewid_draft_reply"];
2100
+ post: operations["post_v1_reviews_reply"];
2101
2101
  delete?: never;
2102
2102
  options?: never;
2103
2103
  head?: never;
@@ -18057,21 +18057,39 @@ interface operations {
18057
18057
  };
18058
18058
  };
18059
18059
  };
18060
- post_v1_reviews_by_reviewid_draft_reply: {
18060
+ post_v1_reviews_reply: {
18061
18061
  parameters: {
18062
- query?: {
18063
- /** @description Required for session auth. API keys already belong to one organization. */
18064
- organizationId?: string;
18065
- };
18062
+ query?: never;
18066
18063
  header?: never;
18067
- path: {
18068
- reviewId: string;
18069
- };
18064
+ path?: never;
18070
18065
  cookie?: never;
18071
18066
  };
18072
- requestBody?: never;
18067
+ requestBody: {
18068
+ content: {
18069
+ "application/json": {
18070
+ /** @description 1–50 review UUIDs. Duplicates are processed once, in first-requested order. */
18071
+ reviewIds: string[];
18072
+ /** @description Seller reply to send to every selected review. Omit when generateWithAi is true. */
18073
+ reply?: string;
18074
+ /**
18075
+ * @description Generate a separate reply for each review using its context and the organization brand voice. Uses AI credits.
18076
+ * @default false
18077
+ */
18078
+ generateWithAi?: boolean;
18079
+ /**
18080
+ * @description true submits replies to the marketplace. With generateWithAi, false returns drafts without submitting.
18081
+ * @default true
18082
+ */
18083
+ submit?: boolean;
18084
+ /** @description Optional writing instructions for AI-generated replies. Requires generateWithAi. */
18085
+ instructions?: string;
18086
+ /** @description Required for session auth. API keys already belong to one organization. */
18087
+ organizationId?: string;
18088
+ };
18089
+ };
18090
+ };
18073
18091
  responses: {
18074
- /** @description The drafted reply. */
18092
+ /** @description Ordered reply or draft results for every requested review. */
18075
18093
  200: {
18076
18094
  headers: {
18077
18095
  [name: string]: unknown;
@@ -18092,8 +18110,21 @@ interface operations {
18092
18110
  [key: string]: string;
18093
18111
  };
18094
18112
  data: {
18095
- reply: string;
18096
- model: string;
18113
+ success: boolean;
18114
+ reviewIds: string[];
18115
+ succeededCount: number;
18116
+ failedCount: number;
18117
+ submittedCount: number;
18118
+ results: {
18119
+ reviewId: string;
18120
+ success: boolean;
18121
+ /** @description True only when the marketplace reply service confirms success. False for drafts and unconfirmed submissions. */
18122
+ submitted: boolean;
18123
+ reply?: string;
18124
+ model?: string;
18125
+ error?: string;
18126
+ sellerCenterUrl?: string;
18127
+ }[];
18097
18128
  };
18098
18129
  };
18099
18130
  };
@@ -18119,13 +18150,6 @@ interface operations {
18119
18150
  };
18120
18151
  content?: never;
18121
18152
  };
18122
- /** @description Review not found */
18123
- 404: {
18124
- headers: {
18125
- [name: string]: unknown;
18126
- };
18127
- content?: never;
18128
- };
18129
18153
  /** @description Rate limit exceeded */
18130
18154
  429: {
18131
18155
  headers: {
@@ -18140,13 +18164,6 @@ interface operations {
18140
18164
  };
18141
18165
  content?: never;
18142
18166
  };
18143
- /** @description The AI draft failed */
18144
- 502: {
18145
- headers: {
18146
- [name: string]: unknown;
18147
- };
18148
- content?: never;
18149
- };
18150
18167
  };
18151
18168
  };
18152
18169
  get_v1_search: {
@@ -22243,15 +22260,15 @@ declare class ReviewsClient {
22243
22260
  */
22244
22261
  get(request: OperationPath<operations["get_v1_reviews_by_reviewid"]> & OperationQuery<operations["get_v1_reviews_by_reviewid"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["get_v1_reviews_by_reviewid"]>>;
22245
22262
  /**
22246
- * Draft Review Reply
22263
+ * Reply to Reviews
22247
22264
  *
22248
- * Draft a reply with AI from the review, the product, recent replies, and the brand kit. Uses AI credits. Requires `reviews:write`.
22265
+ * 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.
22249
22266
 
22250
- Nothing is posted; review and send the draft from the workspace Reviews page.
22267
+ 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.
22251
22268
  *
22252
- * `POST /api/v1/reviews/{reviewId}/draft-reply`
22269
+ * `POST /api/v1/reviews/reply`
22253
22270
  */
22254
- draftReply(request: OperationPath<operations["post_v1_reviews_by_reviewid_draft_reply"]> & OperationQuery<operations["post_v1_reviews_by_reviewid_draft_reply"]> & Record<string, unknown>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["post_v1_reviews_by_reviewid_draft_reply"]>>;
22271
+ reply(request: OperationBody<operations["post_v1_reviews_reply"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["post_v1_reviews_reply"]>>;
22255
22272
  }
22256
22273
  declare class SearchClient {
22257
22274
  protected readonly _http: OmniHttp;
@@ -22591,7 +22608,7 @@ declare function constructEvent(payload: string | Uint8Array, headers: WebhookHe
22591
22608
  toleranceInSeconds?: number;
22592
22609
  }): Promise<ConstructedWebhookEvent>;
22593
22610
 
22594
- declare const SDK_VERSION = "0.10.0";
22611
+ declare const SDK_VERSION = "0.11.0";
22595
22612
 
22596
22613
  type ProductCreatedWebhookEvent = components["schemas"]["ProductCreatedWebhookEvent"];
22597
22614
  type ProductUpdatedWebhookEvent = components["schemas"]["ProductUpdatedWebhookEvent"];
package/dist/index.d.ts CHANGED
@@ -2082,7 +2082,7 @@ interface paths {
2082
2082
  patch?: never;
2083
2083
  trace?: never;
2084
2084
  };
2085
- "/api/v1/reviews/{reviewId}/draft-reply": {
2085
+ "/api/v1/reviews/reply": {
2086
2086
  parameters: {
2087
2087
  query?: never;
2088
2088
  header?: never;
@@ -2092,12 +2092,12 @@ interface paths {
2092
2092
  get?: never;
2093
2093
  put?: never;
2094
2094
  /**
2095
- * Draft Review Reply
2096
- * @description Draft a reply with AI from the review, the product, recent replies, and the brand kit. Uses AI credits. Requires `reviews:write`.
2095
+ * Reply to Reviews
2096
+ * @description 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.
2097
2097
  *
2098
- * Nothing is posted; review and send the draft from the workspace Reviews page.
2098
+ * 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.
2099
2099
  */
2100
- post: operations["post_v1_reviews_by_reviewid_draft_reply"];
2100
+ post: operations["post_v1_reviews_reply"];
2101
2101
  delete?: never;
2102
2102
  options?: never;
2103
2103
  head?: never;
@@ -18057,21 +18057,39 @@ interface operations {
18057
18057
  };
18058
18058
  };
18059
18059
  };
18060
- post_v1_reviews_by_reviewid_draft_reply: {
18060
+ post_v1_reviews_reply: {
18061
18061
  parameters: {
18062
- query?: {
18063
- /** @description Required for session auth. API keys already belong to one organization. */
18064
- organizationId?: string;
18065
- };
18062
+ query?: never;
18066
18063
  header?: never;
18067
- path: {
18068
- reviewId: string;
18069
- };
18064
+ path?: never;
18070
18065
  cookie?: never;
18071
18066
  };
18072
- requestBody?: never;
18067
+ requestBody: {
18068
+ content: {
18069
+ "application/json": {
18070
+ /** @description 1–50 review UUIDs. Duplicates are processed once, in first-requested order. */
18071
+ reviewIds: string[];
18072
+ /** @description Seller reply to send to every selected review. Omit when generateWithAi is true. */
18073
+ reply?: string;
18074
+ /**
18075
+ * @description Generate a separate reply for each review using its context and the organization brand voice. Uses AI credits.
18076
+ * @default false
18077
+ */
18078
+ generateWithAi?: boolean;
18079
+ /**
18080
+ * @description true submits replies to the marketplace. With generateWithAi, false returns drafts without submitting.
18081
+ * @default true
18082
+ */
18083
+ submit?: boolean;
18084
+ /** @description Optional writing instructions for AI-generated replies. Requires generateWithAi. */
18085
+ instructions?: string;
18086
+ /** @description Required for session auth. API keys already belong to one organization. */
18087
+ organizationId?: string;
18088
+ };
18089
+ };
18090
+ };
18073
18091
  responses: {
18074
- /** @description The drafted reply. */
18092
+ /** @description Ordered reply or draft results for every requested review. */
18075
18093
  200: {
18076
18094
  headers: {
18077
18095
  [name: string]: unknown;
@@ -18092,8 +18110,21 @@ interface operations {
18092
18110
  [key: string]: string;
18093
18111
  };
18094
18112
  data: {
18095
- reply: string;
18096
- model: string;
18113
+ success: boolean;
18114
+ reviewIds: string[];
18115
+ succeededCount: number;
18116
+ failedCount: number;
18117
+ submittedCount: number;
18118
+ results: {
18119
+ reviewId: string;
18120
+ success: boolean;
18121
+ /** @description True only when the marketplace reply service confirms success. False for drafts and unconfirmed submissions. */
18122
+ submitted: boolean;
18123
+ reply?: string;
18124
+ model?: string;
18125
+ error?: string;
18126
+ sellerCenterUrl?: string;
18127
+ }[];
18097
18128
  };
18098
18129
  };
18099
18130
  };
@@ -18119,13 +18150,6 @@ interface operations {
18119
18150
  };
18120
18151
  content?: never;
18121
18152
  };
18122
- /** @description Review not found */
18123
- 404: {
18124
- headers: {
18125
- [name: string]: unknown;
18126
- };
18127
- content?: never;
18128
- };
18129
18153
  /** @description Rate limit exceeded */
18130
18154
  429: {
18131
18155
  headers: {
@@ -18140,13 +18164,6 @@ interface operations {
18140
18164
  };
18141
18165
  content?: never;
18142
18166
  };
18143
- /** @description The AI draft failed */
18144
- 502: {
18145
- headers: {
18146
- [name: string]: unknown;
18147
- };
18148
- content?: never;
18149
- };
18150
18167
  };
18151
18168
  };
18152
18169
  get_v1_search: {
@@ -22243,15 +22260,15 @@ declare class ReviewsClient {
22243
22260
  */
22244
22261
  get(request: OperationPath<operations["get_v1_reviews_by_reviewid"]> & OperationQuery<operations["get_v1_reviews_by_reviewid"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["get_v1_reviews_by_reviewid"]>>;
22245
22262
  /**
22246
- * Draft Review Reply
22263
+ * Reply to Reviews
22247
22264
  *
22248
- * Draft a reply with AI from the review, the product, recent replies, and the brand kit. Uses AI credits. Requires `reviews:write`.
22265
+ * 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.
22249
22266
 
22250
- Nothing is posted; review and send the draft from the workspace Reviews page.
22267
+ 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.
22251
22268
  *
22252
- * `POST /api/v1/reviews/{reviewId}/draft-reply`
22269
+ * `POST /api/v1/reviews/reply`
22253
22270
  */
22254
- draftReply(request: OperationPath<operations["post_v1_reviews_by_reviewid_draft_reply"]> & OperationQuery<operations["post_v1_reviews_by_reviewid_draft_reply"]> & Record<string, unknown>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["post_v1_reviews_by_reviewid_draft_reply"]>>;
22271
+ reply(request: OperationBody<operations["post_v1_reviews_reply"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["post_v1_reviews_reply"]>>;
22255
22272
  }
22256
22273
  declare class SearchClient {
22257
22274
  protected readonly _http: OmniHttp;
@@ -22591,7 +22608,7 @@ declare function constructEvent(payload: string | Uint8Array, headers: WebhookHe
22591
22608
  toleranceInSeconds?: number;
22592
22609
  }): Promise<ConstructedWebhookEvent>;
22593
22610
 
22594
- declare const SDK_VERSION = "0.10.0";
22611
+ declare const SDK_VERSION = "0.11.0";
22595
22612
 
22596
22613
  type ProductCreatedWebhookEvent = components["schemas"]["ProductCreatedWebhookEvent"];
22597
22614
  type ProductUpdatedWebhookEvent = components["schemas"]["ProductUpdatedWebhookEvent"];
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.10.0";
36
+ var SDK_VERSION = "0.11.0";
37
37
  var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
38
38
 
39
39
  // src/environments.ts
@@ -2916,20 +2916,20 @@ var ReviewsClient = class {
2916
2916
  });
2917
2917
  }
2918
2918
  /**
2919
- * Draft Review Reply
2919
+ * Reply to Reviews
2920
2920
  *
2921
- * Draft a reply with AI from the review, the product, recent replies, and the brand kit. Uses AI credits. Requires `reviews:write`.
2921
+ * 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.
2922
2922
 
2923
- Nothing is posted; review and send the draft from the workspace Reviews page.
2923
+ 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.
2924
2924
  *
2925
- * `POST /api/v1/reviews/{reviewId}/draft-reply`
2925
+ * `POST /api/v1/reviews/reply`
2926
2926
  */
2927
- draftReply(request, requestOptions) {
2928
- const { reviewId, organizationId, ...body } = request ?? {};
2927
+ reply(request, requestOptions) {
2928
+ const { ...body } = request ?? {};
2929
2929
  return this._http.request({
2930
2930
  method: "POST",
2931
- path: `/api/v1/reviews/${encodePathParam("reviewId", reviewId)}/draft-reply`,
2932
- query: { organizationId },
2931
+ path: "/api/v1/reviews/reply",
2932
+ query: void 0,
2933
2933
  body,
2934
2934
  ...mergeRequestOptions(requestOptions)
2935
2935
  });