@adobe/spacecat-shared-utils 1.30.1 → 1.30.3
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 +14 -0
- package/package.json +4 -5
- package/src/helpers.js +0 -25
- package/src/index.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-utils-v1.30.3](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.30.2...@adobe/spacecat-shared-utils-v1.30.3) (2025-02-11)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **shared-utils:** remove legacy rum domain key retrieval ([#594](https://github.com/adobe/spacecat-shared/issues/594)) ([1a093c4](https://github.com/adobe/spacecat-shared/commit/1a093c4226a966098dfa2207f5652ffac13e38b5))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-utils-v1.30.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.30.1...@adobe/spacecat-shared-utils-v1.30.2) (2025-02-08)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update external fixes ([#587](https://github.com/adobe/spacecat-shared/issues/587)) ([14cce0a](https://github.com/adobe/spacecat-shared/commit/14cce0aa900b4a1b3bbec2d48e6d37766c7769ee))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-utils-v1.30.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.30.0...@adobe/spacecat-shared-utils-v1.30.1) (2025-02-06)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spacecat-shared-utils",
|
|
3
|
-
"version": "1.30.
|
|
3
|
+
"version": "1.30.3",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - utils",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -39,15 +39,14 @@
|
|
|
39
39
|
"chai": "5.1.2",
|
|
40
40
|
"chai-as-promised": "8.0.1",
|
|
41
41
|
"husky": "9.1.7",
|
|
42
|
-
"nock": "14.0.
|
|
42
|
+
"nock": "14.0.1",
|
|
43
43
|
"sinon": "19.0.2",
|
|
44
44
|
"sinon-chai": "4.0.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@adobe/fetch": "4.1.11",
|
|
48
|
-
"@aws-sdk/client-s3": "3.
|
|
49
|
-
"@aws-sdk/client-
|
|
50
|
-
"@aws-sdk/client-sqs": "3.738.0",
|
|
48
|
+
"@aws-sdk/client-s3": "3.744.0",
|
|
49
|
+
"@aws-sdk/client-sqs": "3.744.0",
|
|
51
50
|
"@json2csv/plainjs": "7.0.6",
|
|
52
51
|
"aws-xray-sdk": "3.10.3",
|
|
53
52
|
"uuid": "11.0.5"
|
package/src/helpers.js
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { Parser } from '@json2csv/plainjs';
|
|
14
|
-
import { GetSecretValueCommand, SecretsManagerClient } from '@aws-sdk/client-secrets-manager';
|
|
15
14
|
import { promises as fs } from 'fs';
|
|
16
15
|
import { isString } from './functions.js';
|
|
17
16
|
|
|
@@ -55,30 +54,6 @@ export function resolveCustomerSecretsName(baseURL, ctx) {
|
|
|
55
54
|
return resolveSecretsName({}, ctx, `${basePath}/${customer}`);
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
/**
|
|
59
|
-
* Retrieves the RUM domain key for the specified base URL from the customer secrets.
|
|
60
|
-
*
|
|
61
|
-
* @param {string} baseURL - The base URL for which the RUM domain key is to be retrieved.
|
|
62
|
-
* @param {UniversalContext} context - Helix Universal Context. See https://github.com/adobe/helix-universal/blob/main/src/adapter.d.ts#L120
|
|
63
|
-
* @returns {Promise<string>} - A promise that resolves to the RUM domain key.
|
|
64
|
-
* @throws {Error} Throws an error if no domain key is found for the specified base URL.
|
|
65
|
-
*/
|
|
66
|
-
export async function getRUMDomainKey(baseURL, context) {
|
|
67
|
-
const customerSecretName = resolveCustomerSecretsName(baseURL, context);
|
|
68
|
-
const { runtime } = context;
|
|
69
|
-
|
|
70
|
-
try {
|
|
71
|
-
const client = new SecretsManagerClient({ region: runtime.region });
|
|
72
|
-
const command = new GetSecretValueCommand({
|
|
73
|
-
SecretId: customerSecretName,
|
|
74
|
-
});
|
|
75
|
-
const response = await client.send(command);
|
|
76
|
-
return JSON.parse(response.SecretString)?.RUM_DOMAIN_KEY;
|
|
77
|
-
} catch (error) {
|
|
78
|
-
throw new Error(`Error retrieving the domain key for ${baseURL}. Error: ${error.message}`);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
57
|
/**
|
|
83
58
|
* Generates a CSV file from the provided JSON data.
|
|
84
59
|
*
|