redai-automation-web-sdk 1.9.14 → 1.9.15

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
@@ -423,13 +423,25 @@ var ValidationUtils = class {
423
423
  }
424
424
  }
425
425
  /**
426
- * Validate user UUID format
426
+ * Validate creator UUID format
427
+ */
428
+ static validateCreatedBy(createdBy) {
429
+ if (!createdBy || typeof createdBy !== "string") {
430
+ throw new ValidationError("CreatedBy UUID is required and must be a string", "createdBy");
431
+ }
432
+ const uuidPattern = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;
433
+ if (!uuidPattern.test(createdBy)) {
434
+ throw new ValidationError("CreatedBy UUID format is invalid", "createdBy");
435
+ }
436
+ }
437
+ /**
438
+ * Validate user UUID format (deprecated: use validateCreatedBy)
427
439
  */
428
440
  static validateUserUuid(userUuid) {
429
441
  if (!userUuid || typeof userUuid !== "string") {
430
442
  throw new ValidationError("User UUID is required and must be a string", "userUuid");
431
443
  }
432
- const uuidPattern = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;
444
+ const uuidPattern = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;
433
445
  if (!uuidPattern.test(userUuid)) {
434
446
  throw new ValidationError("User UUID format is invalid", "userUuid");
435
447
  }
@@ -891,8 +903,10 @@ var EventUtils = class {
891
903
  return false;
892
904
  }
893
905
  }
894
- if (criteria.userUuids && criteria.userUuids.length > 0) {
895
- if (!criteria.userUuids.includes(event.userUuid)) {
906
+ const userFilterList = criteria.createdBys || criteria.userUuids;
907
+ if (userFilterList && userFilterList.length > 0) {
908
+ const creator = event.createdBy || event.userUuid;
909
+ if (!creator || !userFilterList.includes(creator)) {
896
910
  return false;
897
911
  }
898
912
  }
@@ -1029,7 +1043,7 @@ var AuthService = class {
1029
1043
  const response = await this.httpClient.post(
1030
1044
  "/auth/zalo/qr-code",
1031
1045
  {
1032
- userUuid: request.userUuid,
1046
+ createdBy: request.createdBy || request.userUuid,
1033
1047
  workspaceId: request.workspaceId,
1034
1048
  baseId: request.baseId,
1035
1049
  sessionId: request.sessionId,
@@ -1056,7 +1070,7 @@ var AuthService = class {
1056
1070
  const response = await this.httpClient.post(
1057
1071
  "/auth/zalo/login-with-credentials",
1058
1072
  {
1059
- userUuid: request.userUuid,
1073
+ createdBy: request.createdBy || request.userUuid,
1060
1074
  credentials: {
1061
1075
  cookie: request.credentials.cookie,
1062
1076
  imei: request.credentials.imei,
@@ -1071,9 +1085,9 @@ var AuthService = class {
1071
1085
  /**
1072
1086
  * Get list of sessions for a user
1073
1087
  */
1074
- async getSessionsByUser(userUuid) {
1088
+ async getSessionsByUser(createdBy) {
1075
1089
  const response = await this.httpClient.get(
1076
- `/auth/zalo/sessions/${userUuid}`
1090
+ `/auth/zalo/sessions/${createdBy}`
1077
1091
  );
1078
1092
  return response;
1079
1093
  }