@adobe/helix-admin-support 1.1.25 → 1.1.28

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,24 @@
1
+ ## [1.1.28](https://github.com/adobe/helix-admin-support/compare/v1.1.27...v1.1.28) (2022-06-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update dependency @adobe/helix-shared-config to v8 ([#43](https://github.com/adobe/helix-admin-support/issues/43)) ([299c0be](https://github.com/adobe/helix-admin-support/commit/299c0be468265da19b926f53b22a7a9f6032a7fd))
7
+
8
+ ## [1.1.27](https://github.com/adobe/helix-admin-support/compare/v1.1.26...v1.1.27) (2022-06-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update adobe fixes ([745c9a8](https://github.com/adobe/helix-admin-support/commit/745c9a83f669a902177a5c8becfa9a514d299ba1))
14
+
15
+ ## [1.1.26](https://github.com/adobe/helix-admin-support/compare/v1.1.25...v1.1.26) (2022-06-02)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * add optional to fetchSitemap ([#40](https://github.com/adobe/helix-admin-support/issues/40)) ([32fd509](https://github.com/adobe/helix-admin-support/commit/32fd509ab2dbb9600018b484ccd7a90dddc8996c))
21
+
1
22
  ## [1.1.25](https://github.com/adobe/helix-admin-support/compare/v1.1.24...v1.1.25) (2022-05-31)
2
23
 
3
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-admin-support",
3
- "version": "1.1.25",
3
+ "version": "1.1.28",
4
4
  "description": "Helix Admin Support Library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -33,8 +33,8 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@adobe/helix-fetch": "3.0.10",
36
- "@adobe/helix-shared-config": "2.1.1",
37
- "@adobe/helix-shared-utils": "2.0.10",
36
+ "@adobe/helix-shared-config": "8.0.0",
37
+ "@adobe/helix-shared-utils": "2.0.11",
38
38
  "@aws-sdk/client-s3": "3.100.0"
39
39
  },
40
40
  "devDependencies": {
@@ -44,18 +44,18 @@
44
44
  "@semantic-release/npm": "9.0.1",
45
45
  "c8": "7.11.3",
46
46
  "codecov": "3.8.3",
47
- "eslint": "8.16.0",
47
+ "eslint": "8.17.0",
48
48
  "eslint-plugin-header": "3.1.1",
49
49
  "eslint-plugin-import": "2.26.0",
50
50
  "husky": "8.0.1",
51
51
  "jsdoc-to-markdown": "7.1.1",
52
52
  "junit-report-builder": "3.0.0",
53
- "lint-staged": "12.4.2",
53
+ "lint-staged": "12.5.0",
54
54
  "mocha": "10.0.0",
55
55
  "mocha-multi-reporters": "1.5.1",
56
- "nock": "13.2.4",
56
+ "nock": "13.2.6",
57
57
  "semantic-release": "19.0.2",
58
- "yaml": "2.1.0"
58
+ "yaml": "2.1.1"
59
59
  },
60
60
  "lint-staged": {
61
61
  "*.js": "eslint",
@@ -16,6 +16,7 @@ import { AdminContext, PathInfo } from './index';
16
16
  * Retrieves the sitemap from the underlying storage and stores it in the context as sitemapConfig.
17
17
  * @param {AdminContext} ctx the context
18
18
  * @param {PathInfo} info path info
19
+ * @param {boolean} optional if {@code true}, no error is thrown if the config can't be retrieved
19
20
  * @returns {Promise<SitemapConfig>} the sitemap configuration
20
21
  */
21
- export function fetchSitemap(ctx: AdminContext, info:PathInfo):Promise<SitemapConfig>;
22
+ export function fetchSitemap(ctx: AdminContext, info:PathInfo, optional:boolean):Promise<SitemapConfig>;
@@ -47,9 +47,10 @@ async function handleResponse(log, response, key, type) {
47
47
  * Retrieves the sitemap from the underlying storage and stores it in the context as sitemapConfig.
48
48
  * @param {AdminContext} ctx the context
49
49
  * @param {LookupOptions} opts lookup options
50
+ * @param {boolean} optional if {@code true}, no error is thrown if the config can't be retrieved
50
51
  * @returns {Promise<SitemapConfig>} the sitemap configuration
51
52
  */
52
- export async function fetchSitemap(ctx, opts) {
53
+ export async function fetchSitemap(ctx, opts, optional) {
53
54
  const { attributes, log } = ctx;
54
55
  const { owner, repo, ref } = opts;
55
56
 
@@ -60,7 +61,7 @@ export async function fetchSitemap(ctx, opts) {
60
61
  const key = `${owner}/${repo}/${ref}/helix-sitemap.yaml`;
61
62
  const response = await fetchS3(ctx, 'helix-code-bus', key);
62
63
  attributes.sitemapConfig = await handleResponse(log, response, key, 'code-bus');
63
- if (attributes.sitemapConfig) {
64
+ if (attributes.sitemapConfig || optional) {
64
65
  return attributes.sitemapConfig;
65
66
  }
66
67
  throw Error(`no sitemap configuration for ${key}`);