redai-automation-web-sdk 1.9.6 → 1.9.8

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.cjs CHANGED
@@ -37,18 +37,12 @@ __export(index_exports, {
37
37
  CommonUrgency: () => Urgency,
38
38
  DEFAULT_CONFIG: () => DEFAULT_CONFIG,
39
39
  DestType: () => DestType,
40
- ERROR_CATEGORIES: () => ERROR_CATEGORIES,
41
- ERROR_MESSAGES: () => ERROR_MESSAGES,
42
- ERROR_SEVERITY: () => ERROR_SEVERITY,
43
40
  EventManager: () => EventManager,
44
41
  EventUtils: () => EventUtils,
45
42
  FRIEND_EVENT_TYPES: () => FRIEND_EVENT_TYPES,
46
43
  FormatUtils: () => FormatUtils,
47
44
  FriendEventType: () => FriendEventType,
48
- FriendRelationship: () => FriendRelationship,
49
- FriendRequestStatus: () => FriendRequestStatus,
50
45
  FriendService: () => FriendService,
51
- FriendStatus: () => FriendStatus,
52
46
  GROUP_EVENT_TYPES: () => GROUP_EVENT_TYPES,
53
47
  Gender: () => Gender2,
54
48
  GroupDeliveredMessage: () => GroupDeliveredMessage,
@@ -59,7 +53,6 @@ __export(index_exports, {
59
53
  GroupTyping: () => GroupTyping,
60
54
  HealthService: () => HealthService,
61
55
  HttpClient: () => HttpClient,
62
- HttpError: () => HttpError,
63
56
  HttpUtils: () => HttpUtils,
64
57
  InstanceManagerService: () => InstanceManagerService,
65
58
  JobPriority: () => JobPriority,
@@ -97,10 +90,6 @@ __export(index_exports, {
97
90
  WebhookGender: () => Gender,
98
91
  WebhookService: () => WebhookService,
99
92
  ZaloConnectionStatus: () => ZaloConnectionStatus,
100
- ZaloErrorCode: () => ZaloErrorCode,
101
- ZaloErrorContext: () => ZaloErrorContext,
102
- ZaloErrorSeverity: () => ZaloErrorSeverity,
103
- ZaloErrorUtils: () => ZaloErrorUtils,
104
93
  ZaloMeService: () => ZaloMeService,
105
94
  ZaloMessageCategory: () => ZaloMessageCategory,
106
95
  ZaloMessageType: () => ZaloMessageType,
@@ -133,15 +122,6 @@ module.exports = __toCommonJS(index_exports);
133
122
 
134
123
  // src/utils/http.utils.ts
135
124
  var import_axios = __toESM(require("axios"));
136
- var HttpError = class extends Error {
137
- constructor(message, status, code, response) {
138
- super(message);
139
- this.status = status;
140
- this.code = code;
141
- this.response = response;
142
- this.name = "HttpError";
143
- }
144
- };
145
125
  var HttpClient = class {
146
126
  constructor(config) {
147
127
  this.config = config;
@@ -156,7 +136,7 @@ var HttpClient = class {
156
136
  timeout: this.config.timeout || 3e4,
157
137
  headers: {
158
138
  "Content-Type": "application/json",
159
- "User-Agent": this.config.userAgent || "@redai/automation-web-sdk/1.0.0",
139
+ "User-Agent": this.config.userAgent || "@redai/automation-web-sdk/1.9.8",
160
140
  ...this.config.apiKey && { Authorization: `Bearer ${this.config.apiKey}` }
161
141
  }
162
142
  });
@@ -188,31 +168,17 @@ var HttpClient = class {
188
168
  },
189
169
  (error) => {
190
170
  if (this.config.logging) {
191
- console.error("[HTTP] Response error:", error.response?.data || error.message);
171
+ if (import_axios.default.isAxiosError(error)) {
172
+ console.error("[HTTP] Response error:", error.response?.data || error.message);
173
+ } else {
174
+ console.error("[HTTP] Response error:", error);
175
+ }
192
176
  }
193
- return Promise.reject(this.handleError(error));
177
+ return Promise.reject(error);
194
178
  }
195
179
  );
196
180
  return instance;
197
181
  }
198
- /**
199
- * Handle axios errors and convert to HttpError
200
- */
201
- handleError(error) {
202
- if (error.response) {
203
- const response = error.response.data;
204
- return new HttpError(
205
- response.error || response.message || "Request failed",
206
- error.response.status,
207
- response.code?.toString(),
208
- response
209
- );
210
- } else if (error.request) {
211
- return new HttpError("Network error - no response received", 0, "NETWORK_ERROR");
212
- } else {
213
- return new HttpError(error.message || "Unknown error occurred", 0, "UNKNOWN_ERROR");
214
- }
215
- }
216
182
  /**
217
183
  * Make HTTP request with retry logic
218
184
  */
@@ -238,7 +204,13 @@ var HttpClient = class {
238
204
  * Determine if request should be retried
239
205
  */
240
206
  shouldRetry(error) {
241
- return error.code === "NETWORK_ERROR" || error.status !== void 0 && error.status >= 500 || error.status === 429;
207
+ if (!import_axios.default.isAxiosError(error)) {
208
+ return false;
209
+ }
210
+ if (!error.response) {
211
+ return true;
212
+ }
213
+ return error.response.status >= 500 || error.response.status === 429;
242
214
  }
243
215
  /**
244
216
  * Delay utility for retry logic
@@ -259,16 +231,7 @@ var HttpClient = class {
259
231
  timeout: options.timeout || this.config.timeout
260
232
  };
261
233
  const response = await this.makeRequestWithRetry(requestConfig);
262
- const responseData = response.data;
263
- if (responseData.error) {
264
- throw new HttpError(
265
- responseData.error,
266
- responseData.code || response.status,
267
- responseData.code?.toString(),
268
- responseData
269
- );
270
- }
271
- return responseData;
234
+ return response.data;
272
235
  }
273
236
  /**
274
237
  * GET request
@@ -452,7 +415,7 @@ var DEFAULT_CONFIG = {
452
415
  timeout: 3e4,
453
416
  retryCount: 3,
454
417
  retryDelay: 1e3,
455
- userAgent: "@redai/automation-web-sdk/1.0.0",
418
+ userAgent: "@redai/automation-web-sdk/1.9.8",
456
419
  logging: false
457
420
  };
458
421
  var ThreadType = /* @__PURE__ */ ((ThreadType4) => {
@@ -2214,9 +2177,9 @@ var FriendService = class {
2214
2177
  }
2215
2178
  // ==================== BASIC FRIEND METHODS ====================
2216
2179
  /**
2217
- * Lấy tất cả friends
2180
+ * Lấy tất cả friends
2218
2181
  * POST /zalo-personal/friends/all
2219
- * @returns ZaloGetAllFriendsResponse - Array của ZaloFriendItem từ SDK (dữ liệu thô)
2182
+ * @returns ZaloGetAllFriendsResponse - Array của ZaloFriendItem từ SDK (dữ liệu thô)
2220
2183
  */
2221
2184
  async getAllFriends(request) {
2222
2185
  const response = await this.httpClient.post(
@@ -2228,7 +2191,7 @@ var FriendService = class {
2228
2191
  return response;
2229
2192
  }
2230
2193
  /**
2231
- * Tìm kiếm friends
2194
+ * Tìm kiếm friends
2232
2195
  * POST /zalo-personal/friends/search
2233
2196
  */
2234
2197
  async searchFriends(request) {
@@ -2243,7 +2206,7 @@ var FriendService = class {
2243
2206
  return response;
2244
2207
  }
2245
2208
  /**
2246
- * Lấy thông tin chi tiết friends
2209
+ * Lấy thông tin chi tiết friends
2247
2210
  * POST /zalo-personal/friends/info
2248
2211
  */
2249
2212
  async getFriendsInfo(request) {
@@ -2257,7 +2220,7 @@ var FriendService = class {
2257
2220
  return response;
2258
2221
  }
2259
2222
  /**
2260
- * Lấy friends đang online
2223
+ * Lấy friends đang online
2261
2224
  * POST /zalo-personal/friends/online
2262
2225
  */
2263
2226
  async getOnlineFriends(request) {
@@ -2270,7 +2233,7 @@ var FriendService = class {
2270
2233
  return response;
2271
2234
  }
2272
2235
  /**
2273
- * Lấy thống kê friends
2236
+ * Lấy thống kê friends
2274
2237
  * GET /zalo-personal/friends/stats
2275
2238
  */
2276
2239
  async getFriendsStats(sessionId) {
@@ -2281,7 +2244,7 @@ var FriendService = class {
2281
2244
  }
2282
2245
  // ==================== FRIEND REQUEST METHODS ====================
2283
2246
  /**
2284
- * Gửi lời mời kết bạn
2247
+ * Gửi lời mời kết bạn
2285
2248
  * POST /zalo-personal/friends/request/send
2286
2249
  */
2287
2250
  async sendFriendRequest(request) {
@@ -2296,7 +2259,7 @@ var FriendService = class {
2296
2259
  return response;
2297
2260
  }
2298
2261
  /**
2299
- * Chấp nhận lời mời kết bạn
2262
+ * Chấp nhận lời mời kết bạn
2300
2263
  * POST /zalo-personal/friends/request/accept
2301
2264
  */
2302
2265
  async acceptFriendRequest(request) {
@@ -2310,17 +2273,7 @@ var FriendService = class {
2310
2273
  return response;
2311
2274
  }
2312
2275
  /**
2313
- * Lấy danh sách lời mời nhận được
2314
- * POST /zalo-personal/friends/request/received
2315
- */
2316
- async getReceivedFriendRequests(request) {
2317
- const response = await this.httpClient.post("/zalo-personal/friends/request/received", {
2318
- sessionId: request.sessionId
2319
- });
2320
- return response;
2321
- }
2322
- /**
2323
- * Lấy danh sách lời mời đã gửi
2276
+ * Lấy danh sách lời mời đã gửi
2324
2277
  * POST /zalo-personal/friends/request/sent
2325
2278
  */
2326
2279
  async getSentFriendRequests(request) {
@@ -2330,7 +2283,7 @@ var FriendService = class {
2330
2283
  return response;
2331
2284
  }
2332
2285
  /**
2333
- * Hủy lời mời đã gửi
2286
+ * Hủy lời mời đã gửi
2334
2287
  * POST /zalo-personal/friends/request/undo
2335
2288
  */
2336
2289
  async undoFriendRequest(request) {
@@ -2345,7 +2298,7 @@ var FriendService = class {
2345
2298
  }
2346
2299
  // ==================== FRIEND MANAGEMENT METHODS ====================
2347
2300
  /**
2348
- * Xóa bạn bè
2301
+ * Xóa bạn bè
2349
2302
  * POST /zalo-personal/friends/remove
2350
2303
  */
2351
2304
  async removeFriend(request) {
@@ -2359,7 +2312,7 @@ var FriendService = class {
2359
2312
  return response;
2360
2313
  }
2361
2314
  /**
2362
- * Chặn user
2315
+ * Chặn user
2363
2316
  * POST /zalo-personal/friends/block
2364
2317
  */
2365
2318
  async blockUser(request) {
@@ -2373,7 +2326,7 @@ var FriendService = class {
2373
2326
  return response;
2374
2327
  }
2375
2328
  /**
2376
- * Bỏ chặn user
2329
+ * Bỏ chặn user
2377
2330
  * POST /zalo-personal/friends/unblock
2378
2331
  */
2379
2332
  async unblockUser(request) {
@@ -2387,7 +2340,7 @@ var FriendService = class {
2387
2340
  return response;
2388
2341
  }
2389
2342
  /**
2390
- * Thay đổi biệt danh friend
2343
+ * Thay đổi biệt danh friend
2391
2344
  * POST /zalo-personal/friends/alias/change
2392
2345
  */
2393
2346
  async changeFriendAlias(request) {
@@ -2402,7 +2355,7 @@ var FriendService = class {
2402
2355
  return response;
2403
2356
  }
2404
2357
  /**
2405
- * Xóa biệt danh friend
2358
+ * Xóa biệt danh friend
2406
2359
  * POST /zalo-personal/friends/alias/remove
2407
2360
  */
2408
2361
  async removeFriendAlias(request) {
@@ -2416,7 +2369,7 @@ var FriendService = class {
2416
2369
  return response;
2417
2370
  }
2418
2371
  /**
2419
- * Lấy danh sách biệt danh
2372
+ * Lấy danh sách biệt danh
2420
2373
  * POST /zalo-personal/friends/alias/list
2421
2374
  */
2422
2375
  async getAliasList(request) {
@@ -2432,7 +2385,7 @@ var FriendService = class {
2432
2385
  }
2433
2386
  // ==================== USER SEARCH & ACCOUNT METHODS ====================
2434
2387
  /**
2435
- * Tìm kiếm user theo số điện thoại
2388
+ * Tìm kiếm user theo số điện thoại
2436
2389
  * POST /zalo-personal/friends/find-user
2437
2390
  */
2438
2391
  async findUser(request) {
@@ -2446,7 +2399,7 @@ var FriendService = class {
2446
2399
  return response;
2447
2400
  }
2448
2401
  /**
2449
- * TAªm ki §¨m nhi ¯?u user theo danh sA­ch s ¯` Ž`i ¯Øn tho §­i
2402
+ * TAªm ki §¨m nhi ¯?u user theo danh sA­ch s ¯` Ž`i ¯Øn tho §­i
2450
2403
  * POST /zalo-personal/friends/find-multi-users
2451
2404
  */
2452
2405
  async findMultiUsers(request) {
@@ -2460,7 +2413,7 @@ var FriendService = class {
2460
2413
  return response;
2461
2414
  }
2462
2415
  /**
2463
- * Lấy thời gian last online
2416
+ * Lấy thời gian last online
2464
2417
  * POST /zalo-personal/friends/last-online
2465
2418
  */
2466
2419
  async getLastOnline(request) {
@@ -2474,7 +2427,7 @@ var FriendService = class {
2474
2427
  return response;
2475
2428
  }
2476
2429
  /**
2477
- * Lấy own ID
2430
+ * Lấy own ID
2478
2431
  * POST /zalo-personal/friends/own-id
2479
2432
  */
2480
2433
  async getOwnId(request) {
@@ -2487,7 +2440,7 @@ var FriendService = class {
2487
2440
  return response;
2488
2441
  }
2489
2442
  /**
2490
- * Lấy cài đặt tài khoản
2443
+ * Lấy cài đặt tài khoản
2491
2444
  * POST /zalo-personal/friends/settings
2492
2445
  */
2493
2446
  async getSettings(request) {
@@ -2497,7 +2450,7 @@ var FriendService = class {
2497
2450
  return response;
2498
2451
  }
2499
2452
  /**
2500
- * Lấy thông tin tài khoản
2453
+ * Lấy thông tin tài khoản
2501
2454
  * POST /zalo-personal/friends/account-info
2502
2455
  */
2503
2456
  async fetchAccountInfo(request) {
@@ -2659,6 +2612,20 @@ var UserInfoService = class {
2659
2612
  });
2660
2613
  return response;
2661
2614
  }
2615
+ /**
2616
+ * Tìm kiếm user theo danh sách số điện thoại
2617
+ * POST /zalo-personal/user-info/get-multi-users-by-phone
2618
+ */
2619
+ async getMultiUsersByPhone(request) {
2620
+ ValidationUtils.validateSessionId(request.sessionId);
2621
+ ValidationUtils.validateIdArray(request.phoneNumbers, "phoneNumbers", 1);
2622
+ const response = await this.httpClient.post("/zalo-personal/user-info/get-multi-users-by-phone", {
2623
+ sessionId: request.sessionId,
2624
+ phoneNumbers: request.phoneNumbers,
2625
+ isAvatarSizeMax: request.isAvatarSizeMax
2626
+ });
2627
+ return response;
2628
+ }
2662
2629
  };
2663
2630
 
2664
2631
  // src/services/profile/profile.service.ts
@@ -4031,7 +3998,7 @@ var AutomationWebClient = class {
4031
3998
  * Get SDK version
4032
3999
  */
4033
4000
  getVersion() {
4034
- return "1.0.0";
4001
+ return "1.9.8";
4035
4002
  }
4036
4003
  /**
4037
4004
  * Test connection to automation-web API
@@ -4683,31 +4650,6 @@ var GROUP_EVENT_TYPES = [
4683
4650
  "group-event-unknown" /* GROUP_EVENT_UNKNOWN */
4684
4651
  ];
4685
4652
 
4686
- // src/types/friends.types.ts
4687
- var FriendStatus = /* @__PURE__ */ ((FriendStatus2) => {
4688
- FriendStatus2["ONLINE"] = "online";
4689
- FriendStatus2["OFFLINE"] = "offline";
4690
- FriendStatus2["AWAY"] = "away";
4691
- FriendStatus2["BUSY"] = "busy";
4692
- FriendStatus2["INVISIBLE"] = "invisible";
4693
- return FriendStatus2;
4694
- })(FriendStatus || {});
4695
- var FriendRequestStatus = /* @__PURE__ */ ((FriendRequestStatus2) => {
4696
- FriendRequestStatus2["PENDING"] = "pending";
4697
- FriendRequestStatus2["ACCEPTED"] = "accepted";
4698
- FriendRequestStatus2["REJECTED"] = "rejected";
4699
- FriendRequestStatus2["CANCELLED"] = "cancelled";
4700
- return FriendRequestStatus2;
4701
- })(FriendRequestStatus || {});
4702
- var FriendRelationship = /* @__PURE__ */ ((FriendRelationship2) => {
4703
- FriendRelationship2["FRIEND"] = "friend";
4704
- FriendRelationship2["BLOCKED"] = "blocked";
4705
- FriendRelationship2["STRANGER"] = "stranger";
4706
- FriendRelationship2["PENDING_INCOMING"] = "pending_incoming";
4707
- FriendRelationship2["PENDING_OUTGOING"] = "pending_outgoing";
4708
- return FriendRelationship2;
4709
- })(FriendRelationship || {});
4710
-
4711
4653
  // src/types/dto/profile.type.ts
4712
4654
  var Gender2 = /* @__PURE__ */ ((Gender3) => {
4713
4655
  Gender3[Gender3["Male"] = 0] = "Male";
@@ -4862,549 +4804,6 @@ var ProxyStatus = /* @__PURE__ */ ((ProxyStatus2) => {
4862
4804
  return ProxyStatus2;
4863
4805
  })(ProxyStatus || {});
4864
4806
 
4865
- // src/types/error.types.ts
4866
- var ZaloErrorCode = /* @__PURE__ */ ((ZaloErrorCode2) => {
4867
- ZaloErrorCode2[ZaloErrorCode2["SESSION_NOT_FOUND"] = 1001] = "SESSION_NOT_FOUND";
4868
- ZaloErrorCode2[ZaloErrorCode2["SESSION_EXPIRED"] = 1002] = "SESSION_EXPIRED";
4869
- ZaloErrorCode2[ZaloErrorCode2["SESSION_INACTIVE"] = 1003] = "SESSION_INACTIVE";
4870
- ZaloErrorCode2[ZaloErrorCode2["INVALID_CREDENTIALS"] = 1004] = "INVALID_CREDENTIALS";
4871
- ZaloErrorCode2[ZaloErrorCode2["AUTHENTICATION_FAILED"] = 1005] = "AUTHENTICATION_FAILED";
4872
- ZaloErrorCode2[ZaloErrorCode2["SESSION_CREATION_FAILED"] = 1006] = "SESSION_CREATION_FAILED";
4873
- ZaloErrorCode2[ZaloErrorCode2["SESSION_VALIDATION_FAILED"] = 1007] = "SESSION_VALIDATION_FAILED";
4874
- ZaloErrorCode2[ZaloErrorCode2["USER_NOT_FOUND"] = 1101] = "USER_NOT_FOUND";
4875
- ZaloErrorCode2[ZaloErrorCode2["USER_ID_INVALID"] = 1102] = "USER_ID_INVALID";
4876
- ZaloErrorCode2[ZaloErrorCode2["USER_PROFILE_PRIVATE"] = 1103] = "USER_PROFILE_PRIVATE";
4877
- ZaloErrorCode2[ZaloErrorCode2["USER_BLOCKED_YOU"] = 1104] = "USER_BLOCKED_YOU";
4878
- ZaloErrorCode2[ZaloErrorCode2["USER_DOESNT_EXIST"] = 1105] = "USER_DOESNT_EXIST";
4879
- ZaloErrorCode2[ZaloErrorCode2["USER_NOT_ACCESSIBLE"] = 1106] = "USER_NOT_ACCESSIBLE";
4880
- ZaloErrorCode2[ZaloErrorCode2["FRIEND_REQUEST_FAILED"] = 1201] = "FRIEND_REQUEST_FAILED";
4881
- ZaloErrorCode2[ZaloErrorCode2["FRIEND_NOT_FOUND"] = 1202] = "FRIEND_NOT_FOUND";
4882
- ZaloErrorCode2[ZaloErrorCode2["ALREADY_FRIENDS"] = 1203] = "ALREADY_FRIENDS";
4883
- ZaloErrorCode2[ZaloErrorCode2["FRIEND_REQUEST_SENT"] = 1204] = "FRIEND_REQUEST_SENT";
4884
- ZaloErrorCode2[ZaloErrorCode2["CANNOT_SEND_REQUEST"] = 1205] = "CANNOT_SEND_REQUEST";
4885
- ZaloErrorCode2[ZaloErrorCode2["FRIEND_BLOCKED"] = 1206] = "FRIEND_BLOCKED";
4886
- ZaloErrorCode2[ZaloErrorCode2["CANNOT_UNFRIEND"] = 1207] = "CANNOT_UNFRIEND";
4887
- ZaloErrorCode2[ZaloErrorCode2["GROUP_NOT_FOUND"] = 1301] = "GROUP_NOT_FOUND";
4888
- ZaloErrorCode2[ZaloErrorCode2["GROUP_ID_INVALID"] = 1302] = "GROUP_ID_INVALID";
4889
- ZaloErrorCode2[ZaloErrorCode2["NOT_GROUP_MEMBER"] = 1303] = "NOT_GROUP_MEMBER";
4890
- ZaloErrorCode2[ZaloErrorCode2["NOT_GROUP_ADMIN"] = 1304] = "NOT_GROUP_ADMIN";
4891
- ZaloErrorCode2[ZaloErrorCode2["GROUP_FULL"] = 1305] = "GROUP_FULL";
4892
- ZaloErrorCode2[ZaloErrorCode2["CANNOT_JOIN_GROUP"] = 1306] = "CANNOT_JOIN_GROUP";
4893
- ZaloErrorCode2[ZaloErrorCode2["GROUP_CREATION_FAILED"] = 1307] = "GROUP_CREATION_FAILED";
4894
- ZaloErrorCode2[ZaloErrorCode2["GROUP_SETTINGS_UPDATE_FAILED"] = 1308] = "GROUP_SETTINGS_UPDATE_FAILED";
4895
- ZaloErrorCode2[ZaloErrorCode2["MESSAGE_NOT_FOUND"] = 1401] = "MESSAGE_NOT_FOUND";
4896
- ZaloErrorCode2[ZaloErrorCode2["CANNOT_SEND_MESSAGE"] = 1402] = "CANNOT_SEND_MESSAGE";
4897
- ZaloErrorCode2[ZaloErrorCode2["MEDIA_TOO_LARGE"] = 1403] = "MEDIA_TOO_LARGE";
4898
- ZaloErrorCode2[ZaloErrorCode2["UNSUPPORTED_MEDIA_TYPE"] = 1404] = "UNSUPPORTED_MEDIA_TYPE";
4899
- ZaloErrorCode2[ZaloErrorCode2["MESSAGE_SEND_FAILED"] = 1405] = "MESSAGE_SEND_FAILED";
4900
- ZaloErrorCode2[ZaloErrorCode2["MESSAGE_FORWARD_FAILED"] = 1406] = "MESSAGE_FORWARD_FAILED";
4901
- ZaloErrorCode2[ZaloErrorCode2["REACTION_FAILED"] = 1407] = "REACTION_FAILED";
4902
- ZaloErrorCode2[ZaloErrorCode2["INVALID_PARAMETERS"] = 1501] = "INVALID_PARAMETERS";
4903
- ZaloErrorCode2[ZaloErrorCode2["MISSING_REQUIRED_FIELDS"] = 1502] = "MISSING_REQUIRED_FIELDS";
4904
- ZaloErrorCode2[ZaloErrorCode2["INVALID_USER_ID_FORMAT"] = 1503] = "INVALID_USER_ID_FORMAT";
4905
- ZaloErrorCode2[ZaloErrorCode2["INVALID_GROUP_ID_FORMAT"] = 1504] = "INVALID_GROUP_ID_FORMAT";
4906
- ZaloErrorCode2[ZaloErrorCode2["INVALID_MESSAGE_FORMAT"] = 1505] = "INVALID_MESSAGE_FORMAT";
4907
- ZaloErrorCode2[ZaloErrorCode2["BATCH_SIZE_EXCEEDED"] = 1506] = "BATCH_SIZE_EXCEEDED";
4908
- ZaloErrorCode2[ZaloErrorCode2["INVALID_ATTACHMENT_FORMAT"] = 1507] = "INVALID_ATTACHMENT_FORMAT";
4909
- ZaloErrorCode2[ZaloErrorCode2["RATE_LIMIT_EXCEEDED"] = 1601] = "RATE_LIMIT_EXCEEDED";
4910
- ZaloErrorCode2[ZaloErrorCode2["TOO_MANY_REQUESTS"] = 1602] = "TOO_MANY_REQUESTS";
4911
- ZaloErrorCode2[ZaloErrorCode2["TEMPORARY_BLOCK"] = 1603] = "TEMPORARY_BLOCK";
4912
- ZaloErrorCode2[ZaloErrorCode2["REQUEST_LIMIT_REACHED"] = 1604] = "REQUEST_LIMIT_REACHED";
4913
- ZaloErrorCode2[ZaloErrorCode2["SPAM_DETECTED"] = 1605] = "SPAM_DETECTED";
4914
- ZaloErrorCode2[ZaloErrorCode2["NETWORK_ERROR"] = 1701] = "NETWORK_ERROR";
4915
- ZaloErrorCode2[ZaloErrorCode2["CONNECTION_TIMEOUT"] = 1702] = "CONNECTION_TIMEOUT";
4916
- ZaloErrorCode2[ZaloErrorCode2["API_UNAVAILABLE"] = 1703] = "API_UNAVAILABLE";
4917
- ZaloErrorCode2[ZaloErrorCode2["SERVER_ERROR"] = 1704] = "SERVER_ERROR";
4918
- ZaloErrorCode2[ZaloErrorCode2["CONNECTION_REFUSED"] = 1705] = "CONNECTION_REFUSED";
4919
- ZaloErrorCode2[ZaloErrorCode2["DNS_RESOLUTION_FAILED"] = 1706] = "DNS_RESOLUTION_FAILED";
4920
- ZaloErrorCode2[ZaloErrorCode2["PROXY_CONNECTION_FAILED"] = 1707] = "PROXY_CONNECTION_FAILED";
4921
- ZaloErrorCode2[ZaloErrorCode2["INSUFFICIENT_PERMISSIONS"] = 1801] = "INSUFFICIENT_PERMISSIONS";
4922
- ZaloErrorCode2[ZaloErrorCode2["ACCESS_DENIED"] = 1802] = "ACCESS_DENIED";
4923
- ZaloErrorCode2[ZaloErrorCode2["ACCOUNT_SUSPENDED"] = 1803] = "ACCOUNT_SUSPENDED";
4924
- ZaloErrorCode2[ZaloErrorCode2["ACCOUNT_BANNED"] = 1804] = "ACCOUNT_BANNED";
4925
- ZaloErrorCode2[ZaloErrorCode2["DEVICE_NOT_VERIFIED"] = 1805] = "DEVICE_NOT_VERIFIED";
4926
- ZaloErrorCode2[ZaloErrorCode2["REGION_RESTRICTED"] = 1806] = "REGION_RESTRICTED";
4927
- ZaloErrorCode2[ZaloErrorCode2["AGE_RESTRICTED"] = 1807] = "AGE_RESTRICTED";
4928
- ZaloErrorCode2[ZaloErrorCode2["OPERATION_NOT_ALLOWED"] = 1901] = "OPERATION_NOT_ALLOWED";
4929
- ZaloErrorCode2[ZaloErrorCode2["FEATURE_NOT_AVAILABLE"] = 1902] = "FEATURE_NOT_AVAILABLE";
4930
- ZaloErrorCode2[ZaloErrorCode2["SUBSCRIPTION_REQUIRED"] = 1903] = "SUBSCRIPTION_REQUIRED";
4931
- ZaloErrorCode2[ZaloErrorCode2["QUOTA_EXCEEDED"] = 1904] = "QUOTA_EXCEEDED";
4932
- ZaloErrorCode2[ZaloErrorCode2["INVALID_OPERATION_CONTEXT"] = 1905] = "INVALID_OPERATION_CONTEXT";
4933
- ZaloErrorCode2[ZaloErrorCode2["DATA_PARSING_FAILED"] = 2001] = "DATA_PARSING_FAILED";
4934
- ZaloErrorCode2[ZaloErrorCode2["ENCRYPTION_FAILED"] = 2002] = "ENCRYPTION_FAILED";
4935
- ZaloErrorCode2[ZaloErrorCode2["DECRYPTION_FAILED"] = 2003] = "DECRYPTION_FAILED";
4936
- ZaloErrorCode2[ZaloErrorCode2["DATA_CORRUPTION"] = 2004] = "DATA_CORRUPTION";
4937
- ZaloErrorCode2[ZaloErrorCode2["INVALID_JSON_FORMAT"] = 2005] = "INVALID_JSON_FORMAT";
4938
- ZaloErrorCode2[ZaloErrorCode2["EXTERNAL_API_ERROR"] = 2101] = "EXTERNAL_API_ERROR";
4939
- ZaloErrorCode2[ZaloErrorCode2["WEBHOOK_DELIVERY_FAILED"] = 2102] = "WEBHOOK_DELIVERY_FAILED";
4940
- ZaloErrorCode2[ZaloErrorCode2["CALLBACK_TIMEOUT"] = 2103] = "CALLBACK_TIMEOUT";
4941
- ZaloErrorCode2[ZaloErrorCode2["THIRD_PARTY_SERVICE_ERROR"] = 2104] = "THIRD_PARTY_SERVICE_ERROR";
4942
- ZaloErrorCode2[ZaloErrorCode2["UNKNOWN_ERROR"] = 9e3] = "UNKNOWN_ERROR";
4943
- ZaloErrorCode2[ZaloErrorCode2["INTERNAL_ERROR"] = 9001] = "INTERNAL_ERROR";
4944
- ZaloErrorCode2[ZaloErrorCode2["INVALID_RESPONSE"] = 9002] = "INVALID_RESPONSE";
4945
- ZaloErrorCode2[ZaloErrorCode2["UNEXPECTED_ERROR"] = 9003] = "UNEXPECTED_ERROR";
4946
- ZaloErrorCode2[ZaloErrorCode2["NOT_IMPLEMENTED"] = 9004] = "NOT_IMPLEMENTED";
4947
- ZaloErrorCode2[ZaloErrorCode2["MAINTENANCE_MODE"] = 9005] = "MAINTENANCE_MODE";
4948
- return ZaloErrorCode2;
4949
- })(ZaloErrorCode || {});
4950
- var ZaloErrorSeverity = /* @__PURE__ */ ((ZaloErrorSeverity2) => {
4951
- ZaloErrorSeverity2["LOW"] = "low";
4952
- ZaloErrorSeverity2["MEDIUM"] = "medium";
4953
- ZaloErrorSeverity2["HIGH"] = "high";
4954
- ZaloErrorSeverity2["CRITICAL"] = "critical";
4955
- return ZaloErrorSeverity2;
4956
- })(ZaloErrorSeverity || {});
4957
- var ERROR_CATEGORIES = {
4958
- [1001 /* SESSION_NOT_FOUND */]: "authentication",
4959
- [1002 /* SESSION_EXPIRED */]: "authentication",
4960
- [1003 /* SESSION_INACTIVE */]: "authentication",
4961
- [1004 /* INVALID_CREDENTIALS */]: "authentication",
4962
- [1005 /* AUTHENTICATION_FAILED */]: "authentication",
4963
- [1101 /* USER_NOT_FOUND */]: "user_info",
4964
- [1102 /* USER_ID_INVALID */]: "user_info",
4965
- [1103 /* USER_PROFILE_PRIVATE */]: "user_info",
4966
- [1104 /* USER_BLOCKED_YOU */]: "user_info",
4967
- [1105 /* USER_DOESNT_EXIST */]: "user_info",
4968
- [1106 /* USER_NOT_ACCESSIBLE */]: "user_info",
4969
- [1201 /* FRIEND_REQUEST_FAILED */]: "friend_management",
4970
- [1202 /* FRIEND_NOT_FOUND */]: "friend_management",
4971
- [1203 /* ALREADY_FRIENDS */]: "friend_management",
4972
- [1204 /* FRIEND_REQUEST_SENT */]: "friend_management",
4973
- [1205 /* CANNOT_SEND_REQUEST */]: "friend_management",
4974
- [1206 /* FRIEND_BLOCKED */]: "friend_management",
4975
- [1207 /* CANNOT_UNFRIEND */]: "friend_management",
4976
- [1301 /* GROUP_NOT_FOUND */]: "group_management",
4977
- [1302 /* GROUP_ID_INVALID */]: "group_management",
4978
- [1303 /* NOT_GROUP_MEMBER */]: "group_management",
4979
- [1304 /* NOT_GROUP_ADMIN */]: "group_management",
4980
- [1305 /* GROUP_FULL */]: "group_management",
4981
- [1306 /* CANNOT_JOIN_GROUP */]: "group_management",
4982
- [1307 /* GROUP_CREATION_FAILED */]: "group_management",
4983
- [1308 /* GROUP_SETTINGS_UPDATE_FAILED */]: "group_management",
4984
- [1401 /* MESSAGE_NOT_FOUND */]: "messaging",
4985
- [1402 /* CANNOT_SEND_MESSAGE */]: "messaging",
4986
- [1403 /* MEDIA_TOO_LARGE */]: "messaging",
4987
- [1404 /* UNSUPPORTED_MEDIA_TYPE */]: "messaging",
4988
- [1405 /* MESSAGE_SEND_FAILED */]: "messaging",
4989
- [1406 /* MESSAGE_FORWARD_FAILED */]: "messaging",
4990
- [1407 /* REACTION_FAILED */]: "messaging",
4991
- [1501 /* INVALID_PARAMETERS */]: "validation",
4992
- [1502 /* MISSING_REQUIRED_FIELDS */]: "validation",
4993
- [1503 /* INVALID_USER_ID_FORMAT */]: "validation",
4994
- [1504 /* INVALID_GROUP_ID_FORMAT */]: "validation",
4995
- [1505 /* INVALID_MESSAGE_FORMAT */]: "validation",
4996
- [1506 /* BATCH_SIZE_EXCEEDED */]: "validation",
4997
- [1507 /* INVALID_ATTACHMENT_FORMAT */]: "validation",
4998
- [1601 /* RATE_LIMIT_EXCEEDED */]: "rate_limiting",
4999
- [1602 /* TOO_MANY_REQUESTS */]: "rate_limiting",
5000
- [1603 /* TEMPORARY_BLOCK */]: "rate_limiting",
5001
- [1604 /* REQUEST_LIMIT_REACHED */]: "rate_limiting",
5002
- [1605 /* SPAM_DETECTED */]: "rate_limiting",
5003
- [1701 /* NETWORK_ERROR */]: "network",
5004
- [1702 /* CONNECTION_TIMEOUT */]: "network",
5005
- [1703 /* API_UNAVAILABLE */]: "network",
5006
- [1704 /* SERVER_ERROR */]: "network",
5007
- [1705 /* CONNECTION_REFUSED */]: "network",
5008
- [1706 /* DNS_RESOLUTION_FAILED */]: "network",
5009
- [1707 /* PROXY_CONNECTION_FAILED */]: "network",
5010
- [1801 /* INSUFFICIENT_PERMISSIONS */]: "permission",
5011
- [1802 /* ACCESS_DENIED */]: "permission",
5012
- [1803 /* ACCOUNT_SUSPENDED */]: "permission",
5013
- [1804 /* ACCOUNT_BANNED */]: "permission",
5014
- [1805 /* DEVICE_NOT_VERIFIED */]: "permission",
5015
- [1806 /* REGION_RESTRICTED */]: "permission",
5016
- [1807 /* AGE_RESTRICTED */]: "permission",
5017
- [1901 /* OPERATION_NOT_ALLOWED */]: "business_logic",
5018
- [1902 /* FEATURE_NOT_AVAILABLE */]: "business_logic",
5019
- [1903 /* SUBSCRIPTION_REQUIRED */]: "business_logic",
5020
- [1904 /* QUOTA_EXCEEDED */]: "business_logic",
5021
- [1905 /* INVALID_OPERATION_CONTEXT */]: "business_logic",
5022
- [2001 /* DATA_PARSING_FAILED */]: "data_processing",
5023
- [2002 /* ENCRYPTION_FAILED */]: "data_processing",
5024
- [2003 /* DECRYPTION_FAILED */]: "data_processing",
5025
- [2004 /* DATA_CORRUPTION */]: "data_processing",
5026
- [2005 /* INVALID_JSON_FORMAT */]: "data_processing",
5027
- [2101 /* EXTERNAL_API_ERROR */]: "external_service",
5028
- [2102 /* WEBHOOK_DELIVERY_FAILED */]: "external_service",
5029
- [2103 /* CALLBACK_TIMEOUT */]: "external_service",
5030
- [2104 /* THIRD_PARTY_SERVICE_ERROR */]: "external_service",
5031
- [9e3 /* UNKNOWN_ERROR */]: "generic",
5032
- [9001 /* INTERNAL_ERROR */]: "generic",
5033
- [9002 /* INVALID_RESPONSE */]: "generic",
5034
- [9003 /* UNEXPECTED_ERROR */]: "generic",
5035
- [9004 /* NOT_IMPLEMENTED */]: "generic",
5036
- [9005 /* MAINTENANCE_MODE */]: "generic"
5037
- };
5038
- var ERROR_SEVERITY = {
5039
- [1001 /* SESSION_NOT_FOUND */]: "high" /* HIGH */,
5040
- [1002 /* SESSION_EXPIRED */]: "high" /* HIGH */,
5041
- [1003 /* SESSION_INACTIVE */]: "medium" /* MEDIUM */,
5042
- [1004 /* INVALID_CREDENTIALS */]: "high" /* HIGH */,
5043
- [1005 /* AUTHENTICATION_FAILED */]: "high" /* HIGH */,
5044
- [1101 /* USER_NOT_FOUND */]: "medium" /* MEDIUM */,
5045
- [1102 /* USER_ID_INVALID */]: "medium" /* MEDIUM */,
5046
- [1103 /* USER_PROFILE_PRIVATE */]: "low" /* LOW */,
5047
- [1104 /* USER_BLOCKED_YOU */]: "medium" /* MEDIUM */,
5048
- [1105 /* USER_DOESNT_EXIST */]: "medium" /* MEDIUM */,
5049
- [1106 /* USER_NOT_ACCESSIBLE */]: "medium" /* MEDIUM */,
5050
- [1201 /* FRIEND_REQUEST_FAILED */]: "medium" /* MEDIUM */,
5051
- [1202 /* FRIEND_NOT_FOUND */]: "medium" /* MEDIUM */,
5052
- [1203 /* ALREADY_FRIENDS */]: "low" /* LOW */,
5053
- [1204 /* FRIEND_REQUEST_SENT */]: "low" /* LOW */,
5054
- [1205 /* CANNOT_SEND_REQUEST */]: "medium" /* MEDIUM */,
5055
- [1206 /* FRIEND_BLOCKED */]: "medium" /* MEDIUM */,
5056
- [1207 /* CANNOT_UNFRIEND */]: "medium" /* MEDIUM */,
5057
- [1301 /* GROUP_NOT_FOUND */]: "medium" /* MEDIUM */,
5058
- [1302 /* GROUP_ID_INVALID */]: "medium" /* MEDIUM */,
5059
- [1303 /* NOT_GROUP_MEMBER */]: "medium" /* MEDIUM */,
5060
- [1304 /* NOT_GROUP_ADMIN */]: "medium" /* MEDIUM */,
5061
- [1305 /* GROUP_FULL */]: "medium" /* MEDIUM */,
5062
- [1306 /* CANNOT_JOIN_GROUP */]: "medium" /* MEDIUM */,
5063
- [1307 /* GROUP_CREATION_FAILED */]: "medium" /* MEDIUM */,
5064
- [1308 /* GROUP_SETTINGS_UPDATE_FAILED */]: "medium" /* MEDIUM */,
5065
- [1401 /* MESSAGE_NOT_FOUND */]: "low" /* LOW */,
5066
- [1402 /* CANNOT_SEND_MESSAGE */]: "high" /* HIGH */,
5067
- [1403 /* MEDIA_TOO_LARGE */]: "medium" /* MEDIUM */,
5068
- [1404 /* UNSUPPORTED_MEDIA_TYPE */]: "medium" /* MEDIUM */,
5069
- [1405 /* MESSAGE_SEND_FAILED */]: "high" /* HIGH */,
5070
- [1406 /* MESSAGE_FORWARD_FAILED */]: "medium" /* MEDIUM */,
5071
- [1407 /* REACTION_FAILED */]: "low" /* LOW */,
5072
- [1501 /* INVALID_PARAMETERS */]: "medium" /* MEDIUM */,
5073
- [1502 /* MISSING_REQUIRED_FIELDS */]: "medium" /* MEDIUM */,
5074
- [1503 /* INVALID_USER_ID_FORMAT */]: "medium" /* MEDIUM */,
5075
- [1504 /* INVALID_GROUP_ID_FORMAT */]: "medium" /* MEDIUM */,
5076
- [1505 /* INVALID_MESSAGE_FORMAT */]: "medium" /* MEDIUM */,
5077
- [1506 /* BATCH_SIZE_EXCEEDED */]: "medium" /* MEDIUM */,
5078
- [1507 /* INVALID_ATTACHMENT_FORMAT */]: "medium" /* MEDIUM */,
5079
- [1601 /* RATE_LIMIT_EXCEEDED */]: "high" /* HIGH */,
5080
- [1602 /* TOO_MANY_REQUESTS */]: "high" /* HIGH */,
5081
- [1603 /* TEMPORARY_BLOCK */]: "high" /* HIGH */,
5082
- [1604 /* REQUEST_LIMIT_REACHED */]: "high" /* HIGH */,
5083
- [1605 /* SPAM_DETECTED */]: "high" /* HIGH */,
5084
- [1701 /* NETWORK_ERROR */]: "high" /* HIGH */,
5085
- [1702 /* CONNECTION_TIMEOUT */]: "high" /* HIGH */,
5086
- [1703 /* API_UNAVAILABLE */]: "high" /* HIGH */,
5087
- [1704 /* SERVER_ERROR */]: "critical" /* CRITICAL */,
5088
- [1705 /* CONNECTION_REFUSED */]: "high" /* HIGH */,
5089
- [1706 /* DNS_RESOLUTION_FAILED */]: "high" /* HIGH */,
5090
- [1707 /* PROXY_CONNECTION_FAILED */]: "high" /* HIGH */,
5091
- [1801 /* INSUFFICIENT_PERMISSIONS */]: "high" /* HIGH */,
5092
- [1802 /* ACCESS_DENIED */]: "high" /* HIGH */,
5093
- [1803 /* ACCOUNT_SUSPENDED */]: "critical" /* CRITICAL */,
5094
- [1804 /* ACCOUNT_BANNED */]: "critical" /* CRITICAL */,
5095
- [1805 /* DEVICE_NOT_VERIFIED */]: "medium" /* MEDIUM */,
5096
- [1806 /* REGION_RESTRICTED */]: "medium" /* MEDIUM */,
5097
- [1807 /* AGE_RESTRICTED */]: "medium" /* MEDIUM */,
5098
- [1901 /* OPERATION_NOT_ALLOWED */]: "medium" /* MEDIUM */,
5099
- [1902 /* FEATURE_NOT_AVAILABLE */]: "medium" /* MEDIUM */,
5100
- [1903 /* SUBSCRIPTION_REQUIRED */]: "medium" /* MEDIUM */,
5101
- [1904 /* QUOTA_EXCEEDED */]: "high" /* HIGH */,
5102
- [1905 /* INVALID_OPERATION_CONTEXT */]: "medium" /* MEDIUM */,
5103
- [2001 /* DATA_PARSING_FAILED */]: "medium" /* MEDIUM */,
5104
- [2002 /* ENCRYPTION_FAILED */]: "high" /* HIGH */,
5105
- [2003 /* DECRYPTION_FAILED */]: "high" /* HIGH */,
5106
- [2004 /* DATA_CORRUPTION */]: "high" /* HIGH */,
5107
- [2005 /* INVALID_JSON_FORMAT */]: "medium" /* MEDIUM */,
5108
- [2101 /* EXTERNAL_API_ERROR */]: "high" /* HIGH */,
5109
- [2102 /* WEBHOOK_DELIVERY_FAILED */]: "medium" /* MEDIUM */,
5110
- [2103 /* CALLBACK_TIMEOUT */]: "medium" /* MEDIUM */,
5111
- [2104 /* THIRD_PARTY_SERVICE_ERROR */]: "high" /* HIGH */,
5112
- [9e3 /* UNKNOWN_ERROR */]: "medium" /* MEDIUM */,
5113
- [9001 /* INTERNAL_ERROR */]: "critical" /* CRITICAL */,
5114
- [9002 /* INVALID_RESPONSE */]: "medium" /* MEDIUM */,
5115
- [9003 /* UNEXPECTED_ERROR */]: "medium" /* MEDIUM */,
5116
- [9004 /* NOT_IMPLEMENTED */]: "low" /* LOW */,
5117
- [9005 /* MAINTENANCE_MODE */]: "high" /* HIGH */
5118
- };
5119
- var ERROR_MESSAGES = {
5120
- // Authentication & Session Errors
5121
- [1001 /* SESSION_NOT_FOUND */]: "Session not found or inactive. Please login again.",
5122
- [1002 /* SESSION_EXPIRED */]: "Session has expired. Please login again.",
5123
- [1003 /* SESSION_INACTIVE */]: "Session is inactive. Please login again.",
5124
- [1004 /* INVALID_CREDENTIALS */]: "Invalid credentials provided. Please check your login information.",
5125
- [1005 /* AUTHENTICATION_FAILED */]: "Authentication failed. Please try again.",
5126
- [1006 /* SESSION_CREATION_FAILED */]: "Failed to create session. Please try again.",
5127
- [1007 /* SESSION_VALIDATION_FAILED */]: "Session validation failed. Please login again.",
5128
- // User Information Errors
5129
- [1101 /* USER_NOT_FOUND */]: "User not found or does not exist.",
5130
- [1102 /* USER_ID_INVALID */]: "Invalid user ID format provided.",
5131
- [1103 /* USER_PROFILE_PRIVATE */]: "User profile is private or not accessible.",
5132
- [1104 /* USER_BLOCKED_YOU */]: "User has blocked you or you have blocked this user.",
5133
- [1105 /* USER_DOESNT_EXIST */]: "User does not exist.",
5134
- [1106 /* USER_NOT_ACCESSIBLE */]: "User information is not accessible.",
5135
- // Friend Management Errors
5136
- [1201 /* FRIEND_REQUEST_FAILED */]: "Failed to send friend request.",
5137
- [1202 /* FRIEND_NOT_FOUND */]: "Friend not found.",
5138
- [1203 /* ALREADY_FRIENDS */]: "Users are already friends.",
5139
- [1204 /* FRIEND_REQUEST_SENT */]: "Friend request has already been sent.",
5140
- [1205 /* CANNOT_SEND_REQUEST */]: "Cannot send friend request at this time.",
5141
- [1206 /* FRIEND_BLOCKED */]: "Friend request blocked due to privacy settings.",
5142
- [1207 /* CANNOT_UNFRIEND */]: "Cannot unfriend this user.",
5143
- // Group Management Errors
5144
- [1301 /* GROUP_NOT_FOUND */]: "Group not found.",
5145
- [1302 /* GROUP_ID_INVALID */]: "Invalid group ID format.",
5146
- [1303 /* NOT_GROUP_MEMBER */]: "You are not a member of this group.",
5147
- [1304 /* NOT_GROUP_ADMIN */]: "You are not an admin of this group.",
5148
- [1305 /* GROUP_FULL */]: "Group is full and cannot accept more members.",
5149
- [1306 /* CANNOT_JOIN_GROUP */]: "Cannot join this group.",
5150
- [1307 /* GROUP_CREATION_FAILED */]: "Failed to create group.",
5151
- [1308 /* GROUP_SETTINGS_UPDATE_FAILED */]: "Failed to update group settings.",
5152
- // Message & Media Errors
5153
- [1401 /* MESSAGE_NOT_FOUND */]: "Message not found.",
5154
- [1402 /* CANNOT_SEND_MESSAGE */]: "Cannot send message at this time.",
5155
- [1403 /* MEDIA_TOO_LARGE */]: "Media file is too large.",
5156
- [1404 /* UNSUPPORTED_MEDIA_TYPE */]: "Unsupported media type.",
5157
- [1405 /* MESSAGE_SEND_FAILED */]: "Failed to send message.",
5158
- [1406 /* MESSAGE_FORWARD_FAILED */]: "Failed to forward message.",
5159
- [1407 /* REACTION_FAILED */]: "Failed to add reaction.",
5160
- // Request Validation Errors
5161
- [1501 /* INVALID_PARAMETERS */]: "Invalid request parameters.",
5162
- [1502 /* MISSING_REQUIRED_FIELDS */]: "Missing required fields in request.",
5163
- [1503 /* INVALID_USER_ID_FORMAT */]: "Invalid user ID format.",
5164
- [1504 /* INVALID_GROUP_ID_FORMAT */]: "Invalid group ID format.",
5165
- [1505 /* INVALID_MESSAGE_FORMAT */]: "Invalid message format.",
5166
- [1506 /* BATCH_SIZE_EXCEEDED */]: "Batch size limit exceeded.",
5167
- [1507 /* INVALID_ATTACHMENT_FORMAT */]: "Invalid attachment format.",
5168
- // Rate Limiting Errors
5169
- [1601 /* RATE_LIMIT_EXCEEDED */]: "Rate limit exceeded. Please try again later.",
5170
- [1602 /* TOO_MANY_REQUESTS */]: "Too many requests. Please slow down.",
5171
- [1603 /* TEMPORARY_BLOCK */]: "Account temporarily blocked. Please try again later.",
5172
- [1604 /* REQUEST_LIMIT_REACHED */]: "Request limit reached. Please wait before trying again.",
5173
- [1605 /* SPAM_DETECTED */]: "Spam activity detected. Please verify your actions.",
5174
- // Network & Connection Errors
5175
- [1701 /* NETWORK_ERROR */]: "Network error occurred. Please check your connection.",
5176
- [1702 /* CONNECTION_TIMEOUT */]: "Connection timeout. Please try again.",
5177
- [1703 /* API_UNAVAILABLE */]: "Zalo API is currently unavailable. Please try again later.",
5178
- [1704 /* SERVER_ERROR */]: "Zalo server error occurred. Please try again later.",
5179
- [1705 /* CONNECTION_REFUSED */]: "Connection refused by server.",
5180
- [1706 /* DNS_RESOLUTION_FAILED */]: "DNS resolution failed.",
5181
- [1707 /* PROXY_CONNECTION_FAILED */]: "Proxy connection failed.",
5182
- // Permission & Access Errors
5183
- [1801 /* INSUFFICIENT_PERMISSIONS */]: "Insufficient permissions to perform this action.",
5184
- [1802 /* ACCESS_DENIED */]: "Access denied. You do not have permission to perform this action.",
5185
- [1803 /* ACCOUNT_SUSPENDED */]: "Account has been suspended. Please contact support.",
5186
- [1804 /* ACCOUNT_BANNED */]: "Account has been banned. Please contact support.",
5187
- [1805 /* DEVICE_NOT_VERIFIED */]: "Device not verified. Please verify your device.",
5188
- [1806 /* REGION_RESTRICTED */]: "This feature is not available in your region.",
5189
- [1807 /* AGE_RESTRICTED */]: "Age restricted content. Please verify your age.",
5190
- // Business Logic Errors
5191
- [1901 /* OPERATION_NOT_ALLOWED */]: "Operation not allowed in current context.",
5192
- [1902 /* FEATURE_NOT_AVAILABLE */]: "Feature is not available.",
5193
- [1903 /* SUBSCRIPTION_REQUIRED */]: "Premium subscription required for this feature.",
5194
- [1904 /* QUOTA_EXCEEDED */]: "Daily/monthly quota exceeded. Please try again later.",
5195
- [1905 /* INVALID_OPERATION_CONTEXT */]: "Invalid operation context.",
5196
- // Data Processing Errors
5197
- [2001 /* DATA_PARSING_FAILED */]: "Failed to parse data.",
5198
- [2002 /* ENCRYPTION_FAILED */]: "Failed to encrypt data.",
5199
- [2003 /* DECRYPTION_FAILED */]: "Failed to decrypt data.",
5200
- [2004 /* DATA_CORRUPTION */]: "Data corruption detected.",
5201
- [2005 /* INVALID_JSON_FORMAT */]: "Invalid JSON format.",
5202
- // External Service Errors
5203
- [2101 /* EXTERNAL_API_ERROR */]: "External API error occurred.",
5204
- [2102 /* WEBHOOK_DELIVERY_FAILED */]: "Webhook delivery failed.",
5205
- [2103 /* CALLBACK_TIMEOUT */]: "Callback timeout occurred.",
5206
- [2104 /* THIRD_PARTY_SERVICE_ERROR */]: "Third party service error.",
5207
- // Generic Errors
5208
- [9e3 /* UNKNOWN_ERROR */]: "An unknown error occurred.",
5209
- [9001 /* INTERNAL_ERROR */]: "Internal server error occurred.",
5210
- [9002 /* INVALID_RESPONSE */]: "Invalid response received.",
5211
- [9003 /* UNEXPECTED_ERROR */]: "An unexpected error occurred.",
5212
- [9004 /* NOT_IMPLEMENTED */]: "Feature not implemented yet.",
5213
- [9005 /* MAINTENANCE_MODE */]: "Service is currently under maintenance."
5214
- };
5215
- var ZaloErrorContext = class {
5216
- constructor() {
5217
- this.details = {};
5218
- }
5219
- /**
5220
- * Set error code
5221
- */
5222
- code(code) {
5223
- this.details.code = code;
5224
- this.details.category = ERROR_CATEGORIES[code];
5225
- this.details.severity = ERROR_SEVERITY[code];
5226
- this.details.message = ERROR_MESSAGES[code];
5227
- return this;
5228
- }
5229
- /**
5230
- * Set custom message
5231
- */
5232
- message(message) {
5233
- this.details.message = message;
5234
- return this;
5235
- }
5236
- /**
5237
- * Add context
5238
- */
5239
- context(context) {
5240
- this.details.context = { ...this.details.context, ...context };
5241
- return this;
5242
- }
5243
- /**
5244
- * Set session ID
5245
- */
5246
- sessionId(sessionId) {
5247
- this.details.sessionId = sessionId;
5248
- return this;
5249
- }
5250
- /**
5251
- * Set user ID
5252
- */
5253
- userId(userId) {
5254
- this.details.userId = userId;
5255
- return this;
5256
- }
5257
- /**
5258
- * Set group ID
5259
- */
5260
- groupId(groupId) {
5261
- this.details.groupId = groupId;
5262
- return this;
5263
- }
5264
- /**
5265
- * Set request ID
5266
- */
5267
- requestId(requestId) {
5268
- this.details.requestId = requestId;
5269
- return this;
5270
- }
5271
- /**
5272
- * Set original error
5273
- */
5274
- originalError(error) {
5275
- this.details.originalError = error;
5276
- return this;
5277
- }
5278
- /**
5279
- * Build the error details
5280
- */
5281
- build() {
5282
- return {
5283
- code: this.details.code || 9e3 /* UNKNOWN_ERROR */,
5284
- message: this.details.message || ERROR_MESSAGES[9e3 /* UNKNOWN_ERROR */],
5285
- category: this.details.category || "generic",
5286
- severity: this.details.severity || "medium" /* MEDIUM */,
5287
- timestamp: Date.now(),
5288
- context: this.details.context,
5289
- originalError: this.details.originalError,
5290
- requestId: this.details.requestId,
5291
- sessionId: this.details.sessionId,
5292
- userId: this.details.userId,
5293
- groupId: this.details.groupId
5294
- };
5295
- }
5296
- };
5297
- var ZaloErrorUtils = class {
5298
- /**
5299
- * Create a standardized error response
5300
- */
5301
- static createErrorResponse(code, customMessage, context) {
5302
- const errorContext = new ZaloErrorContext().code(code).message(customMessage || ERROR_MESSAGES[code]).context(context || {}).build();
5303
- return {
5304
- success: false,
5305
- error: errorContext,
5306
- metadata: context
5307
- };
5308
- }
5309
- /**
5310
- * Check if an error is recoverable
5311
- */
5312
- static isRecoverable(errorCode) {
5313
- const unrecoverableCodes = [
5314
- 1804 /* ACCOUNT_BANNED */,
5315
- 1807 /* AGE_RESTRICTED */,
5316
- 1806 /* REGION_RESTRICTED */,
5317
- 1805 /* DEVICE_NOT_VERIFIED */
5318
- ];
5319
- return !unrecoverableCodes.includes(errorCode);
5320
- }
5321
- /**
5322
- * Check if an error should trigger a retry
5323
- */
5324
- static shouldRetry(errorCode) {
5325
- const retryableCodes = [
5326
- 1701 /* NETWORK_ERROR */,
5327
- 1702 /* CONNECTION_TIMEOUT */,
5328
- 1703 /* API_UNAVAILABLE */,
5329
- 1704 /* SERVER_ERROR */,
5330
- 1601 /* RATE_LIMIT_EXCEEDED */,
5331
- 1603 /* TEMPORARY_BLOCK */
5332
- ];
5333
- return retryableCodes.includes(errorCode);
5334
- }
5335
- /**
5336
- * Get retry delay in milliseconds for a specific error code
5337
- */
5338
- static getRetryDelay(errorCode) {
5339
- const retryDelays = {
5340
- [1601 /* RATE_LIMIT_EXCEEDED */]: 6e4,
5341
- // 1 minute
5342
- [1603 /* TEMPORARY_BLOCK */]: 3e5,
5343
- // 5 minutes
5344
- [1602 /* TOO_MANY_REQUESTS */]: 3e4,
5345
- // 30 seconds
5346
- [1701 /* NETWORK_ERROR */]: 5e3,
5347
- // 5 seconds
5348
- [1702 /* CONNECTION_TIMEOUT */]: 1e4,
5349
- // 10 seconds
5350
- [1703 /* API_UNAVAILABLE */]: 3e4,
5351
- // 30 seconds
5352
- [1704 /* SERVER_ERROR */]: 15e3
5353
- // 15 seconds
5354
- };
5355
- return retryDelays[errorCode] || 5e3;
5356
- }
5357
- /**
5358
- * Format error for logging
5359
- */
5360
- static formatForLogging(error) {
5361
- return `[${error.category.toUpperCase()}] ${error.code}: ${error.message}${error.sessionId ? ` (Session: ${error.sessionId})` : ""}${error.userId ? ` (User: ${error.userId})` : ""}${error.groupId ? ` (Group: ${error.groupId})` : ""}${error.requestId ? ` (Request: ${error.requestId})` : ""}`;
5362
- }
5363
- /**
5364
- * Check if error is session-related
5365
- */
5366
- static isSessionError(errorCode) {
5367
- const sessionErrorCodes = [
5368
- 1001 /* SESSION_NOT_FOUND */,
5369
- 1002 /* SESSION_EXPIRED */,
5370
- 1003 /* SESSION_INACTIVE */,
5371
- 1004 /* INVALID_CREDENTIALS */,
5372
- 1005 /* AUTHENTICATION_FAILED */
5373
- ];
5374
- return sessionErrorCodes.includes(errorCode);
5375
- }
5376
- /**
5377
- * Check if error is user-related
5378
- */
5379
- static isUserError(errorCode) {
5380
- const userErrorCodes = [
5381
- 1101 /* USER_NOT_FOUND */,
5382
- 1102 /* USER_ID_INVALID */,
5383
- 1103 /* USER_PROFILE_PRIVATE */,
5384
- 1104 /* USER_BLOCKED_YOU */,
5385
- 1105 /* USER_DOESNT_EXIST */,
5386
- 1106 /* USER_NOT_ACCESSIBLE */
5387
- ];
5388
- return userErrorCodes.includes(errorCode);
5389
- }
5390
- /**
5391
- * Check if error is group-related
5392
- */
5393
- static isGroupError(errorCode) {
5394
- const groupErrorCodes = [
5395
- 1301 /* GROUP_NOT_FOUND */,
5396
- 1302 /* GROUP_ID_INVALID */,
5397
- 1303 /* NOT_GROUP_MEMBER */,
5398
- 1304 /* NOT_GROUP_ADMIN */,
5399
- 1305 /* GROUP_FULL */,
5400
- 1306 /* CANNOT_JOIN_GROUP */,
5401
- 1307 /* GROUP_CREATION_FAILED */,
5402
- 1308 /* GROUP_SETTINGS_UPDATE_FAILED */
5403
- ];
5404
- return groupErrorCodes.includes(errorCode);
5405
- }
5406
- };
5407
-
5408
4807
  // src/utils/format.utils.ts
5409
4808
  var FormatUtils = class {
5410
4809
  /**
@@ -5694,18 +5093,12 @@ var FormatUtils = class {
5694
5093
  CommonUrgency,
5695
5094
  DEFAULT_CONFIG,
5696
5095
  DestType,
5697
- ERROR_CATEGORIES,
5698
- ERROR_MESSAGES,
5699
- ERROR_SEVERITY,
5700
5096
  EventManager,
5701
5097
  EventUtils,
5702
5098
  FRIEND_EVENT_TYPES,
5703
5099
  FormatUtils,
5704
5100
  FriendEventType,
5705
- FriendRelationship,
5706
- FriendRequestStatus,
5707
5101
  FriendService,
5708
- FriendStatus,
5709
5102
  GROUP_EVENT_TYPES,
5710
5103
  Gender,
5711
5104
  GroupDeliveredMessage,
@@ -5716,7 +5109,6 @@ var FormatUtils = class {
5716
5109
  GroupTyping,
5717
5110
  HealthService,
5718
5111
  HttpClient,
5719
- HttpError,
5720
5112
  HttpUtils,
5721
5113
  InstanceManagerService,
5722
5114
  JobPriority,
@@ -5754,10 +5146,6 @@ var FormatUtils = class {
5754
5146
  WebhookGender,
5755
5147
  WebhookService,
5756
5148
  ZaloConnectionStatus,
5757
- ZaloErrorCode,
5758
- ZaloErrorContext,
5759
- ZaloErrorSeverity,
5760
- ZaloErrorUtils,
5761
5149
  ZaloMeService,
5762
5150
  ZaloMessageCategory,
5763
5151
  ZaloMessageType,