@legalplace/prerenderx 3.6.8 → 3.7.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/CHANGELOG.md +13 -0
- package/dist/libs/OutputParser.js +22 -0
- package/package.json +8 -9
- package/src/libs/OutputParser.ts +25 -0
- package/tsconfig.json +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.7.0](https://git.legalplace.eu/legalplace/prerenderx/compare/@legalplace/prerenderx@3.6.8...@legalplace/prerenderx@3.7.0) (2024-11-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* adding utils to support yousign field tag api[#11471](https://git.legalplace.eu/legalplace/prerenderx/issues/11471) ([b5940c5](https://git.legalplace.eu/legalplace/prerenderx/commits/b5940c5be2fbb7f76d1643810a032d81c1728215))
|
|
12
|
+
* fixing attributes api[#11471](https://git.legalplace.eu/legalplace/prerenderx/issues/11471) ([d05b381](https://git.legalplace.eu/legalplace/prerenderx/commits/d05b3815b1d74161107c8a0aab41594e2f3a51e0))
|
|
13
|
+
* parsing paramsString api[#11471](https://git.legalplace.eu/legalplace/prerenderx/issues/11471) ([4962adb](https://git.legalplace.eu/legalplace/prerenderx/commits/4962adb28b18525b11cce80c78cea184c99d2250))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
6
19
|
## [3.6.8](https://git.legalplace.eu/legalplace/prerenderx/compare/@legalplace/prerenderx@3.6.7...@legalplace/prerenderx@3.6.8) (2024-10-31)
|
|
7
20
|
|
|
8
21
|
**Note:** Version bump only for package @legalplace/prerenderx
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
14
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
15
|
if (ar || !(i in from)) {
|
|
@@ -10,6 +21,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
10
21
|
};
|
|
11
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
23
|
exports.parseDocumentNameWithVariables = exports.parseOutputWithVariables = exports.getRelatedVariablesValues = void 0;
|
|
24
|
+
var yousign_1 = require("@legalplace/yousign");
|
|
13
25
|
var frenchNumber = function (value) {
|
|
14
26
|
var result = typeof value === "number" ? value.toString() : value;
|
|
15
27
|
if (/^([0-9]+)\.([0-9]+)$/.test(result.trim()))
|
|
@@ -67,6 +79,16 @@ var parseOutputWithVariables = function (output, index, variables, autonums) {
|
|
|
67
79
|
return "<span data-signature=\"mention\" data-signature-id=\"" + signatureId + "\" data-signer-index=\"" + index + "\" data-signer-mention=\"" + mention + "\"></span>";
|
|
68
80
|
});
|
|
69
81
|
parsedOutput = parsedOutput.replace(/\[date\]/g, function () { return '<span data-signature="date"></span>'; });
|
|
82
|
+
parsedOutput = parsedOutput.replace(new RegExp(yousign_1.yousignTagFieldRegex, "g"), function (v, paramsString) {
|
|
83
|
+
try {
|
|
84
|
+
var parsedParams = (0, yousign_1.parseYousignTag)("[yousign:" + paramsString.replace(/((=)")|("(;|$))/g, '$2"$4') + "]");
|
|
85
|
+
return (0, yousign_1.convertParamsToHtmlTag)(__assign(__assign({}, parsedParams), { signerIndex: index }));
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
console.error("Failed to parse Yousign tag: " + v, error);
|
|
89
|
+
return v;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
70
92
|
autonums.forEach(function (currentAn) {
|
|
71
93
|
if (currentAn[3] === null)
|
|
72
94
|
parsedOutput = parsedOutput.replace("[" + currentAn[0] + ":" + currentAn[1] + "]", "<span class=\"" + currentAn[0] + "\">" + currentAn[2] + "</span>");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legalplace/prerenderx",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "PrerenderX",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": "https://git.legalplace.eu/legalplace/prerenderx",
|
|
@@ -16,27 +16,26 @@
|
|
|
16
16
|
"release": "standard-version -a --no-verify"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@legalplace/conditions-runner": "^2.1.
|
|
19
|
+
"@legalplace/conditions-runner": "^2.1.28",
|
|
20
20
|
"@legalplace/eslint-config-base": "^1.1.1",
|
|
21
21
|
"@legalplace/lplogic": "2.3.1",
|
|
22
22
|
"@legalplace/models-v3-types": "^5.13.0",
|
|
23
|
-
"@legalplace/ovc-converter": "^2.0.
|
|
23
|
+
"@legalplace/ovc-converter": "^2.0.35",
|
|
24
24
|
"@legalplace/prettier-config": "^2.1.3",
|
|
25
|
-
"@legalplace/referencesparser": "^3.1.
|
|
25
|
+
"@legalplace/referencesparser": "^3.1.28",
|
|
26
|
+
"@legalplace/yousign": "^0.7.0",
|
|
26
27
|
"crypto": "^1.0.1",
|
|
27
|
-
"standard-version": "^9.3.1"
|
|
28
|
-
"typescript": "4.4.3"
|
|
28
|
+
"standard-version": "^9.3.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@babel/core": "^7.7.2",
|
|
32
32
|
"@babel/preset-typescript": "^7.7.2",
|
|
33
|
-
"@legalplace/types": "^2.
|
|
33
|
+
"@legalplace/types": "^2.13.0",
|
|
34
34
|
"@types/jest": "^24.0.15",
|
|
35
|
-
"@types/node": "^20.8.10",
|
|
36
35
|
"jest": "^24.8.0",
|
|
37
36
|
"redux-mock-store": "^1.5.3",
|
|
38
37
|
"ts-jest": "^24.0.2"
|
|
39
38
|
},
|
|
40
39
|
"prettier": "@legalplace/prettier-config",
|
|
41
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "6bda9e14f3ac9477bd51c3d38770f5b98b8f4352"
|
|
42
41
|
}
|
package/src/libs/OutputParser.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { Types } from "@legalplace/referencesparser";
|
|
2
|
+
import {
|
|
3
|
+
convertParamsToHtmlTag,
|
|
4
|
+
parseYousignTag,
|
|
5
|
+
yousignTagFieldRegex,
|
|
6
|
+
} from "@legalplace/yousign";
|
|
2
7
|
import type InputsType from "@legalplace/types/dist/inputs";
|
|
3
8
|
|
|
4
9
|
/**
|
|
@@ -156,6 +161,26 @@ export const parseOutputWithVariables: parseOutputT = (
|
|
|
156
161
|
() => '<span data-signature="date"></span>'
|
|
157
162
|
);
|
|
158
163
|
|
|
164
|
+
// Replace Yousign tags
|
|
165
|
+
parsedOutput = parsedOutput.replace(
|
|
166
|
+
new RegExp(yousignTagFieldRegex, "g"),
|
|
167
|
+
(v, paramsString) => {
|
|
168
|
+
try {
|
|
169
|
+
const parsedParams = parseYousignTag(
|
|
170
|
+
`[yousign:${paramsString.replace(
|
|
171
|
+
/((=)")|("(;|$))/g,
|
|
172
|
+
'$2"$4'
|
|
173
|
+
)}]`
|
|
174
|
+
);
|
|
175
|
+
return convertParamsToHtmlTag({ ...parsedParams, signerIndex: index });
|
|
176
|
+
} catch (error) {
|
|
177
|
+
// eslint-disable-next-line no-console
|
|
178
|
+
console.error(`Failed to parse Yousign tag: ${v}`, error);
|
|
179
|
+
return v;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
|
|
159
184
|
// Inserting autonums
|
|
160
185
|
autonums.forEach((currentAn) => {
|
|
161
186
|
if (currentAn[3] === null)
|
package/tsconfig.json
CHANGED
|
@@ -7,11 +7,10 @@
|
|
|
7
7
|
"lib": ["es2018"],
|
|
8
8
|
"outDir": "./dist/",
|
|
9
9
|
"strict": true,
|
|
10
|
-
"typeRoots": ["node_modules/@types"],
|
|
11
|
-
"types": ["node"],
|
|
12
10
|
"esModuleInterop": true,
|
|
13
11
|
"removeComments": true,
|
|
14
|
-
"declaration": true
|
|
12
|
+
"declaration": true,
|
|
13
|
+
"experimentalDecorators": true
|
|
15
14
|
},
|
|
16
15
|
"include": ["src"],
|
|
17
16
|
"exclude": ["node_modules"]
|