@adobe/spacecat-shared-utils 1.33.2 → 1.34.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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [@adobe/spacecat-shared-utils-v1.34.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.33.3...@adobe/spacecat-shared-utils-v1.34.0) (2025-03-05)
2
+
3
+
4
+ ### Features
5
+
6
+ * Brand client ([#640](https://github.com/adobe/spacecat-shared/issues/640)) ([8d82f45](https://github.com/adobe/spacecat-shared/commit/8d82f45349ea9be2b1359fe5ebebf5a350f52666))
7
+
8
+ # [@adobe/spacecat-shared-utils-v1.33.3](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.33.2...@adobe/spacecat-shared-utils-v1.33.3) (2025-03-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update dependency @adobe/fetch to v4.2.0 ([#645](https://github.com/adobe/spacecat-shared/issues/645)) ([7c97dc4](https://github.com/adobe/spacecat-shared/commit/7c97dc4c4853aa183553ed90f4b0d6dc9f49b656))
14
+
1
15
  # [@adobe/spacecat-shared-utils-v1.33.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.33.1...@adobe/spacecat-shared-utils-v1.33.2) (2025-03-03)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-utils",
3
- "version": "1.33.2",
3
+ "version": "1.34.0",
4
4
  "description": "Shared modules of the Spacecat Services - utils",
5
5
  "type": "module",
6
6
  "engines": {
@@ -44,7 +44,7 @@
44
44
  "sinon-chai": "4.0.0"
45
45
  },
46
46
  "dependencies": {
47
- "@adobe/fetch": "4.1.11",
47
+ "@adobe/fetch": "4.2.0",
48
48
  "@aws-sdk/client-s3": "3.758.0",
49
49
  "@aws-sdk/client-sqs": "3.758.0",
50
50
  "@json2csv/plainjs": "7.0.6",
package/src/functions.js CHANGED
@@ -15,6 +15,7 @@ import { validate as uuidValidate } from 'uuid';
15
15
  // Precompile regular expressions
16
16
  const REGEX_ISO_DATE = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/;
17
17
  const REGEX_TIME_OFFSET_DATE = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}(Z|[+-]\d{2}:\d{2})/;
18
+ const IMS_ORG_ID_REGEX = /[a-z0-9]{24}@AdobeOrg/i;
18
19
 
19
20
  /**
20
21
  * Determines if the given parameter is an array.
@@ -251,6 +252,15 @@ function dateAfterDays(days, dateString) {
251
252
  return currentDate;
252
253
  }
253
254
 
255
+ /**
256
+ * Validates whether the given string is a valid IMS Org ID.
257
+ * @param {string} imsOrgId - The string to validate.
258
+ * @returns {boolean} True if the given string is a valid IMS Org ID, false otherwise.
259
+ */
260
+ function isValidIMSOrgId(imsOrgId) {
261
+ return IMS_ORG_ID_REGEX.test(imsOrgId);
262
+ }
263
+
254
264
  export {
255
265
  arrayEquals,
256
266
  dateAfterDays,
@@ -269,5 +279,6 @@ export {
269
279
  isValidDate,
270
280
  isValidUrl,
271
281
  isValidUUID,
282
+ isValidIMSOrgId,
272
283
  toBoolean,
273
284
  };
package/src/index.d.ts CHANGED
@@ -45,6 +45,8 @@ export function isValidUrl(urlString: string): boolean;
45
45
 
46
46
  export function isValidUUID(uuid: string): boolean;
47
47
 
48
+ export function isValidIMSOrgId(imsOrgId: string): boolean;
49
+
48
50
  export function dateAfterDays(days: number, dateString: string): Date;
49
51
 
50
52
  export function deepEqual(a: unknown, b: unknown): boolean;
package/src/index.js CHANGED
@@ -28,6 +28,7 @@ export {
28
28
  isValidDate,
29
29
  isValidUrl,
30
30
  isValidUUID,
31
+ isValidIMSOrgId,
31
32
  toBoolean,
32
33
  } from './functions.js';
33
34