diff --git a/types/mjml-core/index.d.ts b/types/mjml-core/index.d.ts index 485243c92d3fa74..d93aa3b13f975c2 100644 --- a/types/mjml-core/index.d.ts +++ b/types/mjml-core/index.d.ts @@ -65,6 +65,12 @@ export interface MJMLParsingOptions { * default: '.' */ filePath?: string | undefined; + /** + * Directory (or directories) outside the template's own folder from which mj-include + * partials may be loaded. Added in mjml 5.1 as part of the include path-traversal hardening; + * includes resolving outside these allowed roots are denied. + */ + includePath?: string | string[] | undefined; /** * The path or directory of the .mjmlconfig file * default: process.cwd() diff --git a/types/mjml-core/mjml-core-tests.ts b/types/mjml-core/mjml-core-tests.ts index 136797a3a4255e6..0e6c4d79f01fb87 100644 --- a/types/mjml-core/mjml-core-tests.ts +++ b/types/mjml-core/mjml-core-tests.ts @@ -10,6 +10,8 @@ async function tests() { const minimal_opts_test = await mjml2html("", { beautify: true }); const validation_level_test = await mjml2html("", { validationLevel: "strict" }); const filePath_test = await mjml2html("", { filePath: "." }); + const includePath_test = await mjml2html("", { includePath: "./templates" }); + const includePath_array_test = await mjml2html("", { includePath: ["./templates", "./partials"] }); const jsonObject = { tagName: "mjml", attributes: { width: "100px" }, content: "test content" }; const jsonObject_test = await mjml2html(jsonObject); diff --git a/types/mjml-core/package.json b/types/mjml-core/package.json index 6dc701bff45cb82..2fef357efc0f8b9 100644 --- a/types/mjml-core/package.json +++ b/types/mjml-core/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/mjml-core", - "version": "5.0.9999", + "version": "5.1.9999", "projects": [ "https://mjml.io" ],