@adobe/helix-config 3.11.0 → 3.12.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.json +4 -3
  3. package/src/config-view.js +35 -0
  4. package/src/schemas/access-admin.schema.json +2 -12
  5. package/src/schemas/access-site.schema.json +2 -12
  6. package/src/schemas/access.schema.json +2 -12
  7. package/src/schemas/cdn-prod-akamai.schema.json +2 -12
  8. package/src/schemas/cdn-prod-cloudflare.schema.json +2 -12
  9. package/src/schemas/cdn-prod-cloudfront.schema.json +2 -12
  10. package/src/schemas/cdn-prod-fastly.schema.json +2 -12
  11. package/src/schemas/cdn-prod-managed.schema.json +2 -12
  12. package/src/schemas/cdn.schema.json +4 -12
  13. package/src/schemas/code.schema.json +2 -12
  14. package/src/schemas/common.schema.json +2 -12
  15. package/src/schemas/content-source-google.schema.json +2 -12
  16. package/src/schemas/content-source-markup.schema.json +2 -12
  17. package/src/schemas/content-source-onedrive.schema.json +2 -12
  18. package/src/schemas/content.schema.json +2 -12
  19. package/src/schemas/folders.schema.json +2 -12
  20. package/src/schemas/groups.schema.json +2 -12
  21. package/src/schemas/headers.schema.json +2 -12
  22. package/src/schemas/metadata-source.schema.json +2 -12
  23. package/src/schemas/org.schema.json +2 -12
  24. package/src/schemas/profile.schema.json +2 -12
  25. package/src/schemas/profiles.schema.json +2 -12
  26. package/src/schemas/public.schema.json +2 -12
  27. package/src/schemas/robots.schema.json +2 -12
  28. package/src/schemas/sidekick.schema.json +9 -17
  29. package/src/schemas/site.schema.json +2 -12
  30. package/src/schemas/sites.schema.json +2 -12
  31. package/src/schemas/tokens.schema.json +2 -12
  32. package/src/schemas/user.schema.json +2 -12
  33. package/src/schemas/users.schema.json +3 -14
  34. package/src/storage/config-validator.js +2 -3
  35. package/validate-json-schemas.sh +32 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [3.12.0](https://github.com/adobe/helix-config/compare/v3.11.1...v3.12.0) (2024-07-31)
2
+
3
+
4
+ ### Features
5
+
6
+ * enforce original-site for admin config ([#157](https://github.com/adobe/helix-config/issues/157)) ([366328f](https://github.com/adobe/helix-config/commit/366328f8a918341d61239b7d32205eea1fa09f02))
7
+
8
+ ## [3.11.1](https://github.com/adobe/helix-config/compare/v3.11.0...v3.11.1) (2024-07-29)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * fix schema and add validator ([#155](https://github.com/adobe/helix-config/issues/155)) ([4235141](https://github.com/adobe/helix-config/commit/42351418b61a1e83ee476d241875aa63fd520ae7))
14
+
1
15
  # [3.11.0](https://github.com/adobe/helix-config/compare/v3.10.1...v3.11.0) (2024-07-29)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-config",
3
- "version": "3.11.0",
3
+ "version": "3.12.0",
4
4
  "description": "Helix Config",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  "type": "module",
12
12
  "scripts": {
13
13
  "test": "c8 mocha --spec 'test/**/*.test.js'",
14
- "lint": "eslint .",
14
+ "lint": "eslint . && ./validate-json-schemas.sh",
15
15
  "docs:types": "node ./test/dev/generate-types.js",
16
16
  "semantic-release": "semantic-release",
17
17
  "semantic-release-dry": "semantic-release --dry-run --branches $CI_BRANCH",
@@ -41,11 +41,12 @@
41
41
  "@semantic-release/changelog": "6.0.3",
42
42
  "@semantic-release/git": "10.0.1",
43
43
  "@semantic-release/npm": "12.0.1",
44
+ "ajv-cli": "5.0.0",
44
45
  "c8": "10.1.2",
45
46
  "eslint": "8.57.0",
46
47
  "husky": "9.1.3",
47
48
  "json-schema-to-typescript": "15.0.0",
48
- "junit-report-builder": "3.2.1",
49
+ "junit-report-builder": "4.0.0",
49
50
  "lint-staged": "15.2.7",
50
51
  "mocha": "10.7.0",
51
52
  "mocha-multi-reporters": "1.5.1",
@@ -185,6 +185,23 @@ async function loadMetadata(ctx, config, partition) {
185
185
  };
186
186
  }
187
187
 
188
+ /**
189
+ * loads the original site information from the `.hlx.json` file
190
+ * @param ctx the context
191
+ * @param contentBusId the content bus id
192
+ * @returns {Promise<string>} the original site.
193
+ */
194
+ async function fetchOriginalSite(ctx, contentBusId) {
195
+ const key = `${contentBusId}/.hlx.json`;
196
+ const res = await ctx.loader.getObject(HELIX_CONTENT_BUS, key);
197
+ if (res.body) {
198
+ const json = res.json();
199
+ return json['original-site'] || json['original-repository'] || '';
200
+ }
201
+ ctx.log.error(`failed to load ${key}: ${res.status}`);
202
+ return '';
203
+ }
204
+
188
205
  async function loadHeadHtml(ctx, config, ref) {
189
206
  const key = `${config.code.owner}/${config.code.repo}/${ref}/head.html`;
190
207
  const res = await ctx.loader.getObject(HELIX_CODE_BUS, key);
@@ -387,6 +404,24 @@ export async function getConfigResponse(ctx, opts) {
387
404
  },
388
405
  });
389
406
  }
407
+ // validate original-site
408
+ if (!config.legacy) {
409
+ const originalSite = await fetchOriginalSite(ctx, config.content.contentBusId);
410
+ if (originalSite && originalSite !== `${org}/${site}`) {
411
+ ctx.log.error(`original site ${originalSite} does not match requested ${org}/${site}.`);
412
+ if (scope === SCOPE_ADMIN) {
413
+ return new PipelineResponse('', {
414
+ status: 403,
415
+ headers: {
416
+ 'x-error': 'original site mismatch',
417
+ ...surrogateHeaders,
418
+ },
419
+ });
420
+ }
421
+ // todo: also send 403 for all scopes....but first observe only
422
+ }
423
+ }
424
+
390
425
  if (config.extends && scope !== SCOPE_RAW) {
391
426
  delete config.extends;
392
427
  }
@@ -1,17 +1,7 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
13
3
  "$id": "https://ns.adobe.com/helix/config/access/admin",
14
- "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
15
5
  "title": "Admin Access Config",
16
6
  "type": "object",
17
7
  "properties": {
@@ -1,17 +1,7 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
13
3
  "$id": "https://ns.adobe.com/helix/config/access/site",
14
- "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
15
5
  "title": "Site Access Config",
16
6
  "type": "object",
17
7
  "properties": {
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/access",
15
5
  "type": "object",
16
6
  "title": "Access",
@@ -1,17 +1,7 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2023 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
13
3
  "$id": "https://ns.adobe.com/helix/config/cdn/prod/akamai",
14
- "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
15
5
  "title": "Akamai CDN Config",
16
6
  "type": "object",
17
7
  "properties": {
@@ -1,17 +1,7 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2023 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
13
3
  "$id": "https://ns.adobe.com/helix/config/cdn/prod/cloudflare",
14
- "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
15
5
  "title": "Cloudflare CDN Config",
16
6
  "type": "object",
17
7
  "properties": {
@@ -1,17 +1,7 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2023 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
13
3
  "$id": "https://ns.adobe.com/helix/config/cdn/prod/cloudfront",
14
- "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
15
5
  "title": "Cloudfront CDN Config",
16
6
  "type": "object",
17
7
  "properties": {
@@ -1,17 +1,7 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2023 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
13
3
  "$id": "https://ns.adobe.com/helix/config/cdn/prod/fastly",
14
- "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
15
5
  "title": "Fastly CDN Config",
16
6
  "type": "object",
17
7
  "description": "Production CDN configuration for Fastly",
@@ -1,17 +1,7 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2023 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
13
3
  "$id": "https://ns.adobe.com/helix/config/cdn/prod/managed",
14
- "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
15
5
  "title": "Managed CDN Config",
16
6
  "type": "object",
17
7
  "properties": {
@@ -1,17 +1,7 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2023 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
13
3
  "$id": "https://ns.adobe.com/helix/config/cdn",
14
- "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
15
5
  "title": "CDN Config",
16
6
  "type": "object",
17
7
  "properties": {
@@ -49,6 +39,7 @@
49
39
  ]
50
40
  },
51
41
  "live": {
42
+ "type": "object",
52
43
  "properties": {
53
44
  "host": {
54
45
  "description": "Sidekick config to override the default preview host. it supports parameters $owner and $repo",
@@ -64,6 +55,7 @@
64
55
  "additionalProperties": false
65
56
  },
66
57
  "preview": {
58
+ "type": "object",
67
59
  "properties": {
68
60
  "host": {
69
61
  "description": "Sidekick config to override the default live host. it supports parameters $owner and $repo",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/code",
15
5
  "title": "Code source",
16
6
  "type": "object",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/common",
15
5
  "definitions": {
16
6
  "title": {
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/content-source/google",
15
5
  "title": "Google Content Source",
16
6
  "type": "object",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/content-source/markup",
15
5
  "title": "Markup Content Source",
16
6
  "type": "object",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/content-source/onedrive",
15
5
  "title": "Onedrive Content Source",
16
6
  "type": "object",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/content",
15
5
  "type": "object",
16
6
  "title": "Content source",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/folders",
15
5
  "type": "object",
16
6
  "title": "folders",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/groups",
15
5
  "type": "object",
16
6
  "title": "Groups",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/headers",
15
5
  "type": "object",
16
6
  "title": "Helix Headers Config",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/metadata-source",
15
5
  "type": "object",
16
6
  "title": "metadata",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/org",
15
5
  "title": "Helix Org Config",
16
6
  "type": "object",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/profile",
15
5
  "title": "Helix Profile Config",
16
6
  "type": "object",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/profiles",
15
5
  "title": "Helix Profiles List",
16
6
  "type": "object",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/public",
15
5
  "type": "object",
16
6
  "title": "public",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/robots",
15
5
  "type": "object",
16
6
  "title": "robots",
@@ -1,17 +1,7 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
13
3
  "$id": "https://ns.adobe.com/helix/config/sidekick",
14
- "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
15
5
  "definitions": {
16
6
  "sidekickPlugin": {
17
7
  "type": "object",
@@ -73,13 +63,11 @@
73
63
  },
74
64
  "isPalette": {
75
65
  "type": "boolean",
76
- "description": "Opens the URL in a palette instead of a new tab",
77
- "dependentRequired": ["url"]
66
+ "description": "Opens the URL in a palette instead of a new tab"
78
67
  },
79
68
  "paletteRect": {
80
69
  "type": "string",
81
- "description": "he dimensions and position of a palette box",
82
- "dependentRequired": ["isPalette"]
70
+ "description": "he dimensions and position of a palette box"
83
71
  },
84
72
  "titleI18n": {
85
73
  "type": "object",
@@ -104,7 +92,11 @@
104
92
  },
105
93
  "required": [
106
94
  "id"
107
- ]
95
+ ],
96
+ "dependentRequired": {
97
+ "isPalette": ["url"],
98
+ "paletteRect": ["isPalette"]
99
+ }
108
100
  }
109
101
  },
110
102
  "title": "Sidekick Config",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/site",
15
5
  "title": "Helix Site Config",
16
6
  "type": "object",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/sites",
15
5
  "title": "Helix Sites List",
16
6
  "type": "object",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/tokens",
15
5
  "title": "tokens",
16
6
  "type": "object",
@@ -1,16 +1,6 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/user",
15
5
  "title": "user",
16
6
  "type": "object",
@@ -1,21 +1,10 @@
1
1
  {
2
- "meta:license": [
3
- "Copyright 2024 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$comment": "https://github.com/adobe/helix-config/blob/main/LICENSE.txt",
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
14
4
  "$id": "https://ns.adobe.com/helix/config/users",
15
5
  "title": "users",
16
6
  "type": "array",
17
7
  "items": {
18
8
  "$ref": "https://ns.adobe.com/helix/config/user"
19
- },
20
- "additionalProperties": false
9
+ }
21
10
  }
@@ -9,7 +9,7 @@
9
9
  * OF ANY KIND, either express or implied. See the License for the specific language
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
- import Ajv from 'ajv';
12
+ import Ajv2019 from 'ajv/dist/2019.js';
13
13
  import ajvFormats from 'ajv-formats';
14
14
  import { ValidationError } from './ValidationError.js';
15
15
 
@@ -94,8 +94,7 @@ export async function validate(config, type) {
94
94
  if (!schema) {
95
95
  throw new Error(`no such type: ${type}`);
96
96
  }
97
-
98
- const ajv = new Ajv({
97
+ const ajv = new Ajv2019({
99
98
  allErrors: true,
100
99
  verbose: true,
101
100
  useDefaults: true,
@@ -0,0 +1,32 @@
1
+ # the need the proper file order to compile the schemas.
2
+ npx ajv-cli --spec=draft2019 -c ajv-formats compile \
3
+ -s src/schemas/common.schema.json \
4
+ -s src/schemas/access-admin.schema.json \
5
+ -s src/schemas/access-site.schema.json \
6
+ -s src/schemas/access.schema.json \
7
+ -s src/schemas/cdn-prod-akamai.schema.json \
8
+ -s src/schemas/cdn-prod-cloudflare.schema.json \
9
+ -s src/schemas/cdn-prod-cloudfront.schema.json \
10
+ -s src/schemas/cdn-prod-fastly.schema.json \
11
+ -s src/schemas/cdn-prod-managed.schema.json \
12
+ -s src/schemas/cdn.schema.json \
13
+ -s src/schemas/code.schema.json \
14
+ -s src/schemas/content-source-google.schema.json \
15
+ -s src/schemas/content-source-markup.schema.json \
16
+ -s src/schemas/content-source-onedrive.schema.json \
17
+ -s src/schemas/content.schema.json \
18
+ -s src/schemas/folders.schema.json \
19
+ -s src/schemas/groups.schema.json \
20
+ -s src/schemas/headers.schema.json \
21
+ -s src/schemas/metadata-source.schema.json \
22
+ -s src/schemas/user.schema.json \
23
+ -s src/schemas/users.schema.json \
24
+ -s src/schemas/org.schema.json \
25
+ -s src/schemas/tokens.schema.json \
26
+ -s src/schemas/sidekick.schema.json \
27
+ -s src/schemas/robots.schema.json \
28
+ -s src/schemas/public.schema.json \
29
+ -s src/schemas/profile.schema.json \
30
+ -s src/schemas/profiles.schema.json \
31
+ -s src/schemas/site.schema.json \
32
+ -s src/schemas/sites.schema.json