@accordproject/template-engine 2.7.1 → 2.9.0
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/README.md +28 -3
- package/dist/index.js +56 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +56 -2
- package/dist/index.mjs.map +1 -1
- package/dist/worker.js.map +1 -1
- package/package.json +17 -10
package/dist/worker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sources":["../src/worker.js"],"sourcesContent":["/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport dayjs from 'dayjs';\nimport jp from 'jsonpath';\n\n/**\n * This executed JS code inside a child process, so that the code\n * has no access to the parent process and can be terminated on timeout etc\n * We do not use Node.js Cluster to ensure that each child process that is\n * forked is not reused and cannot be polluted by previous calls.\n */\nprocess.on('message', (msg) => {\n if (!process.send) {\n throw new Error('Cannot communicate with parent process!');\n }\n // we wrap the code in \"use strict\" to so the code cannot access the global scope\n const code = `\"use strict\";\n ${msg.code}\n `;\n try {\n // we expose just two node modules to the function: 'dayjs' and 'jsonpath'\n const argNames = ['dayjs','jp',...msg.argumentNames];\n const args = [dayjs,jp,...msg.arguments];\n const fun = new Function(...argNames, code);\n const result = fun(...args);\n process.send({ result });\n process.exit();\n } catch (err) {\n // console.log(`worker: ${err} ${msg.code}`);\n process.send({ message: err.toString() });\n process.exit(1);\n }\n});\n"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,KAAK;AAC/B,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;AACvB,QAAQ,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC;AAClE;
|
|
1
|
+
{"version":3,"file":"worker.js","sources":["../src/worker.js"],"sourcesContent":["/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport dayjs from 'dayjs';\nimport jp from 'jsonpath';\n\n/**\n * This executed JS code inside a child process, so that the code\n * has no access to the parent process and can be terminated on timeout etc\n * We do not use Node.js Cluster to ensure that each child process that is\n * forked is not reused and cannot be polluted by previous calls.\n */\nprocess.on('message', (msg) => {\n if (!process.send) {\n throw new Error('Cannot communicate with parent process!');\n }\n // we wrap the code in \"use strict\" to so the code cannot access the global scope\n const code = `\"use strict\";\n ${msg.code}\n `;\n try {\n // we expose just two node modules to the function: 'dayjs' and 'jsonpath'\n const argNames = ['dayjs','jp',...msg.argumentNames];\n const args = [dayjs,jp,...msg.arguments];\n const fun = new Function(...argNames, code);\n const result = fun(...args);\n process.send({ result });\n process.exit();\n } catch (err) {\n // console.log(`worker: ${err} ${msg.code}`);\n process.send({ message: err.toString() });\n process.exit(1);\n }\n});\n"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,KAAK;AAC/B,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;AACvB,QAAQ,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC;AAClE,IAAI;AACJ;AACA,IAAI,MAAM,IAAI,GAAG,CAAC;AAClB,IAAI,EAAE,GAAG,CAAC,IAAI;AACd,IAAI,CAAC;AACL,IAAI,IAAI;AACR;AACA,QAAQ,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,aAAa,CAAC;AAC5D,QAAQ,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC;AAChD,QAAQ,MAAM,GAAG,GAAG,IAAI,QAAQ,CAAC,GAAG,QAAQ,EAAE,IAAI,CAAC;AACnD,QAAQ,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC;AACnC,QAAQ,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;AAChC,QAAQ,OAAO,CAAC,IAAI,EAAE;AACtB,IAAI,CAAC,CAAC,OAAO,GAAG,EAAE;AAClB;AACA,QAAQ,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC;AACjD,QAAQ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AACvB,IAAI;AACJ,CAAC,CAAC;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@accordproject/template-engine",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Generation of AgreementMark from TemplateMark + JSON Data",
|
|
5
5
|
"homepage": "https://github.com/accordproject",
|
|
6
6
|
"engines": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"pretest": "npm-run-all licchk lint build",
|
|
22
22
|
"lint": "eslint .",
|
|
23
23
|
"licchk": "license-check-and-add",
|
|
24
|
-
"test": "node --experimental-vm-modules node_modules/.bin/jest",
|
|
24
|
+
"test": "node --experimental-vm-modules node_modules/.bin/jest --coverage --coverageReporters=text-summary",
|
|
25
25
|
"coverage": "node --experimental-vm-modules node_modules/.bin/jest --coverage",
|
|
26
26
|
"test:watch": "jest --watchAll",
|
|
27
27
|
"updateRuntimeDependencies": "node ./scripts/updateRuntimeDependencies"
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"author": "accordproject.org",
|
|
40
40
|
"license": "Apache-2.0",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@accordproject/cicero-core": "0.25.
|
|
43
|
-
"@accordproject/concerto-codegen": "3.
|
|
44
|
-
"@accordproject/concerto-core": "
|
|
45
|
-
"@accordproject/concerto-util": "
|
|
46
|
-
"@accordproject/markdown-common": "0.
|
|
47
|
-
"@accordproject/markdown-template": "0.
|
|
42
|
+
"@accordproject/cicero-core": "0.25.2",
|
|
43
|
+
"@accordproject/concerto-codegen": "3.32.1",
|
|
44
|
+
"@accordproject/concerto-core": "3.25.7",
|
|
45
|
+
"@accordproject/concerto-util": "3.25.7",
|
|
46
|
+
"@accordproject/markdown-common": "0.17.2",
|
|
47
|
+
"@accordproject/markdown-template": "0.17.2",
|
|
48
48
|
"@typescript/twoslash": "^3.2.9",
|
|
49
49
|
"browser-or-node": "^3.0.0",
|
|
50
50
|
"dayjs": "1.11.13",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"typescript": "^5.8.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@accordproject/markdown-html": "0.
|
|
58
|
+
"@accordproject/markdown-html": "0.17.2",
|
|
59
59
|
"@eslint/eslintrc": "^3.3.1",
|
|
60
60
|
"@eslint/js": "^9.23.0",
|
|
61
61
|
"@types/jest": "^29.5.14",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"license-check-and-add": "2.3.6",
|
|
73
73
|
"mkdirp": "^3.0.1",
|
|
74
74
|
"node-fetch": "^3.3.2",
|
|
75
|
-
"npm-run-
|
|
75
|
+
"npm-run-all2": "^8.0.4",
|
|
76
76
|
"rimraf": "6.0.1",
|
|
77
77
|
"rollup": "^4.37.0",
|
|
78
78
|
"rollup-plugin-dts": "^6.2.1",
|
|
@@ -136,6 +136,13 @@
|
|
|
136
136
|
"collectCoverage": false,
|
|
137
137
|
"collectCoverageFrom": [
|
|
138
138
|
"src/**/*.ts"
|
|
139
|
+
],
|
|
140
|
+
"coveragePathIgnorePatterns": [
|
|
141
|
+
"/node_modules/",
|
|
142
|
+
"/dist/",
|
|
143
|
+
"/test/",
|
|
144
|
+
"/src/model-gen/",
|
|
145
|
+
"/src/slc/model-gen/"
|
|
139
146
|
]
|
|
140
147
|
},
|
|
141
148
|
"optionalDependencies": {
|