@adobe/helix-config-storage 1.2.1 → 1.2.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 +9 -9
- package/src/config-merge.js +26 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.2.3](https://github.com/adobe/helix-config-storage/compare/v1.2.2...v1.2.3) (2024-08-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update adobe fixes ([3be774d](https://github.com/adobe/helix-config-storage/commit/3be774d5c930c1c4e7186bd719af6ed026f26d7a))
|
|
7
|
+
|
|
8
|
+
## [1.2.2](https://github.com/adobe/helix-config-storage/compare/v1.2.1...v1.2.2) (2024-08-22)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* export required property check ([#7](https://github.com/adobe/helix-config-storage/issues/7)) ([de7b093](https://github.com/adobe/helix-config-storage/commit/de7b0933651f39c8e9068b7e190253243bc3272f))
|
|
14
|
+
|
|
1
15
|
## [1.2.1](https://github.com/adobe/helix-config-storage/compare/v1.2.0...v1.2.1) (2024-08-22)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-config-storage",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Helix Config Storage",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
"ajv-cli": "5.0.0",
|
|
44
44
|
"c8": "10.1.2",
|
|
45
45
|
"eslint": "8.57.0",
|
|
46
|
-
"husky": "9.1.
|
|
47
|
-
"json-schema-to-typescript": "15.0.
|
|
46
|
+
"husky": "9.1.5",
|
|
47
|
+
"json-schema-to-typescript": "15.0.1",
|
|
48
48
|
"junit-report-builder": "5.0.0",
|
|
49
|
-
"lint-staged": "15.2.
|
|
49
|
+
"lint-staged": "15.2.9",
|
|
50
50
|
"mocha": "10.7.3",
|
|
51
51
|
"mocha-multi-reporters": "1.5.1",
|
|
52
52
|
"mocha-suppress-logs": "0.5.1",
|
|
53
|
-
"nock": "13.5.
|
|
54
|
-
"semantic-release": "24.
|
|
53
|
+
"nock": "13.5.5",
|
|
54
|
+
"semantic-release": "24.1.0",
|
|
55
55
|
"xml2js": "0.6.2"
|
|
56
56
|
},
|
|
57
57
|
"lint-staged": {
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@adobe/fetch": "4.1.8",
|
|
63
|
-
"@adobe/helix-shared-config": "10.6.
|
|
63
|
+
"@adobe/helix-shared-config": "10.6.7",
|
|
64
64
|
"@adobe/helix-shared-git": "3.0.13",
|
|
65
|
-
"@adobe/helix-shared-storage": "1.0.
|
|
65
|
+
"@adobe/helix-shared-storage": "1.0.6",
|
|
66
66
|
"@adobe/helix-shared-utils": "3.0.2",
|
|
67
67
|
"ajv": "8.17.1",
|
|
68
68
|
"ajv-formats": "3.0.1",
|
|
69
|
-
"jose": "5.
|
|
69
|
+
"jose": "5.7.0"
|
|
70
70
|
}
|
|
71
71
|
}
|
package/src/config-merge.js
CHANGED
|
@@ -43,22 +43,31 @@ const FORCED_TYPES = {
|
|
|
43
43
|
/**
|
|
44
44
|
* properties that are required by the schema and must not be removed for empty values
|
|
45
45
|
*/
|
|
46
|
-
const REQUIRED_PROPERTIES =
|
|
47
|
-
'.cdn.prod.host'
|
|
48
|
-
'.cdn.prod.type'
|
|
49
|
-
'.cdn.prod.endpoint'
|
|
50
|
-
'.cdn.prod.clientSecret'
|
|
51
|
-
'.cdn.prod.clientToken'
|
|
52
|
-
'.cdn.prod.accessToken'
|
|
53
|
-
'.cdn.prod.plan'
|
|
54
|
-
'.cdn.prod.zoneId'
|
|
55
|
-
'.cdn.prod.apiToken'
|
|
56
|
-
'.cdn.prod.distributionId'
|
|
57
|
-
'.cdn.prod.accessKeyId'
|
|
58
|
-
'.cdn.prod.secretAccessKey'
|
|
59
|
-
'.cdn.prod.serviceId'
|
|
60
|
-
'.cdn.prod.authToken'
|
|
61
|
-
|
|
46
|
+
const REQUIRED_PROPERTIES = [
|
|
47
|
+
'.cdn.prod.host',
|
|
48
|
+
'.cdn.prod.type',
|
|
49
|
+
'.cdn.prod.endpoint',
|
|
50
|
+
'.cdn.prod.clientSecret',
|
|
51
|
+
'.cdn.prod.clientToken',
|
|
52
|
+
'.cdn.prod.accessToken',
|
|
53
|
+
'.cdn.prod.plan',
|
|
54
|
+
'.cdn.prod.zoneId',
|
|
55
|
+
'.cdn.prod.apiToken',
|
|
56
|
+
'.cdn.prod.distributionId',
|
|
57
|
+
'.cdn.prod.accessKeyId',
|
|
58
|
+
'.cdn.prod.secretAccessKey',
|
|
59
|
+
'.cdn.prod.serviceId',
|
|
60
|
+
'.cdn.prod.authToken',
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* properties that are required by the schema and must not be removed for empty values
|
|
65
|
+
* @param propertyPath
|
|
66
|
+
* @returns {boolean}
|
|
67
|
+
*/
|
|
68
|
+
export function isRequiredProperty(propertyPath) {
|
|
69
|
+
return REQUIRED_PROPERTIES.includes(propertyPath);
|
|
70
|
+
}
|
|
62
71
|
|
|
63
72
|
/**
|
|
64
73
|
* Merges the `src` object into the `dst` object.
|
|
@@ -75,7 +84,7 @@ const REQUIRED_PROPERTIES = {
|
|
|
75
84
|
function merge(dst, src, path, isModifier) {
|
|
76
85
|
for (const [key, value] of Object.entries(src)) {
|
|
77
86
|
const itemPath = `${path}.${key}`;
|
|
78
|
-
if (value === '' && !
|
|
87
|
+
if (value === '' && !isRequiredProperty(itemPath)) {
|
|
79
88
|
// remove key if value is empty string (keep false, 0)
|
|
80
89
|
delete dst[key];
|
|
81
90
|
} else if (typeof value !== 'object') {
|