@shad0wz7/nestjs-pdf 2.1.0 → 2.2.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 +4 -0
- package/dist/index.d.mts +126 -10
- package/dist/index.d.ts +126 -10
- package/dist/index.js +1413 -164
- package/dist/index.mjs +1395 -148
- package/package.json +9 -2
package/dist/index.mjs
CHANGED
|
@@ -75,7 +75,7 @@ var require_main = __commonJS({
|
|
|
75
75
|
}
|
|
76
76
|
__name(dim, "dim");
|
|
77
77
|
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
78
|
-
function
|
|
78
|
+
function parse4(src) {
|
|
79
79
|
const obj = {};
|
|
80
80
|
let lines = src.toString();
|
|
81
81
|
lines = lines.replace(/\r\n?/mg, "\n");
|
|
@@ -94,7 +94,7 @@ var require_main = __commonJS({
|
|
|
94
94
|
}
|
|
95
95
|
return obj;
|
|
96
96
|
}
|
|
97
|
-
__name(
|
|
97
|
+
__name(parse4, "parse");
|
|
98
98
|
function _parseVault(options) {
|
|
99
99
|
options = options || {};
|
|
100
100
|
const vaultPath = _vaultPath(options);
|
|
@@ -278,8 +278,8 @@ var require_main = __commonJS({
|
|
|
278
278
|
const shortPaths = [];
|
|
279
279
|
for (const filePath of optionPaths) {
|
|
280
280
|
try {
|
|
281
|
-
const
|
|
282
|
-
shortPaths.push(
|
|
281
|
+
const relative3 = path2.relative(process.cwd(), filePath);
|
|
282
|
+
shortPaths.push(relative3);
|
|
283
283
|
} catch (e) {
|
|
284
284
|
if (debug) {
|
|
285
285
|
_debug(`failed to load ${filePath} ${e.message}`);
|
|
@@ -377,7 +377,7 @@ var require_main = __commonJS({
|
|
|
377
377
|
_parseVault,
|
|
378
378
|
config,
|
|
379
379
|
decrypt,
|
|
380
|
-
parse,
|
|
380
|
+
parse: parse4,
|
|
381
381
|
populate
|
|
382
382
|
};
|
|
383
383
|
module.exports.configDotenv = DotenvModule.configDotenv;
|
|
@@ -472,9 +472,9 @@ var require_main2 = __commonJS({
|
|
|
472
472
|
}
|
|
473
473
|
});
|
|
474
474
|
|
|
475
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
475
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/config.constants.js
|
|
476
476
|
var require_config_constants = __commonJS({
|
|
477
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
477
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/config.constants.js"(exports) {
|
|
478
478
|
"use strict";
|
|
479
479
|
Object.defineProperty(exports, "__esModule", {
|
|
480
480
|
value: true
|
|
@@ -495,8 +495,8 @@ var require_config_constants = __commonJS({
|
|
|
495
495
|
var require_isArray = __commonJS({
|
|
496
496
|
"node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArray.js"(exports, module) {
|
|
497
497
|
"use strict";
|
|
498
|
-
var
|
|
499
|
-
module.exports =
|
|
498
|
+
var isArray2 = Array.isArray;
|
|
499
|
+
module.exports = isArray2;
|
|
500
500
|
}
|
|
501
501
|
});
|
|
502
502
|
|
|
@@ -567,11 +567,11 @@ var require_objectToString = __commonJS({
|
|
|
567
567
|
"use strict";
|
|
568
568
|
var objectProto = Object.prototype;
|
|
569
569
|
var nativeObjectToString = objectProto.toString;
|
|
570
|
-
function
|
|
570
|
+
function objectToString2(value) {
|
|
571
571
|
return nativeObjectToString.call(value);
|
|
572
572
|
}
|
|
573
|
-
__name(
|
|
574
|
-
module.exports =
|
|
573
|
+
__name(objectToString2, "objectToString");
|
|
574
|
+
module.exports = objectToString2;
|
|
575
575
|
}
|
|
576
576
|
});
|
|
577
577
|
|
|
@@ -581,7 +581,7 @@ var require_baseGetTag = __commonJS({
|
|
|
581
581
|
"use strict";
|
|
582
582
|
var Symbol2 = require_Symbol();
|
|
583
583
|
var getRawTag = require_getRawTag();
|
|
584
|
-
var
|
|
584
|
+
var objectToString2 = require_objectToString();
|
|
585
585
|
var nullTag = "[object Null]";
|
|
586
586
|
var undefinedTag = "[object Undefined]";
|
|
587
587
|
var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
|
|
@@ -589,7 +589,7 @@ var require_baseGetTag = __commonJS({
|
|
|
589
589
|
if (value == null) {
|
|
590
590
|
return value === void 0 ? undefinedTag : nullTag;
|
|
591
591
|
}
|
|
592
|
-
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) :
|
|
592
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString2(value);
|
|
593
593
|
}
|
|
594
594
|
__name(baseGetTag, "baseGetTag");
|
|
595
595
|
module.exports = baseGetTag;
|
|
@@ -627,12 +627,12 @@ var require_isSymbol = __commonJS({
|
|
|
627
627
|
var require_isKey = __commonJS({
|
|
628
628
|
"node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isKey.js"(exports, module) {
|
|
629
629
|
"use strict";
|
|
630
|
-
var
|
|
630
|
+
var isArray2 = require_isArray();
|
|
631
631
|
var isSymbol = require_isSymbol();
|
|
632
632
|
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
633
633
|
var reIsPlainProp = /^\w*$/;
|
|
634
634
|
function isKey(value, object) {
|
|
635
|
-
if (
|
|
635
|
+
if (isArray2(value)) {
|
|
636
636
|
return false;
|
|
637
637
|
}
|
|
638
638
|
var type = typeof value;
|
|
@@ -669,15 +669,15 @@ var require_isFunction = __commonJS({
|
|
|
669
669
|
var funcTag = "[object Function]";
|
|
670
670
|
var genTag = "[object GeneratorFunction]";
|
|
671
671
|
var proxyTag = "[object Proxy]";
|
|
672
|
-
function
|
|
672
|
+
function isFunction2(value) {
|
|
673
673
|
if (!isObject(value)) {
|
|
674
674
|
return false;
|
|
675
675
|
}
|
|
676
676
|
var tag = baseGetTag(value);
|
|
677
677
|
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
678
678
|
}
|
|
679
|
-
__name(
|
|
680
|
-
module.exports =
|
|
679
|
+
__name(isFunction2, "isFunction");
|
|
680
|
+
module.exports = isFunction2;
|
|
681
681
|
}
|
|
682
682
|
});
|
|
683
683
|
|
|
@@ -736,7 +736,7 @@ var require_toSource = __commonJS({
|
|
|
736
736
|
var require_baseIsNative = __commonJS({
|
|
737
737
|
"node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsNative.js"(exports, module) {
|
|
738
738
|
"use strict";
|
|
739
|
-
var
|
|
739
|
+
var isFunction2 = require_isFunction();
|
|
740
740
|
var isMasked = require_isMasked();
|
|
741
741
|
var isObject = require_isObject();
|
|
742
742
|
var toSource = require_toSource();
|
|
@@ -751,7 +751,7 @@ var require_baseIsNative = __commonJS({
|
|
|
751
751
|
if (!isObject(value) || isMasked(value)) {
|
|
752
752
|
return false;
|
|
753
753
|
}
|
|
754
|
-
var pattern =
|
|
754
|
+
var pattern = isFunction2(value) ? reIsNative : reIsHostCtor;
|
|
755
755
|
return pattern.test(toSource(value));
|
|
756
756
|
}
|
|
757
757
|
__name(baseIsNative, "baseIsNative");
|
|
@@ -1058,8 +1058,8 @@ var require_Map = __commonJS({
|
|
|
1058
1058
|
"use strict";
|
|
1059
1059
|
var getNative = require_getNative();
|
|
1060
1060
|
var root = require_root();
|
|
1061
|
-
var
|
|
1062
|
-
module.exports =
|
|
1061
|
+
var Map2 = getNative(root, "Map");
|
|
1062
|
+
module.exports = Map2;
|
|
1063
1063
|
}
|
|
1064
1064
|
});
|
|
1065
1065
|
|
|
@@ -1069,12 +1069,12 @@ var require_mapCacheClear = __commonJS({
|
|
|
1069
1069
|
"use strict";
|
|
1070
1070
|
var Hash = require_Hash();
|
|
1071
1071
|
var ListCache = require_ListCache();
|
|
1072
|
-
var
|
|
1072
|
+
var Map2 = require_Map();
|
|
1073
1073
|
function mapCacheClear() {
|
|
1074
1074
|
this.size = 0;
|
|
1075
1075
|
this.__data__ = {
|
|
1076
1076
|
"hash": new Hash(),
|
|
1077
|
-
"map": new (
|
|
1077
|
+
"map": new (Map2 || ListCache)(),
|
|
1078
1078
|
"string": new Hash()
|
|
1079
1079
|
};
|
|
1080
1080
|
}
|
|
@@ -1286,7 +1286,7 @@ var require_baseToString = __commonJS({
|
|
|
1286
1286
|
"use strict";
|
|
1287
1287
|
var Symbol2 = require_Symbol();
|
|
1288
1288
|
var arrayMap = require_arrayMap();
|
|
1289
|
-
var
|
|
1289
|
+
var isArray2 = require_isArray();
|
|
1290
1290
|
var isSymbol = require_isSymbol();
|
|
1291
1291
|
var INFINITY = 1 / 0;
|
|
1292
1292
|
var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
|
|
@@ -1295,7 +1295,7 @@ var require_baseToString = __commonJS({
|
|
|
1295
1295
|
if (typeof value == "string") {
|
|
1296
1296
|
return value;
|
|
1297
1297
|
}
|
|
1298
|
-
if (
|
|
1298
|
+
if (isArray2(value)) {
|
|
1299
1299
|
return arrayMap(value, baseToString) + "";
|
|
1300
1300
|
}
|
|
1301
1301
|
if (isSymbol(value)) {
|
|
@@ -1326,12 +1326,12 @@ var require_toString = __commonJS({
|
|
|
1326
1326
|
var require_castPath = __commonJS({
|
|
1327
1327
|
"node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_castPath.js"(exports, module) {
|
|
1328
1328
|
"use strict";
|
|
1329
|
-
var
|
|
1329
|
+
var isArray2 = require_isArray();
|
|
1330
1330
|
var isKey = require_isKey();
|
|
1331
1331
|
var stringToPath = require_stringToPath();
|
|
1332
1332
|
var toString = require_toString();
|
|
1333
1333
|
function castPath(value, object) {
|
|
1334
|
-
if (
|
|
1334
|
+
if (isArray2(value)) {
|
|
1335
1335
|
return value;
|
|
1336
1336
|
}
|
|
1337
1337
|
return isKey(value, object) ? [
|
|
@@ -1476,7 +1476,7 @@ var require_hasPath = __commonJS({
|
|
|
1476
1476
|
"use strict";
|
|
1477
1477
|
var castPath = require_castPath();
|
|
1478
1478
|
var isArguments = require_isArguments();
|
|
1479
|
-
var
|
|
1479
|
+
var isArray2 = require_isArray();
|
|
1480
1480
|
var isIndex = require_isIndex();
|
|
1481
1481
|
var isLength = require_isLength();
|
|
1482
1482
|
var toKey = require_toKey();
|
|
@@ -1494,7 +1494,7 @@ var require_hasPath = __commonJS({
|
|
|
1494
1494
|
return result;
|
|
1495
1495
|
}
|
|
1496
1496
|
length = object == null ? 0 : object.length;
|
|
1497
|
-
return !!length && isLength(length) && isIndex(key, length) && (
|
|
1497
|
+
return !!length && isLength(length) && isIndex(key, length) && (isArray2(object) || isArguments(object));
|
|
1498
1498
|
}
|
|
1499
1499
|
__name(hasPath, "hasPath");
|
|
1500
1500
|
module.exports = hasPath;
|
|
@@ -1623,9 +1623,9 @@ var require_set = __commonJS({
|
|
|
1623
1623
|
}
|
|
1624
1624
|
});
|
|
1625
1625
|
|
|
1626
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
1626
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/config.service.js
|
|
1627
1627
|
var require_config_service = __commonJS({
|
|
1628
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
1628
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/config.service.js"(exports) {
|
|
1629
1629
|
"use strict";
|
|
1630
1630
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
1631
1631
|
if (k2 === void 0) k2 = k;
|
|
@@ -1858,9 +1858,9 @@ var require_config_service = __commonJS({
|
|
|
1858
1858
|
}
|
|
1859
1859
|
});
|
|
1860
1860
|
|
|
1861
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
1861
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/config-host.module.js
|
|
1862
1862
|
var require_config_host_module = __commonJS({
|
|
1863
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
1863
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/config-host.module.js"(exports) {
|
|
1864
1864
|
"use strict";
|
|
1865
1865
|
var __decorate = exports && exports.__decorate || function(decorators, target, key, desc) {
|
|
1866
1866
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1903,9 +1903,9 @@ var require_config_host_module = __commonJS({
|
|
|
1903
1903
|
}
|
|
1904
1904
|
});
|
|
1905
1905
|
|
|
1906
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
1906
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/get-config-token.util.js
|
|
1907
1907
|
var require_get_config_token_util = __commonJS({
|
|
1908
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
1908
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/get-config-token.util.js"(exports) {
|
|
1909
1909
|
"use strict";
|
|
1910
1910
|
Object.defineProperty(exports, "__esModule", {
|
|
1911
1911
|
value: true
|
|
@@ -1918,9 +1918,9 @@ var require_get_config_token_util = __commonJS({
|
|
|
1918
1918
|
}
|
|
1919
1919
|
});
|
|
1920
1920
|
|
|
1921
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
1921
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/create-config-factory.util.js
|
|
1922
1922
|
var require_create_config_factory_util = __commonJS({
|
|
1923
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
1923
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/create-config-factory.util.js"(exports) {
|
|
1924
1924
|
"use strict";
|
|
1925
1925
|
Object.defineProperty(exports, "__esModule", {
|
|
1926
1926
|
value: true
|
|
@@ -1939,9 +1939,9 @@ var require_create_config_factory_util = __commonJS({
|
|
|
1939
1939
|
}
|
|
1940
1940
|
});
|
|
1941
1941
|
|
|
1942
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
1942
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/get-registration-token.util.js
|
|
1943
1943
|
var require_get_registration_token_util = __commonJS({
|
|
1944
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
1944
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/get-registration-token.util.js"(exports) {
|
|
1945
1945
|
"use strict";
|
|
1946
1946
|
Object.defineProperty(exports, "__esModule", {
|
|
1947
1947
|
value: true
|
|
@@ -1955,9 +1955,9 @@ var require_get_registration_token_util = __commonJS({
|
|
|
1955
1955
|
}
|
|
1956
1956
|
});
|
|
1957
1957
|
|
|
1958
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
1958
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/merge-configs.util.js
|
|
1959
1959
|
var require_merge_configs_util = __commonJS({
|
|
1960
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
1960
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/merge-configs.util.js"(exports) {
|
|
1961
1961
|
"use strict";
|
|
1962
1962
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
1963
1963
|
return mod && mod.__esModule ? mod : {
|
|
@@ -1980,9 +1980,9 @@ var require_merge_configs_util = __commonJS({
|
|
|
1980
1980
|
}
|
|
1981
1981
|
});
|
|
1982
1982
|
|
|
1983
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
1983
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/config.module.js
|
|
1984
1984
|
var require_config_module = __commonJS({
|
|
1985
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
1985
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/config.module.js"(exports) {
|
|
1986
1986
|
"use strict";
|
|
1987
1987
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
1988
1988
|
if (k2 === void 0) k2 = k;
|
|
@@ -2237,7 +2237,7 @@ var require_config_module = __commonJS({
|
|
|
2237
2237
|
}
|
|
2238
2238
|
};
|
|
2239
2239
|
exports.ConfigModule = ConfigModule2;
|
|
2240
|
-
ConfigModule2._envVariablesLoaded = new Promise((
|
|
2240
|
+
ConfigModule2._envVariablesLoaded = new Promise((resolve5) => ConfigModule_1.environmentVariablesLoadedSignal = resolve5);
|
|
2241
2241
|
exports.ConfigModule = ConfigModule2 = ConfigModule_1 = __decorate([
|
|
2242
2242
|
(0, common_1.Module)({
|
|
2243
2243
|
imports: [
|
|
@@ -2258,9 +2258,9 @@ var require_config_module = __commonJS({
|
|
|
2258
2258
|
}
|
|
2259
2259
|
});
|
|
2260
2260
|
|
|
2261
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2261
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/conditional.module.js
|
|
2262
2262
|
var require_conditional_module = __commonJS({
|
|
2263
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2263
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/conditional.module.js"(exports) {
|
|
2264
2264
|
"use strict";
|
|
2265
2265
|
Object.defineProperty(exports, "__esModule", {
|
|
2266
2266
|
value: true
|
|
@@ -2320,9 +2320,9 @@ var require_conditional_module = __commonJS({
|
|
|
2320
2320
|
}
|
|
2321
2321
|
});
|
|
2322
2322
|
|
|
2323
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2323
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/config-object.type.js
|
|
2324
2324
|
var require_config_object_type = __commonJS({
|
|
2325
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2325
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/config-object.type.js"(exports) {
|
|
2326
2326
|
"use strict";
|
|
2327
2327
|
Object.defineProperty(exports, "__esModule", {
|
|
2328
2328
|
value: true
|
|
@@ -2330,9 +2330,9 @@ var require_config_object_type = __commonJS({
|
|
|
2330
2330
|
}
|
|
2331
2331
|
});
|
|
2332
2332
|
|
|
2333
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2333
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/config.type.js
|
|
2334
2334
|
var require_config_type = __commonJS({
|
|
2335
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2335
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/config.type.js"(exports) {
|
|
2336
2336
|
"use strict";
|
|
2337
2337
|
Object.defineProperty(exports, "__esModule", {
|
|
2338
2338
|
value: true
|
|
@@ -2340,9 +2340,9 @@ var require_config_type = __commonJS({
|
|
|
2340
2340
|
}
|
|
2341
2341
|
});
|
|
2342
2342
|
|
|
2343
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2343
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/no-infer.type.js
|
|
2344
2344
|
var require_no_infer_type = __commonJS({
|
|
2345
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2345
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/no-infer.type.js"(exports) {
|
|
2346
2346
|
"use strict";
|
|
2347
2347
|
Object.defineProperty(exports, "__esModule", {
|
|
2348
2348
|
value: true
|
|
@@ -2350,9 +2350,9 @@ var require_no_infer_type = __commonJS({
|
|
|
2350
2350
|
}
|
|
2351
2351
|
});
|
|
2352
2352
|
|
|
2353
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2353
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/path-value.type.js
|
|
2354
2354
|
var require_path_value_type = __commonJS({
|
|
2355
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2355
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/path-value.type.js"(exports) {
|
|
2356
2356
|
"use strict";
|
|
2357
2357
|
Object.defineProperty(exports, "__esModule", {
|
|
2358
2358
|
value: true
|
|
@@ -2360,9 +2360,9 @@ var require_path_value_type = __commonJS({
|
|
|
2360
2360
|
}
|
|
2361
2361
|
});
|
|
2362
2362
|
|
|
2363
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2363
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/index.js
|
|
2364
2364
|
var require_types = __commonJS({
|
|
2365
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2365
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/index.js"(exports) {
|
|
2366
2366
|
"use strict";
|
|
2367
2367
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
2368
2368
|
if (k2 === void 0) k2 = k;
|
|
@@ -2393,9 +2393,9 @@ var require_types = __commonJS({
|
|
|
2393
2393
|
}
|
|
2394
2394
|
});
|
|
2395
2395
|
|
|
2396
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2396
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/register-as.util.js
|
|
2397
2397
|
var require_register_as_util = __commonJS({
|
|
2398
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2398
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/register-as.util.js"(exports) {
|
|
2399
2399
|
"use strict";
|
|
2400
2400
|
Object.defineProperty(exports, "__esModule", {
|
|
2401
2401
|
value: true
|
|
@@ -2430,9 +2430,9 @@ var require_register_as_util = __commonJS({
|
|
|
2430
2430
|
}
|
|
2431
2431
|
});
|
|
2432
2432
|
|
|
2433
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2433
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/index.js
|
|
2434
2434
|
var require_utils = __commonJS({
|
|
2435
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2435
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/index.js"(exports) {
|
|
2436
2436
|
"use strict";
|
|
2437
2437
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
2438
2438
|
if (k2 === void 0) k2 = k;
|
|
@@ -2461,9 +2461,9 @@ var require_utils = __commonJS({
|
|
|
2461
2461
|
}
|
|
2462
2462
|
});
|
|
2463
2463
|
|
|
2464
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2464
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/interfaces/config-change-event.interface.js
|
|
2465
2465
|
var require_config_change_event_interface = __commonJS({
|
|
2466
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2466
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/interfaces/config-change-event.interface.js"(exports) {
|
|
2467
2467
|
"use strict";
|
|
2468
2468
|
Object.defineProperty(exports, "__esModule", {
|
|
2469
2469
|
value: true
|
|
@@ -2471,9 +2471,9 @@ var require_config_change_event_interface = __commonJS({
|
|
|
2471
2471
|
}
|
|
2472
2472
|
});
|
|
2473
2473
|
|
|
2474
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2474
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/interfaces/config-factory.interface.js
|
|
2475
2475
|
var require_config_factory_interface = __commonJS({
|
|
2476
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2476
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/interfaces/config-factory.interface.js"(exports) {
|
|
2477
2477
|
"use strict";
|
|
2478
2478
|
Object.defineProperty(exports, "__esModule", {
|
|
2479
2479
|
value: true
|
|
@@ -2481,9 +2481,9 @@ var require_config_factory_interface = __commonJS({
|
|
|
2481
2481
|
}
|
|
2482
2482
|
});
|
|
2483
2483
|
|
|
2484
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2484
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/interfaces/config-module-options.interface.js
|
|
2485
2485
|
var require_config_module_options_interface = __commonJS({
|
|
2486
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2486
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/interfaces/config-module-options.interface.js"(exports) {
|
|
2487
2487
|
"use strict";
|
|
2488
2488
|
Object.defineProperty(exports, "__esModule", {
|
|
2489
2489
|
value: true
|
|
@@ -2491,9 +2491,9 @@ var require_config_module_options_interface = __commonJS({
|
|
|
2491
2491
|
}
|
|
2492
2492
|
});
|
|
2493
2493
|
|
|
2494
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2494
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/interfaces/index.js
|
|
2495
2495
|
var require_interfaces = __commonJS({
|
|
2496
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2496
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/interfaces/index.js"(exports) {
|
|
2497
2497
|
"use strict";
|
|
2498
2498
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
2499
2499
|
if (k2 === void 0) k2 = k;
|
|
@@ -2523,9 +2523,9 @@ var require_interfaces = __commonJS({
|
|
|
2523
2523
|
}
|
|
2524
2524
|
});
|
|
2525
2525
|
|
|
2526
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2526
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/index.js
|
|
2527
2527
|
var require_dist = __commonJS({
|
|
2528
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2528
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/dist/index.js"(exports) {
|
|
2529
2529
|
"use strict";
|
|
2530
2530
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
2531
2531
|
if (k2 === void 0) k2 = k;
|
|
@@ -2558,9 +2558,9 @@ var require_dist = __commonJS({
|
|
|
2558
2558
|
}
|
|
2559
2559
|
});
|
|
2560
2560
|
|
|
2561
|
-
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2561
|
+
// node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/index.js
|
|
2562
2562
|
var require_config = __commonJS({
|
|
2563
|
-
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.
|
|
2563
|
+
"node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.23_reflect-metadata@0.2.2_rxjs@7.8.2__rxjs@7.8.2/node_modules/@nestjs/config/index.js"(exports) {
|
|
2564
2564
|
"use strict";
|
|
2565
2565
|
function __export(m) {
|
|
2566
2566
|
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
@@ -2575,22 +2575,21 @@ var require_config = __commonJS({
|
|
|
2575
2575
|
import { Module as Module2 } from "@nestjs/common";
|
|
2576
2576
|
|
|
2577
2577
|
// src/nestjs-pdf.service.ts
|
|
2578
|
-
import { Injectable as
|
|
2578
|
+
import { Injectable as Injectable9 } from "@nestjs/common";
|
|
2579
2579
|
|
|
2580
2580
|
// src/puppeteer/puppeteer.service.ts
|
|
2581
|
-
import { Inject as Inject2, Injectable as
|
|
2581
|
+
import { Inject as Inject2, Injectable as Injectable8, Logger as Logger2, Optional } from "@nestjs/common";
|
|
2582
2582
|
|
|
2583
|
-
// src/
|
|
2583
|
+
// src/helpers/tokens.ts
|
|
2584
2584
|
var PDF_PARAMETERS = "PDF_PARAMETERS";
|
|
2585
2585
|
var HANDLEBARS_PARAMETERS = "HANDLEBARS_PARAMETERS";
|
|
2586
2586
|
|
|
2587
|
-
// src/puppeteer/browser.service.ts
|
|
2587
|
+
// src/puppeteer/browser/browser.service.ts
|
|
2588
2588
|
import { Inject, Injectable, Logger } from "@nestjs/common";
|
|
2589
|
-
import
|
|
2590
|
-
import
|
|
2591
|
-
import
|
|
2592
|
-
import
|
|
2593
|
-
import { Browser as BrowserType } from "@puppeteer/browsers";
|
|
2589
|
+
import { existsSync, promises, readFileSync, writeFileSync } from "fs";
|
|
2590
|
+
import { resolve } from "path";
|
|
2591
|
+
import { launch } from "puppeteer";
|
|
2592
|
+
import { Browser as BrowserType, BrowserPlatform, canDownload, detectBrowserPlatform, getInstalledBrowsers, resolveBuildId, install } from "@puppeteer/browsers";
|
|
2594
2593
|
function _ts_decorate(decorators, target, key, desc) {
|
|
2595
2594
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2596
2595
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2615,7 +2614,7 @@ __name(sleep, "sleep");
|
|
|
2615
2614
|
async function rmWithRetries(dir, retries = 5) {
|
|
2616
2615
|
for (let attempt = 1; attempt <= retries; attempt++) {
|
|
2617
2616
|
try {
|
|
2618
|
-
await
|
|
2617
|
+
await promises.rm(dir, {
|
|
2619
2618
|
recursive: true,
|
|
2620
2619
|
force: true
|
|
2621
2620
|
});
|
|
@@ -2647,7 +2646,7 @@ var BrowserService = class {
|
|
|
2647
2646
|
useLockedBrowser;
|
|
2648
2647
|
buildId;
|
|
2649
2648
|
constructor(pdfParams) {
|
|
2650
|
-
this.cacheDir =
|
|
2649
|
+
this.cacheDir = resolve(".cache/puppeteer-browser");
|
|
2651
2650
|
this.options = pdfParams;
|
|
2652
2651
|
if (pdfParams.cleanupBrowserCacheOnExit) {
|
|
2653
2652
|
this.registerCleanupHooks();
|
|
@@ -2670,7 +2669,7 @@ var BrowserService = class {
|
|
|
2670
2669
|
async getBrowserInstance(args, headless) {
|
|
2671
2670
|
if (!this._browserInstance?.connected) {
|
|
2672
2671
|
const executablePath = await this.getExecutablePath();
|
|
2673
|
-
this._browserInstance = await
|
|
2672
|
+
this._browserInstance = await launch({
|
|
2674
2673
|
executablePath,
|
|
2675
2674
|
headless,
|
|
2676
2675
|
args
|
|
@@ -2720,10 +2719,10 @@ var BrowserService = class {
|
|
|
2720
2719
|
const logger = new Logger("NestJsPdf");
|
|
2721
2720
|
const dir = this.cacheDir;
|
|
2722
2721
|
try {
|
|
2723
|
-
if (!
|
|
2722
|
+
if (!existsSync(dir)) return;
|
|
2724
2723
|
logger.log(`Cleanup puppeteer cache on signal: ${dir}`);
|
|
2725
2724
|
await rmWithRetries(dir, 6);
|
|
2726
|
-
if (
|
|
2725
|
+
if (existsSync(dir)) {
|
|
2727
2726
|
await sleep(100);
|
|
2728
2727
|
await rmWithRetries(dir, 3);
|
|
2729
2728
|
}
|
|
@@ -2732,7 +2731,7 @@ var BrowserService = class {
|
|
|
2732
2731
|
logger.error(`Cleanup failed for ${dir}`, err instanceof Error ? err.stack : String(err));
|
|
2733
2732
|
}
|
|
2734
2733
|
try {
|
|
2735
|
-
const leftover = await
|
|
2734
|
+
const leftover = await promises.readdir(dir, {
|
|
2736
2735
|
recursive: true
|
|
2737
2736
|
});
|
|
2738
2737
|
logger.warn(`Leftover files: ${leftover.slice(0, 20).join(", ")}...`);
|
|
@@ -2743,10 +2742,10 @@ var BrowserService = class {
|
|
|
2743
2742
|
async install(lock = false) {
|
|
2744
2743
|
const browser = this.browser;
|
|
2745
2744
|
const versionTag = this.browserTag;
|
|
2746
|
-
const browserPlatform =
|
|
2745
|
+
const browserPlatform = detectBrowserPlatform() ?? BrowserPlatform.LINUX;
|
|
2747
2746
|
let buildId;
|
|
2748
2747
|
if (this.buildId === void 0) {
|
|
2749
|
-
buildId = await
|
|
2748
|
+
buildId = await resolveBuildId(browser, browserPlatform, versionTag);
|
|
2750
2749
|
} else {
|
|
2751
2750
|
buildId = this.buildId;
|
|
2752
2751
|
}
|
|
@@ -2765,9 +2764,9 @@ var BrowserService = class {
|
|
|
2765
2764
|
buildId,
|
|
2766
2765
|
baseUrl: this.options?.browserInstallBaseUrl ?? void 0
|
|
2767
2766
|
};
|
|
2768
|
-
if (await
|
|
2767
|
+
if (await canDownload(installOption)) {
|
|
2769
2768
|
Logger.log(`Installing ${installOption.browser} ${installOption.buildId}`, "NestJsPdf");
|
|
2770
|
-
const installedBrowser = await
|
|
2769
|
+
const installedBrowser = await install(installOption);
|
|
2771
2770
|
if (await this.hasBrowserInstalled(browser, buildId)) {
|
|
2772
2771
|
Logger.log("Browser installed successfully", "NestJsPdf");
|
|
2773
2772
|
if (lock) {
|
|
@@ -2859,7 +2858,7 @@ var BrowserService = class {
|
|
|
2859
2858
|
this.useLockedBrowser = useLockedBrowser;
|
|
2860
2859
|
}
|
|
2861
2860
|
async hasBrowserInstalled(browser, buildId) {
|
|
2862
|
-
const installedBrowserlist = await
|
|
2861
|
+
const installedBrowserlist = await getInstalledBrowsers({
|
|
2863
2862
|
cacheDir: this.cacheDir
|
|
2864
2863
|
});
|
|
2865
2864
|
const installedBrowser = installedBrowserlist.find((installedBrowser2) => {
|
|
@@ -2870,14 +2869,14 @@ var BrowserService = class {
|
|
|
2870
2869
|
async getExecutablePath() {
|
|
2871
2870
|
const browser = this.browser;
|
|
2872
2871
|
const versionTag = this.browserTag;
|
|
2873
|
-
const browserPlatform =
|
|
2872
|
+
const browserPlatform = detectBrowserPlatform() ?? BrowserPlatform.LINUX;
|
|
2874
2873
|
let buildId = null;
|
|
2875
2874
|
if (this.useLockedBrowser) {
|
|
2876
2875
|
buildId = this.getLockedBuildId(browser);
|
|
2877
2876
|
Logger.log(`Using locked browser ${buildId}`, "NestJsPdf");
|
|
2878
2877
|
}
|
|
2879
|
-
buildId ??= await
|
|
2880
|
-
const installedBrowserlist = await
|
|
2878
|
+
buildId ??= await resolveBuildId(browser, browserPlatform, versionTag);
|
|
2879
|
+
const installedBrowserlist = await getInstalledBrowsers({
|
|
2881
2880
|
cacheDir: this.cacheDir
|
|
2882
2881
|
});
|
|
2883
2882
|
const installedBrowser = installedBrowserlist.find((installedBrowser2) => {
|
|
@@ -2894,19 +2893,19 @@ var BrowserService = class {
|
|
|
2894
2893
|
return installedBrowser.executablePath;
|
|
2895
2894
|
}
|
|
2896
2895
|
writeLockFile(browser, buildId) {
|
|
2897
|
-
const lockFile =
|
|
2896
|
+
const lockFile = resolve(this.cacheDir, `${browser}.lock`);
|
|
2898
2897
|
const data = JSON.stringify({
|
|
2899
2898
|
browser,
|
|
2900
2899
|
buildId,
|
|
2901
2900
|
date: (/* @__PURE__ */ new Date()).toISOString()
|
|
2902
2901
|
});
|
|
2903
|
-
|
|
2902
|
+
writeFileSync(lockFile, data);
|
|
2904
2903
|
Logger.log(`Browser ${browser} locked to build ${buildId}`, "NestJsPdf");
|
|
2905
2904
|
}
|
|
2906
2905
|
getLockedBuildId(browser) {
|
|
2907
|
-
const lockFile =
|
|
2908
|
-
if (
|
|
2909
|
-
const data =
|
|
2906
|
+
const lockFile = resolve(this.cacheDir, `${browser}.lock`);
|
|
2907
|
+
if (existsSync(lockFile)) {
|
|
2908
|
+
const data = readFileSync(lockFile);
|
|
2910
2909
|
const lock = JSON.parse(data.toString());
|
|
2911
2910
|
return lock.buildId;
|
|
2912
2911
|
}
|
|
@@ -2938,7 +2937,7 @@ __name(mergePuppeteerParameters, "mergePuppeteerParameters");
|
|
|
2938
2937
|
import pLimit from "p-limit";
|
|
2939
2938
|
import { HandlebarsService } from "@gboutte/nestjs-hbs";
|
|
2940
2939
|
|
|
2941
|
-
// src/puppeteer/
|
|
2940
|
+
// src/puppeteer/engines/mjml/mjml.service.ts
|
|
2942
2941
|
import { Injectable as Injectable2 } from "@nestjs/common";
|
|
2943
2942
|
import mjml from "mjml";
|
|
2944
2943
|
import { readFileSync as readFileSync2 } from "fs";
|
|
@@ -2966,10 +2965,10 @@ MjmlService = _ts_decorate2([
|
|
|
2966
2965
|
Injectable2()
|
|
2967
2966
|
], MjmlService);
|
|
2968
2967
|
|
|
2969
|
-
// src/puppeteer/
|
|
2968
|
+
// src/puppeteer/engines/pug/pug.service.ts
|
|
2970
2969
|
import { Injectable as Injectable3 } from "@nestjs/common";
|
|
2971
|
-
import pug from "pug";
|
|
2972
2970
|
import { readFileSync as readFileSync3 } from "fs";
|
|
2971
|
+
import { compile } from "pug";
|
|
2973
2972
|
function _ts_decorate3(decorators, target, key, desc) {
|
|
2974
2973
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2975
2974
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2983,7 +2982,7 @@ var PugService = class {
|
|
|
2983
2982
|
}
|
|
2984
2983
|
render(template, data = {}, options) {
|
|
2985
2984
|
try {
|
|
2986
|
-
const compiledFn =
|
|
2985
|
+
const compiledFn = compile(template, {
|
|
2987
2986
|
...options
|
|
2988
2987
|
});
|
|
2989
2988
|
return compiledFn(data);
|
|
@@ -3008,7 +3007,7 @@ PugService = _ts_decorate3([
|
|
|
3008
3007
|
Injectable3()
|
|
3009
3008
|
], PugService);
|
|
3010
3009
|
|
|
3011
|
-
// src/puppeteer/
|
|
3010
|
+
// src/puppeteer/engines/ejs/ejs.service.ts
|
|
3012
3011
|
import { Injectable as Injectable4 } from "@nestjs/common";
|
|
3013
3012
|
import { render, renderFile } from "ejs";
|
|
3014
3013
|
function _ts_decorate4(decorators, target, key, desc) {
|
|
@@ -3051,9 +3050,9 @@ EjsService = _ts_decorate4([
|
|
|
3051
3050
|
Injectable4()
|
|
3052
3051
|
], EjsService);
|
|
3053
3052
|
|
|
3054
|
-
// src/puppeteer/
|
|
3053
|
+
// src/puppeteer/engines/nunjucks/nunjucks.service.ts
|
|
3055
3054
|
import { Injectable as Injectable5 } from "@nestjs/common";
|
|
3056
|
-
import
|
|
3055
|
+
import { configure, render as render2, renderString } from "nunjucks";
|
|
3057
3056
|
function _ts_decorate5(decorators, target, key, desc) {
|
|
3058
3057
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3059
3058
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3070,7 +3069,7 @@ var NunjucksService = class {
|
|
|
3070
3069
|
__name(this, "NunjucksService");
|
|
3071
3070
|
}
|
|
3072
3071
|
constructor() {
|
|
3073
|
-
|
|
3072
|
+
configure({
|
|
3074
3073
|
noCache: true,
|
|
3075
3074
|
trimBlocks: true,
|
|
3076
3075
|
lstripBlocks: true
|
|
@@ -3086,9 +3085,9 @@ var NunjucksService = class {
|
|
|
3086
3085
|
trimBlocks: options.trimBlocks ?? true,
|
|
3087
3086
|
lstripBlocks: options.lstripBlocks ?? true
|
|
3088
3087
|
};
|
|
3089
|
-
|
|
3088
|
+
configure(configOptions);
|
|
3090
3089
|
}
|
|
3091
|
-
return
|
|
3090
|
+
return renderString(template, data);
|
|
3092
3091
|
} catch (error) {
|
|
3093
3092
|
throw new Error(`Nunjucks rendering failed: ${String(error)}`, {
|
|
3094
3093
|
cause: error
|
|
@@ -3105,9 +3104,9 @@ var NunjucksService = class {
|
|
|
3105
3104
|
trimBlocks: options.trimBlocks ?? true,
|
|
3106
3105
|
lstripBlocks: options.lstripBlocks ?? true
|
|
3107
3106
|
};
|
|
3108
|
-
|
|
3107
|
+
configure(configOptions);
|
|
3109
3108
|
}
|
|
3110
|
-
return
|
|
3109
|
+
return render2(filePath, data);
|
|
3111
3110
|
} catch (error) {
|
|
3112
3111
|
throw new Error(`Nunjucks file rendering failed: ${String(error)}`, {
|
|
3113
3112
|
cause: error
|
|
@@ -3121,7 +3120,508 @@ NunjucksService = _ts_decorate5([
|
|
|
3121
3120
|
_ts_metadata2("design:paramtypes", [])
|
|
3122
3121
|
], NunjucksService);
|
|
3123
3122
|
|
|
3124
|
-
// src/puppeteer/
|
|
3123
|
+
// src/puppeteer/engines/eta/eta.service.ts
|
|
3124
|
+
import { Injectable as Injectable6 } from "@nestjs/common";
|
|
3125
|
+
|
|
3126
|
+
// node_modules/.pnpm/eta@4.6.0/node_modules/eta/dist/index.mjs
|
|
3127
|
+
import * as fs from "fs";
|
|
3128
|
+
import * as path from "path";
|
|
3129
|
+
var EtaError = class extends Error {
|
|
3130
|
+
static {
|
|
3131
|
+
__name(this, "EtaError");
|
|
3132
|
+
}
|
|
3133
|
+
constructor(message) {
|
|
3134
|
+
super(message);
|
|
3135
|
+
this.name = "Eta Error";
|
|
3136
|
+
}
|
|
3137
|
+
};
|
|
3138
|
+
var EtaParseError = class extends EtaError {
|
|
3139
|
+
static {
|
|
3140
|
+
__name(this, "EtaParseError");
|
|
3141
|
+
}
|
|
3142
|
+
constructor(message) {
|
|
3143
|
+
super(message);
|
|
3144
|
+
this.name = "EtaParser Error";
|
|
3145
|
+
}
|
|
3146
|
+
};
|
|
3147
|
+
var EtaRuntimeError = class extends EtaError {
|
|
3148
|
+
static {
|
|
3149
|
+
__name(this, "EtaRuntimeError");
|
|
3150
|
+
}
|
|
3151
|
+
constructor(message) {
|
|
3152
|
+
super(message);
|
|
3153
|
+
this.name = "EtaRuntime Error";
|
|
3154
|
+
}
|
|
3155
|
+
};
|
|
3156
|
+
var EtaFileResolutionError = class extends EtaError {
|
|
3157
|
+
static {
|
|
3158
|
+
__name(this, "EtaFileResolutionError");
|
|
3159
|
+
}
|
|
3160
|
+
constructor(message) {
|
|
3161
|
+
super(message);
|
|
3162
|
+
this.name = "EtaFileResolution Error";
|
|
3163
|
+
}
|
|
3164
|
+
};
|
|
3165
|
+
var EtaNameResolutionError = class extends EtaError {
|
|
3166
|
+
static {
|
|
3167
|
+
__name(this, "EtaNameResolutionError");
|
|
3168
|
+
}
|
|
3169
|
+
constructor(message) {
|
|
3170
|
+
super(message);
|
|
3171
|
+
this.name = "EtaNameResolution Error";
|
|
3172
|
+
}
|
|
3173
|
+
};
|
|
3174
|
+
function ParseErr(message, str, indx) {
|
|
3175
|
+
const whitespace = str.slice(0, indx).split(/\n/);
|
|
3176
|
+
const lineNo = whitespace.length;
|
|
3177
|
+
const colNo = whitespace[lineNo - 1].length + 1;
|
|
3178
|
+
message += " at line " + lineNo + " col " + colNo + ":\n\n " + str.split(/\n/)[lineNo - 1] + "\n " + Array(colNo).join(" ") + "^";
|
|
3179
|
+
throw new EtaParseError(message);
|
|
3180
|
+
}
|
|
3181
|
+
__name(ParseErr, "ParseErr");
|
|
3182
|
+
function RuntimeErr(originalError, str, lineNo, path$1) {
|
|
3183
|
+
const lines = str.split("\n");
|
|
3184
|
+
const start = Math.max(lineNo - 3, 0);
|
|
3185
|
+
const end = Math.min(lines.length, lineNo + 3);
|
|
3186
|
+
const filename = path$1;
|
|
3187
|
+
const context = lines.slice(start, end).map((line, i) => {
|
|
3188
|
+
const curr = i + start + 1;
|
|
3189
|
+
return (curr === lineNo ? " >> " : " ") + curr + "| " + line;
|
|
3190
|
+
}).join("\n");
|
|
3191
|
+
const err = new EtaRuntimeError((filename ? filename + ":" + lineNo + "\n" : "line " + lineNo + "\n") + context + "\n\n" + originalError.message);
|
|
3192
|
+
err.name = originalError.name;
|
|
3193
|
+
err.cause = originalError;
|
|
3194
|
+
throw err;
|
|
3195
|
+
}
|
|
3196
|
+
__name(RuntimeErr, "RuntimeErr");
|
|
3197
|
+
function readFile(path$1) {
|
|
3198
|
+
let res = "";
|
|
3199
|
+
try {
|
|
3200
|
+
res = fs.readFileSync(path$1, "utf8");
|
|
3201
|
+
} catch (err) {
|
|
3202
|
+
if (err?.code === "ENOENT") throw new EtaFileResolutionError(`Could not find template: ${path$1}`);
|
|
3203
|
+
else throw err;
|
|
3204
|
+
}
|
|
3205
|
+
return res;
|
|
3206
|
+
}
|
|
3207
|
+
__name(readFile, "readFile");
|
|
3208
|
+
function resolvePath(templatePath, options) {
|
|
3209
|
+
let resolvedFilePath = "";
|
|
3210
|
+
const views = this.config.views;
|
|
3211
|
+
if (!views) throw new EtaFileResolutionError("Views directory is not defined");
|
|
3212
|
+
const baseFilePath = options?.filepath;
|
|
3213
|
+
const defaultExtension = this.config.defaultExtension === void 0 ? ".eta" : this.config.defaultExtension;
|
|
3214
|
+
const cacheIndex = JSON.stringify({
|
|
3215
|
+
filename: baseFilePath,
|
|
3216
|
+
path: templatePath,
|
|
3217
|
+
views: this.config.views
|
|
3218
|
+
});
|
|
3219
|
+
templatePath += path.extname(templatePath) ? "" : defaultExtension;
|
|
3220
|
+
if (baseFilePath) {
|
|
3221
|
+
if (this.config.cacheFilepaths && this.filepathCache[cacheIndex]) return this.filepathCache[cacheIndex];
|
|
3222
|
+
if (absolutePathRegExp.exec(templatePath)?.length) {
|
|
3223
|
+
const formattedPath = templatePath.replace(/^\/*|^\\*/, "");
|
|
3224
|
+
resolvedFilePath = path.join(views, formattedPath);
|
|
3225
|
+
} else resolvedFilePath = path.join(path.dirname(baseFilePath), templatePath);
|
|
3226
|
+
} else resolvedFilePath = path.join(views, templatePath);
|
|
3227
|
+
if (dirIsChild(views, resolvedFilePath)) {
|
|
3228
|
+
if (baseFilePath && this.config.cacheFilepaths) this.filepathCache[cacheIndex] = resolvedFilePath;
|
|
3229
|
+
return resolvedFilePath;
|
|
3230
|
+
} else throw new EtaFileResolutionError(`Template '${templatePath}' is not in the views directory`);
|
|
3231
|
+
}
|
|
3232
|
+
__name(resolvePath, "resolvePath");
|
|
3233
|
+
function dirIsChild(parent, dir) {
|
|
3234
|
+
const relative3 = path.relative(parent, dir);
|
|
3235
|
+
return relative3 && !relative3.startsWith("..") && !path.isAbsolute(relative3);
|
|
3236
|
+
}
|
|
3237
|
+
__name(dirIsChild, "dirIsChild");
|
|
3238
|
+
var absolutePathRegExp = /^\\|^\//;
|
|
3239
|
+
var AsyncFunction = (async () => {
|
|
3240
|
+
}).constructor;
|
|
3241
|
+
function compile2(str, options) {
|
|
3242
|
+
const config = this.config;
|
|
3243
|
+
const ctor = options?.async ? AsyncFunction : Function;
|
|
3244
|
+
try {
|
|
3245
|
+
return new ctor(config.varName, "options", this.compileToString.call(this, str, options));
|
|
3246
|
+
} catch (e) {
|
|
3247
|
+
if (e instanceof SyntaxError) throw new EtaParseError("Bad template syntax\n\n" + e.message + "\n" + Array(e.message.length + 1).join("=") + "\n" + this.compileToString.call(this, str, options) + "\n");
|
|
3248
|
+
else throw e;
|
|
3249
|
+
}
|
|
3250
|
+
}
|
|
3251
|
+
__name(compile2, "compile");
|
|
3252
|
+
function compileToString(str, options) {
|
|
3253
|
+
const config = this.config;
|
|
3254
|
+
const isAsync = options?.async;
|
|
3255
|
+
const compileBody$1 = this.compileBody;
|
|
3256
|
+
const buffer = this.parse.call(this, str);
|
|
3257
|
+
let res = `${config.functionHeader}
|
|
3258
|
+
let include = (__eta_t, __eta_d) => this.render(__eta_t, {...${config.varName}, ...(__eta_d ?? {})}, options);
|
|
3259
|
+
let includeAsync = (__eta_t, __eta_d) => this.renderAsync(__eta_t, {...${config.varName}, ...(__eta_d ?? {})}, options);
|
|
3260
|
+
|
|
3261
|
+
let __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction, blocks: {}${config.debug ? ', line: 1, templateStr: "' + str.replace(/\\|"/g, "\\$&").replace(/\r\n|\n|\r/g, "\\n") + '"' : ""}};
|
|
3262
|
+
|
|
3263
|
+
function layout(path, data) {
|
|
3264
|
+
__eta.layout = path;
|
|
3265
|
+
__eta.layoutData = data;
|
|
3266
|
+
}${config.debug ? "try {" : ""}${config.useWith ? "with(" + config.varName + "||{}){" : ""}
|
|
3267
|
+
|
|
3268
|
+
function ${config.outputFunctionName}(s){__eta.res+=s;}
|
|
3269
|
+
function capture(fn){const s=__eta.res;__eta.res='';try{fn();return __eta.res}finally{__eta.res=s;}}
|
|
3270
|
+
async function captureAsync(fn){const s=__eta.res;__eta.res='';try{await fn();return __eta.res}finally{__eta.res=s;}}
|
|
3271
|
+
function block(name,fn){if(__eta.layout){if(fn){__eta.blocks[name]=capture(fn);}return '';}const b=${config.varName}.__blocks||{};if(name in b){return b[name];}return fn?capture(fn):'';}
|
|
3272
|
+
async function blockAsync(name,fn){if(__eta.layout){if(fn){__eta.blocks[name]=await captureAsync(fn);}return '';}const b=${config.varName}.__blocks||{};if(name in b){return b[name];}return fn?await captureAsync(fn):'';}
|
|
3273
|
+
|
|
3274
|
+
${compileBody$1.call(this, buffer)}
|
|
3275
|
+
if (__eta.layout) {
|
|
3276
|
+
__eta.res = ${isAsync ? "await includeAsync" : "include"} (__eta.layout, {...${config.varName}, body: __eta.res, ...__eta.layoutData, __blocks: __eta.blocks});
|
|
3277
|
+
}
|
|
3278
|
+
${config.useWith ? "}" : ""}${config.debug ? "} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }" : ""}
|
|
3279
|
+
return __eta.res;
|
|
3280
|
+
`;
|
|
3281
|
+
if (config.plugins) for (let i = 0; i < config.plugins.length; i++) {
|
|
3282
|
+
const plugin = config.plugins[i];
|
|
3283
|
+
if (plugin.processFnString) res = plugin.processFnString(res, config);
|
|
3284
|
+
}
|
|
3285
|
+
return res;
|
|
3286
|
+
}
|
|
3287
|
+
__name(compileToString, "compileToString");
|
|
3288
|
+
function compileBody(buff) {
|
|
3289
|
+
const config = this.config;
|
|
3290
|
+
let i = 0;
|
|
3291
|
+
const buffLength = buff.length;
|
|
3292
|
+
let returnStr = "";
|
|
3293
|
+
for (; i < buffLength; i++) {
|
|
3294
|
+
const currentBlock = buff[i];
|
|
3295
|
+
if (typeof currentBlock === "string") returnStr += "__eta.res+='" + currentBlock + "';\n";
|
|
3296
|
+
else {
|
|
3297
|
+
const type = currentBlock.t;
|
|
3298
|
+
let content = currentBlock.val || "";
|
|
3299
|
+
if (config.debug) returnStr += "__eta.line=" + currentBlock.lineNo + "\n";
|
|
3300
|
+
if (type === "r") {
|
|
3301
|
+
if (config.autoFilter) content = "__eta.f(" + content + ")";
|
|
3302
|
+
returnStr += "__eta.res+=" + content + ";\n";
|
|
3303
|
+
} else if (type === "i") {
|
|
3304
|
+
if (config.autoFilter) content = "__eta.f(" + content + ")";
|
|
3305
|
+
if (config.autoEscape) content = "__eta.e(" + content + ")";
|
|
3306
|
+
returnStr += "__eta.res+=" + content + ";\n";
|
|
3307
|
+
} else if (type === "e") returnStr += content + "\n";
|
|
3308
|
+
else if (Object.hasOwn(config.customTags, type)) returnStr += `__eta.res+=this.config.customTags[${JSON.stringify(type)}](${JSON.stringify(content)},${config.varName});
|
|
3309
|
+
`;
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
return returnStr;
|
|
3313
|
+
}
|
|
3314
|
+
__name(compileBody, "compileBody");
|
|
3315
|
+
function trimWS(str, config, wsLeft, wsRight) {
|
|
3316
|
+
let leftTrim;
|
|
3317
|
+
let rightTrim;
|
|
3318
|
+
if (Array.isArray(config.autoTrim)) {
|
|
3319
|
+
leftTrim = config.autoTrim[1];
|
|
3320
|
+
rightTrim = config.autoTrim[0];
|
|
3321
|
+
} else leftTrim = rightTrim = config.autoTrim;
|
|
3322
|
+
if (wsLeft || wsLeft === false) leftTrim = wsLeft;
|
|
3323
|
+
if (wsRight || wsRight === false) rightTrim = wsRight;
|
|
3324
|
+
if (!rightTrim && !leftTrim) return str;
|
|
3325
|
+
if (leftTrim === "slurp" && rightTrim === "slurp") return str.trim();
|
|
3326
|
+
if (leftTrim === "_" || leftTrim === "slurp") str = str.trimStart();
|
|
3327
|
+
else if (leftTrim === "-" || leftTrim === "nl") str = str.replace(/^(?:\r\n|\n|\r)/, "");
|
|
3328
|
+
if (rightTrim === "_" || rightTrim === "slurp") str = str.trimEnd();
|
|
3329
|
+
else if (rightTrim === "-" || rightTrim === "nl") str = str.replace(/(?:\r\n|\n|\r)$/, "");
|
|
3330
|
+
return str;
|
|
3331
|
+
}
|
|
3332
|
+
__name(trimWS, "trimWS");
|
|
3333
|
+
var escMap = {
|
|
3334
|
+
"&": "&",
|
|
3335
|
+
"<": "<",
|
|
3336
|
+
">": ">",
|
|
3337
|
+
'"': """,
|
|
3338
|
+
"'": "'"
|
|
3339
|
+
};
|
|
3340
|
+
function replaceChar(s) {
|
|
3341
|
+
return escMap[s];
|
|
3342
|
+
}
|
|
3343
|
+
__name(replaceChar, "replaceChar");
|
|
3344
|
+
function XMLEscape(str) {
|
|
3345
|
+
const newStr = String(str);
|
|
3346
|
+
if (/[&<>"']/.test(newStr)) return newStr.replace(/[&<>"']/g, replaceChar);
|
|
3347
|
+
else return newStr;
|
|
3348
|
+
}
|
|
3349
|
+
__name(XMLEscape, "XMLEscape");
|
|
3350
|
+
var defaultConfig = {
|
|
3351
|
+
autoEscape: true,
|
|
3352
|
+
autoFilter: false,
|
|
3353
|
+
autoTrim: [false, "nl"],
|
|
3354
|
+
cache: false,
|
|
3355
|
+
cacheFilepaths: true,
|
|
3356
|
+
customTags: {},
|
|
3357
|
+
debug: false,
|
|
3358
|
+
escapeFunction: XMLEscape,
|
|
3359
|
+
filterFunction: /* @__PURE__ */ __name((val) => String(val), "filterFunction"),
|
|
3360
|
+
outputFunctionName: "output",
|
|
3361
|
+
functionHeader: "",
|
|
3362
|
+
parse: {
|
|
3363
|
+
exec: "",
|
|
3364
|
+
interpolate: "=",
|
|
3365
|
+
raw: "~"
|
|
3366
|
+
},
|
|
3367
|
+
plugins: [],
|
|
3368
|
+
rmWhitespace: false,
|
|
3369
|
+
tags: ["<%", "%>"],
|
|
3370
|
+
useWith: false,
|
|
3371
|
+
varName: "it",
|
|
3372
|
+
defaultExtension: ".eta"
|
|
3373
|
+
};
|
|
3374
|
+
var templateLitReg = /`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g;
|
|
3375
|
+
var singleQuoteReg = /'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g;
|
|
3376
|
+
var doubleQuoteReg = /"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;
|
|
3377
|
+
function escapeRegExp(string) {
|
|
3378
|
+
return string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&");
|
|
3379
|
+
}
|
|
3380
|
+
__name(escapeRegExp, "escapeRegExp");
|
|
3381
|
+
function getLineNo(str, index) {
|
|
3382
|
+
return str.slice(0, index).split("\n").length;
|
|
3383
|
+
}
|
|
3384
|
+
__name(getLineNo, "getLineNo");
|
|
3385
|
+
function parse(str) {
|
|
3386
|
+
const config = this.config;
|
|
3387
|
+
let buffer = [];
|
|
3388
|
+
let trimLeftOfNextStr = false;
|
|
3389
|
+
let lastIndex = 0;
|
|
3390
|
+
const parseOptions = config.parse;
|
|
3391
|
+
const customTagPrefixes = Object.keys(config.customTags);
|
|
3392
|
+
if (config.plugins) for (let i = 0; i < config.plugins.length; i++) {
|
|
3393
|
+
const plugin = config.plugins[i];
|
|
3394
|
+
if (plugin.processTemplate) str = plugin.processTemplate(str, config);
|
|
3395
|
+
}
|
|
3396
|
+
if (config.rmWhitespace) str = str.replace(/[\r\n]+/g, "\n").replace(/^\s+|\s+$/gm, "");
|
|
3397
|
+
templateLitReg.lastIndex = 0;
|
|
3398
|
+
singleQuoteReg.lastIndex = 0;
|
|
3399
|
+
doubleQuoteReg.lastIndex = 0;
|
|
3400
|
+
function pushString(strng, shouldTrimRightOfString) {
|
|
3401
|
+
if (strng) {
|
|
3402
|
+
strng = trimWS(strng, config, trimLeftOfNextStr, shouldTrimRightOfString);
|
|
3403
|
+
if (strng) {
|
|
3404
|
+
strng = strng.replace(/\\|'/g, "\\$&").replace(/\r\n|\n|\r/g, "\\n");
|
|
3405
|
+
buffer.push(strng);
|
|
3406
|
+
}
|
|
3407
|
+
}
|
|
3408
|
+
}
|
|
3409
|
+
__name(pushString, "pushString");
|
|
3410
|
+
const prefixes = [
|
|
3411
|
+
parseOptions.exec,
|
|
3412
|
+
parseOptions.interpolate,
|
|
3413
|
+
parseOptions.raw,
|
|
3414
|
+
...customTagPrefixes
|
|
3415
|
+
].reduce((accumulator, prefix) => {
|
|
3416
|
+
if (accumulator && prefix) return accumulator + "|" + escapeRegExp(prefix);
|
|
3417
|
+
else if (prefix) return escapeRegExp(prefix);
|
|
3418
|
+
else return accumulator;
|
|
3419
|
+
}, "");
|
|
3420
|
+
const parseOpenReg = new RegExp(escapeRegExp(config.tags[0]) + "(-|_)?\\s*(" + prefixes + ")?\\s*", "g");
|
|
3421
|
+
const parseCloseReg = new RegExp("'|\"|`|\\/\\*|(\\s*(-|_)?" + escapeRegExp(config.tags[1]) + ")", "g");
|
|
3422
|
+
let m;
|
|
3423
|
+
while (m = parseOpenReg.exec(str)) {
|
|
3424
|
+
const precedingString = str.slice(lastIndex, m.index);
|
|
3425
|
+
lastIndex = m[0].length + m.index;
|
|
3426
|
+
const wsLeft = m[1];
|
|
3427
|
+
const prefix = m[2] || "";
|
|
3428
|
+
pushString(precedingString, wsLeft);
|
|
3429
|
+
parseCloseReg.lastIndex = lastIndex;
|
|
3430
|
+
let closeTag;
|
|
3431
|
+
let currentObj = false;
|
|
3432
|
+
while (closeTag = parseCloseReg.exec(str)) if (closeTag[1]) {
|
|
3433
|
+
const content = str.slice(lastIndex, closeTag.index);
|
|
3434
|
+
parseOpenReg.lastIndex = lastIndex = parseCloseReg.lastIndex;
|
|
3435
|
+
trimLeftOfNextStr = closeTag[2];
|
|
3436
|
+
currentObj = {
|
|
3437
|
+
t: prefix === parseOptions.exec ? "e" : prefix === parseOptions.raw ? "r" : prefix === parseOptions.interpolate ? "i" : customTagPrefixes.includes(prefix) ? prefix : "",
|
|
3438
|
+
val: content
|
|
3439
|
+
};
|
|
3440
|
+
break;
|
|
3441
|
+
} else {
|
|
3442
|
+
const char = closeTag[0];
|
|
3443
|
+
if (char === "/*") {
|
|
3444
|
+
const commentCloseInd = str.indexOf("*/", parseCloseReg.lastIndex);
|
|
3445
|
+
if (commentCloseInd === -1) ParseErr("unclosed comment", str, closeTag.index);
|
|
3446
|
+
parseCloseReg.lastIndex = commentCloseInd;
|
|
3447
|
+
} else if (char === "'") {
|
|
3448
|
+
singleQuoteReg.lastIndex = closeTag.index;
|
|
3449
|
+
if (singleQuoteReg.exec(str)) parseCloseReg.lastIndex = singleQuoteReg.lastIndex;
|
|
3450
|
+
else ParseErr("unclosed string", str, closeTag.index);
|
|
3451
|
+
} else if (char === '"') {
|
|
3452
|
+
doubleQuoteReg.lastIndex = closeTag.index;
|
|
3453
|
+
if (doubleQuoteReg.exec(str)) parseCloseReg.lastIndex = doubleQuoteReg.lastIndex;
|
|
3454
|
+
else ParseErr("unclosed string", str, closeTag.index);
|
|
3455
|
+
} else if (char === "`") {
|
|
3456
|
+
templateLitReg.lastIndex = closeTag.index;
|
|
3457
|
+
if (templateLitReg.exec(str)) parseCloseReg.lastIndex = templateLitReg.lastIndex;
|
|
3458
|
+
else ParseErr("unclosed string", str, closeTag.index);
|
|
3459
|
+
}
|
|
3460
|
+
}
|
|
3461
|
+
if (currentObj) {
|
|
3462
|
+
if (config.debug) currentObj.lineNo = getLineNo(str, m.index);
|
|
3463
|
+
buffer.push(currentObj);
|
|
3464
|
+
} else ParseErr("unclosed tag", str, m.index);
|
|
3465
|
+
}
|
|
3466
|
+
pushString(str.slice(lastIndex, str.length), false);
|
|
3467
|
+
if (config.plugins) for (let i = 0; i < config.plugins.length; i++) {
|
|
3468
|
+
const plugin = config.plugins[i];
|
|
3469
|
+
if (plugin.processAST) buffer = plugin.processAST(buffer, config);
|
|
3470
|
+
}
|
|
3471
|
+
return buffer;
|
|
3472
|
+
}
|
|
3473
|
+
__name(parse, "parse");
|
|
3474
|
+
function handleCache(template, options) {
|
|
3475
|
+
const templateStore = options?.async ? this.templatesAsync : this.templatesSync;
|
|
3476
|
+
if (this.resolvePath && this.readFile && !template.startsWith("@")) {
|
|
3477
|
+
const templatePath = options.filepath;
|
|
3478
|
+
const cachedTemplate = templateStore.get(templatePath);
|
|
3479
|
+
if (this.config.cache && cachedTemplate) return cachedTemplate;
|
|
3480
|
+
else {
|
|
3481
|
+
const templateString = this.readFile(templatePath);
|
|
3482
|
+
const templateFn = this.compile(templateString, options);
|
|
3483
|
+
if (this.config.cache) templateStore.define(templatePath, templateFn);
|
|
3484
|
+
return templateFn;
|
|
3485
|
+
}
|
|
3486
|
+
} else {
|
|
3487
|
+
const cachedTemplate = templateStore.get(template);
|
|
3488
|
+
if (cachedTemplate) return cachedTemplate;
|
|
3489
|
+
else throw new EtaNameResolutionError(`Failed to get template '${template}'`);
|
|
3490
|
+
}
|
|
3491
|
+
}
|
|
3492
|
+
__name(handleCache, "handleCache");
|
|
3493
|
+
function render3(template, data, meta) {
|
|
3494
|
+
let templateFn;
|
|
3495
|
+
const options = {
|
|
3496
|
+
...meta,
|
|
3497
|
+
async: false
|
|
3498
|
+
};
|
|
3499
|
+
if (typeof template === "string") {
|
|
3500
|
+
if (this.resolvePath && this.readFile && !template.startsWith("@")) options.filepath = this.resolvePath(template, options);
|
|
3501
|
+
templateFn = handleCache.call(this, template, options);
|
|
3502
|
+
} else templateFn = template;
|
|
3503
|
+
return templateFn.call(this, data, options);
|
|
3504
|
+
}
|
|
3505
|
+
__name(render3, "render");
|
|
3506
|
+
function renderAsync(template, data, meta) {
|
|
3507
|
+
let templateFn;
|
|
3508
|
+
const options = {
|
|
3509
|
+
...meta,
|
|
3510
|
+
async: true
|
|
3511
|
+
};
|
|
3512
|
+
if (typeof template === "string") {
|
|
3513
|
+
if (this.resolvePath && this.readFile && !template.startsWith("@")) options.filepath = this.resolvePath(template, options);
|
|
3514
|
+
templateFn = handleCache.call(this, template, options);
|
|
3515
|
+
} else templateFn = template;
|
|
3516
|
+
const res = templateFn.call(this, data, options);
|
|
3517
|
+
return Promise.resolve(res);
|
|
3518
|
+
}
|
|
3519
|
+
__name(renderAsync, "renderAsync");
|
|
3520
|
+
function renderString2(template, data) {
|
|
3521
|
+
const templateFn = this.compile(template, { async: false });
|
|
3522
|
+
return render3.call(this, templateFn, data);
|
|
3523
|
+
}
|
|
3524
|
+
__name(renderString2, "renderString");
|
|
3525
|
+
function renderStringAsync(template, data) {
|
|
3526
|
+
const templateFn = this.compile(template, { async: true });
|
|
3527
|
+
return renderAsync.call(this, templateFn, data);
|
|
3528
|
+
}
|
|
3529
|
+
__name(renderStringAsync, "renderStringAsync");
|
|
3530
|
+
var Cacher = class {
|
|
3531
|
+
static {
|
|
3532
|
+
__name(this, "Cacher");
|
|
3533
|
+
}
|
|
3534
|
+
constructor(cache) {
|
|
3535
|
+
this.cache = cache;
|
|
3536
|
+
}
|
|
3537
|
+
define(key, val) {
|
|
3538
|
+
this.cache[key] = val;
|
|
3539
|
+
}
|
|
3540
|
+
get(key) {
|
|
3541
|
+
return this.cache[key];
|
|
3542
|
+
}
|
|
3543
|
+
remove(key) {
|
|
3544
|
+
delete this.cache[key];
|
|
3545
|
+
}
|
|
3546
|
+
reset() {
|
|
3547
|
+
this.cache = {};
|
|
3548
|
+
}
|
|
3549
|
+
load(cacheObj) {
|
|
3550
|
+
this.cache = {
|
|
3551
|
+
...this.cache,
|
|
3552
|
+
...cacheObj
|
|
3553
|
+
};
|
|
3554
|
+
}
|
|
3555
|
+
};
|
|
3556
|
+
var Eta$1 = class {
|
|
3557
|
+
static {
|
|
3558
|
+
__name(this, "Eta$1");
|
|
3559
|
+
}
|
|
3560
|
+
constructor(customConfig) {
|
|
3561
|
+
if (customConfig) this.config = {
|
|
3562
|
+
...defaultConfig,
|
|
3563
|
+
...customConfig
|
|
3564
|
+
};
|
|
3565
|
+
else this.config = { ...defaultConfig };
|
|
3566
|
+
const reserved = [
|
|
3567
|
+
this.config.parse.exec,
|
|
3568
|
+
this.config.parse.interpolate,
|
|
3569
|
+
this.config.parse.raw,
|
|
3570
|
+
"-",
|
|
3571
|
+
"_"
|
|
3572
|
+
];
|
|
3573
|
+
for (const prefix of Object.keys(this.config.customTags)) if (reserved.includes(prefix)) throw new EtaError(`Custom tag prefix "${prefix}" conflicts with a built-in prefix`);
|
|
3574
|
+
}
|
|
3575
|
+
config;
|
|
3576
|
+
RuntimeErr = RuntimeErr;
|
|
3577
|
+
compile = compile2;
|
|
3578
|
+
compileToString = compileToString;
|
|
3579
|
+
compileBody = compileBody;
|
|
3580
|
+
parse = parse;
|
|
3581
|
+
render = render3;
|
|
3582
|
+
renderAsync = renderAsync;
|
|
3583
|
+
renderString = renderString2;
|
|
3584
|
+
renderStringAsync = renderStringAsync;
|
|
3585
|
+
filepathCache = {};
|
|
3586
|
+
templatesSync = new Cacher({});
|
|
3587
|
+
templatesAsync = new Cacher({});
|
|
3588
|
+
resolvePath = null;
|
|
3589
|
+
readFile = null;
|
|
3590
|
+
configure(customConfig) {
|
|
3591
|
+
this.config = {
|
|
3592
|
+
...this.config,
|
|
3593
|
+
...customConfig
|
|
3594
|
+
};
|
|
3595
|
+
}
|
|
3596
|
+
withConfig(customConfig) {
|
|
3597
|
+
return {
|
|
3598
|
+
...this,
|
|
3599
|
+
config: {
|
|
3600
|
+
...this.config,
|
|
3601
|
+
...customConfig
|
|
3602
|
+
}
|
|
3603
|
+
};
|
|
3604
|
+
}
|
|
3605
|
+
loadTemplate(name, template, options) {
|
|
3606
|
+
if (typeof template === "string") (options?.async ? this.templatesAsync : this.templatesSync).define(name, this.compile(template, options));
|
|
3607
|
+
else {
|
|
3608
|
+
let templates = this.templatesSync;
|
|
3609
|
+
if (template.constructor.name === "AsyncFunction" || options?.async) templates = this.templatesAsync;
|
|
3610
|
+
templates.define(name, template);
|
|
3611
|
+
}
|
|
3612
|
+
}
|
|
3613
|
+
};
|
|
3614
|
+
var Eta = class extends Eta$1 {
|
|
3615
|
+
static {
|
|
3616
|
+
__name(this, "Eta");
|
|
3617
|
+
}
|
|
3618
|
+
readFile = readFile;
|
|
3619
|
+
resolvePath = resolvePath;
|
|
3620
|
+
};
|
|
3621
|
+
|
|
3622
|
+
// src/puppeteer/engines/eta/eta.service.ts
|
|
3623
|
+
import { resolve as resolve2 } from "path";
|
|
3624
|
+
import { readFileSync as readFileSync5 } from "fs";
|
|
3125
3625
|
function _ts_decorate6(decorators, target, key, desc) {
|
|
3126
3626
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3127
3627
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3133,6 +3633,655 @@ function _ts_metadata3(k, v) {
|
|
|
3133
3633
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3134
3634
|
}
|
|
3135
3635
|
__name(_ts_metadata3, "_ts_metadata");
|
|
3636
|
+
var EtaService = class {
|
|
3637
|
+
static {
|
|
3638
|
+
__name(this, "EtaService");
|
|
3639
|
+
}
|
|
3640
|
+
eta;
|
|
3641
|
+
templateCache = /* @__PURE__ */ new Map();
|
|
3642
|
+
maxCacheSize = 100;
|
|
3643
|
+
constructor() {
|
|
3644
|
+
this.eta = new Eta({
|
|
3645
|
+
cache: true,
|
|
3646
|
+
autoEscape: true,
|
|
3647
|
+
useWith: true
|
|
3648
|
+
});
|
|
3649
|
+
}
|
|
3650
|
+
/**
|
|
3651
|
+
* Render an Eta template from a string
|
|
3652
|
+
* @param template The template string to render
|
|
3653
|
+
* @param data The data object to use for rendering
|
|
3654
|
+
* @param options Optional Eta rendering options
|
|
3655
|
+
* @returns The rendered HTML string
|
|
3656
|
+
*/
|
|
3657
|
+
render(template, data = {}, options) {
|
|
3658
|
+
try {
|
|
3659
|
+
const eta = options && Object.keys(options).length > 0 ? new Eta({
|
|
3660
|
+
cache: true,
|
|
3661
|
+
autoEscape: true,
|
|
3662
|
+
useWith: true,
|
|
3663
|
+
...options,
|
|
3664
|
+
varName: options.varName ?? "it"
|
|
3665
|
+
}) : this.eta;
|
|
3666
|
+
return eta.renderString(template, data);
|
|
3667
|
+
} catch (error) {
|
|
3668
|
+
throw new Error(`Eta rendering failed: ${String(error)}`, {
|
|
3669
|
+
cause: error
|
|
3670
|
+
});
|
|
3671
|
+
}
|
|
3672
|
+
}
|
|
3673
|
+
/**
|
|
3674
|
+
* Render an Eta template from a file
|
|
3675
|
+
* @param filePath The path to the template file
|
|
3676
|
+
* @param data The data object to use for rendering
|
|
3677
|
+
* @param options Optional Eta rendering options
|
|
3678
|
+
* @returns The rendered HTML string
|
|
3679
|
+
*/
|
|
3680
|
+
renderFile(filePath, data = {}, options) {
|
|
3681
|
+
try {
|
|
3682
|
+
const resolvedPath = resolve2(filePath);
|
|
3683
|
+
const useCache = options?.cache ?? true;
|
|
3684
|
+
let template = useCache ? this.templateCache.get(resolvedPath) : void 0;
|
|
3685
|
+
if (!template) {
|
|
3686
|
+
template = readFileSync5(resolvedPath, "utf-8");
|
|
3687
|
+
if (useCache && this.templateCache.size < this.maxCacheSize) {
|
|
3688
|
+
this.templateCache.set(resolvedPath, template);
|
|
3689
|
+
}
|
|
3690
|
+
}
|
|
3691
|
+
return this.render(template, data, options);
|
|
3692
|
+
} catch (error) {
|
|
3693
|
+
throw new Error(`Eta file rendering failed for ${filePath}: ${String(error)}`, {
|
|
3694
|
+
cause: error
|
|
3695
|
+
});
|
|
3696
|
+
}
|
|
3697
|
+
}
|
|
3698
|
+
/**
|
|
3699
|
+
* Clear the template cache
|
|
3700
|
+
*/
|
|
3701
|
+
clearCache() {
|
|
3702
|
+
this.templateCache.clear();
|
|
3703
|
+
}
|
|
3704
|
+
/**
|
|
3705
|
+
* Get the current cache size
|
|
3706
|
+
* @returns The number of cached templates
|
|
3707
|
+
*/
|
|
3708
|
+
getCacheSize() {
|
|
3709
|
+
return this.templateCache.size;
|
|
3710
|
+
}
|
|
3711
|
+
};
|
|
3712
|
+
EtaService = _ts_decorate6([
|
|
3713
|
+
Injectable6(),
|
|
3714
|
+
_ts_metadata3("design:type", Function),
|
|
3715
|
+
_ts_metadata3("design:paramtypes", [])
|
|
3716
|
+
], EtaService);
|
|
3717
|
+
|
|
3718
|
+
// src/puppeteer/engines/mustache/mustache.service.ts
|
|
3719
|
+
import { Injectable as Injectable7 } from "@nestjs/common";
|
|
3720
|
+
|
|
3721
|
+
// node_modules/.pnpm/mustache@4.2.0/node_modules/mustache/mustache.mjs
|
|
3722
|
+
var objectToString = Object.prototype.toString;
|
|
3723
|
+
var isArray = Array.isArray || /* @__PURE__ */ __name(function isArrayPolyfill(object) {
|
|
3724
|
+
return objectToString.call(object) === "[object Array]";
|
|
3725
|
+
}, "isArrayPolyfill");
|
|
3726
|
+
function isFunction(object) {
|
|
3727
|
+
return typeof object === "function";
|
|
3728
|
+
}
|
|
3729
|
+
__name(isFunction, "isFunction");
|
|
3730
|
+
function typeStr(obj) {
|
|
3731
|
+
return isArray(obj) ? "array" : typeof obj;
|
|
3732
|
+
}
|
|
3733
|
+
__name(typeStr, "typeStr");
|
|
3734
|
+
function escapeRegExp2(string) {
|
|
3735
|
+
return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
3736
|
+
}
|
|
3737
|
+
__name(escapeRegExp2, "escapeRegExp");
|
|
3738
|
+
function hasProperty(obj, propName) {
|
|
3739
|
+
return obj != null && typeof obj === "object" && propName in obj;
|
|
3740
|
+
}
|
|
3741
|
+
__name(hasProperty, "hasProperty");
|
|
3742
|
+
function primitiveHasOwnProperty(primitive, propName) {
|
|
3743
|
+
return primitive != null && typeof primitive !== "object" && primitive.hasOwnProperty && primitive.hasOwnProperty(propName);
|
|
3744
|
+
}
|
|
3745
|
+
__name(primitiveHasOwnProperty, "primitiveHasOwnProperty");
|
|
3746
|
+
var regExpTest = RegExp.prototype.test;
|
|
3747
|
+
function testRegExp(re, string) {
|
|
3748
|
+
return regExpTest.call(re, string);
|
|
3749
|
+
}
|
|
3750
|
+
__name(testRegExp, "testRegExp");
|
|
3751
|
+
var nonSpaceRe = /\S/;
|
|
3752
|
+
function isWhitespace(string) {
|
|
3753
|
+
return !testRegExp(nonSpaceRe, string);
|
|
3754
|
+
}
|
|
3755
|
+
__name(isWhitespace, "isWhitespace");
|
|
3756
|
+
var entityMap = {
|
|
3757
|
+
"&": "&",
|
|
3758
|
+
"<": "<",
|
|
3759
|
+
">": ">",
|
|
3760
|
+
'"': """,
|
|
3761
|
+
"'": "'",
|
|
3762
|
+
"/": "/",
|
|
3763
|
+
"`": "`",
|
|
3764
|
+
"=": "="
|
|
3765
|
+
};
|
|
3766
|
+
function escapeHtml(string) {
|
|
3767
|
+
return String(string).replace(/[&<>"'`=\/]/g, /* @__PURE__ */ __name(function fromEntityMap(s) {
|
|
3768
|
+
return entityMap[s];
|
|
3769
|
+
}, "fromEntityMap"));
|
|
3770
|
+
}
|
|
3771
|
+
__name(escapeHtml, "escapeHtml");
|
|
3772
|
+
var whiteRe = /\s*/;
|
|
3773
|
+
var spaceRe = /\s+/;
|
|
3774
|
+
var equalsRe = /\s*=/;
|
|
3775
|
+
var curlyRe = /\s*\}/;
|
|
3776
|
+
var tagRe = /#|\^|\/|>|\{|&|=|!/;
|
|
3777
|
+
function parseTemplate(template, tags) {
|
|
3778
|
+
if (!template)
|
|
3779
|
+
return [];
|
|
3780
|
+
var lineHasNonSpace = false;
|
|
3781
|
+
var sections = [];
|
|
3782
|
+
var tokens = [];
|
|
3783
|
+
var spaces = [];
|
|
3784
|
+
var hasTag = false;
|
|
3785
|
+
var nonSpace = false;
|
|
3786
|
+
var indentation = "";
|
|
3787
|
+
var tagIndex = 0;
|
|
3788
|
+
function stripSpace() {
|
|
3789
|
+
if (hasTag && !nonSpace) {
|
|
3790
|
+
while (spaces.length)
|
|
3791
|
+
delete tokens[spaces.pop()];
|
|
3792
|
+
} else {
|
|
3793
|
+
spaces = [];
|
|
3794
|
+
}
|
|
3795
|
+
hasTag = false;
|
|
3796
|
+
nonSpace = false;
|
|
3797
|
+
}
|
|
3798
|
+
__name(stripSpace, "stripSpace");
|
|
3799
|
+
var openingTagRe, closingTagRe, closingCurlyRe;
|
|
3800
|
+
function compileTags(tagsToCompile) {
|
|
3801
|
+
if (typeof tagsToCompile === "string")
|
|
3802
|
+
tagsToCompile = tagsToCompile.split(spaceRe, 2);
|
|
3803
|
+
if (!isArray(tagsToCompile) || tagsToCompile.length !== 2)
|
|
3804
|
+
throw new Error("Invalid tags: " + tagsToCompile);
|
|
3805
|
+
openingTagRe = new RegExp(escapeRegExp2(tagsToCompile[0]) + "\\s*");
|
|
3806
|
+
closingTagRe = new RegExp("\\s*" + escapeRegExp2(tagsToCompile[1]));
|
|
3807
|
+
closingCurlyRe = new RegExp("\\s*" + escapeRegExp2("}" + tagsToCompile[1]));
|
|
3808
|
+
}
|
|
3809
|
+
__name(compileTags, "compileTags");
|
|
3810
|
+
compileTags(tags || mustache.tags);
|
|
3811
|
+
var scanner = new Scanner(template);
|
|
3812
|
+
var start, type, value, chr, token, openSection;
|
|
3813
|
+
while (!scanner.eos()) {
|
|
3814
|
+
start = scanner.pos;
|
|
3815
|
+
value = scanner.scanUntil(openingTagRe);
|
|
3816
|
+
if (value) {
|
|
3817
|
+
for (var i = 0, valueLength = value.length; i < valueLength; ++i) {
|
|
3818
|
+
chr = value.charAt(i);
|
|
3819
|
+
if (isWhitespace(chr)) {
|
|
3820
|
+
spaces.push(tokens.length);
|
|
3821
|
+
indentation += chr;
|
|
3822
|
+
} else {
|
|
3823
|
+
nonSpace = true;
|
|
3824
|
+
lineHasNonSpace = true;
|
|
3825
|
+
indentation += " ";
|
|
3826
|
+
}
|
|
3827
|
+
tokens.push(["text", chr, start, start + 1]);
|
|
3828
|
+
start += 1;
|
|
3829
|
+
if (chr === "\n") {
|
|
3830
|
+
stripSpace();
|
|
3831
|
+
indentation = "";
|
|
3832
|
+
tagIndex = 0;
|
|
3833
|
+
lineHasNonSpace = false;
|
|
3834
|
+
}
|
|
3835
|
+
}
|
|
3836
|
+
}
|
|
3837
|
+
if (!scanner.scan(openingTagRe))
|
|
3838
|
+
break;
|
|
3839
|
+
hasTag = true;
|
|
3840
|
+
type = scanner.scan(tagRe) || "name";
|
|
3841
|
+
scanner.scan(whiteRe);
|
|
3842
|
+
if (type === "=") {
|
|
3843
|
+
value = scanner.scanUntil(equalsRe);
|
|
3844
|
+
scanner.scan(equalsRe);
|
|
3845
|
+
scanner.scanUntil(closingTagRe);
|
|
3846
|
+
} else if (type === "{") {
|
|
3847
|
+
value = scanner.scanUntil(closingCurlyRe);
|
|
3848
|
+
scanner.scan(curlyRe);
|
|
3849
|
+
scanner.scanUntil(closingTagRe);
|
|
3850
|
+
type = "&";
|
|
3851
|
+
} else {
|
|
3852
|
+
value = scanner.scanUntil(closingTagRe);
|
|
3853
|
+
}
|
|
3854
|
+
if (!scanner.scan(closingTagRe))
|
|
3855
|
+
throw new Error("Unclosed tag at " + scanner.pos);
|
|
3856
|
+
if (type == ">") {
|
|
3857
|
+
token = [type, value, start, scanner.pos, indentation, tagIndex, lineHasNonSpace];
|
|
3858
|
+
} else {
|
|
3859
|
+
token = [type, value, start, scanner.pos];
|
|
3860
|
+
}
|
|
3861
|
+
tagIndex++;
|
|
3862
|
+
tokens.push(token);
|
|
3863
|
+
if (type === "#" || type === "^") {
|
|
3864
|
+
sections.push(token);
|
|
3865
|
+
} else if (type === "/") {
|
|
3866
|
+
openSection = sections.pop();
|
|
3867
|
+
if (!openSection)
|
|
3868
|
+
throw new Error('Unopened section "' + value + '" at ' + start);
|
|
3869
|
+
if (openSection[1] !== value)
|
|
3870
|
+
throw new Error('Unclosed section "' + openSection[1] + '" at ' + start);
|
|
3871
|
+
} else if (type === "name" || type === "{" || type === "&") {
|
|
3872
|
+
nonSpace = true;
|
|
3873
|
+
} else if (type === "=") {
|
|
3874
|
+
compileTags(value);
|
|
3875
|
+
}
|
|
3876
|
+
}
|
|
3877
|
+
stripSpace();
|
|
3878
|
+
openSection = sections.pop();
|
|
3879
|
+
if (openSection)
|
|
3880
|
+
throw new Error('Unclosed section "' + openSection[1] + '" at ' + scanner.pos);
|
|
3881
|
+
return nestTokens(squashTokens(tokens));
|
|
3882
|
+
}
|
|
3883
|
+
__name(parseTemplate, "parseTemplate");
|
|
3884
|
+
function squashTokens(tokens) {
|
|
3885
|
+
var squashedTokens = [];
|
|
3886
|
+
var token, lastToken;
|
|
3887
|
+
for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
|
|
3888
|
+
token = tokens[i];
|
|
3889
|
+
if (token) {
|
|
3890
|
+
if (token[0] === "text" && lastToken && lastToken[0] === "text") {
|
|
3891
|
+
lastToken[1] += token[1];
|
|
3892
|
+
lastToken[3] = token[3];
|
|
3893
|
+
} else {
|
|
3894
|
+
squashedTokens.push(token);
|
|
3895
|
+
lastToken = token;
|
|
3896
|
+
}
|
|
3897
|
+
}
|
|
3898
|
+
}
|
|
3899
|
+
return squashedTokens;
|
|
3900
|
+
}
|
|
3901
|
+
__name(squashTokens, "squashTokens");
|
|
3902
|
+
function nestTokens(tokens) {
|
|
3903
|
+
var nestedTokens = [];
|
|
3904
|
+
var collector = nestedTokens;
|
|
3905
|
+
var sections = [];
|
|
3906
|
+
var token, section;
|
|
3907
|
+
for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
|
|
3908
|
+
token = tokens[i];
|
|
3909
|
+
switch (token[0]) {
|
|
3910
|
+
case "#":
|
|
3911
|
+
case "^":
|
|
3912
|
+
collector.push(token);
|
|
3913
|
+
sections.push(token);
|
|
3914
|
+
collector = token[4] = [];
|
|
3915
|
+
break;
|
|
3916
|
+
case "/":
|
|
3917
|
+
section = sections.pop();
|
|
3918
|
+
section[5] = token[2];
|
|
3919
|
+
collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;
|
|
3920
|
+
break;
|
|
3921
|
+
default:
|
|
3922
|
+
collector.push(token);
|
|
3923
|
+
}
|
|
3924
|
+
}
|
|
3925
|
+
return nestedTokens;
|
|
3926
|
+
}
|
|
3927
|
+
__name(nestTokens, "nestTokens");
|
|
3928
|
+
function Scanner(string) {
|
|
3929
|
+
this.string = string;
|
|
3930
|
+
this.tail = string;
|
|
3931
|
+
this.pos = 0;
|
|
3932
|
+
}
|
|
3933
|
+
__name(Scanner, "Scanner");
|
|
3934
|
+
Scanner.prototype.eos = /* @__PURE__ */ __name(function eos() {
|
|
3935
|
+
return this.tail === "";
|
|
3936
|
+
}, "eos");
|
|
3937
|
+
Scanner.prototype.scan = /* @__PURE__ */ __name(function scan(re) {
|
|
3938
|
+
var match = this.tail.match(re);
|
|
3939
|
+
if (!match || match.index !== 0)
|
|
3940
|
+
return "";
|
|
3941
|
+
var string = match[0];
|
|
3942
|
+
this.tail = this.tail.substring(string.length);
|
|
3943
|
+
this.pos += string.length;
|
|
3944
|
+
return string;
|
|
3945
|
+
}, "scan");
|
|
3946
|
+
Scanner.prototype.scanUntil = /* @__PURE__ */ __name(function scanUntil(re) {
|
|
3947
|
+
var index = this.tail.search(re), match;
|
|
3948
|
+
switch (index) {
|
|
3949
|
+
case -1:
|
|
3950
|
+
match = this.tail;
|
|
3951
|
+
this.tail = "";
|
|
3952
|
+
break;
|
|
3953
|
+
case 0:
|
|
3954
|
+
match = "";
|
|
3955
|
+
break;
|
|
3956
|
+
default:
|
|
3957
|
+
match = this.tail.substring(0, index);
|
|
3958
|
+
this.tail = this.tail.substring(index);
|
|
3959
|
+
}
|
|
3960
|
+
this.pos += match.length;
|
|
3961
|
+
return match;
|
|
3962
|
+
}, "scanUntil");
|
|
3963
|
+
function Context(view, parentContext) {
|
|
3964
|
+
this.view = view;
|
|
3965
|
+
this.cache = { ".": this.view };
|
|
3966
|
+
this.parent = parentContext;
|
|
3967
|
+
}
|
|
3968
|
+
__name(Context, "Context");
|
|
3969
|
+
Context.prototype.push = /* @__PURE__ */ __name(function push(view) {
|
|
3970
|
+
return new Context(view, this);
|
|
3971
|
+
}, "push");
|
|
3972
|
+
Context.prototype.lookup = /* @__PURE__ */ __name(function lookup(name) {
|
|
3973
|
+
var cache = this.cache;
|
|
3974
|
+
var value;
|
|
3975
|
+
if (cache.hasOwnProperty(name)) {
|
|
3976
|
+
value = cache[name];
|
|
3977
|
+
} else {
|
|
3978
|
+
var context = this, intermediateValue, names, index, lookupHit = false;
|
|
3979
|
+
while (context) {
|
|
3980
|
+
if (name.indexOf(".") > 0) {
|
|
3981
|
+
intermediateValue = context.view;
|
|
3982
|
+
names = name.split(".");
|
|
3983
|
+
index = 0;
|
|
3984
|
+
while (intermediateValue != null && index < names.length) {
|
|
3985
|
+
if (index === names.length - 1)
|
|
3986
|
+
lookupHit = hasProperty(intermediateValue, names[index]) || primitiveHasOwnProperty(intermediateValue, names[index]);
|
|
3987
|
+
intermediateValue = intermediateValue[names[index++]];
|
|
3988
|
+
}
|
|
3989
|
+
} else {
|
|
3990
|
+
intermediateValue = context.view[name];
|
|
3991
|
+
lookupHit = hasProperty(context.view, name);
|
|
3992
|
+
}
|
|
3993
|
+
if (lookupHit) {
|
|
3994
|
+
value = intermediateValue;
|
|
3995
|
+
break;
|
|
3996
|
+
}
|
|
3997
|
+
context = context.parent;
|
|
3998
|
+
}
|
|
3999
|
+
cache[name] = value;
|
|
4000
|
+
}
|
|
4001
|
+
if (isFunction(value))
|
|
4002
|
+
value = value.call(this.view);
|
|
4003
|
+
return value;
|
|
4004
|
+
}, "lookup");
|
|
4005
|
+
function Writer() {
|
|
4006
|
+
this.templateCache = {
|
|
4007
|
+
_cache: {},
|
|
4008
|
+
set: /* @__PURE__ */ __name(function set(key, value) {
|
|
4009
|
+
this._cache[key] = value;
|
|
4010
|
+
}, "set"),
|
|
4011
|
+
get: /* @__PURE__ */ __name(function get(key) {
|
|
4012
|
+
return this._cache[key];
|
|
4013
|
+
}, "get"),
|
|
4014
|
+
clear: /* @__PURE__ */ __name(function clear() {
|
|
4015
|
+
this._cache = {};
|
|
4016
|
+
}, "clear")
|
|
4017
|
+
};
|
|
4018
|
+
}
|
|
4019
|
+
__name(Writer, "Writer");
|
|
4020
|
+
Writer.prototype.clearCache = /* @__PURE__ */ __name(function clearCache() {
|
|
4021
|
+
if (typeof this.templateCache !== "undefined") {
|
|
4022
|
+
this.templateCache.clear();
|
|
4023
|
+
}
|
|
4024
|
+
}, "clearCache");
|
|
4025
|
+
Writer.prototype.parse = /* @__PURE__ */ __name(function parse2(template, tags) {
|
|
4026
|
+
var cache = this.templateCache;
|
|
4027
|
+
var cacheKey = template + ":" + (tags || mustache.tags).join(":");
|
|
4028
|
+
var isCacheEnabled = typeof cache !== "undefined";
|
|
4029
|
+
var tokens = isCacheEnabled ? cache.get(cacheKey) : void 0;
|
|
4030
|
+
if (tokens == void 0) {
|
|
4031
|
+
tokens = parseTemplate(template, tags);
|
|
4032
|
+
isCacheEnabled && cache.set(cacheKey, tokens);
|
|
4033
|
+
}
|
|
4034
|
+
return tokens;
|
|
4035
|
+
}, "parse");
|
|
4036
|
+
Writer.prototype.render = /* @__PURE__ */ __name(function render4(template, view, partials, config) {
|
|
4037
|
+
var tags = this.getConfigTags(config);
|
|
4038
|
+
var tokens = this.parse(template, tags);
|
|
4039
|
+
var context = view instanceof Context ? view : new Context(view, void 0);
|
|
4040
|
+
return this.renderTokens(tokens, context, partials, template, config);
|
|
4041
|
+
}, "render");
|
|
4042
|
+
Writer.prototype.renderTokens = /* @__PURE__ */ __name(function renderTokens(tokens, context, partials, originalTemplate, config) {
|
|
4043
|
+
var buffer = "";
|
|
4044
|
+
var token, symbol, value;
|
|
4045
|
+
for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
|
|
4046
|
+
value = void 0;
|
|
4047
|
+
token = tokens[i];
|
|
4048
|
+
symbol = token[0];
|
|
4049
|
+
if (symbol === "#") value = this.renderSection(token, context, partials, originalTemplate, config);
|
|
4050
|
+
else if (symbol === "^") value = this.renderInverted(token, context, partials, originalTemplate, config);
|
|
4051
|
+
else if (symbol === ">") value = this.renderPartial(token, context, partials, config);
|
|
4052
|
+
else if (symbol === "&") value = this.unescapedValue(token, context);
|
|
4053
|
+
else if (symbol === "name") value = this.escapedValue(token, context, config);
|
|
4054
|
+
else if (symbol === "text") value = this.rawValue(token);
|
|
4055
|
+
if (value !== void 0)
|
|
4056
|
+
buffer += value;
|
|
4057
|
+
}
|
|
4058
|
+
return buffer;
|
|
4059
|
+
}, "renderTokens");
|
|
4060
|
+
Writer.prototype.renderSection = /* @__PURE__ */ __name(function renderSection(token, context, partials, originalTemplate, config) {
|
|
4061
|
+
var self2 = this;
|
|
4062
|
+
var buffer = "";
|
|
4063
|
+
var value = context.lookup(token[1]);
|
|
4064
|
+
function subRender(template) {
|
|
4065
|
+
return self2.render(template, context, partials, config);
|
|
4066
|
+
}
|
|
4067
|
+
__name(subRender, "subRender");
|
|
4068
|
+
if (!value) return;
|
|
4069
|
+
if (isArray(value)) {
|
|
4070
|
+
for (var j = 0, valueLength = value.length; j < valueLength; ++j) {
|
|
4071
|
+
buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate, config);
|
|
4072
|
+
}
|
|
4073
|
+
} else if (typeof value === "object" || typeof value === "string" || typeof value === "number") {
|
|
4074
|
+
buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate, config);
|
|
4075
|
+
} else if (isFunction(value)) {
|
|
4076
|
+
if (typeof originalTemplate !== "string")
|
|
4077
|
+
throw new Error("Cannot use higher-order sections without the original template");
|
|
4078
|
+
value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);
|
|
4079
|
+
if (value != null)
|
|
4080
|
+
buffer += value;
|
|
4081
|
+
} else {
|
|
4082
|
+
buffer += this.renderTokens(token[4], context, partials, originalTemplate, config);
|
|
4083
|
+
}
|
|
4084
|
+
return buffer;
|
|
4085
|
+
}, "renderSection");
|
|
4086
|
+
Writer.prototype.renderInverted = /* @__PURE__ */ __name(function renderInverted(token, context, partials, originalTemplate, config) {
|
|
4087
|
+
var value = context.lookup(token[1]);
|
|
4088
|
+
if (!value || isArray(value) && value.length === 0)
|
|
4089
|
+
return this.renderTokens(token[4], context, partials, originalTemplate, config);
|
|
4090
|
+
}, "renderInverted");
|
|
4091
|
+
Writer.prototype.indentPartial = /* @__PURE__ */ __name(function indentPartial(partial, indentation, lineHasNonSpace) {
|
|
4092
|
+
var filteredIndentation = indentation.replace(/[^ \t]/g, "");
|
|
4093
|
+
var partialByNl = partial.split("\n");
|
|
4094
|
+
for (var i = 0; i < partialByNl.length; i++) {
|
|
4095
|
+
if (partialByNl[i].length && (i > 0 || !lineHasNonSpace)) {
|
|
4096
|
+
partialByNl[i] = filteredIndentation + partialByNl[i];
|
|
4097
|
+
}
|
|
4098
|
+
}
|
|
4099
|
+
return partialByNl.join("\n");
|
|
4100
|
+
}, "indentPartial");
|
|
4101
|
+
Writer.prototype.renderPartial = /* @__PURE__ */ __name(function renderPartial(token, context, partials, config) {
|
|
4102
|
+
if (!partials) return;
|
|
4103
|
+
var tags = this.getConfigTags(config);
|
|
4104
|
+
var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];
|
|
4105
|
+
if (value != null) {
|
|
4106
|
+
var lineHasNonSpace = token[6];
|
|
4107
|
+
var tagIndex = token[5];
|
|
4108
|
+
var indentation = token[4];
|
|
4109
|
+
var indentedValue = value;
|
|
4110
|
+
if (tagIndex == 0 && indentation) {
|
|
4111
|
+
indentedValue = this.indentPartial(value, indentation, lineHasNonSpace);
|
|
4112
|
+
}
|
|
4113
|
+
var tokens = this.parse(indentedValue, tags);
|
|
4114
|
+
return this.renderTokens(tokens, context, partials, indentedValue, config);
|
|
4115
|
+
}
|
|
4116
|
+
}, "renderPartial");
|
|
4117
|
+
Writer.prototype.unescapedValue = /* @__PURE__ */ __name(function unescapedValue(token, context) {
|
|
4118
|
+
var value = context.lookup(token[1]);
|
|
4119
|
+
if (value != null)
|
|
4120
|
+
return value;
|
|
4121
|
+
}, "unescapedValue");
|
|
4122
|
+
Writer.prototype.escapedValue = /* @__PURE__ */ __name(function escapedValue(token, context, config) {
|
|
4123
|
+
var escape = this.getConfigEscape(config) || mustache.escape;
|
|
4124
|
+
var value = context.lookup(token[1]);
|
|
4125
|
+
if (value != null)
|
|
4126
|
+
return typeof value === "number" && escape === mustache.escape ? String(value) : escape(value);
|
|
4127
|
+
}, "escapedValue");
|
|
4128
|
+
Writer.prototype.rawValue = /* @__PURE__ */ __name(function rawValue(token) {
|
|
4129
|
+
return token[1];
|
|
4130
|
+
}, "rawValue");
|
|
4131
|
+
Writer.prototype.getConfigTags = /* @__PURE__ */ __name(function getConfigTags(config) {
|
|
4132
|
+
if (isArray(config)) {
|
|
4133
|
+
return config;
|
|
4134
|
+
} else if (config && typeof config === "object") {
|
|
4135
|
+
return config.tags;
|
|
4136
|
+
} else {
|
|
4137
|
+
return void 0;
|
|
4138
|
+
}
|
|
4139
|
+
}, "getConfigTags");
|
|
4140
|
+
Writer.prototype.getConfigEscape = /* @__PURE__ */ __name(function getConfigEscape(config) {
|
|
4141
|
+
if (config && typeof config === "object" && !isArray(config)) {
|
|
4142
|
+
return config.escape;
|
|
4143
|
+
} else {
|
|
4144
|
+
return void 0;
|
|
4145
|
+
}
|
|
4146
|
+
}, "getConfigEscape");
|
|
4147
|
+
var mustache = {
|
|
4148
|
+
name: "mustache.js",
|
|
4149
|
+
version: "4.2.0",
|
|
4150
|
+
tags: ["{{", "}}"],
|
|
4151
|
+
clearCache: void 0,
|
|
4152
|
+
escape: void 0,
|
|
4153
|
+
parse: void 0,
|
|
4154
|
+
render: void 0,
|
|
4155
|
+
Scanner: void 0,
|
|
4156
|
+
Context: void 0,
|
|
4157
|
+
Writer: void 0,
|
|
4158
|
+
/**
|
|
4159
|
+
* Allows a user to override the default caching strategy, by providing an
|
|
4160
|
+
* object with set, get and clear methods. This can also be used to disable
|
|
4161
|
+
* the cache by setting it to the literal `undefined`.
|
|
4162
|
+
*/
|
|
4163
|
+
set templateCache(cache) {
|
|
4164
|
+
defaultWriter.templateCache = cache;
|
|
4165
|
+
},
|
|
4166
|
+
/**
|
|
4167
|
+
* Gets the default or overridden caching object from the default writer.
|
|
4168
|
+
*/
|
|
4169
|
+
get templateCache() {
|
|
4170
|
+
return defaultWriter.templateCache;
|
|
4171
|
+
}
|
|
4172
|
+
};
|
|
4173
|
+
var defaultWriter = new Writer();
|
|
4174
|
+
mustache.clearCache = /* @__PURE__ */ __name(function clearCache2() {
|
|
4175
|
+
return defaultWriter.clearCache();
|
|
4176
|
+
}, "clearCache");
|
|
4177
|
+
mustache.parse = /* @__PURE__ */ __name(function parse3(template, tags) {
|
|
4178
|
+
return defaultWriter.parse(template, tags);
|
|
4179
|
+
}, "parse");
|
|
4180
|
+
mustache.render = /* @__PURE__ */ __name(function render5(template, view, partials, config) {
|
|
4181
|
+
if (typeof template !== "string") {
|
|
4182
|
+
throw new TypeError('Invalid template! Template should be a "string" but "' + typeStr(template) + '" was given as the first argument for mustache#render(template, view, partials)');
|
|
4183
|
+
}
|
|
4184
|
+
return defaultWriter.render(template, view, partials, config);
|
|
4185
|
+
}, "render");
|
|
4186
|
+
mustache.escape = escapeHtml;
|
|
4187
|
+
mustache.Scanner = Scanner;
|
|
4188
|
+
mustache.Context = Context;
|
|
4189
|
+
mustache.Writer = Writer;
|
|
4190
|
+
var mustache_default = mustache;
|
|
4191
|
+
|
|
4192
|
+
// src/puppeteer/engines/mustache/mustache.service.ts
|
|
4193
|
+
import { resolve as resolve3 } from "path";
|
|
4194
|
+
import { readFileSync as readFileSync6 } from "fs";
|
|
4195
|
+
function _ts_decorate7(decorators, target, key, desc) {
|
|
4196
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4197
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4198
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4199
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4200
|
+
}
|
|
4201
|
+
__name(_ts_decorate7, "_ts_decorate");
|
|
4202
|
+
var MustacheService = class {
|
|
4203
|
+
static {
|
|
4204
|
+
__name(this, "MustacheService");
|
|
4205
|
+
}
|
|
4206
|
+
templateCache = /* @__PURE__ */ new Map();
|
|
4207
|
+
maxCacheSize = 100;
|
|
4208
|
+
/**
|
|
4209
|
+
* Render a Mustache template from a string
|
|
4210
|
+
* @param template The template string to render
|
|
4211
|
+
* @param data The data object to use for rendering
|
|
4212
|
+
* @param options Optional Mustache rendering options
|
|
4213
|
+
* @returns The rendered HTML string
|
|
4214
|
+
*/
|
|
4215
|
+
render(template, data = {}, options) {
|
|
4216
|
+
try {
|
|
4217
|
+
const tags = options?.tags ?? [
|
|
4218
|
+
"{{",
|
|
4219
|
+
"}}"
|
|
4220
|
+
];
|
|
4221
|
+
return mustache_default.render(template, data, void 0, {
|
|
4222
|
+
tags,
|
|
4223
|
+
escape: options?.escape
|
|
4224
|
+
});
|
|
4225
|
+
} catch (error) {
|
|
4226
|
+
throw new Error(`Mustache rendering failed: ${String(error)}`, {
|
|
4227
|
+
cause: error
|
|
4228
|
+
});
|
|
4229
|
+
}
|
|
4230
|
+
}
|
|
4231
|
+
/**
|
|
4232
|
+
* Render a Mustache template from a file
|
|
4233
|
+
* @param filePath The path to the template file
|
|
4234
|
+
* @param data The data object to use for rendering
|
|
4235
|
+
* @param options Optional Mustache rendering options
|
|
4236
|
+
* @returns The rendered HTML string
|
|
4237
|
+
*/
|
|
4238
|
+
renderFile(filePath, data = {}, options) {
|
|
4239
|
+
try {
|
|
4240
|
+
const resolvedPath = resolve3(filePath);
|
|
4241
|
+
let template = this.templateCache.get(resolvedPath);
|
|
4242
|
+
if (!template) {
|
|
4243
|
+
template = readFileSync6(resolvedPath, "utf-8");
|
|
4244
|
+
if (this.templateCache.size < this.maxCacheSize) {
|
|
4245
|
+
this.templateCache.set(resolvedPath, template);
|
|
4246
|
+
}
|
|
4247
|
+
}
|
|
4248
|
+
return this.render(template, data, options);
|
|
4249
|
+
} catch (error) {
|
|
4250
|
+
throw new Error(`Mustache file rendering failed for ${filePath}: ${String(error)}`, {
|
|
4251
|
+
cause: error
|
|
4252
|
+
});
|
|
4253
|
+
}
|
|
4254
|
+
}
|
|
4255
|
+
/**
|
|
4256
|
+
* Clear the template cache
|
|
4257
|
+
*/
|
|
4258
|
+
clearCache() {
|
|
4259
|
+
this.templateCache.clear();
|
|
4260
|
+
}
|
|
4261
|
+
/**
|
|
4262
|
+
* Get the current cache size
|
|
4263
|
+
* @returns The number of cached templates
|
|
4264
|
+
*/
|
|
4265
|
+
getCacheSize() {
|
|
4266
|
+
return this.templateCache.size;
|
|
4267
|
+
}
|
|
4268
|
+
};
|
|
4269
|
+
MustacheService = _ts_decorate7([
|
|
4270
|
+
Injectable7()
|
|
4271
|
+
], MustacheService);
|
|
4272
|
+
|
|
4273
|
+
// src/puppeteer/puppeteer.service.ts
|
|
4274
|
+
function _ts_decorate8(decorators, target, key, desc) {
|
|
4275
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4276
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4277
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4278
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4279
|
+
}
|
|
4280
|
+
__name(_ts_decorate8, "_ts_decorate");
|
|
4281
|
+
function _ts_metadata4(k, v) {
|
|
4282
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
4283
|
+
}
|
|
4284
|
+
__name(_ts_metadata4, "_ts_metadata");
|
|
3136
4285
|
function _ts_param2(paramIndex, decorator) {
|
|
3137
4286
|
return function(target, key) {
|
|
3138
4287
|
decorator(target, key, paramIndex);
|
|
@@ -3150,7 +4299,9 @@ var PuppeteerService = class {
|
|
|
3150
4299
|
pugService;
|
|
3151
4300
|
ejsService;
|
|
3152
4301
|
nunjucksService;
|
|
3153
|
-
|
|
4302
|
+
etaService;
|
|
4303
|
+
mustacheService;
|
|
4304
|
+
constructor(hbsService, browserService, options, mjmlService, pugService, ejsService, nunjucksService, etaService, mustacheService) {
|
|
3154
4305
|
this.hbsService = hbsService;
|
|
3155
4306
|
this.browserService = browserService;
|
|
3156
4307
|
this.options = options;
|
|
@@ -3158,6 +4309,8 @@ var PuppeteerService = class {
|
|
|
3158
4309
|
this.pugService = pugService;
|
|
3159
4310
|
this.ejsService = ejsService;
|
|
3160
4311
|
this.nunjucksService = nunjucksService;
|
|
4312
|
+
this.etaService = etaService;
|
|
4313
|
+
this.mustacheService = mustacheService;
|
|
3161
4314
|
}
|
|
3162
4315
|
limit = pLimit(3);
|
|
3163
4316
|
async generatePdfFromHtml(html, options) {
|
|
@@ -3302,23 +4455,55 @@ var PuppeteerService = class {
|
|
|
3302
4455
|
const html = this.nunjucksService.renderFile(file, data, options?.nunjucksOptions ?? this.options.nunjucksOptions);
|
|
3303
4456
|
return this.generatePdfFromHtml(html, options);
|
|
3304
4457
|
}
|
|
4458
|
+
async generatePdfFromEtaString(template, data = {}, options) {
|
|
4459
|
+
if (!this.etaService) {
|
|
4460
|
+
throw new Error("Eta service is not available. If the problem persists, open an issue in the repo.");
|
|
4461
|
+
}
|
|
4462
|
+
const html = this.etaService.render(template, data, options?.etaOptions ?? this.options.etaOptions);
|
|
4463
|
+
return this.generatePdfFromHtml(html, options);
|
|
4464
|
+
}
|
|
4465
|
+
async generatePdfFromEtaFile(file, data = {}, options) {
|
|
4466
|
+
if (!this.etaService) {
|
|
4467
|
+
throw new Error("Eta service is not available. If the problem persists, open an issue in the repo.");
|
|
4468
|
+
}
|
|
4469
|
+
const html = this.etaService.renderFile(file, data, options?.etaOptions ?? this.options.etaOptions);
|
|
4470
|
+
return this.generatePdfFromHtml(html, options);
|
|
4471
|
+
}
|
|
4472
|
+
async generatePdfFromMustacheString(template, data = {}, options) {
|
|
4473
|
+
if (!this.mustacheService) {
|
|
4474
|
+
throw new Error("Mustache service is not available. If the problem persists, open an issue in the repo.");
|
|
4475
|
+
}
|
|
4476
|
+
const html = this.mustacheService.render(template, data, options?.mustacheOptions ?? this.options.mustacheOptions);
|
|
4477
|
+
return this.generatePdfFromHtml(html, options);
|
|
4478
|
+
}
|
|
4479
|
+
async generatePdfFromMustacheFile(file, data = {}, options) {
|
|
4480
|
+
if (!this.mustacheService) {
|
|
4481
|
+
throw new Error("Mustache service is not available. If the problem persists, open an issue in the repo.");
|
|
4482
|
+
}
|
|
4483
|
+
const html = this.mustacheService.renderFile(file, data, options?.mustacheOptions ?? this.options.mustacheOptions);
|
|
4484
|
+
return this.generatePdfFromHtml(html, options);
|
|
4485
|
+
}
|
|
3305
4486
|
};
|
|
3306
|
-
PuppeteerService =
|
|
3307
|
-
|
|
4487
|
+
PuppeteerService = _ts_decorate8([
|
|
4488
|
+
Injectable8(),
|
|
3308
4489
|
_ts_param2(2, Inject2(PDF_PARAMETERS)),
|
|
3309
4490
|
_ts_param2(3, Optional()),
|
|
3310
4491
|
_ts_param2(4, Optional()),
|
|
3311
4492
|
_ts_param2(5, Optional()),
|
|
3312
4493
|
_ts_param2(6, Optional()),
|
|
3313
|
-
|
|
3314
|
-
|
|
4494
|
+
_ts_param2(7, Optional()),
|
|
4495
|
+
_ts_param2(8, Optional()),
|
|
4496
|
+
_ts_metadata4("design:type", Function),
|
|
4497
|
+
_ts_metadata4("design:paramtypes", [
|
|
3315
4498
|
typeof HandlebarsService === "undefined" ? Object : HandlebarsService,
|
|
3316
4499
|
typeof BrowserService === "undefined" ? Object : BrowserService,
|
|
3317
4500
|
typeof PuppeteerParameters === "undefined" ? Object : PuppeteerParameters,
|
|
3318
4501
|
typeof MjmlService === "undefined" ? Object : MjmlService,
|
|
3319
4502
|
typeof PugService === "undefined" ? Object : PugService,
|
|
3320
4503
|
typeof EjsService === "undefined" ? Object : EjsService,
|
|
3321
|
-
typeof NunjucksService === "undefined" ? Object : NunjucksService
|
|
4504
|
+
typeof NunjucksService === "undefined" ? Object : NunjucksService,
|
|
4505
|
+
typeof EtaService === "undefined" ? Object : EtaService,
|
|
4506
|
+
typeof MustacheService === "undefined" ? Object : MustacheService
|
|
3322
4507
|
])
|
|
3323
4508
|
], PuppeteerService);
|
|
3324
4509
|
|
|
@@ -3476,17 +4661,17 @@ async function addSignatureFieldUsingAnchor(pdf, fieldName = "SignatureDebtor",
|
|
|
3476
4661
|
__name(addSignatureFieldUsingAnchor, "addSignatureFieldUsingAnchor");
|
|
3477
4662
|
|
|
3478
4663
|
// src/nestjs-pdf.service.ts
|
|
3479
|
-
function
|
|
4664
|
+
function _ts_decorate9(decorators, target, key, desc) {
|
|
3480
4665
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3481
4666
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3482
4667
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3483
4668
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3484
4669
|
}
|
|
3485
|
-
__name(
|
|
3486
|
-
function
|
|
4670
|
+
__name(_ts_decorate9, "_ts_decorate");
|
|
4671
|
+
function _ts_metadata5(k, v) {
|
|
3487
4672
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3488
4673
|
}
|
|
3489
|
-
__name(
|
|
4674
|
+
__name(_ts_metadata5, "_ts_metadata");
|
|
3490
4675
|
var NestjsPdfService = class {
|
|
3491
4676
|
static {
|
|
3492
4677
|
__name(this, "NestjsPdfService");
|
|
@@ -3603,6 +4788,46 @@ var NestjsPdfService = class {
|
|
|
3603
4788
|
return this.puppeteerService.generatePdfFromNunjucksFile(file, data, options);
|
|
3604
4789
|
}
|
|
3605
4790
|
/**
|
|
4791
|
+
* @param template Eta template string
|
|
4792
|
+
* @param data Data to inject into the template
|
|
4793
|
+
* @param options PDF generation options (optional)
|
|
4794
|
+
* @returns PDF generated from the provided Eta template with data applied
|
|
4795
|
+
* @description This method generates a PDF from an Eta template provided as a string. Eta is a fast and lightweight embedded templating language with a syntax similar to EJS but with better performance. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
|
|
4796
|
+
*/
|
|
4797
|
+
generatePdfFromEtaString(template, data = {}, options) {
|
|
4798
|
+
return this.puppeteerService.generatePdfFromEtaString(template, data, options);
|
|
4799
|
+
}
|
|
4800
|
+
/**
|
|
4801
|
+
* @param file Path to the Eta template file
|
|
4802
|
+
* @param data Data to inject into the template
|
|
4803
|
+
* @param options PDF generation options (optional)
|
|
4804
|
+
* @returns PDF generated from the Eta template at the provided file path with data applied
|
|
4805
|
+
* @description This method generates a PDF from an Eta template located at the specified file path. The file path is passed as a string in the `file` parameter. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
|
|
4806
|
+
*/
|
|
4807
|
+
generatePdfFromEtaFile(file, data = {}, options) {
|
|
4808
|
+
return this.puppeteerService.generatePdfFromEtaFile(file, data, options);
|
|
4809
|
+
}
|
|
4810
|
+
/**
|
|
4811
|
+
* @param template Mustache template string
|
|
4812
|
+
* @param data Data to inject into the template
|
|
4813
|
+
* @param options PDF generation options (optional)
|
|
4814
|
+
* @returns PDF generated from the provided Mustache template with data applied
|
|
4815
|
+
* @description This method generates a PDF from a Mustache template provided as a string. Mustache is a logic-less template language that emphasizes readable and simple templates. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
|
|
4816
|
+
*/
|
|
4817
|
+
generatePdfFromMustacheString(template, data = {}, options) {
|
|
4818
|
+
return this.puppeteerService.generatePdfFromMustacheString(template, data, options);
|
|
4819
|
+
}
|
|
4820
|
+
/**
|
|
4821
|
+
* @param file Path to the Mustache template file
|
|
4822
|
+
* @param data Data to inject into the template
|
|
4823
|
+
* @param options PDF generation options (optional)
|
|
4824
|
+
* @returns PDF generated from the Mustache template at the provided file path with data applied
|
|
4825
|
+
* @description This method generates a PDF from a Mustache template located at the specified file path. The file path is passed as a string in the `file` parameter. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
|
|
4826
|
+
*/
|
|
4827
|
+
generatePdfFromMustacheFile(file, data = {}, options) {
|
|
4828
|
+
return this.puppeteerService.generatePdfFromMustacheFile(file, data, options);
|
|
4829
|
+
}
|
|
4830
|
+
/**
|
|
3606
4831
|
* @param pdf The PDF bytes to modify
|
|
3607
4832
|
* @param fieldName The name of the signature field to add (default: 'SignatureDebtor')
|
|
3608
4833
|
* @param anchorText The text anchor to locate the signature field position (default: '__SIG_DEBTOR_ANCHOR__')
|
|
@@ -3628,10 +4853,10 @@ var NestjsPdfService = class {
|
|
|
3628
4853
|
return await addSignatureFieldUsingAnchor(pdf, fieldName, anchorText);
|
|
3629
4854
|
}
|
|
3630
4855
|
};
|
|
3631
|
-
NestjsPdfService =
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
4856
|
+
NestjsPdfService = _ts_decorate9([
|
|
4857
|
+
Injectable9(),
|
|
4858
|
+
_ts_metadata5("design:type", Function),
|
|
4859
|
+
_ts_metadata5("design:paramtypes", [
|
|
3635
4860
|
typeof PuppeteerService === "undefined" ? Object : PuppeteerService
|
|
3636
4861
|
])
|
|
3637
4862
|
], NestjsPdfService);
|
|
@@ -3640,17 +4865,17 @@ NestjsPdfService = _ts_decorate7([
|
|
|
3640
4865
|
import { Inject as Inject3, Module } from "@nestjs/common";
|
|
3641
4866
|
var import_config = __toESM(require_config());
|
|
3642
4867
|
import { HandlebarsService as HandlebarsService2 } from "@gboutte/nestjs-hbs";
|
|
3643
|
-
function
|
|
4868
|
+
function _ts_decorate10(decorators, target, key, desc) {
|
|
3644
4869
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3645
4870
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3646
4871
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3647
4872
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3648
4873
|
}
|
|
3649
|
-
__name(
|
|
3650
|
-
function
|
|
4874
|
+
__name(_ts_decorate10, "_ts_decorate");
|
|
4875
|
+
function _ts_metadata6(k, v) {
|
|
3651
4876
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3652
4877
|
}
|
|
3653
|
-
__name(
|
|
4878
|
+
__name(_ts_metadata6, "_ts_metadata");
|
|
3654
4879
|
function _ts_param3(paramIndex, decorator) {
|
|
3655
4880
|
return function(target, key) {
|
|
3656
4881
|
decorator(target, key, paramIndex);
|
|
@@ -3684,7 +4909,9 @@ var PuppeteerModule = class _PuppeteerModule {
|
|
|
3684
4909
|
MjmlService,
|
|
3685
4910
|
PugService,
|
|
3686
4911
|
EjsService,
|
|
3687
|
-
NunjucksService
|
|
4912
|
+
NunjucksService,
|
|
4913
|
+
EtaService,
|
|
4914
|
+
MustacheService
|
|
3688
4915
|
];
|
|
3689
4916
|
return {
|
|
3690
4917
|
module: _PuppeteerModule,
|
|
@@ -3697,7 +4924,9 @@ var PuppeteerModule = class _PuppeteerModule {
|
|
|
3697
4924
|
MjmlService,
|
|
3698
4925
|
PugService,
|
|
3699
4926
|
EjsService,
|
|
3700
|
-
NunjucksService
|
|
4927
|
+
NunjucksService,
|
|
4928
|
+
EtaService,
|
|
4929
|
+
MustacheService
|
|
3701
4930
|
]
|
|
3702
4931
|
};
|
|
3703
4932
|
}
|
|
@@ -3729,19 +4958,23 @@ var PuppeteerModule = class _PuppeteerModule {
|
|
|
3729
4958
|
MjmlService,
|
|
3730
4959
|
PugService,
|
|
3731
4960
|
EjsService,
|
|
3732
|
-
NunjucksService
|
|
4961
|
+
NunjucksService,
|
|
4962
|
+
EtaService,
|
|
4963
|
+
MustacheService
|
|
3733
4964
|
],
|
|
3734
4965
|
exports: [
|
|
3735
4966
|
PuppeteerService,
|
|
3736
4967
|
MjmlService,
|
|
3737
4968
|
PugService,
|
|
3738
4969
|
EjsService,
|
|
3739
|
-
NunjucksService
|
|
4970
|
+
NunjucksService,
|
|
4971
|
+
EtaService,
|
|
4972
|
+
MustacheService
|
|
3740
4973
|
]
|
|
3741
4974
|
};
|
|
3742
4975
|
}
|
|
3743
4976
|
};
|
|
3744
|
-
PuppeteerModule =
|
|
4977
|
+
PuppeteerModule = _ts_decorate10([
|
|
3745
4978
|
Module({
|
|
3746
4979
|
providers: [
|
|
3747
4980
|
PuppeteerService,
|
|
@@ -3749,32 +4982,36 @@ PuppeteerModule = _ts_decorate8([
|
|
|
3749
4982
|
MjmlService,
|
|
3750
4983
|
PugService,
|
|
3751
4984
|
EjsService,
|
|
3752
|
-
NunjucksService
|
|
4985
|
+
NunjucksService,
|
|
4986
|
+
EtaService,
|
|
4987
|
+
MustacheService
|
|
3753
4988
|
],
|
|
3754
4989
|
exports: [
|
|
3755
4990
|
PuppeteerService,
|
|
3756
4991
|
MjmlService,
|
|
3757
4992
|
PugService,
|
|
3758
4993
|
EjsService,
|
|
3759
|
-
NunjucksService
|
|
4994
|
+
NunjucksService,
|
|
4995
|
+
EtaService,
|
|
4996
|
+
MustacheService
|
|
3760
4997
|
]
|
|
3761
4998
|
}),
|
|
3762
4999
|
_ts_param3(1, Inject3(PDF_PARAMETERS)),
|
|
3763
|
-
|
|
3764
|
-
|
|
5000
|
+
_ts_metadata6("design:type", Function),
|
|
5001
|
+
_ts_metadata6("design:paramtypes", [
|
|
3765
5002
|
typeof BrowserService === "undefined" ? Object : BrowserService,
|
|
3766
5003
|
typeof PuppeteerParameters === "undefined" ? Object : PuppeteerParameters
|
|
3767
5004
|
])
|
|
3768
5005
|
], PuppeteerModule);
|
|
3769
5006
|
|
|
3770
5007
|
// src/nestjs-pdf.module.ts
|
|
3771
|
-
function
|
|
5008
|
+
function _ts_decorate11(decorators, target, key, desc) {
|
|
3772
5009
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3773
5010
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3774
5011
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3775
5012
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3776
5013
|
}
|
|
3777
|
-
__name(
|
|
5014
|
+
__name(_ts_decorate11, "_ts_decorate");
|
|
3778
5015
|
var NestjsPdfModule = class _NestjsPdfModule {
|
|
3779
5016
|
static {
|
|
3780
5017
|
__name(this, "NestjsPdfModule");
|
|
@@ -3808,20 +5045,22 @@ var NestjsPdfModule = class _NestjsPdfModule {
|
|
|
3808
5045
|
};
|
|
3809
5046
|
}
|
|
3810
5047
|
};
|
|
3811
|
-
NestjsPdfModule =
|
|
5048
|
+
NestjsPdfModule = _ts_decorate11([
|
|
3812
5049
|
Module2({})
|
|
3813
5050
|
], NestjsPdfModule);
|
|
3814
5051
|
|
|
3815
5052
|
// src/helpers/getRelativePath.helper.ts
|
|
3816
|
-
import { relative, resolve as
|
|
5053
|
+
import { relative as relative2, resolve as resolve4 } from "path";
|
|
3817
5054
|
function getRelativePathToValue(moduleDir, relativeToModule) {
|
|
3818
|
-
const fullTemplatePath =
|
|
3819
|
-
return
|
|
5055
|
+
const fullTemplatePath = resolve4(moduleDir, relativeToModule);
|
|
5056
|
+
return relative2(process.cwd(), fullTemplatePath);
|
|
3820
5057
|
}
|
|
3821
5058
|
__name(getRelativePathToValue, "getRelativePathToValue");
|
|
3822
5059
|
export {
|
|
3823
5060
|
EjsService,
|
|
5061
|
+
EtaService,
|
|
3824
5062
|
MjmlService,
|
|
5063
|
+
MustacheService,
|
|
3825
5064
|
NestjsPdfModule,
|
|
3826
5065
|
NestjsPdfService,
|
|
3827
5066
|
NunjucksService,
|
|
@@ -3830,3 +5069,11 @@ export {
|
|
|
3830
5069
|
PuppeteerService,
|
|
3831
5070
|
getRelativePathToValue
|
|
3832
5071
|
};
|
|
5072
|
+
/*! Bundled license information:
|
|
5073
|
+
|
|
5074
|
+
mustache/mustache.mjs:
|
|
5075
|
+
(*!
|
|
5076
|
+
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
5077
|
+
* http://github.com/janl/mustache.js
|
|
5078
|
+
*)
|
|
5079
|
+
*/
|