@adobe/helix-md2docx 2.1.107 → 2.2.1

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,50 @@
1
+ ## [2.2.1](https://github.com/adobe/helix-md2docx/compare/v2.2.0...v2.2.1) (2025-03-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update dependency @adobe/helix-shared-process-queue to v3.1.2 ([#563](https://github.com/adobe/helix-md2docx/issues/563)) ([16df999](https://github.com/adobe/helix-md2docx/commit/16df99957e56fafeb841bd99ac46e55e276c508c))
7
+
8
+ # [2.2.0](https://github.com/adobe/helix-md2docx/compare/v2.1.111...v2.2.0) (2025-03-05)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update dependency image-size to v2 ([#558](https://github.com/adobe/helix-md2docx/issues/558)) ([0694f7d](https://github.com/adobe/helix-md2docx/commit/0694f7d50bb2463ab0167d445de883c63281a78c))
14
+
15
+
16
+ ### Features
17
+
18
+ * trigger release ([937be0e](https://github.com/adobe/helix-md2docx/commit/937be0e9b6751bd87d368640db4afa3cd4f312e9))
19
+
20
+ ## [2.1.111](https://github.com/adobe/helix-md2docx/compare/v2.1.110...v2.1.111) (2025-03-05)
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * **561:** unable to pass custom headers to download images ([#562](https://github.com/adobe/helix-md2docx/issues/562)) ([387bf02](https://github.com/adobe/helix-md2docx/commit/387bf0253180cfb911c8556fe780f311c299fe79))
26
+
27
+ ## [2.1.110](https://github.com/adobe/helix-md2docx/compare/v2.1.109...v2.1.110) (2025-03-04)
28
+
29
+
30
+ ### Bug Fixes
31
+
32
+ * **deps:** update dependency @adobe/fetch to v4.2.0 ([#560](https://github.com/adobe/helix-md2docx/issues/560)) ([61c907f](https://github.com/adobe/helix-md2docx/commit/61c907f4cd5a50ae1468ba670f9ae0d806394c5c))
33
+
34
+ ## [2.1.109](https://github.com/adobe/helix-md2docx/compare/v2.1.108...v2.1.109) (2025-02-26)
35
+
36
+
37
+ ### Bug Fixes
38
+
39
+ * **deps:** update adobe fixes ([#557](https://github.com/adobe/helix-md2docx/issues/557)) ([c78b5b7](https://github.com/adobe/helix-md2docx/commit/c78b5b7197fb68c3f754fce9e350ad6ee7c78ee3))
40
+
41
+ ## [2.1.108](https://github.com/adobe/helix-md2docx/compare/v2.1.107...v2.1.108) (2025-02-25)
42
+
43
+
44
+ ### Bug Fixes
45
+
46
+ * **deps:** update adobe fixes ([#556](https://github.com/adobe/helix-md2docx/issues/556)) ([fe0dd35](https://github.com/adobe/helix-md2docx/commit/fe0dd35ea8347d3e664b1f8a82b25b57e20d20a1))
47
+
1
48
  ## [2.1.107](https://github.com/adobe/helix-md2docx/compare/v2.1.106...v2.1.107) (2025-02-17)
2
49
 
3
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-md2docx",
3
- "version": "2.1.107",
3
+ "version": "2.2.1",
4
4
  "description": "Helix Service that converts markdown to word documents",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -28,16 +28,16 @@
28
28
  },
29
29
  "homepage": "https://github.com/adobe/helix-md2docx#readme",
30
30
  "dependencies": {
31
- "@adobe/fetch": "4.1.11",
32
- "@adobe/helix-docx2md": "1.6.19",
33
- "@adobe/helix-markdown-support": "7.1.11",
34
- "@adobe/helix-shared-process-queue": "3.1.1",
35
- "@adobe/remark-gridtables": "3.0.9",
31
+ "@adobe/fetch": "4.2.0",
32
+ "@adobe/helix-docx2md": "1.6.22",
33
+ "@adobe/helix-markdown-support": "7.1.12",
34
+ "@adobe/helix-shared-process-queue": "3.1.2",
35
+ "@adobe/remark-gridtables": "3.0.10",
36
36
  "docx": "9.2.0",
37
37
  "github-slugger": "2.0.0",
38
38
  "hast-util-is-element": "3.0.0",
39
39
  "hast-util-to-mdast": "10.1.2",
40
- "image-size": "1.2.0",
40
+ "image-size": "2.0.0",
41
41
  "mdast-util-to-string": "4.0.0",
42
42
  "mime": "4.0.6",
43
43
  "rehype-parse": "9.0.1",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "@adobe/eslint-config-helix": "2.0.9",
51
- "@adobe/helix-mediahandler": "2.6.1",
51
+ "@adobe/helix-mediahandler": "2.6.4",
52
52
  "@semantic-release/changelog": "6.0.3",
53
53
  "@semantic-release/exec": "7.0.3",
54
54
  "@semantic-release/git": "10.0.1",
@@ -62,7 +62,12 @@ declare interface Mdast2DocxOptions {
62
62
  /**
63
63
  * Optional image2png converter
64
64
  */
65
- image2png?: ImageToPngConverter
65
+ image2png?: ImageToPngConverter;
66
+
67
+ /**
68
+ * Optional custom headers to be used in fetch requests
69
+ */
70
+ customHeaders?: Record<string, string>;
66
71
  }
67
72
 
68
73
  /**
@@ -28,6 +28,7 @@ export default async function mdast2docx(mdast, opts = {}) {
28
28
  log = console,
29
29
  resourceLoader,
30
30
  image2png,
31
+ customHeaders = {},
31
32
  } = opts;
32
33
 
33
34
  let {
@@ -44,6 +45,7 @@ export default async function mdast2docx(mdast, opts = {}) {
44
45
  log,
45
46
  image2png,
46
47
  resourceLoader,
48
+ customHeaders,
47
49
  };
48
50
 
49
51
  // eslint-disable-next-line no-param-reassign
@@ -40,7 +40,12 @@ function hsize(bytes, decimals = 2) {
40
40
  * @returns {Promise<void>}
41
41
  */
42
42
  export default async function downloadImages(ctx, tree) {
43
- const { log, resourceLoader, image2png } = ctx;
43
+ const {
44
+ log,
45
+ resourceLoader,
46
+ image2png,
47
+ customHeaders,
48
+ } = ctx;
44
49
  const context = createFetchContext();
45
50
  const { fetch } = context;
46
51
 
@@ -94,7 +99,13 @@ export default async function downloadImages(ctx, tree) {
94
99
  doFetch = resourceLoader.fetch.bind(resourceLoader);
95
100
  }
96
101
 
97
- const ret = await doFetch(node.url);
102
+ const fetchOptions = {};
103
+ if (customHeaders && Object.keys(customHeaders).length > 0) {
104
+ fetchOptions.headers = customHeaders;
105
+ }
106
+
107
+ const ret = await doFetch(node.url, fetchOptions);
108
+
98
109
  if (!ret.ok) {
99
110
  const text = await ret.text();
100
111
  log.error(`[${idx}] ${ret.status} ${text}`);