@approvio/api 0.0.45 → 0.0.46

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.
@@ -339,8 +339,11 @@ function isStringBigInt(value) {
339
339
  }
340
340
  return true;
341
341
  }
342
- const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
343
- const isUUIDv4 = (value) => value.match(UUID_REGEX) !== null;
342
+ const UUID_REGEX_V4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
343
+ const UUID_REGEX_V7 = /^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
344
+ const isUUIDv4 = (value) => value.match(UUID_REGEX_V4) !== null;
345
+ const isUUIDv7 = (value) => value.match(UUID_REGEX_V7) !== null;
346
+ const isValidUUID = (value) => isUUIDv7(value) || isUUIDv4(value);
344
347
  //#endregion
345
348
  //#region src/validators/auth.validators.ts
346
349
  function validateTokenResponse(object) {
@@ -1163,7 +1166,7 @@ function validateListWorkflowsParams(object) {
1163
1166
  const validatedIncludeGroups = [];
1164
1167
  for (const item of includeGroupsVal) {
1165
1168
  if (typeof item !== "string") return (0, fp_ts_Either.left)("invalid_include_groups");
1166
- if (!isUUIDv4(item)) return (0, fp_ts_Either.left)("invalid_include_groups");
1169
+ if (!isValidUUID(item)) return (0, fp_ts_Either.left)("invalid_include_groups");
1167
1170
  validatedIncludeGroups.push(item);
1168
1171
  }
1169
1172
  includeGroups = validatedIncludeGroups;
@@ -1768,7 +1771,7 @@ function validateQuotaCreate(object) {
1768
1771
  const scope = getStringAsEnum(scopeStr, QuotaScope);
1769
1772
  if (!scope) return (0, fp_ts_Either.left)("invalid_scope");
1770
1773
  if (!hasOwnProperty(object, "targetId")) return (0, fp_ts_Either.left)("missing_targetId");
1771
- if (!isNonEmptyString(object.targetId) || !isUUIDv4(object.targetId)) return (0, fp_ts_Either.left)("invalid_targetId");
1774
+ if (!isNonEmptyString(object.targetId) || !isValidUUID(object.targetId)) return (0, fp_ts_Either.left)("invalid_targetId");
1772
1775
  const targetId = object.targetId;
1773
1776
  const quotaType = getStringAsEnum(quotaTypeStr, QUOTA_TYPE_ENUM_BY_SCOPE[scope]);
1774
1777
  if (quotaType === void 0) return (0, fp_ts_Either.left)("invalid_scope_quotaType_combination");
@@ -1797,7 +1800,7 @@ function validateListQuotasParams(object) {
1797
1800
  result.scope = scope;
1798
1801
  }
1799
1802
  if (hasOwnProperty(object, "targetId") && object.targetId !== void 0) {
1800
- if (!isNonEmptyString(object.targetId) || !isUUIDv4(object.targetId)) return (0, fp_ts_Either.left)("invalid_targetId");
1803
+ if (!isNonEmptyString(object.targetId) || !isValidUUID(object.targetId)) return (0, fp_ts_Either.left)("invalid_targetId");
1801
1804
  result.targetId = object.targetId;
1802
1805
  }
1803
1806
  if (hasOwnProperty(object, "quotaType") && object.quotaType !== void 0) {
@@ -315,8 +315,11 @@ function isStringBigInt(value) {
315
315
  }
316
316
  return true;
317
317
  }
318
- const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
319
- const isUUIDv4 = (value) => value.match(UUID_REGEX) !== null;
318
+ const UUID_REGEX_V4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
319
+ const UUID_REGEX_V7 = /^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
320
+ const isUUIDv4 = (value) => value.match(UUID_REGEX_V4) !== null;
321
+ const isUUIDv7 = (value) => value.match(UUID_REGEX_V7) !== null;
322
+ const isValidUUID = (value) => isUUIDv7(value) || isUUIDv4(value);
320
323
  //#endregion
321
324
  //#region src/validators/auth.validators.ts
322
325
  function validateTokenResponse(object) {
@@ -1139,7 +1142,7 @@ function validateListWorkflowsParams(object) {
1139
1142
  const validatedIncludeGroups = [];
1140
1143
  for (const item of includeGroupsVal) {
1141
1144
  if (typeof item !== "string") return left("invalid_include_groups");
1142
- if (!isUUIDv4(item)) return left("invalid_include_groups");
1145
+ if (!isValidUUID(item)) return left("invalid_include_groups");
1143
1146
  validatedIncludeGroups.push(item);
1144
1147
  }
1145
1148
  includeGroups = validatedIncludeGroups;
@@ -1744,7 +1747,7 @@ function validateQuotaCreate(object) {
1744
1747
  const scope = getStringAsEnum(scopeStr, QuotaScope);
1745
1748
  if (!scope) return left("invalid_scope");
1746
1749
  if (!hasOwnProperty(object, "targetId")) return left("missing_targetId");
1747
- if (!isNonEmptyString(object.targetId) || !isUUIDv4(object.targetId)) return left("invalid_targetId");
1750
+ if (!isNonEmptyString(object.targetId) || !isValidUUID(object.targetId)) return left("invalid_targetId");
1748
1751
  const targetId = object.targetId;
1749
1752
  const quotaType = getStringAsEnum(quotaTypeStr, QUOTA_TYPE_ENUM_BY_SCOPE[scope]);
1750
1753
  if (quotaType === void 0) return left("invalid_scope_quotaType_combination");
@@ -1773,7 +1776,7 @@ function validateListQuotasParams(object) {
1773
1776
  result.scope = scope;
1774
1777
  }
1775
1778
  if (hasOwnProperty(object, "targetId") && object.targetId !== void 0) {
1776
- if (!isNonEmptyString(object.targetId) || !isUUIDv4(object.targetId)) return left("invalid_targetId");
1779
+ if (!isNonEmptyString(object.targetId) || !isValidUUID(object.targetId)) return left("invalid_targetId");
1777
1780
  result.targetId = object.targetId;
1778
1781
  }
1779
1782
  if (hasOwnProperty(object, "quotaType") && object.quotaType !== void 0) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@approvio/api",
3
3
  "author": "Giovanni Baratta",
4
4
  "license": "MIT",
5
- "version": "0.0.45",
5
+ "version": "0.0.46",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "main": "./dist/src/index.cjs",
@@ -62,7 +62,7 @@
62
62
  "prettier": "3.8.1",
63
63
  "ts-jest": "29.4.6",
64
64
  "typescript": "5.7.3",
65
- "typescript-eslint": "8.56.1",
65
+ "typescript-eslint": "8.59.1",
66
66
  "fp-ts": "2.16.11",
67
67
  "tsdown": "0.21.4"
68
68
  },