@adobe/helix-config-storage 2.2.13 → 2.3.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 +7 -0
- package/package.json +4 -3
- package/src/config-store.js +33 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [2.3.0](https://github.com/adobe/helix-config-storage/compare/v2.2.13...v2.3.0) (2025-06-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* include site details in list ([#146](https://github.com/adobe/helix-config-storage/issues/146)) ([00656ee](https://github.com/adobe/helix-config-storage/commit/00656ee93da9ac41410aeb79b4c2fdad35359fe7))
|
|
7
|
+
|
|
1
8
|
## [2.2.13](https://github.com/adobe/helix-config-storage/compare/v2.2.12...v2.2.13) (2025-06-18)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-config-storage",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Helix Config Storage",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"reporter-options": "configFile=.mocha-multi.json"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@adobe/eslint-config-helix": "3.0.
|
|
39
|
+
"@adobe/eslint-config-helix": "3.0.5",
|
|
40
40
|
"@eslint/config-helpers": "0.2.3",
|
|
41
41
|
"@semantic-release/changelog": "6.0.3",
|
|
42
42
|
"@semantic-release/git": "10.0.1",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"json-schema-to-typescript": "15.0.4",
|
|
49
49
|
"junit-report-builder": "5.1.1",
|
|
50
50
|
"lint-staged": "16.1.2",
|
|
51
|
-
"mocha": "11.
|
|
51
|
+
"mocha": "11.7.0",
|
|
52
52
|
"mocha-multi-reporters": "1.5.1",
|
|
53
53
|
"mocha-suppress-logs": "0.5.1",
|
|
54
54
|
"nock": "13.5.6",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"@adobe/fetch": "^4.2.0",
|
|
64
64
|
"@adobe/helix-shared-config": "^11.1.4",
|
|
65
65
|
"@adobe/helix-shared-git": "^3.0.18",
|
|
66
|
+
"@adobe/helix-shared-process-queue": "3.1.3",
|
|
66
67
|
"@adobe/helix-shared-storage": "^1.3.0",
|
|
67
68
|
"@adobe/helix-shared-string": "^2.1.0",
|
|
68
69
|
"@adobe/helix-shared-utils": "^3.0.2",
|
package/src/config-store.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import crypto from 'crypto';
|
|
14
14
|
import { decodeJwt } from 'jose';
|
|
15
15
|
import { HelixStorage } from '@adobe/helix-shared-storage';
|
|
16
|
+
import processQueue from '@adobe/helix-shared-process-queue';
|
|
16
17
|
import { StatusCodeError } from './status-code-error.js';
|
|
17
18
|
import {
|
|
18
19
|
createToken, createUser,
|
|
@@ -350,6 +351,7 @@ export class ConfigStore {
|
|
|
350
351
|
this.now = new Date();
|
|
351
352
|
this.isAdmin = false;
|
|
352
353
|
this.isOps = false;
|
|
354
|
+
this.listDetails = false;
|
|
353
355
|
}
|
|
354
356
|
|
|
355
357
|
/**
|
|
@@ -372,6 +374,16 @@ export class ConfigStore {
|
|
|
372
374
|
return this;
|
|
373
375
|
}
|
|
374
376
|
|
|
377
|
+
/**
|
|
378
|
+
* shows the details of the config list, like the source and code urls.
|
|
379
|
+
* @param v
|
|
380
|
+
* @returns {ConfigStore}
|
|
381
|
+
*/
|
|
382
|
+
withListDetails(v) {
|
|
383
|
+
this.listDetails = v;
|
|
384
|
+
return this;
|
|
385
|
+
}
|
|
386
|
+
|
|
375
387
|
/**
|
|
376
388
|
* updates the created and lastModified time stamp on the data object to the current time.
|
|
377
389
|
* the created property is only set if it doesn't exist yet.
|
|
@@ -388,18 +400,28 @@ export class ConfigStore {
|
|
|
388
400
|
const storage = HelixStorage.fromContext(ctx).configBus();
|
|
389
401
|
const key = `orgs/${this.org}/${this.type}/`;
|
|
390
402
|
const list = await storage.list(key);
|
|
403
|
+
let entries = list.map((entry) => {
|
|
404
|
+
const siteKey = entry.key;
|
|
405
|
+
if (siteKey.endsWith('.json')) {
|
|
406
|
+
const name = siteKey.split('/').pop();
|
|
407
|
+
return {
|
|
408
|
+
path: `/config/${this.org}/${this.type}/${name}`,
|
|
409
|
+
name: name.substring(0, name.length - 5),
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
return null;
|
|
413
|
+
}).filter((entry) => !!entry);
|
|
414
|
+
|
|
415
|
+
if (this.listDetails) {
|
|
416
|
+
entries = await processQueue(entries, async (entry) => {
|
|
417
|
+
const json = JSON.parse(await storage.get(`/orgs/${this.org}/${this.type}/${entry.name}.json`));
|
|
418
|
+
entry.content = json.content;
|
|
419
|
+
entry.code = json.code;
|
|
420
|
+
return entry;
|
|
421
|
+
});
|
|
422
|
+
}
|
|
391
423
|
return {
|
|
392
|
-
[this.type]:
|
|
393
|
-
const siteKey = entry.key;
|
|
394
|
-
if (siteKey.endsWith('.json')) {
|
|
395
|
-
const name = siteKey.split('/').pop();
|
|
396
|
-
return {
|
|
397
|
-
path: `/config/${this.org}/${this.type}/${name}`,
|
|
398
|
-
name: name.substring(0, name.length - 5),
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
|
-
return null;
|
|
402
|
-
}).filter((entry) => !!entry),
|
|
424
|
+
[this.type]: entries,
|
|
403
425
|
};
|
|
404
426
|
}
|
|
405
427
|
|