@adobe/helix-admin-support 1.1.18 → 1.1.19
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 +1 -1
- package/src/fetch-index.js +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.1.19](https://github.com/adobe/helix-admin-support/compare/v1.1.18...v1.1.19) (2022-05-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add optional for fetch index ([#33](https://github.com/adobe/helix-admin-support/issues/33)) ([dd0055c](https://github.com/adobe/helix-admin-support/commit/dd0055cd4ed8ea492b2f1a306b7d883e8a1a8eec))
|
|
7
|
+
|
|
1
8
|
## [1.1.18](https://github.com/adobe/helix-admin-support/compare/v1.1.17...v1.1.18) (2022-05-14)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/fetch-index.js
CHANGED
|
@@ -51,9 +51,10 @@ async function handleResponse(log, response, key, type) {
|
|
|
51
51
|
*
|
|
52
52
|
* @param {AdminContext} ctx the context
|
|
53
53
|
* @param {LookupOptions} opts lookup options
|
|
54
|
+
* @param {boolean} optional if {@code true}, no error is thrown if the config can't be retrieved
|
|
54
55
|
* @returns {Promise<IndexConfig>} the index config
|
|
55
56
|
*/
|
|
56
|
-
export async function fetchIndex(ctx, opts) {
|
|
57
|
+
export async function fetchIndex(ctx, opts, optional) {
|
|
57
58
|
const { attributes, log } = ctx;
|
|
58
59
|
const {
|
|
59
60
|
owner, repo, ref, branch,
|
|
@@ -80,7 +81,8 @@ export async function fetchIndex(ctx, opts) {
|
|
|
80
81
|
headers,
|
|
81
82
|
});
|
|
82
83
|
attributes.indexConfig = await handleResponse(log, response, key, 'github');
|
|
83
|
-
|
|
84
|
+
|
|
85
|
+
if (attributes.indexConfig || optional) {
|
|
84
86
|
return attributes.indexConfig;
|
|
85
87
|
}
|
|
86
88
|
|