@adobe/helix-admin-support 1.0.3 → 1.1.2
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 +21 -0
- package/package.json +5 -5
- package/src/fetch-config.d.ts +100 -0
- package/src/fetch-config.js +1 -1
- package/src/index.d.ts +214 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [1.1.2](https://github.com/adobe/helix-admin-support/compare/v1.1.1...v1.1.2) (2022-04-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update external fixes ([0c8573d](https://github.com/adobe/helix-admin-support/commit/0c8573d6392e54a7e14fada0b748ae943d4bf940))
|
|
7
|
+
|
|
8
|
+
## [1.1.1](https://github.com/adobe/helix-admin-support/compare/v1.1.0...v1.1.1) (2022-04-05)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update dependency @adobe/helix-shared-config to v1.7.22 ([35b1962](https://github.com/adobe/helix-admin-support/commit/35b1962b15daab44e265f02762c48165083ac7c7))
|
|
14
|
+
|
|
15
|
+
# [1.1.0](https://github.com/adobe/helix-admin-support/compare/v1.0.3...v1.1.0) (2022-04-05)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* copy over some types from admin ([#9](https://github.com/adobe/helix-admin-support/issues/9)) ([41c5735](https://github.com/adobe/helix-admin-support/commit/41c5735a456355be65c8342c0f589bfb7b2efa42))
|
|
21
|
+
|
|
1
22
|
## [1.0.3](https://github.com/adobe/helix-admin-support/compare/v1.0.2...v1.0.3) (2022-04-03)
|
|
2
23
|
|
|
3
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-admin-support",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Helix Admin Support Library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@adobe/helix-fetch": "3.0.8",
|
|
36
|
-
"@adobe/helix-shared-config": "1.7.
|
|
36
|
+
"@adobe/helix-shared-config": "1.7.22",
|
|
37
37
|
"@adobe/helix-shared-utils": "2.0.6",
|
|
38
|
-
"@aws-sdk/client-s3": "3.
|
|
38
|
+
"@aws-sdk/client-s3": "3.67.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@adobe/eslint-config-helix": "1.3.2",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"codecov": "3.8.3",
|
|
47
47
|
"commitizen": "4.2.4",
|
|
48
48
|
"cz-conventional-changelog": "3.3.0",
|
|
49
|
-
"eslint": "8.
|
|
49
|
+
"eslint": "8.13.0",
|
|
50
50
|
"eslint-plugin-header": "3.1.1",
|
|
51
|
-
"eslint-plugin-import": "2.
|
|
51
|
+
"eslint-plugin-import": "2.26.0",
|
|
52
52
|
"husky": "7.0.4",
|
|
53
53
|
"jsdoc-to-markdown": "7.1.1",
|
|
54
54
|
"junit-report-builder": "3.0.0",
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2021 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Project CDN Config
|
|
15
|
+
*/
|
|
16
|
+
declare interface ProjectCDNProductionConfig {
|
|
17
|
+
/**
|
|
18
|
+
* cnd type
|
|
19
|
+
* @enum 'fastly', 'cloudflare', 'akamai'
|
|
20
|
+
*/
|
|
21
|
+
type:string,
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* production host
|
|
25
|
+
*/
|
|
26
|
+
host:string,
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* cloudflare specific: origin
|
|
30
|
+
*/
|
|
31
|
+
origin:string,
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* cloudflare specific: plan
|
|
35
|
+
*/
|
|
36
|
+
plan:string,
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* cloudflare specific: zoneId
|
|
40
|
+
*/
|
|
41
|
+
zoneId:string,
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* cloudflare specific: apiToken
|
|
45
|
+
*/
|
|
46
|
+
apiToken:string,
|
|
47
|
+
// fastly
|
|
48
|
+
serviceId:string,
|
|
49
|
+
authToken:string,
|
|
50
|
+
// akamai
|
|
51
|
+
endpoint:string,
|
|
52
|
+
clientSecret:string,
|
|
53
|
+
clientToken:string,
|
|
54
|
+
accessToken:string,
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Cloudflare Config
|
|
59
|
+
*/
|
|
60
|
+
declare interface CloudflareConfig extends ProjectCDNProductionConfig {
|
|
61
|
+
origin:string,
|
|
62
|
+
plan:string,
|
|
63
|
+
zoneId:string,
|
|
64
|
+
apiToken:string,
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Fastly Config
|
|
69
|
+
*/
|
|
70
|
+
declare interface FastlyConfig extends ProjectCDNProductionConfig {
|
|
71
|
+
serviceId:string,
|
|
72
|
+
authToken:string,
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Akamai Config
|
|
77
|
+
*/
|
|
78
|
+
declare interface AkamaiConfig extends ProjectCDNProductionConfig {
|
|
79
|
+
endpoint:string,
|
|
80
|
+
clientSecret:string,
|
|
81
|
+
clientToken:string,
|
|
82
|
+
accessToken:string,
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Project CDN Config
|
|
87
|
+
*/
|
|
88
|
+
declare interface ProjectCDNConfig {
|
|
89
|
+
prod?: (FastlyConfig|AkamaiConfig|CloudflareConfig),
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Project Config
|
|
94
|
+
*/
|
|
95
|
+
declare interface ProjectConfig {
|
|
96
|
+
/**
|
|
97
|
+
* CDN Configuration
|
|
98
|
+
*/
|
|
99
|
+
cdn?:ProjectCDNConfig;
|
|
100
|
+
}
|
package/src/fetch-config.js
CHANGED
|
@@ -17,7 +17,7 @@ import { flatJson2object } from './flatJson2Object.js';
|
|
|
17
17
|
/**
|
|
18
18
|
* Checks if the response is valid and returns the project config.
|
|
19
19
|
*
|
|
20
|
-
* @param {
|
|
20
|
+
* @param {Console} log logger
|
|
21
21
|
* @param {Response} response content response from the storage
|
|
22
22
|
* @param {string} key storage key (logging information)
|
|
23
23
|
* @param {string} type type of storage (logging information)
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2021 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import {UniversalContext} from "@adobe/helix-universal";
|
|
13
|
+
import {Credentials} from "./support/credentials";
|
|
14
|
+
import {AuthInfo} from "./support/auth";
|
|
15
|
+
import {ProjectConfig} from "./support/fetch-config";
|
|
16
|
+
import {OneDrive} from "@adobe/helix-onedrive-support";
|
|
17
|
+
|
|
18
|
+
declare interface MountConfig {}
|
|
19
|
+
declare interface IgnoreConfig {}
|
|
20
|
+
declare interface IndexConfig {}
|
|
21
|
+
declare interface SitemapConfig {}
|
|
22
|
+
|
|
23
|
+
declare interface ErrorResponse {
|
|
24
|
+
/**
|
|
25
|
+
* http like status code
|
|
26
|
+
*/
|
|
27
|
+
status:number;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* error message
|
|
31
|
+
*/
|
|
32
|
+
error:string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Path Info
|
|
37
|
+
*/
|
|
38
|
+
declare interface PathInfo {
|
|
39
|
+
/**
|
|
40
|
+
* Original path
|
|
41
|
+
*/
|
|
42
|
+
rawPath:string,
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* API route
|
|
46
|
+
*/
|
|
47
|
+
route:string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Repository owner (lowercase)
|
|
51
|
+
*/
|
|
52
|
+
owner:string;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Repository name (lowercase)
|
|
56
|
+
*/
|
|
57
|
+
repo:string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Repository ref (lowercase)
|
|
61
|
+
*/
|
|
62
|
+
ref:string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Repository ref (case)
|
|
66
|
+
*/
|
|
67
|
+
branch:string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Resource path
|
|
71
|
+
* @example '/express/index.md'
|
|
72
|
+
* @example '/en/query-index.json'
|
|
73
|
+
*/
|
|
74
|
+
resourcePath:string;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Resource path extension
|
|
78
|
+
*/
|
|
79
|
+
ext:string;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Web path
|
|
83
|
+
* @example '/express/'
|
|
84
|
+
* @example '/blogs/may-21'
|
|
85
|
+
* @example '/en/query-index.json'
|
|
86
|
+
*/
|
|
87
|
+
path:string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The precomputed live url
|
|
91
|
+
*/
|
|
92
|
+
liveUrl:string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The precomputed preview url
|
|
96
|
+
*/
|
|
97
|
+
previewUrl:string;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* request scheme
|
|
101
|
+
*/
|
|
102
|
+
scheme:string;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* request host
|
|
106
|
+
*/
|
|
107
|
+
host:string;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* request method
|
|
111
|
+
*/
|
|
112
|
+
method:string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* request parameters relevant for creating external links, eg. version-lock
|
|
116
|
+
*/
|
|
117
|
+
query:object;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* function path (aka servletPath)
|
|
121
|
+
*/
|
|
122
|
+
functionPath:string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* request headers
|
|
126
|
+
*/
|
|
127
|
+
headers:object;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* request cookies
|
|
131
|
+
*/
|
|
132
|
+
cookies?:object;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
declare interface ContextAttributes {
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* optional credentials, once computed
|
|
139
|
+
*/
|
|
140
|
+
credentials?:Credentials;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* optional mount config, once fetched
|
|
144
|
+
*/
|
|
145
|
+
mountConfig?:MountConfig;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* optional ignore config, once fetched
|
|
149
|
+
*/
|
|
150
|
+
ignoreConfig?:IgnoreConfig;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* optional index config, once fetched
|
|
154
|
+
*/
|
|
155
|
+
indexConfig?:IndexConfig;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* optional sitemap config, once fetched
|
|
159
|
+
*/
|
|
160
|
+
sitemapConfig?:SitemapConfig;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* optional content bus id from the `x-helix-contentbus-id` header or computed from fstab.
|
|
164
|
+
*/
|
|
165
|
+
contentBusId?:string;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* optional code bus id
|
|
169
|
+
*/
|
|
170
|
+
codeBusId?:string;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Authentication information
|
|
174
|
+
*/
|
|
175
|
+
authInfo:AuthInfo;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* optional project config
|
|
179
|
+
*/
|
|
180
|
+
projectConfig?:ProjectConfig;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* optional redirects information
|
|
184
|
+
*/
|
|
185
|
+
redirects?:any;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* onedrive client
|
|
189
|
+
*/
|
|
190
|
+
onedrive?:OneDrive;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Notifier
|
|
194
|
+
*/
|
|
195
|
+
notifier?:any;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
declare interface AdminContext extends UniversalContext {
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* optional github token extracted from the `x-github-token` header
|
|
202
|
+
*/
|
|
203
|
+
githubToken?:string;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Additional context attributes
|
|
207
|
+
*/
|
|
208
|
+
attributes:ContextAttributes;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* context data provided via helix-shared-body
|
|
212
|
+
*/
|
|
213
|
+
data?:any;
|
|
214
|
+
}
|