@adobe/helix-config-storage 2.0.2 → 2.0.4
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 +2 -2
- package/src/config-store.js +4 -5
- package/src/schemas/features.schema.json +0 -8
- package/src/utils.js +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [2.0.4](https://github.com/adobe/helix-config-storage/compare/v2.0.3...v2.0.4) (2025-03-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* relax features schema ([#100](https://github.com/adobe/helix-config-storage/issues/100)) ([558a046](https://github.com/adobe/helix-config-storage/commit/558a046a36363bc9c80cc1879209f4bf4a709dad))
|
|
7
|
+
|
|
8
|
+
## [2.0.3](https://github.com/adobe/helix-config-storage/compare/v2.0.2...v2.0.3) (2025-03-04)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update dependency @adobe/fetch to v4.2.0 ([#99](https://github.com/adobe/helix-config-storage/issues/99)) ([99cf373](https://github.com/adobe/helix-config-storage/commit/99cf37335f5b6013b9a42544d9c7b6c03a854f12))
|
|
14
|
+
|
|
1
15
|
## [2.0.2](https://github.com/adobe/helix-config-storage/compare/v2.0.1...v2.0.2) (2025-03-03)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-config-storage",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Helix Config Storage",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"*.cjs": "eslint"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@adobe/fetch": "4.
|
|
62
|
+
"@adobe/fetch": "4.2.0",
|
|
63
63
|
"@adobe/helix-shared-config": "11.1.0",
|
|
64
64
|
"@adobe/helix-shared-git": "3.0.17",
|
|
65
65
|
"@adobe/helix-shared-storage": "1.2.0",
|
package/src/config-store.js
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
*/
|
|
12
12
|
/* eslint-disable no-param-reassign */
|
|
13
13
|
import crypto from 'crypto';
|
|
14
|
-
import { isDeepStrictEqual } from 'util';
|
|
15
14
|
import { HelixStorage } from '@adobe/helix-shared-storage';
|
|
16
15
|
import { StatusCodeError } from './status-code-error.js';
|
|
17
16
|
import {
|
|
@@ -19,7 +18,7 @@ import {
|
|
|
19
18
|
migrateToken,
|
|
20
19
|
updateCodeSource,
|
|
21
20
|
updateContentSource,
|
|
22
|
-
deepGetOrCreate, deepPut, prune, createSecret, migrateSecret,
|
|
21
|
+
deepGetOrCreate, deepPut, prune, createSecret, migrateSecret, isDeepEqual,
|
|
23
22
|
} from './utils.js';
|
|
24
23
|
import { validate as validateSchema } from './config-validator.js';
|
|
25
24
|
import { getMergedConfig } from './config-merge.js';
|
|
@@ -438,12 +437,12 @@ export class ConfigStore {
|
|
|
438
437
|
if (this.type !== 'org') {
|
|
439
438
|
const oldFeatures = oldConfig?.features ?? {};
|
|
440
439
|
const newFeatures = newConfig?.features ?? {};
|
|
441
|
-
if (!
|
|
440
|
+
if (!isDeepEqual(oldFeatures, newFeatures)) {
|
|
442
441
|
throw new StatusCodeError(403, 'not allowed to modify features');
|
|
443
442
|
}
|
|
444
443
|
const oldLimits = oldConfig?.limits ?? {};
|
|
445
444
|
const newLimits = newConfig?.limits ?? {};
|
|
446
|
-
if (!
|
|
445
|
+
if (!isDeepEqual(oldLimits, newLimits)) {
|
|
447
446
|
throw new StatusCodeError(403, 'not allowed to modify limits');
|
|
448
447
|
}
|
|
449
448
|
}
|
|
@@ -505,7 +504,7 @@ export class ConfigStore {
|
|
|
505
504
|
const frag = getFragmentInfo(this.type, relPath);
|
|
506
505
|
let config = data;
|
|
507
506
|
// set config to null if empty object
|
|
508
|
-
if (
|
|
507
|
+
if (isDeepEqual(config, {})) {
|
|
509
508
|
config = null;
|
|
510
509
|
}
|
|
511
510
|
|
package/src/utils.js
CHANGED
|
@@ -305,3 +305,14 @@ export function deepPut(obj, path, value) {
|
|
|
305
305
|
}
|
|
306
306
|
return obj;
|
|
307
307
|
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Lazy implementation of deep equals. Note that isDeepStrictEquals() is not suited for our case,
|
|
311
|
+
* as object with null prototypes are not equal to objects with default prototype.
|
|
312
|
+
* @param {object} o0
|
|
313
|
+
* @param {object} o1
|
|
314
|
+
* @returns {boolean}
|
|
315
|
+
*/
|
|
316
|
+
export function isDeepEqual(o0, o1) {
|
|
317
|
+
return JSON.stringify(o0) === JSON.stringify(o1);
|
|
318
|
+
}
|