redai-automation-web-sdk 1.9.10 → 1.9.12

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
@@ -180,8 +180,8 @@ new AutomationWebClient(config: AutomationWebConfig)
180
180
  **Config Options:**
181
181
  - `baseUrl`: URL của automation-web API
182
182
  - `timeout`: Timeout cho requests (ms)
183
- - `retryCount`: Số lần retry khi lỗi
184
- - `retryDelay`: Delay giữa các retry (ms)
183
+ - `retryCount`: Deprecated (no-op, SDK không retry)
184
+ - `retryDelay`: Deprecated (no-op, SDK không retry)
185
185
  - `apiKey`: API key (nếu cần)
186
186
  - `userAgent`: Custom user agent
187
187
  - `logging`: Bật/tắt logging
package/dist/index.cjs CHANGED
@@ -137,7 +137,7 @@ var HttpClient = class {
137
137
  timeout: this.config.timeout || 3e4,
138
138
  headers: {
139
139
  "Content-Type": "application/json",
140
- "User-Agent": this.config.userAgent || "@redai/automation-web-sdk/1.9.8",
140
+ "User-Agent": this.config.userAgent || "@redai/automation-web-sdk/1.9.11",
141
141
  ...this.config.apiKey && { Authorization: `Bearer ${this.config.apiKey}` }
142
142
  }
143
143
  });
@@ -181,43 +181,10 @@ var HttpClient = class {
181
181
  return instance;
182
182
  }
183
183
  /**
184
- * Make HTTP request with retry logic
184
+ * Make HTTP request (single attempt, no retry)
185
185
  */
186
- async makeRequestWithRetry(requestConfig, retryCount = 0) {
187
- try {
188
- return await this.axiosInstance.request(requestConfig);
189
- } catch (error) {
190
- const maxRetries = this.config.retryCount || 3;
191
- const retryDelay = this.config.retryDelay || 1e3;
192
- if (retryCount < maxRetries && this.shouldRetry(error)) {
193
- if (this.config.logging) {
194
- console.log(
195
- `[HTTP] Retrying request (${retryCount + 1}/${maxRetries}) after ${retryDelay}ms`
196
- );
197
- }
198
- await this.delay(retryDelay * Math.pow(2, retryCount));
199
- return this.makeRequestWithRetry(requestConfig, retryCount + 1);
200
- }
201
- throw error;
202
- }
203
- }
204
- /**
205
- * Determine if request should be retried
206
- */
207
- shouldRetry(error) {
208
- if (!import_axios.default.isAxiosError(error)) {
209
- return false;
210
- }
211
- if (!error.response) {
212
- return true;
213
- }
214
- return error.response.status >= 500 || error.response.status === 429;
215
- }
216
- /**
217
- * Delay utility for retry logic
218
- */
219
- delay(ms) {
220
- return new Promise((resolve) => setTimeout(resolve, ms));
186
+ async makeRequestWithRetry(requestConfig) {
187
+ return this.axiosInstance.request(requestConfig);
221
188
  }
222
189
  /**
223
190
  * Generic request method
@@ -414,9 +381,9 @@ var HttpUtils = class {
414
381
  var DEFAULT_CONFIG = {
415
382
  baseUrl: "http://localhost:3000",
416
383
  timeout: 3e4,
417
- retryCount: 3,
418
- retryDelay: 1e3,
419
- userAgent: "@redai/automation-web-sdk/1.9.8",
384
+ retryCount: 0,
385
+ retryDelay: 0,
386
+ userAgent: "@redai/automation-web-sdk/1.9.11",
420
387
  logging: false
421
388
  };
422
389
  var ThreadType = /* @__PURE__ */ ((ThreadType4) => {
@@ -1407,6 +1374,21 @@ var MessagingService = class {
1407
1374
  );
1408
1375
  return response;
1409
1376
  }
1377
+ async updateLabels(request) {
1378
+ const response = await this.httpClient.post(
1379
+ "/zalo-personal/messaging/labels/update",
1380
+ request
1381
+ );
1382
+ return response;
1383
+ }
1384
+ async assignConversationLabel(request) {
1385
+ const response = await this.httpClient.post("/zalo-personal/messaging/labels/assign-conversation", request);
1386
+ return response;
1387
+ }
1388
+ async unassignConversationLabel(request) {
1389
+ const response = await this.httpClient.post("/zalo-personal/messaging/labels/unassign-conversation", request);
1390
+ return response;
1391
+ }
1410
1392
  async getMute(request) {
1411
1393
  const response = await this.httpClient.post(
1412
1394
  "/zalo-personal/messaging/mute/get",