@adobe/helix-admin-support 1.6.31 → 1.6.32

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 (74) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/docs/API.md +434 -5
  3. package/docs/README.md +45 -0
  4. package/docs/project-config-all-properties-config-properties-data.md +15 -0
  5. package/docs/project-config-all-properties-config-properties-lastmodified.md +15 -0
  6. package/docs/project-config-all-properties-config.md +58 -0
  7. package/docs/project-config-all-properties-headers-properties-data.md +15 -0
  8. package/docs/project-config-all-properties-headers-properties-lastmodified.md +15 -0
  9. package/docs/project-config-all-properties-headers.md +58 -0
  10. package/docs/project-config-all-properties-metadata-properties-data.md +15 -0
  11. package/docs/project-config-all-properties-metadata-properties-lastmodified.md +15 -0
  12. package/docs/project-config-all-properties-metadata.md +58 -0
  13. package/docs/project-config-all-properties-projectconfigentry-properties-data.md +15 -0
  14. package/docs/project-config-all-properties-projectconfigentry-properties-lastmodified.md +15 -0
  15. package/docs/project-config-all-properties-projectconfigentry.md +58 -0
  16. package/docs/project-config-all.md +77 -0
  17. package/docs/project-config-all.schema.json +1 -0
  18. package/docs/project-config-cdn-defs-stringorarray-oneof-0.md +15 -0
  19. package/docs/project-config-cdn-defs-stringorarray-oneof-1-items.md +15 -0
  20. package/docs/project-config-cdn-defs-stringorarray-oneof-1.md +15 -0
  21. package/docs/project-config-cdn-defs-stringorarray.md +21 -0
  22. package/docs/project-config-cdn-defs.md +15 -0
  23. package/docs/project-config-cdn-properties-prod-oneof-akamaiconfig-properties-accesstoken.md +15 -0
  24. package/docs/project-config-cdn-properties-prod-oneof-akamaiconfig-properties-clientsecret.md +15 -0
  25. package/docs/project-config-cdn-properties-prod-oneof-akamaiconfig-properties-clienttoken.md +15 -0
  26. package/docs/project-config-cdn-properties-prod-oneof-akamaiconfig-properties-endpoint.md +15 -0
  27. package/docs/project-config-cdn-properties-prod-oneof-akamaiconfig-properties-host.md +15 -0
  28. package/docs/project-config-cdn-properties-prod-oneof-akamaiconfig-properties-type.md +23 -0
  29. package/docs/project-config-cdn-properties-prod-oneof-akamaiconfig.md +167 -0
  30. package/docs/project-config-cdn-properties-prod-oneof-cloudflareconfig-properties-apitoken.md +15 -0
  31. package/docs/project-config-cdn-properties-prod-oneof-cloudflareconfig-properties-host.md +15 -0
  32. package/docs/project-config-cdn-properties-prod-oneof-cloudflareconfig-properties-origin.md +15 -0
  33. package/docs/project-config-cdn-properties-prod-oneof-cloudflareconfig-properties-plan.md +15 -0
  34. package/docs/project-config-cdn-properties-prod-oneof-cloudflareconfig-properties-type.md +23 -0
  35. package/docs/project-config-cdn-properties-prod-oneof-cloudflareconfig-properties-zoneid.md +15 -0
  36. package/docs/project-config-cdn-properties-prod-oneof-cloudflareconfig.md +167 -0
  37. package/docs/project-config-cdn-properties-prod-oneof-fastlyconfig-properties-authtoken.md +15 -0
  38. package/docs/project-config-cdn-properties-prod-oneof-fastlyconfig-properties-host.md +15 -0
  39. package/docs/project-config-cdn-properties-prod-oneof-fastlyconfig-properties-serviceid.md +15 -0
  40. package/docs/project-config-cdn-properties-prod-oneof-fastlyconfig-properties-type.md +23 -0
  41. package/docs/project-config-cdn-properties-prod-oneof-fastlyconfig.md +129 -0
  42. package/docs/project-config-cdn-properties-prod-oneof-managedconfig-properties-host.md +15 -0
  43. package/docs/project-config-cdn-properties-prod-oneof-managedconfig-properties-type.md +23 -0
  44. package/docs/project-config-cdn-properties-prod-oneof-managedconfig.md +91 -0
  45. package/docs/project-config-cdn-properties-prod.md +25 -0
  46. package/docs/project-config-cdn.md +62 -0
  47. package/docs/project-config-cdn.schema.json +1 -0
  48. package/docs/project-config-defs-emailglob-oneof-0.md +15 -0
  49. package/docs/project-config-defs-emailglob-oneof-1-items.md +15 -0
  50. package/docs/project-config-defs-emailglob-oneof-1.md +15 -0
  51. package/docs/project-config-defs-emailglob.md +21 -0
  52. package/docs/project-config-defs.md +15 -0
  53. package/docs/project-config-properties-adminconfig-properties-role.md +70 -0
  54. package/docs/project-config-properties-adminconfig.md +39 -0
  55. package/docs/project-config-properties-host.md +15 -0
  56. package/docs/project-config-properties-name.md +15 -0
  57. package/docs/project-config-properties-project.md +15 -0
  58. package/docs/project-config-properties-siteaccessconfig.md +45 -0
  59. package/docs/project-config-properties-slack-oneof-0.md +15 -0
  60. package/docs/project-config-properties-slack-oneof-1-items.md +15 -0
  61. package/docs/project-config-properties-slack-oneof-1.md +15 -0
  62. package/docs/project-config-properties-slack.md +21 -0
  63. package/docs/project-config-properties-timezone.md +22 -0
  64. package/docs/project-config.md +198 -0
  65. package/docs/project-config.schema.json +1 -0
  66. package/package.json +11 -6
  67. package/src/fetch-config-all.d.ts +1 -32
  68. package/src/fetch-config.d.ts +2 -77
  69. package/src/fetch-ignore.js +0 -2
  70. package/src/schemas/project-config-all.schema.json +63 -0
  71. package/src/schemas/project-config-cdn.schema.json +148 -0
  72. package/src/schemas/project-config.schema.json +108 -0
  73. package/types/project-config-all.d.ts +42 -0
  74. package/types/project-config.d.ts +127 -0
@@ -0,0 +1,198 @@
1
+ # ProjectConfig Schema
2
+
3
+ ```txt
4
+ https://ns.adobe.com/helix/config/project
5
+ ```
6
+
7
+
8
+
9
+ | Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
10
+ | :------------------ | :--------- | :------------- | :----------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------ |
11
+ | Can be instantiated | No | Unknown status | No | Forbidden | Forbidden | none | [project-config.schema.json](project-config.schema.json "open original schema") |
12
+
13
+ ## ProjectConfig Type
14
+
15
+ `object` ([ProjectConfig](project-config.md))
16
+
17
+ # ProjectConfig Properties
18
+
19
+ | Property | Type | Required | Nullable | Defined by |
20
+ | :-------------------- | :------- | :------- | :------------- | :---------------------------------------------------------------------------------------------------------------------------- |
21
+ | [name](#name) | `string` | Optional | cannot be null | [ProjectConfig](project-config-properties-name.md "https://ns.adobe.com/helix/config/project#/properties/name") |
22
+ | [project](#project) | `string` | Optional | cannot be null | [ProjectConfig](project-config-properties-project.md "https://ns.adobe.com/helix/config/project#/properties/project") |
23
+ | [timezone](#timezone) | `string` | Optional | cannot be null | [ProjectConfig](project-config-properties-timezone.md "https://ns.adobe.com/helix/config/project#/properties/timezone") |
24
+ | [host](#host) | `string` | Optional | cannot be null | [ProjectConfig](project-config-properties-host.md "https://ns.adobe.com/helix/config/project#/properties/host") |
25
+ | [slack](#slack) | Merged | Optional | cannot be null | [ProjectConfig](project-config-properties-slack.md "https://ns.adobe.com/helix/config/project#/properties/slack") |
26
+ | [cdn](#cdn) | `object` | Optional | cannot be null | [ProjectConfig](project-config-cdn.md "https://ns.adobe.com/helix/config/cdn#/properties/cdn") |
27
+ | [access](#access) | `object` | Optional | cannot be null | [ProjectConfig](project-config-properties-siteaccessconfig.md "https://ns.adobe.com/helix/config/project#/properties/access") |
28
+ | [admin](#admin) | `object` | Optional | cannot be null | [ProjectConfig](project-config-properties-adminconfig.md "https://ns.adobe.com/helix/config/project#/properties/admin") |
29
+
30
+ ## name
31
+
32
+ Name of the project used by the slack bot when reporting.
33
+
34
+ `name`
35
+
36
+ * is optional
37
+
38
+ * Type: `string`
39
+
40
+ * cannot be null
41
+
42
+ * defined in: [ProjectConfig](project-config-properties-name.md "https://ns.adobe.com/helix/config/project#/properties/name")
43
+
44
+ ### name Type
45
+
46
+ `string`
47
+
48
+ ## project
49
+
50
+ Name of the project used by the sidekick.
51
+
52
+ `project`
53
+
54
+ * is optional
55
+
56
+ * Type: `string`
57
+
58
+ * cannot be null
59
+
60
+ * defined in: [ProjectConfig](project-config-properties-project.md "https://ns.adobe.com/helix/config/project#/properties/project")
61
+
62
+ ### project Type
63
+
64
+ `string`
65
+
66
+ ## timezone
67
+
68
+ Timezone to be used by the slack bot when reporting times.
69
+
70
+ `timezone`
71
+
72
+ * is optional
73
+
74
+ * Type: `string`
75
+
76
+ * cannot be null
77
+
78
+ * defined in: [ProjectConfig](project-config-properties-timezone.md "https://ns.adobe.com/helix/config/project#/properties/timezone")
79
+
80
+ ### timezone Type
81
+
82
+ `string`
83
+
84
+ ### timezone Examples
85
+
86
+ ```yaml
87
+ Europe/Zurich
88
+
89
+ ```
90
+
91
+ ## host
92
+
93
+ Production host use by the slack bot to display project information.
94
+
95
+ `host`
96
+
97
+ * is optional
98
+
99
+ * Type: `string`
100
+
101
+ * cannot be null
102
+
103
+ * defined in: [ProjectConfig](project-config-properties-host.md "https://ns.adobe.com/helix/config/project#/properties/host")
104
+
105
+ ### host Type
106
+
107
+ `string`
108
+
109
+ ## slack
110
+
111
+ the slack teamId/channelID(s) where the slack bot is used.
112
+
113
+ `slack`
114
+
115
+ * is optional
116
+
117
+ * Type: merged type ([Details](project-config-properties-slack.md))
118
+
119
+ * cannot be null
120
+
121
+ * defined in: [ProjectConfig](project-config-properties-slack.md "https://ns.adobe.com/helix/config/project#/properties/slack")
122
+
123
+ ### slack Type
124
+
125
+ merged type ([Details](project-config-properties-slack.md))
126
+
127
+ one (and only one) of
128
+
129
+ * [Untitled string in ProjectConfig](project-config-properties-slack-oneof-0.md "check type definition")
130
+
131
+ * [Untitled array in ProjectConfig](project-config-properties-slack-oneof-1.md "check type definition")
132
+
133
+ ## cdn
134
+
135
+ The CDN config
136
+
137
+ `cdn`
138
+
139
+ * is optional
140
+
141
+ * Type: `object` ([ProjectCDNConfig](project-config-cdn.md))
142
+
143
+ * cannot be null
144
+
145
+ * defined in: [ProjectConfig](project-config-cdn.md "https://ns.adobe.com/helix/config/cdn#/properties/cdn")
146
+
147
+ ### cdn Type
148
+
149
+ `object` ([ProjectCDNConfig](project-config-cdn.md))
150
+
151
+ ## access
152
+
153
+
154
+
155
+ `access`
156
+
157
+ * is optional
158
+
159
+ * Type: `object` ([SiteAccessConfig](project-config-properties-siteaccessconfig.md))
160
+
161
+ * cannot be null
162
+
163
+ * defined in: [ProjectConfig](project-config-properties-siteaccessconfig.md "https://ns.adobe.com/helix/config/project#/properties/access")
164
+
165
+ ### access Type
166
+
167
+ `object` ([SiteAccessConfig](project-config-properties-siteaccessconfig.md))
168
+
169
+ ## admin
170
+
171
+
172
+
173
+ `admin`
174
+
175
+ * is optional
176
+
177
+ * Type: `object` ([AdminConfig](project-config-properties-adminconfig.md))
178
+
179
+ * cannot be null
180
+
181
+ * defined in: [ProjectConfig](project-config-properties-adminconfig.md "https://ns.adobe.com/helix/config/project#/properties/admin")
182
+
183
+ ### admin Type
184
+
185
+ `object` ([AdminConfig](project-config-properties-adminconfig.md))
186
+
187
+ # ProjectConfig Definitions
188
+
189
+ ## Definitions group emailglob
190
+
191
+ Reference this group by using
192
+
193
+ ```json
194
+ {"$ref":"https://ns.adobe.com/helix/config/project#/$defs/emailglob"}
195
+ ```
196
+
197
+ | Property | Type | Required | Nullable | Defined by |
198
+ | :------- | :--- | :------- | :------- | :--------- |
@@ -0,0 +1 @@
1
+ {"meta:license":["Copyright 2023 Adobe. All rights reserved.","This file is licensed to you under the Apache License, Version 2.0 (the \"License\");","you may not use this file except in compliance with the License. You may obtain a copy","of the License at http://www.apache.org/licenses/LICENSE-2.0","","Unless required by applicable law or agreed to in writing, software distributed under","the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS","OF ANY KIND, either express or implied. See the License for the specific language","governing permissions and limitations under the License."],"$id":"https://ns.adobe.com/helix/config/project","$schema":"http://json-schema.org/draft-07/schema#","$defs":{"emailglob":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"matches one or several users or group of users"}},"title":"ProjectConfig","type":"object","properties":{"name":{"type":"string","description":"Name of the project used by the slack bot when reporting."},"project":{"type":"string","description":"Name of the project used by the sidekick."},"timezone":{"type":"string","description":"Timezone to be used by the slack bot when reporting times.","examples":["Europe/Zurich"]},"host":{"type":"string","description":"Production host use by the slack bot to display project information."},"slack":{"description":"the slack teamId/channelID(s) where the slack bot is used.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cdn":{"description":"The CDN config","$ref":"./project-config-cdn.schema.json"},"access":{"type":"object","title":"SiteAccessConfig","properties":{"allow":{"description":"The email glob of the users that are allowed.","$ref":"#/$defs/emailglob"}},"required":["allow"],"additionalProperties":false},"admin":{"title":"AdminConfig","type":"object","properties":{"role":{"title":"Role","type":"object","properties":{"author":{"description":"The email glob of the users with author role.","$ref":"#/$defs/emailglob"},"publish":{"description":"The email glob of the users with publish role.","$ref":"#/$defs/emailglob"}},"required":["role"],"additionalProperties":false}},"additionalProperties":false}},"additionalProperties":false}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-admin-support",
3
- "version": "1.6.31",
3
+ "version": "1.6.32",
4
4
  "description": "Helix Admin Support Library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -8,7 +8,10 @@
8
8
  "scripts": {
9
9
  "test": "c8 mocha",
10
10
  "lint": "eslint .",
11
- "docs": "npx jsdoc2md -c .jsdoc.json --files 'src/*.js' > docs/API.md",
11
+ "docs:schema": "jsonschema2md -d src/schemas -o docs -x docs -f yaml",
12
+ "docs:api": "jsdoc2md -c .jsdoc.json --files src/*.js > docs/API.md",
13
+ "docs:types": "node ./test/dev/generate-types.js",
14
+ "docs": "npm run docs:schema && npm run docs:api && npm run docs:types",
12
15
  "semantic-release": "semantic-release",
13
16
  "prepare": "husky install"
14
17
  },
@@ -34,12 +37,13 @@
34
37
  "@adobe/fetch": "4.0.5",
35
38
  "@adobe/helix-shared-config": "10.0.1",
36
39
  "@adobe/helix-shared-utils": "3.0.0",
37
- "@aws-sdk/client-s3": "3.289.0",
38
- "@aws-sdk/client-sqs": "3.289.0",
39
- "@aws-sdk/node-http-handler": "3.289.0"
40
+ "@aws-sdk/client-s3": "3.294.0",
41
+ "@aws-sdk/client-sqs": "3.294.0",
42
+ "@aws-sdk/node-http-handler": "3.292.0"
40
43
  },
41
44
  "devDependencies": {
42
45
  "@adobe/eslint-config-helix": "2.0.2",
46
+ "@adobe/jsonschema2md": "7.1.5",
43
47
  "@semantic-release/changelog": "6.0.2",
44
48
  "@semantic-release/git": "10.0.1",
45
49
  "@semantic-release/npm": "9.0.2",
@@ -47,12 +51,13 @@
47
51
  "eslint": "8.36.0",
48
52
  "husky": "8.0.3",
49
53
  "jsdoc-to-markdown": "8.0.0",
54
+ "json-schema-to-typescript": "12.0.0",
50
55
  "junit-report-builder": "3.0.1",
51
56
  "lint-staged": "13.2.0",
52
57
  "mocha": "10.2.0",
53
58
  "mocha-multi-reporters": "1.5.1",
54
59
  "nock": "13.3.0",
55
- "semantic-release": "20.1.1",
60
+ "semantic-release": "20.1.3",
56
61
  "yaml": "2.2.1"
57
62
  },
58
63
  "lint-staged": {
@@ -9,39 +9,8 @@
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 { ModifierMap } from '@adobe/helix-shared-config';
13
12
  import {AdminContext, PathInfo} from './index';
14
- import { ProjectConfig } from './fetch-config';
15
-
16
- export declare interface ProjectConfigEntry {
17
- data: ProjectConfig;
18
- lastModified: string;
19
- }
20
-
21
- export declare interface ModifierConfigEntry {
22
- data: ModifierMap;
23
- lastModified: string;
24
- }
25
-
26
- /**
27
- * Combine config stored in /.helix/config-all.json
28
- */
29
- export declare interface ConfigAll {
30
- /**
31
- * Project config (from /.helix/config.json)
32
- */
33
- config?:ProjectConfigEntry;
34
-
35
- /**
36
- * Metadata (from /metadata.json)
37
- */
38
- metadata?:ModifierConfigEntry;
39
-
40
- /**
41
- * Headers modifier (from /.helix/config.json)
42
- */
43
- headers?:ModifierConfigEntry;
44
- }
13
+ import {ConfigAll} from "../types/project-config-all";
45
14
 
46
15
  /**
47
16
  * Retrieves the project config from the underlying storage
@@ -10,82 +10,7 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
  import { AdminContext, PathInfo } from './index';
13
-
14
- /**
15
- * Project CDN Config
16
- */
17
- export declare interface ProjectCDNProductionConfig {
18
- /**
19
- * cnd type
20
- * @enum 'fastly', 'cloudflare', 'akamai'
21
- */
22
- type:string,
23
-
24
- /**
25
- * production host
26
- */
27
- host:string,
28
-
29
- /**
30
- * Route or routes on the CDN that are rendered with helix
31
- */
32
- route: (string|string[]),
33
- }
34
-
35
- /**
36
- * Cloudflare Config
37
- */
38
- export declare interface CloudflareConfig extends ProjectCDNProductionConfig {
39
- origin:string,
40
- plan:string,
41
- zoneId:string,
42
- apiToken:string,
43
- }
44
-
45
- /**
46
- * Fastly Config
47
- */
48
- export declare interface FastlyConfig extends ProjectCDNProductionConfig {
49
- serviceId:string,
50
- authToken:string,
51
- }
52
-
53
- /**
54
- * Akamai Config
55
- */
56
- export declare interface AkamaiConfig extends ProjectCDNProductionConfig {
57
- endpoint:string,
58
- clientSecret:string,
59
- clientToken:string,
60
- accessToken:string,
61
- }
62
-
63
- /**
64
- * Project CDN Config
65
- */
66
- export declare interface ProjectCDNConfig {
67
- prod?: (FastlyConfig|AkamaiConfig|CloudflareConfig),
68
- }
69
-
70
- /**
71
- * Project Config
72
- */
73
- export declare interface ProjectConfig {
74
- /**
75
- * CDN Configuration
76
- */
77
- cdn?:ProjectCDNConfig;
78
-
79
- /**
80
- * project title
81
- */
82
- project?: string;
83
-
84
- /**
85
- * slack specific config
86
- */
87
- slack?: (string|string[]);
88
- }
13
+ import { ProjectConfig } from "../types/project-config";
89
14
 
90
15
  /**
91
16
  * Retrieves the project config from the underlying storage
@@ -94,4 +19,4 @@ export declare interface ProjectConfig {
94
19
  * @param {PathInfo} info path info
95
20
  * @returns {Promise<object>} the project configuration
96
21
  */
97
- export function fetchProjectConfig(ctx: AdminContext, info:PathInfo): Promise<ProjectConfig>;
22
+ export function fetchProjectConfig(ctx:AdminContext, info:PathInfo): Promise<ProjectConfig>;
@@ -47,8 +47,6 @@ async function handleResponse(log, response, key) {
47
47
  * @param {AdminContext} ctx the context
48
48
  * @param {LookupOptions} opts lookup options
49
49
  * @returns {Promise<IgnoreConfig>} the IgnoreConfig
50
- *
51
- * @throws
52
50
  */
53
51
  export async function fetchIgnore(ctx, opts) {
54
52
  const { attributes, log } = ctx;
@@ -0,0 +1,63 @@
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
+ ],
13
+ "$id": "https://ns.adobe.com/helix/config/all",
14
+ "$schema": "http://json-schema.org/draft-07/schema#",
15
+ "title": "ConfigAll",
16
+ "type": "object",
17
+ "properties": {
18
+ "config": {
19
+ "type": "object",
20
+ "description": "Project config (from /.helix/config.json)",
21
+ "properties": {
22
+ "data": {
23
+ "description": "The project config",
24
+ "tsType": "ProjectConfig"
25
+ },
26
+ "lastModified": {
27
+ "type": "string"
28
+ }
29
+ },
30
+ "required": [ "data", "lastModified"],
31
+ "additionalProperties": false
32
+ },
33
+ "metadata": {
34
+ "type": "object",
35
+ "description": "Metadata (from /metadata.json)",
36
+ "properties": {
37
+ "data": {
38
+ "tsType": "ModifierMap"
39
+ },
40
+ "lastModified": {
41
+ "type": "string"
42
+ }
43
+ },
44
+ "required": [ "data", "lastModified"],
45
+ "additionalProperties": false
46
+ },
47
+ "headers": {
48
+ "type": "object",
49
+ "description": "Headers modifier (from /.helix/config.json)",
50
+ "properties": {
51
+ "data": {
52
+ "tsType": "ModifierMap"
53
+ },
54
+ "lastModified": {
55
+ "type": "string"
56
+ }
57
+ },
58
+ "required": [ "data", "lastModified"],
59
+ "additionalProperties": false
60
+ }
61
+ },
62
+ "additionalProperties": false
63
+ }
@@ -0,0 +1,148 @@
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
+ ],
13
+ "$id": "https://ns.adobe.com/helix/config/cdn",
14
+ "$schema": "http://json-schema.org/draft-07/schema#",
15
+ "$defs": {
16
+ "stringOrArray": {
17
+ "oneOf": [
18
+ {
19
+ "type": "string"
20
+ },
21
+ {
22
+ "type": "array",
23
+ "items": {
24
+ "type": "string"
25
+ }
26
+ }
27
+ ]
28
+ }
29
+ },
30
+ "title": "ProjectCDNConfig",
31
+ "type": "object",
32
+ "properties": {
33
+ "prod": {
34
+ "oneOf": [{
35
+ "type": "object",
36
+ "title": "FastlyConfig",
37
+ "description": "Production CDN configuration for Fastly",
38
+ "properties": {
39
+ "type": {
40
+ "type": "string",
41
+ "const": "fastly"
42
+ },
43
+ "host": {
44
+ "description": "production host",
45
+ "type": "string"
46
+ },
47
+ "route": {
48
+ "description": "Route or routes on the CDN that are rendered with Franklin",
49
+ "$ref": "#/$defs/stringOrArray"
50
+ },
51
+ "serviceId": {
52
+ "description": "The Fastly Service ID",
53
+ "type": "string"
54
+ },
55
+ "authToken": {
56
+ "description": "A Fastly token for purging",
57
+ "type": "string"
58
+ }
59
+ },
60
+ "required": ["type", "host", "route", "serviceId", "authToken"],
61
+ "additionalProperties": false
62
+ }, {
63
+ "type": "object",
64
+ "title": "AkamaiConfig",
65
+ "properties": {
66
+ "type": {
67
+ "type": "string",
68
+ "const": "akamai"
69
+ },
70
+ "host": {
71
+ "description": "production host",
72
+ "type": "string"
73
+ },
74
+ "route": {
75
+ "description": "Route or routes on the CDN that are rendered with Franklin",
76
+ "$ref": "#/$defs/stringOrArray"
77
+ },
78
+ "endpoint": {
79
+ "type": "string"
80
+ },
81
+ "clientSecret": {
82
+ "type": "string"
83
+ },
84
+ "clientToken": {
85
+ "type": "string"
86
+ },
87
+ "accessToken": {
88
+ "type": "string"
89
+ }
90
+ },
91
+ "required": ["type", "host", "route", "endpoint", "clientSecret", "clientToken", "accessToken"],
92
+ "additionalProperties": false
93
+ }, {
94
+ "type": "object",
95
+ "title": "CloudflareConfig",
96
+ "properties": {
97
+ "type": {
98
+ "type": "string",
99
+ "const": "cloudflare"
100
+ },
101
+ "host": {
102
+ "description": "production host",
103
+ "type": "string"
104
+ },
105
+ "route": {
106
+ "description": "Route or routes on the CDN that are rendered with Franklin",
107
+ "$ref": "#/$defs/stringOrArray"
108
+ },
109
+ "origin": {
110
+ "type": "string"
111
+ },
112
+ "plan": {
113
+ "type": "string"
114
+ },
115
+ "zoneId": {
116
+ "type": "string"
117
+ },
118
+ "apiToken": {
119
+ "type": "string"
120
+ }
121
+ },
122
+ "required": ["type", "host", "route", "origin", "plan", "zoneId", "apiToken"],
123
+ "additionalProperties": false
124
+ }, {
125
+ "type": "object",
126
+ "title": "ManagedConfig",
127
+ "properties": {
128
+ "type": {
129
+ "type": "string",
130
+ "const": "managed"
131
+ },
132
+ "host": {
133
+ "description": "production host",
134
+ "type": "string"
135
+ },
136
+ "route": {
137
+ "description": "Route or routes on the CDN that are rendered with Franklin",
138
+ "$ref": "#/$defs/stringOrArray"
139
+ }
140
+ },
141
+ "required": [ "type", "host", "route"],
142
+ "additionalProperties": false
143
+ }]
144
+ }
145
+ },
146
+ "required": ["prod"],
147
+ "additionalProperties": false
148
+ }