@adobe/spacecat-shared-utils 1.18.3 → 1.19.1
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 +19 -0
- package/package.json +5 -5
- package/src/helpers.js +1 -22
- package/src/index.d.ts +0 -17
- package/src/index.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-utils-v1.19.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.19.0...@adobe/spacecat-shared-utils-v1.19.1) (2024-07-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update external fixes ([#304](https://github.com/adobe/spacecat-shared/issues/304)) ([c6c56a7](https://github.com/adobe/spacecat-shared/commit/c6c56a72897acb60fb042215b708816ec16a5870))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-utils-v1.19.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.18.3...@adobe/spacecat-shared-utils-v1.19.0) (2024-07-22)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update external fixes ([#295](https://github.com/adobe/spacecat-shared/issues/295)) ([4e8d50d](https://github.com/adobe/spacecat-shared/commit/4e8d50d8d88b2d68b483fda2ead31542d15ee952))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* new config data model ([2525af4](https://github.com/adobe/spacecat-shared/commit/2525af48d1d4dad7e1b6e1fb3fbf3cda79d1252d))
|
|
19
|
+
|
|
1
20
|
# [@adobe/spacecat-shared-utils-v1.18.3](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.18.2...@adobe/spacecat-shared-utils-v1.18.3) (2024-07-13)
|
|
2
21
|
|
|
3
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spacecat-shared-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.1",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - utils",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@adobe/helix-shared-wrap": "2.0.2",
|
|
34
34
|
"@adobe/spacecat-shared-data-access": "file:../spacecat-shared-data-access",
|
|
35
|
-
"chai": "4.
|
|
35
|
+
"chai": "4.5.0",
|
|
36
36
|
"chai-as-promised": "8.0.0",
|
|
37
|
-
"husky": "9.
|
|
37
|
+
"husky": "9.1.3",
|
|
38
38
|
"nock": "13.5.4",
|
|
39
39
|
"sinon": "18.0.0",
|
|
40
40
|
"sinon-chai": "3.7.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@adobe/fetch": "4.1.8",
|
|
44
|
-
"@aws-sdk/client-s3": "3.
|
|
45
|
-
"@aws-sdk/client-sqs": "3.
|
|
44
|
+
"@aws-sdk/client-s3": "3.620.0",
|
|
45
|
+
"@aws-sdk/client-sqs": "3.620.0",
|
|
46
46
|
"@json2csv/plainjs": "7.0.6"
|
|
47
47
|
}
|
|
48
48
|
}
|
package/src/helpers.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { Parser } from '@json2csv/plainjs';
|
|
14
|
-
import {
|
|
14
|
+
import { isString } from './functions.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Resolves the name of the secret based on the function version.
|
|
@@ -53,27 +53,6 @@ export function resolveCustomerSecretsName(baseURL, ctx) {
|
|
|
53
53
|
return resolveSecretsName({}, ctx, `${basePath}/${customer}`);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
export function isAuditsDisabled(site, organization, auditType) {
|
|
57
|
-
// return early if all audits are disabled for the organization
|
|
58
|
-
if (organization.getAuditConfig().auditsDisabled()) {
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// return early if all audits are disabled for the site
|
|
63
|
-
if (site.getAuditConfig().auditsDisabled()) {
|
|
64
|
-
return true;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (hasText(auditType)) {
|
|
68
|
-
const disabledAtOrg = organization.getAuditConfig().getAuditTypeConfig(auditType)?.disabled();
|
|
69
|
-
const disabledAtSite = site.getAuditConfig().getAuditTypeConfig(auditType)?.disabled();
|
|
70
|
-
|
|
71
|
-
return !!disabledAtOrg || !!disabledAtSite;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
56
|
/**
|
|
78
57
|
* Generates a CSV file from the provided JSON data.
|
|
79
58
|
*
|
package/src/index.d.ts
CHANGED
|
@@ -96,23 +96,6 @@ declare function composeBaseURL(domain: string): string;
|
|
|
96
96
|
*/
|
|
97
97
|
declare function composeAuditURL(url: string): Promise<string>;
|
|
98
98
|
|
|
99
|
-
/**
|
|
100
|
-
* Checks whether audits are disabled for a given site by inspecting the audit configurations
|
|
101
|
-
* in the respective organization and site models.
|
|
102
|
-
*
|
|
103
|
-
* If the optional parameter `auditType` is NOT provided, only the root-level "auditsDisabled" flag
|
|
104
|
-
* in the site and organization is checked.
|
|
105
|
-
*
|
|
106
|
-
* If the optional parameter `auditType` is provided, then the specific audit configuration for the
|
|
107
|
-
* specified type is also checked.
|
|
108
|
-
*
|
|
109
|
-
* @param {object} site - The site object.
|
|
110
|
-
* @param {object} organization - The organization object.
|
|
111
|
-
* @param {string} [auditType] - The type of audit.
|
|
112
|
-
* @returns {boolean} - True if the audit(s) are disabled, otherwise false.
|
|
113
|
-
*/
|
|
114
|
-
declare function isAuditsDisabled(site: object, organization: object, auditType?: string): boolean
|
|
115
|
-
|
|
116
99
|
/**
|
|
117
100
|
* Resolves the name of the secret based on the function version.
|
|
118
101
|
* @param {Object} opts - The options object, not used in this implementation.
|