@adobe/helix-html-pipeline 5.12.4 → 5.12.6

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,17 @@
1
+ ## [5.12.6](https://github.com/adobe/helix-html-pipeline/compare/v5.12.5...v5.12.6) (2024-09-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * set code and content surrogate keys for json 404 ([#692](https://github.com/adobe/helix-html-pipeline/issues/692)) ([#698](https://github.com/adobe/helix-html-pipeline/issues/698)) ([d334099](https://github.com/adobe/helix-html-pipeline/commit/d334099f806eddcf84181a4c354de0e8b02ced0a)), closes [#688](https://github.com/adobe/helix-html-pipeline/issues/688)
7
+
8
+ ## [5.12.5](https://github.com/adobe/helix-html-pipeline/compare/v5.12.4...v5.12.5) (2024-09-23)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * missing config/support should not be treated as 500 ([#694](https://github.com/adobe/helix-html-pipeline/issues/694)) ([#697](https://github.com/adobe/helix-html-pipeline/issues/697)) ([7257e13](https://github.com/adobe/helix-html-pipeline/commit/7257e13f1e7d9f8e73ab8e6c8129fbbe3a91ee34))
14
+
1
15
  ## [5.12.4](https://github.com/adobe/helix-html-pipeline/compare/v5.12.3...v5.12.4) (2024-09-04)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "5.12.4",
3
+ "version": "5.12.6",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -51,15 +51,15 @@
51
51
  "github-slugger": "2.0.0",
52
52
  "hast-util-raw": "9.0.4",
53
53
  "hast-util-select": "6.0.2",
54
- "hast-util-to-html": "9.0.2",
54
+ "hast-util-to-html": "9.0.3",
55
55
  "hast-util-to-string": "3.0.0",
56
56
  "hastscript": "9.0.0",
57
- "jose": "5.8.0",
57
+ "jose": "5.9.2",
58
58
  "lodash.escape": "4.0.1",
59
59
  "mdast-util-to-hast": "13.2.0",
60
60
  "mdast-util-to-string": "4.0.0",
61
61
  "mime": "4.0.4",
62
- "rehype-format": "5.0.0",
62
+ "rehype-format": "5.0.1",
63
63
  "rehype-parse": "9.0.0",
64
64
  "remark-parse": "11.0.0",
65
65
  "strip-markdown": "6.0.0",
@@ -72,26 +72,26 @@
72
72
  "unist-util-visit-parents": "6.0.1"
73
73
  },
74
74
  "devDependencies": {
75
- "@adobe/eslint-config-helix": "2.0.6",
76
- "@markedjs/html-differ": "4.0.2",
75
+ "@adobe/eslint-config-helix": "2.0.7",
76
+ "@markedjs/html-differ": "5.0.1",
77
77
  "@semantic-release/changelog": "6.0.3",
78
78
  "@semantic-release/git": "10.0.1",
79
79
  "@semantic-release/npm": "12.0.1",
80
80
  "c8": "10.1.2",
81
- "eslint": "8.57.0",
81
+ "eslint": "8.57.1",
82
82
  "eslint-import-resolver-exports": "1.0.0-beta.5",
83
83
  "eslint-plugin-header": "3.1.1",
84
- "eslint-plugin-import": "2.29.1",
84
+ "eslint-plugin-import": "2.30.0",
85
85
  "esmock": "2.6.7",
86
- "husky": "9.1.5",
86
+ "husky": "9.1.6",
87
87
  "js-yaml": "4.1.0",
88
88
  "jsdom": "25.0.0",
89
- "junit-report-builder": "5.0.0",
90
- "lint-staged": "15.2.9",
89
+ "junit-report-builder": "5.1.1",
90
+ "lint-staged": "15.2.10",
91
91
  "mocha": "10.7.3",
92
92
  "mocha-multi-reporters": "1.5.1",
93
93
  "mocha-suppress-logs": "0.5.1",
94
- "semantic-release": "24.1.0"
94
+ "semantic-release": "24.1.1"
95
95
  },
96
96
  "lint-staged": {
97
97
  "*.js": "eslint",
package/src/json-pipe.js CHANGED
@@ -87,7 +87,8 @@ async function fetchJsonContent(state, req, res) {
87
87
 
88
88
  updateLastModified(state, res, extractLastModified(ret.headers));
89
89
  } else {
90
- state.content.sourceBus = 'content';
90
+ // also add code surrogate key in case json is later added to code bus (#688)
91
+ state.content.sourceBus = 'code|content';
91
92
  res.status = ret.status === 404 ? 404 : 502;
92
93
  res.error = `failed to load ${state.info.resourcePath}: ${ret.status}`;
93
94
  }
@@ -95,16 +96,15 @@ async function fetchJsonContent(state, req, res) {
95
96
 
96
97
  async function computeSurrogateKeys(state) {
97
98
  const keys = [];
98
- const pathKey = state.content?.sourceBus === 'code'
99
- ? `${state.ref}--${state.repo}--${state.owner}${state.info.path}`
100
- : `${state.contentBusId}${state.info.path}`;
101
-
102
- keys.push(await computeSurrogateKey(pathKey));
103
- if (state.content?.sourceBus === 'content') {
104
- keys.push(state.contentBusId);
105
- } else {
99
+ if (state.content.sourceBus.includes('code')) {
100
+ keys.push(await computeSurrogateKey(`${state.ref}--${state.repo}--${state.owner}${state.info.path}`));
106
101
  keys.push(`${state.ref}--${state.repo}--${state.owner}_code`);
107
102
  }
103
+ if (state.content.sourceBus.includes('content')) {
104
+ keys.push(await computeSurrogateKey(`${state.contentBusId}${state.info.path}`));
105
+ keys.push(state.contentBusId);
106
+ }
107
+
108
108
  return keys;
109
109
  }
110
110
 
@@ -55,10 +55,10 @@ export default async function validateCaptcha(state, body) {
55
55
  // Check captcha type is correctly configured
56
56
  const validator = SUPPORTED_CAPTCHA_TYPES[captcha.type];
57
57
  if (!validator) {
58
- throw new PipelineStatusError(500, `The captcha type ${captcha.type} is not supported.`);
58
+ throw new PipelineStatusError(400, `The captcha type ${captcha.type} is not supported.`);
59
59
  }
60
60
  if (!captcha.secret) {
61
- throw new PipelineStatusError(500, 'Captcha secret key is not configured.');
61
+ throw new PipelineStatusError(400, 'Captcha secret key is not configured.');
62
62
  }
63
63
 
64
64
  // Perform validation