@adobe/helix-config-storage 3.0.1 → 3.2.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 CHANGED
@@ -1,3 +1,17 @@
1
+ # [3.2.0](https://github.com/adobe/helix-config-storage/compare/v3.1.0...v3.2.0) (2026-05-28)
2
+
3
+
4
+ ### Features
5
+
6
+ * add withCreatedOverride() to allow caller-supplied created date ([#268](https://github.com/adobe/helix-config-storage/issues/268)) ([0da8b14](https://github.com/adobe/helix-config-storage/commit/0da8b14f15b4784df18a71c1016c303814c76906))
7
+
8
+ # [3.1.0](https://github.com/adobe/helix-config-storage/compare/v3.0.1...v3.1.0) (2026-05-19)
9
+
10
+
11
+ ### Features
12
+
13
+ * **config:** reject site creation if main--site--org exceeds 63 characters ([#262](https://github.com/adobe/helix-config-storage/issues/262)) ([36d97e0](https://github.com/adobe/helix-config-storage/commit/36d97e0be36b8369f460ebd9d70dff25c226efbe))
14
+
1
15
  ## [3.0.1](https://github.com/adobe/helix-config-storage/compare/v3.0.0...v3.0.1) (2026-05-12)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-config-storage",
3
- "version": "3.0.1",
3
+ "version": "3.2.0",
4
4
  "description": "Helix Config Storage",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -36,8 +36,8 @@
36
36
  "reporter-options": "configFile=.mocha-multi.json"
37
37
  },
38
38
  "devDependencies": {
39
- "@adobe/eslint-config-helix": "3.0.26",
40
- "@eslint/config-helpers": "0.5.5",
39
+ "@adobe/eslint-config-helix": "3.0.28",
40
+ "@eslint/config-helpers": "0.6.0",
41
41
  "@semantic-release/changelog": "6.0.3",
42
42
  "@semantic-release/git": "10.0.1",
43
43
  "@semantic-release/npm": "13.1.5",
@@ -47,11 +47,11 @@
47
47
  "husky": "9.1.7",
48
48
  "json-schema-to-typescript": "15.0.4",
49
49
  "junit-report-builder": "5.1.2",
50
- "lint-staged": "16.4.0",
50
+ "lint-staged": "17.0.4",
51
51
  "mocha": "11.7.5",
52
52
  "mocha-multi-reporters": "1.5.1",
53
53
  "mocha-suppress-logs": "0.6.0",
54
- "nock": "14.0.13",
54
+ "nock": "14.0.15",
55
55
  "semantic-release": "25.0.3",
56
56
  "xml2js": "0.6.2"
57
57
  },
@@ -109,6 +109,12 @@ export class ConfigStore {
109
109
  */
110
110
  #versioning;
111
111
 
112
+ /**
113
+ * indicates that update of the created date is allowed.
114
+ * @type {boolean}
115
+ */
116
+ #createdOverride = false;
117
+
112
118
  /**
113
119
  * @param {string} org the org id
114
120
  * @param {string} type store type (org, sites, profiles, secrets, users)
@@ -160,6 +166,16 @@ export class ConfigStore {
160
166
  return this;
161
167
  }
162
168
 
169
+ /**
170
+ * Allows the caller to supply a custom created date. used for migrations.
171
+ * @param {boolean} v
172
+ * @returns {ConfigStore}
173
+ */
174
+ withCreatedOverride(v) {
175
+ this.#createdOverride = v;
176
+ return this;
177
+ }
178
+
163
179
  /**
164
180
  * Controls the details included in config list entries.
165
181
  * When `true`, each entry includes the `content` and `code` fields from the config.
@@ -348,6 +364,12 @@ export class ConfigStore {
348
364
  if (relPath) {
349
365
  throw new StatusCodeError(409, 'create not supported on substructures.');
350
366
  }
367
+ if (this.type === 'sites') {
368
+ const domainLabelLength = `main--${this.name}--${this.org}`.length;
369
+ if (domainLabelLength > 63) {
370
+ throw new StatusCodeError(409, `main--site--org length exceeds maximum of 63 characters: ${domainLabelLength}`);
371
+ }
372
+ }
351
373
  const storage = HelixStorage.fromContext(ctx).configBus();
352
374
 
353
375
  if (await storage.head(this.key)) {
@@ -517,8 +539,8 @@ export class ConfigStore {
517
539
  lastModified: 'ignore',
518
540
  });
519
541
  config.created = oldConfig.created;
520
- } else if (!restoreVersion) {
521
- delete config.created; // don't allow to set created on new config
542
+ } else if (!restoreVersion && !this.#createdOverride) {
543
+ delete config.created; // don't allow to set created on new config if not allowed
522
544
  }
523
545
  this.#updateTimeStamps(config);
524
546
  let newConfig = config;