@shad0wz7/nestjs-pdf 2.5.4 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -32
- package/dist/index.cjs +1217 -2332
- package/dist/index.d.cts +56 -25
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +56 -25
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1219 -2322
- package/dist/index.mjs.map +1 -1
- package/package.json +26 -66
package/dist/index.cjs
CHANGED
|
@@ -25,22 +25,29 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
let node_path = require("node:path");
|
|
26
26
|
let _nestjs_common = require("@nestjs/common");
|
|
27
27
|
let pdf_lib = require("pdf-lib");
|
|
28
|
-
let _gboutte_nestjs_hbs = require("@gboutte/nestjs-hbs");
|
|
29
|
-
let p_limit = require("p-limit");
|
|
30
|
-
p_limit = __toESM(p_limit);
|
|
31
28
|
let deepmerge_ts = require("deepmerge-ts");
|
|
32
29
|
let node_fs = require("node:fs");
|
|
33
30
|
let _puppeteer_browsers = require("@puppeteer/browsers");
|
|
34
31
|
let puppeteer = require("puppeteer");
|
|
35
32
|
let ejs = require("ejs");
|
|
33
|
+
ejs = __toESM(ejs, 1);
|
|
36
34
|
let eta = require("eta");
|
|
35
|
+
let handlebars = require("handlebars");
|
|
36
|
+
handlebars = __toESM(handlebars, 1);
|
|
37
37
|
let mjml = require("mjml");
|
|
38
|
-
mjml = __toESM(mjml);
|
|
38
|
+
mjml = __toESM(mjml, 1);
|
|
39
39
|
let mustache = require("mustache");
|
|
40
|
-
mustache = __toESM(mustache);
|
|
40
|
+
mustache = __toESM(mustache, 1);
|
|
41
41
|
let nunjucks = require("nunjucks");
|
|
42
|
-
nunjucks = __toESM(nunjucks);
|
|
42
|
+
nunjucks = __toESM(nunjucks, 1);
|
|
43
43
|
let pug = require("pug");
|
|
44
|
+
pug = __toESM(pug, 1);
|
|
45
|
+
let _nestjs_common_utils_shared_utils_js = require("@nestjs/common/utils/shared.utils.js");
|
|
46
|
+
let fs = require("fs");
|
|
47
|
+
fs = __toESM(fs, 1);
|
|
48
|
+
let path = require("path");
|
|
49
|
+
let rxjs = require("rxjs");
|
|
50
|
+
let crypto = require("crypto");
|
|
44
51
|
//#region src/helpers/getRelativePath.helper.ts
|
|
45
52
|
/**
|
|
46
53
|
* Get the relative path to a value from the module directory.
|
|
@@ -202,6 +209,133 @@ async function addSignatureFieldUsingAnchor(pdf, fieldName = "SignatureDebtor",
|
|
|
202
209
|
return await pdfDoc.save();
|
|
203
210
|
}
|
|
204
211
|
//#endregion
|
|
212
|
+
//#region node_modules/.pnpm/yocto-queue@1.2.2/node_modules/yocto-queue/index.js
|
|
213
|
+
var Node = class {
|
|
214
|
+
value;
|
|
215
|
+
next;
|
|
216
|
+
constructor(value) {
|
|
217
|
+
this.value = value;
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
var Queue = class {
|
|
221
|
+
#head;
|
|
222
|
+
#tail;
|
|
223
|
+
#size;
|
|
224
|
+
constructor() {
|
|
225
|
+
this.clear();
|
|
226
|
+
}
|
|
227
|
+
enqueue(value) {
|
|
228
|
+
const node = new Node(value);
|
|
229
|
+
if (this.#head) {
|
|
230
|
+
this.#tail.next = node;
|
|
231
|
+
this.#tail = node;
|
|
232
|
+
} else {
|
|
233
|
+
this.#head = node;
|
|
234
|
+
this.#tail = node;
|
|
235
|
+
}
|
|
236
|
+
this.#size++;
|
|
237
|
+
}
|
|
238
|
+
dequeue() {
|
|
239
|
+
const current = this.#head;
|
|
240
|
+
if (!current) return;
|
|
241
|
+
this.#head = this.#head.next;
|
|
242
|
+
this.#size--;
|
|
243
|
+
if (!this.#head) this.#tail = void 0;
|
|
244
|
+
return current.value;
|
|
245
|
+
}
|
|
246
|
+
peek() {
|
|
247
|
+
if (!this.#head) return;
|
|
248
|
+
return this.#head.value;
|
|
249
|
+
}
|
|
250
|
+
clear() {
|
|
251
|
+
this.#head = void 0;
|
|
252
|
+
this.#tail = void 0;
|
|
253
|
+
this.#size = 0;
|
|
254
|
+
}
|
|
255
|
+
get size() {
|
|
256
|
+
return this.#size;
|
|
257
|
+
}
|
|
258
|
+
*[Symbol.iterator]() {
|
|
259
|
+
let current = this.#head;
|
|
260
|
+
while (current) {
|
|
261
|
+
yield current.value;
|
|
262
|
+
current = current.next;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
*drain() {
|
|
266
|
+
while (this.#head) yield this.dequeue();
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region node_modules/.pnpm/p-limit@7.3.2/node_modules/p-limit/index.js
|
|
271
|
+
function pLimit(concurrency) {
|
|
272
|
+
let rejectOnClear = false;
|
|
273
|
+
if (typeof concurrency === "object") ({concurrency, rejectOnClear = false} = concurrency);
|
|
274
|
+
validateConcurrency(concurrency);
|
|
275
|
+
if (typeof rejectOnClear !== "boolean") throw new TypeError("Expected `rejectOnClear` to be a boolean");
|
|
276
|
+
const queue = new Queue();
|
|
277
|
+
let activeCount = 0;
|
|
278
|
+
const resumeNext = () => {
|
|
279
|
+
if (activeCount < concurrency && queue.size > 0) {
|
|
280
|
+
activeCount++;
|
|
281
|
+
queue.dequeue().run();
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
const next = () => {
|
|
285
|
+
activeCount--;
|
|
286
|
+
resumeNext();
|
|
287
|
+
};
|
|
288
|
+
const run = async (function_, resolve, arguments_) => {
|
|
289
|
+
const result = (async () => function_(...arguments_))();
|
|
290
|
+
resolve(result);
|
|
291
|
+
try {
|
|
292
|
+
await result;
|
|
293
|
+
} catch {}
|
|
294
|
+
next();
|
|
295
|
+
};
|
|
296
|
+
const enqueue = (function_, resolve, reject, arguments_) => {
|
|
297
|
+
const queueItem = { reject };
|
|
298
|
+
new Promise((internalResolve) => {
|
|
299
|
+
queueItem.run = internalResolve;
|
|
300
|
+
queue.enqueue(queueItem);
|
|
301
|
+
}).then(run.bind(void 0, function_, resolve, arguments_));
|
|
302
|
+
if (activeCount < concurrency) resumeNext();
|
|
303
|
+
};
|
|
304
|
+
const generator = (function_, ...arguments_) => new Promise((resolve, reject) => {
|
|
305
|
+
enqueue(function_, resolve, reject, arguments_);
|
|
306
|
+
});
|
|
307
|
+
Object.defineProperties(generator, {
|
|
308
|
+
activeCount: { get: () => activeCount },
|
|
309
|
+
pendingCount: { get: () => queue.size },
|
|
310
|
+
clearQueue: { value() {
|
|
311
|
+
if (!rejectOnClear) {
|
|
312
|
+
queue.clear();
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
const abortError = AbortSignal.abort().reason;
|
|
316
|
+
while (queue.size > 0) queue.dequeue().reject(abortError);
|
|
317
|
+
} },
|
|
318
|
+
concurrency: {
|
|
319
|
+
get: () => concurrency,
|
|
320
|
+
set(newConcurrency) {
|
|
321
|
+
validateConcurrency(newConcurrency);
|
|
322
|
+
concurrency = newConcurrency;
|
|
323
|
+
queueMicrotask(() => {
|
|
324
|
+
while (activeCount < concurrency && queue.size > 0) resumeNext();
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
map: { async value(iterable, function_) {
|
|
329
|
+
const promises = Array.from(iterable, (value, index) => generator(function_, value, index));
|
|
330
|
+
return Promise.all(promises);
|
|
331
|
+
} }
|
|
332
|
+
});
|
|
333
|
+
return generator;
|
|
334
|
+
}
|
|
335
|
+
function validateConcurrency(concurrency) {
|
|
336
|
+
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
337
|
+
}
|
|
338
|
+
//#endregion
|
|
205
339
|
//#region src/helpers/deepMergePdfparams.ts
|
|
206
340
|
function mergePuppeteerParameters(defaults, overrides) {
|
|
207
341
|
if (!overrides) return { ...defaults };
|
|
@@ -210,22 +344,21 @@ function mergePuppeteerParameters(defaults, overrides) {
|
|
|
210
344
|
//#endregion
|
|
211
345
|
//#region src/helpers/tokens.ts
|
|
212
346
|
const PDF_PARAMETERS = "PDF_PARAMETERS";
|
|
213
|
-
const HANDLEBARS_PARAMETERS = "HANDLEBARS_PARAMETERS";
|
|
214
347
|
//#endregion
|
|
215
|
-
//#region \0@oxc-project+runtime@0.
|
|
348
|
+
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/decorateMetadata.js
|
|
216
349
|
function __decorateMetadata(k, v) {
|
|
217
350
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
218
351
|
}
|
|
219
352
|
//#endregion
|
|
220
|
-
//#region \0@oxc-project+runtime@0.
|
|
353
|
+
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/decorateParam.js
|
|
221
354
|
function __decorateParam(paramIndex, decorator) {
|
|
222
355
|
return function(target, key) {
|
|
223
356
|
decorator(target, key, paramIndex);
|
|
224
357
|
};
|
|
225
358
|
}
|
|
226
359
|
//#endregion
|
|
227
|
-
//#region \0@oxc-project+runtime@0.
|
|
228
|
-
function __decorate(decorators, target, key, desc) {
|
|
360
|
+
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/decorate.js
|
|
361
|
+
function __decorate$3(decorators, target, key, desc) {
|
|
229
362
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
230
363
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
231
364
|
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;
|
|
@@ -284,7 +417,7 @@ let BrowserService = class BrowserService {
|
|
|
284
417
|
} catch (error) {
|
|
285
418
|
_nestjs_common.Logger.warn(`Failed to close browser on module destroy: ${error instanceof Error ? error.message : String(error)}`);
|
|
286
419
|
}
|
|
287
|
-
await this.cleanupCacheBestEffort();
|
|
420
|
+
if (this.options?.cleanupBrowserCacheOnExit !== false) await this.cleanupCacheBestEffort();
|
|
288
421
|
}
|
|
289
422
|
/** Wait until no PDF job is in flight, or until the timeout elapses. */
|
|
290
423
|
async waitForIdle(timeoutMs) {
|
|
@@ -395,17 +528,15 @@ let BrowserService = class BrowserService {
|
|
|
395
528
|
else browser = this.options.browser;
|
|
396
529
|
this.browser = browser;
|
|
397
530
|
}
|
|
398
|
-
setBrowser(browser) {
|
|
399
|
-
this.browser = browser;
|
|
400
|
-
}
|
|
401
531
|
getBrowser() {
|
|
402
532
|
return this.browser;
|
|
403
533
|
}
|
|
404
534
|
loadBrowserTag() {
|
|
405
535
|
let versionTag;
|
|
406
|
-
if (this.options?.browserTag === void 0)
|
|
407
|
-
|
|
408
|
-
|
|
536
|
+
if (this.options?.browserTag === void 0) {
|
|
537
|
+
if (this.browser === _puppeteer_browsers.Browser.CHROMIUM) versionTag = "latest";
|
|
538
|
+
else versionTag = "stable";
|
|
539
|
+
} else versionTag = this.options.browserTag;
|
|
409
540
|
this.browserTag = versionTag;
|
|
410
541
|
}
|
|
411
542
|
loadBuildId() {
|
|
@@ -423,9 +554,6 @@ let BrowserService = class BrowserService {
|
|
|
423
554
|
getBuildId() {
|
|
424
555
|
return this.buildId;
|
|
425
556
|
}
|
|
426
|
-
setBuildId(value) {
|
|
427
|
-
this.buildId = value;
|
|
428
|
-
}
|
|
429
557
|
loadUseLockedBrowser() {
|
|
430
558
|
let useLockedBrowser;
|
|
431
559
|
if (this.options?.useLockedBrowser === void 0) useLockedBrowser = false;
|
|
@@ -489,7 +617,7 @@ let BrowserService = class BrowserService {
|
|
|
489
617
|
return null;
|
|
490
618
|
}
|
|
491
619
|
};
|
|
492
|
-
BrowserService = __decorate([
|
|
620
|
+
BrowserService = __decorate$3([
|
|
493
621
|
(0, _nestjs_common.Injectable)(),
|
|
494
622
|
__decorateParam(0, (0, _nestjs_common.Inject)("PDF_PARAMETERS")),
|
|
495
623
|
__decorateMetadata("design:paramtypes", [Object])
|
|
@@ -499,7 +627,7 @@ BrowserService = __decorate([
|
|
|
499
627
|
let EjsService = class EjsService {
|
|
500
628
|
async render(template, data = {}, options) {
|
|
501
629
|
try {
|
|
502
|
-
return await
|
|
630
|
+
return await ejs.default.render(template, data, {
|
|
503
631
|
async: true,
|
|
504
632
|
...options
|
|
505
633
|
});
|
|
@@ -509,7 +637,7 @@ let EjsService = class EjsService {
|
|
|
509
637
|
}
|
|
510
638
|
async renderFile(filePath, data = {}, options) {
|
|
511
639
|
try {
|
|
512
|
-
return await
|
|
640
|
+
return await ejs.default.renderFile(filePath, data, {
|
|
513
641
|
async: true,
|
|
514
642
|
...options
|
|
515
643
|
});
|
|
@@ -518,7 +646,7 @@ let EjsService = class EjsService {
|
|
|
518
646
|
}
|
|
519
647
|
}
|
|
520
648
|
};
|
|
521
|
-
EjsService = __decorate([(0, _nestjs_common.Injectable)()], EjsService);
|
|
649
|
+
EjsService = __decorate$3([(0, _nestjs_common.Injectable)()], EjsService);
|
|
522
650
|
//#endregion
|
|
523
651
|
//#region src/puppeteer/engines/eta/eta.service.ts
|
|
524
652
|
let EtaService = class EtaService {
|
|
@@ -587,7 +715,58 @@ let EtaService = class EtaService {
|
|
|
587
715
|
return this.templateCache.size;
|
|
588
716
|
}
|
|
589
717
|
};
|
|
590
|
-
EtaService = __decorate([(0, _nestjs_common.Injectable)(), __decorateMetadata("design:paramtypes", [])], EtaService);
|
|
718
|
+
EtaService = __decorate$3([(0, _nestjs_common.Injectable)(), __decorateMetadata("design:paramtypes", [])], EtaService);
|
|
719
|
+
//#endregion
|
|
720
|
+
//#region src/puppeteer/engines/handlebars/handlebars.service.ts
|
|
721
|
+
let HandlebarsService = class HandlebarsService {
|
|
722
|
+
cachedOptions;
|
|
723
|
+
cachedEnv;
|
|
724
|
+
render(template, parameters = {}, options = {}) {
|
|
725
|
+
try {
|
|
726
|
+
return this.getEnv(options).compile(template, options.compileOptions)(parameters, options.templateOptions);
|
|
727
|
+
} catch (error) {
|
|
728
|
+
throw new Error(`Handlebars rendering failed: ${String(error)}`, { cause: error });
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
renderFile(file, parameters = {}, options = {}) {
|
|
732
|
+
if (options.templateDirectory === void 0) throw new Error("Handlebars file rendering failed: option `templateDirectory` is not set");
|
|
733
|
+
const baseDir = (0, node_path.resolve)(process.cwd(), options.templateDirectory);
|
|
734
|
+
const templatePath = (0, node_path.resolve)(baseDir, file);
|
|
735
|
+
if (templatePath !== baseDir && !templatePath.startsWith(baseDir + node_path.sep)) throw new Error(`Handlebars file rendering failed: ’${file}’ resolves outside \`templateDirectory\``);
|
|
736
|
+
let template;
|
|
737
|
+
try {
|
|
738
|
+
template = (0, node_fs.readFileSync)(templatePath, "utf8");
|
|
739
|
+
} catch (error) {
|
|
740
|
+
throw new Error(`Handlebars file rendering failed: ${String(error)}`, { cause: error });
|
|
741
|
+
}
|
|
742
|
+
return this.render(template, parameters, options);
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* Build an isolated Handlebars environment with the given helpers/partials so
|
|
746
|
+
* nothing leaks into the global Handlebars. Memoised for the common case where
|
|
747
|
+
* the same options object is reused across calls (e.g. the module `hbsOptions`).
|
|
748
|
+
*/
|
|
749
|
+
getEnv(options) {
|
|
750
|
+
if (this.cachedEnv && this.cachedOptions === options) return this.cachedEnv;
|
|
751
|
+
const env = handlebars.default.create();
|
|
752
|
+
for (const helper of options.helpers ?? []) env.registerHelper(helper.name, helper.fn);
|
|
753
|
+
this.registerPartials(env, options.partialDirectory);
|
|
754
|
+
this.cachedOptions = options;
|
|
755
|
+
this.cachedEnv = env;
|
|
756
|
+
return env;
|
|
757
|
+
}
|
|
758
|
+
registerPartials(env, partialDirectory) {
|
|
759
|
+
if (partialDirectory === void 0) return;
|
|
760
|
+
const partialPath = (0, node_path.join)(process.cwd(), partialDirectory);
|
|
761
|
+
if (!(0, node_fs.existsSync)(partialPath)) throw new Error(`Handlebars partial directory does not exist: ${partialPath}`);
|
|
762
|
+
for (const entry of (0, node_fs.readdirSync)(partialPath)) {
|
|
763
|
+
const filePath = (0, node_path.join)(partialPath, entry);
|
|
764
|
+
if (!(0, node_fs.statSync)(filePath).isFile()) continue;
|
|
765
|
+
env.registerPartial((0, node_path.basename)(entry, (0, node_path.extname)(entry)), (0, node_fs.readFileSync)(filePath, "utf8"));
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
};
|
|
769
|
+
HandlebarsService = __decorate$3([(0, _nestjs_common.Injectable)()], HandlebarsService);
|
|
591
770
|
//#endregion
|
|
592
771
|
//#region src/puppeteer/engines/mjml/mjml.service.ts
|
|
593
772
|
let MjmlService = class MjmlService {
|
|
@@ -600,7 +779,7 @@ let MjmlService = class MjmlService {
|
|
|
600
779
|
return await this.render(template, options);
|
|
601
780
|
}
|
|
602
781
|
};
|
|
603
|
-
MjmlService = __decorate([(0, _nestjs_common.Injectable)()], MjmlService);
|
|
782
|
+
MjmlService = __decorate$3([(0, _nestjs_common.Injectable)()], MjmlService);
|
|
604
783
|
//#endregion
|
|
605
784
|
//#region src/puppeteer/engines/mustache/mustache.service.ts
|
|
606
785
|
let MustacheService = class MustacheService {
|
|
@@ -658,7 +837,7 @@ let MustacheService = class MustacheService {
|
|
|
658
837
|
return this.templateCache.size;
|
|
659
838
|
}
|
|
660
839
|
};
|
|
661
|
-
MustacheService = __decorate([(0, _nestjs_common.Injectable)()], MustacheService);
|
|
840
|
+
MustacheService = __decorate$3([(0, _nestjs_common.Injectable)()], MustacheService);
|
|
662
841
|
//#endregion
|
|
663
842
|
//#region src/puppeteer/engines/nunjucks/nunjucks.service.ts
|
|
664
843
|
let NunjucksService = class NunjucksService {
|
|
@@ -704,13 +883,13 @@ let NunjucksService = class NunjucksService {
|
|
|
704
883
|
}
|
|
705
884
|
}
|
|
706
885
|
};
|
|
707
|
-
NunjucksService = __decorate([(0, _nestjs_common.Injectable)(), __decorateMetadata("design:paramtypes", [])], NunjucksService);
|
|
886
|
+
NunjucksService = __decorate$3([(0, _nestjs_common.Injectable)(), __decorateMetadata("design:paramtypes", [])], NunjucksService);
|
|
708
887
|
//#endregion
|
|
709
888
|
//#region src/puppeteer/engines/pug/pug.service.ts
|
|
710
889
|
let PugService = class PugService {
|
|
711
890
|
render(template, data = {}, options) {
|
|
712
891
|
try {
|
|
713
|
-
return
|
|
892
|
+
return pug.default.compile(template, { ...options })(data);
|
|
714
893
|
} catch (error) {
|
|
715
894
|
throw new Error(`Pug rendering failed: ${String(error)}`, { cause: error });
|
|
716
895
|
}
|
|
@@ -724,7 +903,7 @@ let PugService = class PugService {
|
|
|
724
903
|
}
|
|
725
904
|
}
|
|
726
905
|
};
|
|
727
|
-
PugService = __decorate([(0, _nestjs_common.Injectable)()], PugService);
|
|
906
|
+
PugService = __decorate$3([(0, _nestjs_common.Injectable)()], PugService);
|
|
728
907
|
//#endregion
|
|
729
908
|
//#region src/puppeteer/libs/requireService.utils.ts
|
|
730
909
|
function requireService(service, name) {
|
|
@@ -754,7 +933,7 @@ let PuppeteerService = class PuppeteerService {
|
|
|
754
933
|
this.etaService = etaService;
|
|
755
934
|
this.mustacheService = mustacheService;
|
|
756
935
|
}
|
|
757
|
-
limit = (
|
|
936
|
+
limit = pLimit(3);
|
|
758
937
|
async generatePdfFromHtml(html, options) {
|
|
759
938
|
return this.limit(async () => {
|
|
760
939
|
const mergePuppeteerOptions = mergePuppeteerParameters(this.options, options);
|
|
@@ -811,6 +990,7 @@ let PuppeteerService = class PuppeteerService {
|
|
|
811
990
|
idleTime: 500,
|
|
812
991
|
timeout: 3e4
|
|
813
992
|
});
|
|
993
|
+
/* v8 ignore next */
|
|
814
994
|
await page.evaluate(() => document.fonts.ready);
|
|
815
995
|
return await page.pdf(pdfOptions);
|
|
816
996
|
} catch (e) {
|
|
@@ -827,11 +1007,11 @@ let PuppeteerService = class PuppeteerService {
|
|
|
827
1007
|
});
|
|
828
1008
|
}
|
|
829
1009
|
async generatePdfFromTemplateHbsString(template, parameters = {}, options) {
|
|
830
|
-
const html = requireService(this.hbsService, "Handlebars").render(template, parameters);
|
|
1010
|
+
const html = requireService(this.hbsService, "Handlebars").render(template, parameters, options?.hbsOptions ?? this.options.hbsOptions);
|
|
831
1011
|
return this.generatePdfFromHtml(html, options);
|
|
832
1012
|
}
|
|
833
1013
|
async generatePdfFromTemplateHbsFile(file, parameters = {}, options) {
|
|
834
|
-
const html = requireService(this.hbsService, "Handlebars").renderFile(file, parameters);
|
|
1014
|
+
const html = requireService(this.hbsService, "Handlebars").renderFile(file, parameters, options?.hbsOptions ?? this.options.hbsOptions);
|
|
835
1015
|
return this.generatePdfFromHtml(html, options);
|
|
836
1016
|
}
|
|
837
1017
|
async generatePdfFromMjmlString(template, options) {
|
|
@@ -883,7 +1063,7 @@ let PuppeteerService = class PuppeteerService {
|
|
|
883
1063
|
return this.generatePdfFromHtml(html, options);
|
|
884
1064
|
}
|
|
885
1065
|
};
|
|
886
|
-
PuppeteerService = __decorate([
|
|
1066
|
+
PuppeteerService = __decorate$3([
|
|
887
1067
|
(0, _nestjs_common.Injectable)(),
|
|
888
1068
|
__decorateParam(1, (0, _nestjs_common.Inject)(PDF_PARAMETERS)),
|
|
889
1069
|
__decorateParam(2, (0, _nestjs_common.Optional)()),
|
|
@@ -896,7 +1076,7 @@ PuppeteerService = __decorate([
|
|
|
896
1076
|
__decorateMetadata("design:paramtypes", [
|
|
897
1077
|
typeof BrowserService === "undefined" ? Object : BrowserService,
|
|
898
1078
|
Object,
|
|
899
|
-
typeof
|
|
1079
|
+
typeof HandlebarsService === "undefined" ? Object : HandlebarsService,
|
|
900
1080
|
typeof MjmlService === "undefined" ? Object : MjmlService,
|
|
901
1081
|
typeof PugService === "undefined" ? Object : PugService,
|
|
902
1082
|
typeof EjsService === "undefined" ? Object : EjsService,
|
|
@@ -1085,14 +1265,604 @@ let NestjsPdfService = class NestjsPdfService {
|
|
|
1085
1265
|
return await addSignatureFieldUsingAnchor(pdf, fieldName, anchorText);
|
|
1086
1266
|
}
|
|
1087
1267
|
};
|
|
1088
|
-
NestjsPdfService = __decorate([(0, _nestjs_common.Injectable)(), __decorateMetadata("design:paramtypes", [typeof PuppeteerService === "undefined" ? Object : PuppeteerService])], NestjsPdfService);
|
|
1268
|
+
NestjsPdfService = __decorate$3([(0, _nestjs_common.Injectable)(), __decorateMetadata("design:paramtypes", [typeof PuppeteerService === "undefined" ? Object : PuppeteerService])], NestjsPdfService);
|
|
1269
|
+
//#endregion
|
|
1270
|
+
//#region node_modules/.pnpm/@nestjs+config@12.0.0_@nestjs+common@12.0.1_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/config.constants.js
|
|
1271
|
+
var import_main = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1272
|
+
function _resolveEscapeSequences(value) {
|
|
1273
|
+
return value.replace(/\\\$/g, "$");
|
|
1274
|
+
}
|
|
1275
|
+
function expandValue(value, processEnv, runningParsed) {
|
|
1276
|
+
const env = {
|
|
1277
|
+
...runningParsed,
|
|
1278
|
+
...processEnv
|
|
1279
|
+
};
|
|
1280
|
+
const regex = /(?<!\\)\${([^{}]+)}|(?<!\\)\$([A-Za-z_][A-Za-z0-9_]*)/g;
|
|
1281
|
+
let result = value;
|
|
1282
|
+
let match;
|
|
1283
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1284
|
+
while ((match = regex.exec(result)) !== null) {
|
|
1285
|
+
seen.add(result);
|
|
1286
|
+
const [template, bracedExpression, unbracedExpression] = match;
|
|
1287
|
+
const expression = bracedExpression || unbracedExpression;
|
|
1288
|
+
const opMatch = expression.match(/(:\+|\+|:-|-)/);
|
|
1289
|
+
const splitter = opMatch ? opMatch[0] : null;
|
|
1290
|
+
const r = expression.split(splitter);
|
|
1291
|
+
let defaultValue;
|
|
1292
|
+
let value;
|
|
1293
|
+
const key = r.shift();
|
|
1294
|
+
if ([":+", "+"].includes(splitter)) {
|
|
1295
|
+
defaultValue = env[key] ? r.join(splitter) : "";
|
|
1296
|
+
value = null;
|
|
1297
|
+
} else {
|
|
1298
|
+
defaultValue = r.join(splitter);
|
|
1299
|
+
value = env[key];
|
|
1300
|
+
}
|
|
1301
|
+
if (value) {
|
|
1302
|
+
if (seen.has(value)) result = result.replace(template, defaultValue);
|
|
1303
|
+
else result = result.replace(template, value);
|
|
1304
|
+
} else result = result.replace(template, defaultValue);
|
|
1305
|
+
if (result === runningParsed[key]) break;
|
|
1306
|
+
regex.lastIndex = 0;
|
|
1307
|
+
}
|
|
1308
|
+
return result;
|
|
1309
|
+
}
|
|
1310
|
+
function expand(options) {
|
|
1311
|
+
const runningParsed = {};
|
|
1312
|
+
let processEnv = process.env;
|
|
1313
|
+
if (options && options.processEnv != null) processEnv = options.processEnv;
|
|
1314
|
+
for (const key in options.parsed) {
|
|
1315
|
+
let value = options.parsed[key];
|
|
1316
|
+
if (processEnv[key] && processEnv[key] !== value) value = processEnv[key];
|
|
1317
|
+
else value = expandValue(value, processEnv, runningParsed);
|
|
1318
|
+
options.parsed[key] = _resolveEscapeSequences(value);
|
|
1319
|
+
runningParsed[key] = _resolveEscapeSequences(value);
|
|
1320
|
+
}
|
|
1321
|
+
for (const processKey in options.parsed) processEnv[processKey] = options.parsed[processKey];
|
|
1322
|
+
return options;
|
|
1323
|
+
}
|
|
1324
|
+
module.exports.expand = expand;
|
|
1325
|
+
})))();
|
|
1326
|
+
/**
|
|
1327
|
+
* Injection tokens
|
|
1328
|
+
*/
|
|
1329
|
+
const CONFIGURATION_SERVICE_TOKEN = Symbol("CONFIG_SERVICE");
|
|
1330
|
+
const CONFIGURATION_TOKEN = "CONFIGURATION_TOKEN";
|
|
1331
|
+
const CONFIGURATION_LOADER = "CONFIGURATION_LOADER";
|
|
1332
|
+
const VALIDATED_ENV_LOADER = "VALIDATED_ENV_LOADER";
|
|
1333
|
+
const PARTIAL_CONFIGURATION_KEY = "PARTIAL_CONFIGURATION_KEY";
|
|
1334
|
+
const VALIDATED_ENV_PROPNAME = "_PROCESS_ENV_VALIDATED";
|
|
1335
|
+
//#endregion
|
|
1336
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs
|
|
1337
|
+
/**
|
|
1338
|
+
* Checks if a property key is unsafe to access or copy directly.
|
|
1339
|
+
*
|
|
1340
|
+
* This function is used in functions like `get`, `unset`, and `merge` to prevent
|
|
1341
|
+
* prototype pollution attacks by identifying `__proto__`, which modifies the object's
|
|
1342
|
+
* prototype chain. `constructor` and `prototype` stay accessible here because lodash
|
|
1343
|
+
* keeps reads of them unrestricted; write paths use `isUnsafeToWriteProperty` instead,
|
|
1344
|
+
* which also blocks those keys.
|
|
1345
|
+
*
|
|
1346
|
+
* @param key - The property key to check
|
|
1347
|
+
* @returns `true` if the property is unsafe to access directly, `false` otherwise
|
|
1348
|
+
* @internal
|
|
1349
|
+
*/
|
|
1350
|
+
function isUnsafeProperty(key) {
|
|
1351
|
+
return key === "__proto__";
|
|
1352
|
+
}
|
|
1353
|
+
//#endregion
|
|
1354
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.mjs
|
|
1355
|
+
/** Matches any deep property path. Examples: `a.b`, `a[0]`, `a["b"]` */
|
|
1356
|
+
const regexIsDeepProp$1 = /\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;
|
|
1357
|
+
/**
|
|
1358
|
+
* Checks if a given key is a deep key.
|
|
1359
|
+
*
|
|
1360
|
+
* A deep key is a string that contains a dot (.) or square brackets with a property accessor.
|
|
1361
|
+
*
|
|
1362
|
+
* @param {PropertyKey} key - The key to check.
|
|
1363
|
+
* @returns {boolean} - Returns true if the key is a deep key, otherwise false.
|
|
1364
|
+
*
|
|
1365
|
+
* Examples:
|
|
1366
|
+
*
|
|
1367
|
+
* isDeepKey('a.b') // true
|
|
1368
|
+
* isDeepKey('a[b]') // true
|
|
1369
|
+
* isDeepKey('a') // false
|
|
1370
|
+
* isDeepKey(123) // false
|
|
1371
|
+
* isDeepKey('a.b.c') // true
|
|
1372
|
+
* isDeepKey('a[b][c]') // true
|
|
1373
|
+
* isDeepKey('a.') // false
|
|
1374
|
+
* isDeepKey('.a') // false
|
|
1375
|
+
* isDeepKey('a[b') // false
|
|
1376
|
+
* isDeepKey('a]b]') // false
|
|
1377
|
+
* isDeepKey('a][b') // false
|
|
1378
|
+
* isDeepKey('') // false
|
|
1379
|
+
* isDeepKey('a[0]') // true
|
|
1380
|
+
*
|
|
1381
|
+
*/
|
|
1382
|
+
function isDeepKey(key) {
|
|
1383
|
+
switch (typeof key) {
|
|
1384
|
+
case "number":
|
|
1385
|
+
case "symbol": return false;
|
|
1386
|
+
case "string":
|
|
1387
|
+
if (key === "" || key.startsWith(".") || key.endsWith(".")) return false;
|
|
1388
|
+
return regexIsDeepProp$1.test(key);
|
|
1389
|
+
default: return false;
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
//#endregion
|
|
1393
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/compat/_internal/toKey.mjs
|
|
1394
|
+
/**
|
|
1395
|
+
* Converts `value` to a string key if it's not a string or symbol.
|
|
1396
|
+
*
|
|
1397
|
+
* @private
|
|
1398
|
+
* @param {unknown} value The value to inspect.
|
|
1399
|
+
* @returns {string|symbol} Returns the key.
|
|
1400
|
+
*/
|
|
1401
|
+
function toKey(value) {
|
|
1402
|
+
if (typeof value === "string" || typeof value === "symbol") return value;
|
|
1403
|
+
if (Object.is(value?.valueOf?.(), -0)) return "-0";
|
|
1404
|
+
return String(value);
|
|
1405
|
+
}
|
|
1406
|
+
//#endregion
|
|
1407
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/compat/util/toString.mjs
|
|
1408
|
+
/**
|
|
1409
|
+
* Converts `value` to a string.
|
|
1410
|
+
*
|
|
1411
|
+
* An empty string is returned for `null` and `undefined` values.
|
|
1412
|
+
* The sign of `-0` is preserved.
|
|
1413
|
+
*
|
|
1414
|
+
* @param value - The value to convert.
|
|
1415
|
+
* @returns Returns the converted string.
|
|
1416
|
+
*
|
|
1417
|
+
* @example
|
|
1418
|
+
* toString(null) // returns ''
|
|
1419
|
+
* toString(undefined) // returns ''
|
|
1420
|
+
* toString(-0) // returns '-0'
|
|
1421
|
+
* toString([1, 2, -0]) // returns '1,2,-0'
|
|
1422
|
+
* toString([Symbol('a'), Symbol('b')]) // returns 'Symbol(a),Symbol(b)'
|
|
1423
|
+
*/
|
|
1424
|
+
function toString(value) {
|
|
1425
|
+
if (value == null) return "";
|
|
1426
|
+
return baseToString(value);
|
|
1427
|
+
}
|
|
1428
|
+
function baseToString(value) {
|
|
1429
|
+
if (typeof value === "string") return value;
|
|
1430
|
+
if (Array.isArray(value)) return value.map(baseToString).join(",");
|
|
1431
|
+
const result = String(value);
|
|
1432
|
+
if (result === "0" && Object.is(Number(value), -0)) return "-0";
|
|
1433
|
+
return result;
|
|
1434
|
+
}
|
|
1435
|
+
//#endregion
|
|
1436
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/compat/util/toPath.mjs
|
|
1437
|
+
/**
|
|
1438
|
+
* Converts a deep key string into an array of path segments.
|
|
1439
|
+
*
|
|
1440
|
+
* This function takes a string representing a deep key (e.g., 'a.b.c' or 'a[b][c]') and breaks it down into an array of strings, each representing a segment of the path.
|
|
1441
|
+
*
|
|
1442
|
+
* @param deepKey - The deep key string to convert.
|
|
1443
|
+
* @returns An array of strings, each representing a segment of the path.
|
|
1444
|
+
*
|
|
1445
|
+
* Examples:
|
|
1446
|
+
*
|
|
1447
|
+
* toPath('a.b.c') // Returns ['a', 'b', 'c']
|
|
1448
|
+
* toPath('a[b][c]') // Returns ['a', 'b', 'c']
|
|
1449
|
+
* toPath('.a.b.c') // Returns ['', 'a', 'b', 'c']
|
|
1450
|
+
* toPath('a["b.c"].d') // Returns ['a', 'b.c', 'd']
|
|
1451
|
+
* toPath('') // Returns []
|
|
1452
|
+
* toPath('.a[b].c.d[e]["f.g"].h') // Returns ['', 'a', 'b', 'c', 'd', 'e', 'f.g', 'h']
|
|
1453
|
+
*/
|
|
1454
|
+
function toPath(deepKey) {
|
|
1455
|
+
if (Array.isArray(deepKey)) return deepKey.map(toKey);
|
|
1456
|
+
if (typeof deepKey === "symbol") return [deepKey];
|
|
1457
|
+
deepKey = toString(deepKey);
|
|
1458
|
+
const result = [];
|
|
1459
|
+
const length = deepKey.length;
|
|
1460
|
+
if (length === 0) return result;
|
|
1461
|
+
let index = 0;
|
|
1462
|
+
let key = "";
|
|
1463
|
+
let quoteChar = "";
|
|
1464
|
+
let bracket = false;
|
|
1465
|
+
let bracketHadQuote = false;
|
|
1466
|
+
const bracketNumberRegex = /^-?\d+(?:\.\d+)?$/;
|
|
1467
|
+
if (deepKey.charCodeAt(0) === 46) result.push("");
|
|
1468
|
+
while (index < length) {
|
|
1469
|
+
const char = deepKey[index];
|
|
1470
|
+
if (quoteChar) if (char === "\\" && index + 1 < length) {
|
|
1471
|
+
index++;
|
|
1472
|
+
key += deepKey[index];
|
|
1473
|
+
} else if (char === quoteChar) quoteChar = "";
|
|
1474
|
+
else key += char;
|
|
1475
|
+
else if (bracket) if (char === "\"" || char === "'") {
|
|
1476
|
+
quoteChar = char;
|
|
1477
|
+
bracketHadQuote = true;
|
|
1478
|
+
} else if (char === "]") {
|
|
1479
|
+
bracket = false;
|
|
1480
|
+
if (!bracketHadQuote && key.includes(".") && !bracketNumberRegex.test(key)) {
|
|
1481
|
+
const segments = key.split(".");
|
|
1482
|
+
for (let i = 0; i < segments.length; i++) if (segments[i] !== "") result.push(segments[i]);
|
|
1483
|
+
} else result.push(key);
|
|
1484
|
+
key = "";
|
|
1485
|
+
} else key += char;
|
|
1486
|
+
else if (char === "[") {
|
|
1487
|
+
bracket = true;
|
|
1488
|
+
bracketHadQuote = false;
|
|
1489
|
+
if (key) {
|
|
1490
|
+
result.push(key);
|
|
1491
|
+
key = "";
|
|
1492
|
+
}
|
|
1493
|
+
} else if (char === ".") {
|
|
1494
|
+
if (key) {
|
|
1495
|
+
result.push(key);
|
|
1496
|
+
key = "";
|
|
1497
|
+
}
|
|
1498
|
+
const next = deepKey[index + 1];
|
|
1499
|
+
if (next === void 0 || next === ".") result.push("");
|
|
1500
|
+
} else key += char;
|
|
1501
|
+
index++;
|
|
1502
|
+
}
|
|
1503
|
+
if (key) result.push(key);
|
|
1504
|
+
return result;
|
|
1505
|
+
}
|
|
1506
|
+
//#endregion
|
|
1507
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/compat/object/get.mjs
|
|
1508
|
+
/**
|
|
1509
|
+
* Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.
|
|
1510
|
+
*
|
|
1511
|
+
* @param object - The object to query.
|
|
1512
|
+
* @param path - The path of the property to get.
|
|
1513
|
+
* @param [defaultValue] - The value returned if the resolved value is undefined.
|
|
1514
|
+
* @returns Returns the resolved value.
|
|
1515
|
+
*
|
|
1516
|
+
* @example
|
|
1517
|
+
* const object = { a: { b: { c: 1 } } };
|
|
1518
|
+
* get(object, 'a.b.c');
|
|
1519
|
+
* // => 1
|
|
1520
|
+
*
|
|
1521
|
+
* get(object, ['a', 'b', 'c']);
|
|
1522
|
+
* // => 1
|
|
1523
|
+
*
|
|
1524
|
+
* get(object, 'a.b.d', 'default');
|
|
1525
|
+
* // => 'default'
|
|
1526
|
+
*/
|
|
1527
|
+
function get(object, path, defaultValue) {
|
|
1528
|
+
if (object == null) return defaultValue;
|
|
1529
|
+
switch (typeof path) {
|
|
1530
|
+
case "string": {
|
|
1531
|
+
if (isUnsafeProperty(path)) return defaultValue;
|
|
1532
|
+
const result = object[path];
|
|
1533
|
+
if (result === void 0) if (isDeepKey(path) && !Object.hasOwn(object, path)) return get(object, toPath(path), defaultValue);
|
|
1534
|
+
else return defaultValue;
|
|
1535
|
+
return result;
|
|
1536
|
+
}
|
|
1537
|
+
case "number":
|
|
1538
|
+
case "symbol": {
|
|
1539
|
+
if (typeof path === "number") path = toKey(path);
|
|
1540
|
+
const result = object[path];
|
|
1541
|
+
if (result === void 0) return defaultValue;
|
|
1542
|
+
return result;
|
|
1543
|
+
}
|
|
1544
|
+
default: {
|
|
1545
|
+
if (Array.isArray(path)) return getWithPath(object, path, defaultValue);
|
|
1546
|
+
if (Object.is(path?.valueOf(), -0)) path = "-0";
|
|
1547
|
+
else path = String(path);
|
|
1548
|
+
if (isUnsafeProperty(path)) return defaultValue;
|
|
1549
|
+
const result = object[path];
|
|
1550
|
+
if (result === void 0) return defaultValue;
|
|
1551
|
+
return result;
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
function getWithPath(object, path, defaultValue) {
|
|
1556
|
+
if (path.length === 0) return defaultValue;
|
|
1557
|
+
let current = object;
|
|
1558
|
+
for (let index = 0; index < path.length; index++) {
|
|
1559
|
+
if (current == null) return defaultValue;
|
|
1560
|
+
if (isUnsafeProperty(path[index])) return defaultValue;
|
|
1561
|
+
current = current[path[index]];
|
|
1562
|
+
}
|
|
1563
|
+
if (current === void 0) return defaultValue;
|
|
1564
|
+
return current;
|
|
1565
|
+
}
|
|
1566
|
+
//#endregion
|
|
1567
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/compat/_internal/isIndex.mjs
|
|
1568
|
+
const IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/;
|
|
1569
|
+
function isIndex(value, length = Number.MAX_SAFE_INTEGER) {
|
|
1570
|
+
switch (typeof value) {
|
|
1571
|
+
case "number": return Number.isInteger(value) && value >= 0 && value < length;
|
|
1572
|
+
case "symbol": return false;
|
|
1573
|
+
case "string": return IS_UNSIGNED_INTEGER.test(value);
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
//#endregion
|
|
1577
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
|
|
1578
|
+
/**
|
|
1579
|
+
* Gets the `toStringTag` of `value`.
|
|
1580
|
+
*
|
|
1581
|
+
* @private
|
|
1582
|
+
* @param {T} value The value to query.
|
|
1583
|
+
* @returns {string} Returns the `Object.prototype.toString.call` result.
|
|
1584
|
+
*/
|
|
1585
|
+
function getTag(value) {
|
|
1586
|
+
if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
|
|
1587
|
+
return Object.prototype.toString.call(value);
|
|
1588
|
+
}
|
|
1589
|
+
//#endregion
|
|
1590
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/compat/predicate/isArguments.mjs
|
|
1591
|
+
/**
|
|
1592
|
+
* Checks if the given value is an arguments object.
|
|
1593
|
+
*
|
|
1594
|
+
* This function tests whether the provided value is an arguments object or not.
|
|
1595
|
+
* It returns `true` if the value is an arguments object, and `false` otherwise.
|
|
1596
|
+
*
|
|
1597
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an arguments object.
|
|
1598
|
+
*
|
|
1599
|
+
* @param value - The value to test if it is an arguments object.
|
|
1600
|
+
* @returns `true` if the value is an arguments, `false` otherwise.
|
|
1601
|
+
*
|
|
1602
|
+
* @example
|
|
1603
|
+
* const args = (function() { return arguments; })();
|
|
1604
|
+
* const strictArgs = (function() { 'use strict'; return arguments; })();
|
|
1605
|
+
* const value = [1, 2, 3];
|
|
1606
|
+
*
|
|
1607
|
+
* console.log(isArguments(args)); // true
|
|
1608
|
+
* console.log(isArguments(strictArgs)); // true
|
|
1609
|
+
* console.log(isArguments(value)); // false
|
|
1610
|
+
*/
|
|
1611
|
+
function isArguments(value) {
|
|
1612
|
+
return value !== null && typeof value === "object" && getTag(value) === "[object Arguments]";
|
|
1613
|
+
}
|
|
1614
|
+
//#endregion
|
|
1615
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/compat/object/has.mjs
|
|
1616
|
+
/**
|
|
1617
|
+
* Checks if a given path exists within an object.
|
|
1618
|
+
*
|
|
1619
|
+
* You can provide the path as a single property key, an array of property keys,
|
|
1620
|
+
* or a string representing a deep path.
|
|
1621
|
+
*
|
|
1622
|
+
* If the path is an index and the object is an array or an arguments object, the function will verify
|
|
1623
|
+
* if the index is valid and within the bounds of the array or arguments object, even if the array or
|
|
1624
|
+
* arguments object is sparse (i.e., not all indexes are defined).
|
|
1625
|
+
*
|
|
1626
|
+
* @param object - The object to query.
|
|
1627
|
+
* @param path - The path to check. This can be a single property key,
|
|
1628
|
+
* an array of property keys, or a string representing a deep path.
|
|
1629
|
+
* @returns Returns `true` if the path exists in the object, `false` otherwise.
|
|
1630
|
+
*
|
|
1631
|
+
* @example
|
|
1632
|
+
*
|
|
1633
|
+
* const obj = { a: { b: { c: 3 } } };
|
|
1634
|
+
*
|
|
1635
|
+
* has(obj, 'a'); // true
|
|
1636
|
+
* has(obj, ['a', 'b']); // true
|
|
1637
|
+
* has(obj, ['a', 'b', 'c']); // true
|
|
1638
|
+
* has(obj, 'a.b.c'); // true
|
|
1639
|
+
* has(obj, 'a.b.d'); // false
|
|
1640
|
+
* has(obj, ['a', 'b', 'c', 'd']); // false
|
|
1641
|
+
* has([], 0); // false
|
|
1642
|
+
* has([1, 2, 3], 2); // true
|
|
1643
|
+
* has([1, 2, 3], 5); // false
|
|
1644
|
+
*/
|
|
1645
|
+
function has(object, path) {
|
|
1646
|
+
let resolvedPath;
|
|
1647
|
+
if (Array.isArray(path)) resolvedPath = path;
|
|
1648
|
+
else if (typeof path === "string" && isDeepKey(path) && !(path in Object(object))) resolvedPath = toPath(path);
|
|
1649
|
+
else resolvedPath = [path];
|
|
1650
|
+
if (resolvedPath.length === 0) return false;
|
|
1651
|
+
let current = object;
|
|
1652
|
+
for (let i = 0; i < resolvedPath.length; i++) {
|
|
1653
|
+
const key = resolvedPath[i];
|
|
1654
|
+
if (current == null || !Object.hasOwn(current, key)) {
|
|
1655
|
+
if (!((Array.isArray(current) || isArguments(current)) && isIndex(key) && key < current.length)) return false;
|
|
1656
|
+
}
|
|
1657
|
+
current = current[key];
|
|
1658
|
+
}
|
|
1659
|
+
return true;
|
|
1660
|
+
}
|
|
1661
|
+
//#endregion
|
|
1662
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/compat/predicate/isObject.mjs
|
|
1663
|
+
/**
|
|
1664
|
+
* Checks if the given value is an object. An object is a value that is
|
|
1665
|
+
* not a primitive type (string, number, boolean, symbol, null, or undefined).
|
|
1666
|
+
*
|
|
1667
|
+
* This function tests whether the provided value is an object or not.
|
|
1668
|
+
* It returns `true` if the value is an object, and `false` otherwise.
|
|
1669
|
+
*
|
|
1670
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an object value.
|
|
1671
|
+
*
|
|
1672
|
+
* @param value - The value to check if it is an object.
|
|
1673
|
+
* @returns `true` if the value is an object, `false` otherwise.
|
|
1674
|
+
*
|
|
1675
|
+
* @example
|
|
1676
|
+
* const value1 = {};
|
|
1677
|
+
* const value2 = [1, 2, 3];
|
|
1678
|
+
* const value3 = () => {};
|
|
1679
|
+
* const value4 = null;
|
|
1680
|
+
*
|
|
1681
|
+
* console.log(isObject(value1)); // true
|
|
1682
|
+
* console.log(isObject(value2)); // true
|
|
1683
|
+
* console.log(isObject(value3)); // true
|
|
1684
|
+
* console.log(isObject(value4)); // false
|
|
1685
|
+
*/
|
|
1686
|
+
function isObject$1(value) {
|
|
1687
|
+
return value !== null && (typeof value === "object" || typeof value === "function");
|
|
1688
|
+
}
|
|
1689
|
+
//#endregion
|
|
1690
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/compat/predicate/isSymbol.mjs
|
|
1691
|
+
/**
|
|
1692
|
+
* Check whether a value is a symbol.
|
|
1693
|
+
*
|
|
1694
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `symbol`.
|
|
1695
|
+
*
|
|
1696
|
+
* @param value The value to check.
|
|
1697
|
+
* @returns Returns `true` if `value` is a symbol, else `false`.
|
|
1698
|
+
* @example
|
|
1699
|
+
* isSymbol(Symbol.iterator);
|
|
1700
|
+
* // => true
|
|
1701
|
+
*
|
|
1702
|
+
* isSymbol('abc');
|
|
1703
|
+
* // => false
|
|
1704
|
+
*/
|
|
1705
|
+
function isSymbol(value) {
|
|
1706
|
+
return typeof value === "symbol" || value instanceof Symbol;
|
|
1707
|
+
}
|
|
1708
|
+
//#endregion
|
|
1709
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/compat/_internal/isKey.mjs
|
|
1710
|
+
/** Matches any deep property path. (e.g. `a.b[0].c`)*/
|
|
1711
|
+
const regexIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
1712
|
+
/** Matches any word character (alphanumeric & underscore).*/
|
|
1713
|
+
const regexIsPlainProp = /^\w*$/;
|
|
1714
|
+
/**
|
|
1715
|
+
* Checks if `value` is a property name and not a property path. (It's ok that the `value` is not in the keys of the `object`)
|
|
1716
|
+
* @param {unknown} value The value to check.
|
|
1717
|
+
* @param {unknown} object The object to query.
|
|
1718
|
+
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
1719
|
+
*
|
|
1720
|
+
* @example
|
|
1721
|
+
* isKey('a', { a: 1 });
|
|
1722
|
+
* // => true
|
|
1723
|
+
*
|
|
1724
|
+
* isKey('a.b', { a: { b: 2 } });
|
|
1725
|
+
* // => false
|
|
1726
|
+
*/
|
|
1727
|
+
function isKey(value, object) {
|
|
1728
|
+
if (Array.isArray(value)) return false;
|
|
1729
|
+
if (typeof value === "number" || typeof value === "boolean" || value == null || isSymbol(value)) return true;
|
|
1730
|
+
return typeof value === "string" && (regexIsPlainProp.test(value) || !regexIsDeepProp.test(value)) || object != null && Object.hasOwn(object, value);
|
|
1731
|
+
}
|
|
1732
|
+
//#endregion
|
|
1733
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/compat/util/eq.mjs
|
|
1734
|
+
/**
|
|
1735
|
+
* Performs a `SameValueZero` comparison between two values to determine if they are equivalent.
|
|
1736
|
+
*
|
|
1737
|
+
* @param value The value to compare.
|
|
1738
|
+
* @param other The other value to compare.
|
|
1739
|
+
* @returns Returns `true` if the values are equivalent, else `false`.
|
|
1740
|
+
*
|
|
1741
|
+
* @example
|
|
1742
|
+
* eq(1, 1); // true
|
|
1743
|
+
* eq(0, -0); // true
|
|
1744
|
+
* eq(NaN, NaN); // true
|
|
1745
|
+
* eq('a', Object('a')); // false
|
|
1746
|
+
*/
|
|
1747
|
+
function eq(value, other) {
|
|
1748
|
+
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
1749
|
+
}
|
|
1750
|
+
//#endregion
|
|
1751
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/compat/_internal/assignValue.mjs
|
|
1752
|
+
const assignValue = (object, key, value) => {
|
|
1753
|
+
const objValue = object[key];
|
|
1754
|
+
if (!(Object.hasOwn(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) object[key] = value;
|
|
1755
|
+
};
|
|
1756
|
+
//#endregion
|
|
1757
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/_internal/isUnsafeToWriteProperty.mjs
|
|
1758
|
+
/**
|
|
1759
|
+
* Checks if a property key is unsafe to write to.
|
|
1760
|
+
*
|
|
1761
|
+
* Writing through `__proto__`, `constructor`, or `prototype` can reach
|
|
1762
|
+
* `Object.prototype` and pollute every object, so write paths like `set`,
|
|
1763
|
+
* `update`, and `zipObjectDeep` abort when a path segment matches one of
|
|
1764
|
+
* these keys, matching lodash's behavior.
|
|
1765
|
+
*
|
|
1766
|
+
* Read paths like `get` and `unset` use `isUnsafeProperty` instead, which
|
|
1767
|
+
* only blocks `__proto__`; lodash keeps reads of `constructor` and
|
|
1768
|
+
* `prototype` unrestricted.
|
|
1769
|
+
*
|
|
1770
|
+
* @param key - The property key to check
|
|
1771
|
+
* @returns `true` if the property is unsafe to write to, `false` otherwise
|
|
1772
|
+
* @internal
|
|
1773
|
+
*/
|
|
1774
|
+
function isUnsafeToWriteProperty(key) {
|
|
1775
|
+
return key === "__proto__" || key === "constructor" || key === "prototype";
|
|
1776
|
+
}
|
|
1777
|
+
//#endregion
|
|
1778
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/compat/object/updateWith.mjs
|
|
1779
|
+
/**
|
|
1780
|
+
* Updates the value at the specified path of the given object using an updater function and a customizer.
|
|
1781
|
+
* If any part of the path does not exist, it will be created.
|
|
1782
|
+
*
|
|
1783
|
+
* @template T - The type of the object.
|
|
1784
|
+
* @template R - The type of the return value.
|
|
1785
|
+
* @param obj - The object to modify.
|
|
1786
|
+
* @param path - The path of the property to update.
|
|
1787
|
+
* @param updater - The function to produce the updated value.
|
|
1788
|
+
* @param customizer - The function to customize the update process.
|
|
1789
|
+
* @returns The modified object.
|
|
1790
|
+
*
|
|
1791
|
+
* @example
|
|
1792
|
+
* const object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
1793
|
+
* updateWith(object, 'a[0].b.c', (n) => n * n);
|
|
1794
|
+
* // => { 'a': [{ 'b': { 'c': 9 } }] }
|
|
1795
|
+
*/
|
|
1796
|
+
function updateWith(obj, path, updater, customizer) {
|
|
1797
|
+
if (obj == null && !isObject$1(obj)) return obj;
|
|
1798
|
+
let resolvedPath;
|
|
1799
|
+
if (isKey(path, obj)) resolvedPath = [path];
|
|
1800
|
+
else if (Array.isArray(path)) resolvedPath = path;
|
|
1801
|
+
else resolvedPath = toPath(path);
|
|
1802
|
+
const updateValue = updater(get(obj, resolvedPath));
|
|
1803
|
+
let current = obj;
|
|
1804
|
+
for (let i = 0; i < resolvedPath.length && current != null; i++) {
|
|
1805
|
+
const key = toKey(resolvedPath[i]);
|
|
1806
|
+
if (isUnsafeToWriteProperty(key)) return obj;
|
|
1807
|
+
let newValue;
|
|
1808
|
+
if (i === resolvedPath.length - 1) newValue = updateValue;
|
|
1809
|
+
else {
|
|
1810
|
+
const objValue = current[key];
|
|
1811
|
+
const customizerResult = customizer?.(objValue, key, obj);
|
|
1812
|
+
newValue = customizerResult !== void 0 ? customizerResult : isObject$1(objValue) ? objValue : isIndex(resolvedPath[i + 1]) ? [] : {};
|
|
1813
|
+
}
|
|
1814
|
+
assignValue(current, key, newValue);
|
|
1815
|
+
current = current[key];
|
|
1816
|
+
}
|
|
1817
|
+
return obj;
|
|
1818
|
+
}
|
|
1819
|
+
//#endregion
|
|
1820
|
+
//#region node_modules/.pnpm/es-toolkit@1.51.0/node_modules/es-toolkit/dist/compat/object/set.mjs
|
|
1821
|
+
/**
|
|
1822
|
+
* Sets the value at the specified path of the given object. If any part of the path does not exist, it will be created.
|
|
1823
|
+
*
|
|
1824
|
+
* @template T - The type of the object.
|
|
1825
|
+
* @param obj - The object to modify.
|
|
1826
|
+
* @param path - The path of the property to set.
|
|
1827
|
+
* @param value - The value to set.
|
|
1828
|
+
* @returns The modified object.
|
|
1829
|
+
*
|
|
1830
|
+
* @example
|
|
1831
|
+
* // Set a value in a nested object
|
|
1832
|
+
* const obj = { a: { b: { c: 3 } } };
|
|
1833
|
+
* set(obj, 'a.b.c', 4);
|
|
1834
|
+
* console.log(obj.a.b.c); // 4
|
|
1835
|
+
*
|
|
1836
|
+
* @example
|
|
1837
|
+
* // Set a value in an array
|
|
1838
|
+
* const arr = [1, 2, 3];
|
|
1839
|
+
* set(arr, 1, 4);
|
|
1840
|
+
* console.log(arr[1]); // 4
|
|
1841
|
+
*
|
|
1842
|
+
* @example
|
|
1843
|
+
* // Create non-existent path and set value
|
|
1844
|
+
* const obj = {};
|
|
1845
|
+
* set(obj, 'a.b.c', 4);
|
|
1846
|
+
* console.log(obj); // { a: { b: { c: 4 } } }
|
|
1847
|
+
*/
|
|
1848
|
+
function set(obj, path, value) {
|
|
1849
|
+
return updateWith(obj, path, () => value, () => void 0);
|
|
1850
|
+
}
|
|
1851
|
+
//#endregion
|
|
1852
|
+
//#region node_modules/.pnpm/@nestjs+config@12.0.0_@nestjs+common@12.0.1_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/get-config-token.util.js
|
|
1853
|
+
/**
|
|
1854
|
+
* @publicApi
|
|
1855
|
+
*/
|
|
1856
|
+
function getConfigToken(token) {
|
|
1857
|
+
return `CONFIGURATION(${token.toString()})`;
|
|
1858
|
+
}
|
|
1089
1859
|
//#endregion
|
|
1090
|
-
//#region node_modules/.pnpm
|
|
1091
|
-
var
|
|
1092
|
-
const fs$
|
|
1093
|
-
const path = require("path");
|
|
1860
|
+
//#region node_modules/.pnpm/@nestjs+config@12.0.0_@nestjs+common@12.0.1_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/get-default-parser.util.js
|
|
1861
|
+
var import_main$1 = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1862
|
+
const fs$2 = require("fs");
|
|
1863
|
+
const path$1 = require("path");
|
|
1094
1864
|
const os = require("os");
|
|
1095
|
-
const crypto = require("crypto");
|
|
1865
|
+
const crypto$1 = require("crypto");
|
|
1096
1866
|
const TIPS = [
|
|
1097
1867
|
"◈ encrypted .env [www.dotenvx.com]",
|
|
1098
1868
|
"◈ secrets for agents [www.dotenvx.com]",
|
|
@@ -1216,15 +1986,16 @@ var require_main$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1216
1986
|
}
|
|
1217
1987
|
function _vaultPath(options) {
|
|
1218
1988
|
let possibleVaultPath = null;
|
|
1219
|
-
if (options && options.path && options.path.length > 0)
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1989
|
+
if (options && options.path && options.path.length > 0) {
|
|
1990
|
+
if (Array.isArray(options.path)) {
|
|
1991
|
+
for (const filepath of options.path) if (fs$2.existsSync(filepath)) possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
1992
|
+
} else possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
1993
|
+
} else possibleVaultPath = path$1.resolve(process.cwd(), ".env.vault");
|
|
1994
|
+
if (fs$2.existsSync(possibleVaultPath)) return possibleVaultPath;
|
|
1224
1995
|
return null;
|
|
1225
1996
|
}
|
|
1226
1997
|
function _resolveHome(envPath) {
|
|
1227
|
-
return envPath[0] === "~" ? path.join(os.homedir(), envPath.slice(1)) : envPath;
|
|
1998
|
+
return envPath[0] === "~" ? path$1.join(os.homedir(), envPath.slice(1)) : envPath;
|
|
1228
1999
|
}
|
|
1229
2000
|
function _configVault(options) {
|
|
1230
2001
|
const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
|
|
@@ -1237,7 +2008,7 @@ var require_main$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1237
2008
|
return { parsed };
|
|
1238
2009
|
}
|
|
1239
2010
|
function configDotenv(options) {
|
|
1240
|
-
const dotenvPath = path.resolve(process.cwd(), ".env");
|
|
2011
|
+
const dotenvPath = path$1.resolve(process.cwd(), ".env");
|
|
1241
2012
|
let encoding = "utf8";
|
|
1242
2013
|
let processEnv = process.env;
|
|
1243
2014
|
if (options && options.processEnv != null) processEnv = options.processEnv;
|
|
@@ -1246,18 +2017,20 @@ var require_main$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1246
2017
|
if (options && options.encoding) encoding = options.encoding;
|
|
1247
2018
|
else if (debug) _debug("no encoding is specified (UTF-8 is used by default)");
|
|
1248
2019
|
let optionPaths = [dotenvPath];
|
|
1249
|
-
if (options && options.path)
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
2020
|
+
if (options && options.path) {
|
|
2021
|
+
if (!Array.isArray(options.path)) optionPaths = [_resolveHome(options.path)];
|
|
2022
|
+
else {
|
|
2023
|
+
optionPaths = [];
|
|
2024
|
+
for (const filepath of options.path) optionPaths.push(_resolveHome(filepath));
|
|
2025
|
+
}
|
|
1253
2026
|
}
|
|
1254
2027
|
let lastError;
|
|
1255
2028
|
const parsedAll = {};
|
|
1256
|
-
for (const path of optionPaths) try {
|
|
1257
|
-
const parsed = DotenvModule.parse(fs$
|
|
2029
|
+
for (const path$2 of optionPaths) try {
|
|
2030
|
+
const parsed = DotenvModule.parse(fs$2.readFileSync(path$2, { encoding }));
|
|
1258
2031
|
DotenvModule.populate(parsedAll, parsed, options);
|
|
1259
2032
|
} catch (e) {
|
|
1260
|
-
if (debug) _debug(`failed to load ${path} ${e.message}`);
|
|
2033
|
+
if (debug) _debug(`failed to load ${path$2} ${e.message}`);
|
|
1261
2034
|
lastError = e;
|
|
1262
2035
|
}
|
|
1263
2036
|
const populated = DotenvModule.populate(processEnv, parsedAll, options);
|
|
@@ -1267,7 +2040,7 @@ var require_main$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1267
2040
|
const keysCount = Object.keys(populated).length;
|
|
1268
2041
|
const shortPaths = [];
|
|
1269
2042
|
for (const filePath of optionPaths) try {
|
|
1270
|
-
const relative = path.relative(process.cwd(), filePath);
|
|
2043
|
+
const relative = path$1.relative(process.cwd(), filePath);
|
|
1271
2044
|
shortPaths.push(relative);
|
|
1272
2045
|
} catch (e) {
|
|
1273
2046
|
if (debug) _debug(`failed to load ${filePath} ${e.message}`);
|
|
@@ -1297,7 +2070,7 @@ var require_main$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1297
2070
|
const authTag = ciphertext.subarray(-16);
|
|
1298
2071
|
ciphertext = ciphertext.subarray(12, -16);
|
|
1299
2072
|
try {
|
|
1300
|
-
const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
|
|
2073
|
+
const aesgcm = crypto$1.createDecipheriv("aes-256-gcm", key, nonce);
|
|
1301
2074
|
aesgcm.setAuthTag(authTag);
|
|
1302
2075
|
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
1303
2076
|
} catch (error) {
|
|
@@ -1329,8 +2102,10 @@ var require_main$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1329
2102
|
processEnv[key] = parsed[key];
|
|
1330
2103
|
populated[key] = parsed[key];
|
|
1331
2104
|
}
|
|
1332
|
-
if (debug)
|
|
1333
|
-
|
|
2105
|
+
if (debug) {
|
|
2106
|
+
if (override === true) _debug(`"${key}" is already defined and WAS overwritten`);
|
|
2107
|
+
else _debug(`"${key}" is already defined and was NOT overwritten`);
|
|
2108
|
+
}
|
|
1334
2109
|
} else {
|
|
1335
2110
|
processEnv[key] = parsed[key];
|
|
1336
2111
|
populated[key] = parsed[key];
|
|
@@ -1354,2299 +2129,413 @@ var require_main$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1354
2129
|
module.exports.parse = DotenvModule.parse;
|
|
1355
2130
|
module.exports.populate = DotenvModule.populate;
|
|
1356
2131
|
module.exports = DotenvModule;
|
|
1357
|
-
}));
|
|
2132
|
+
})))(), 1);
|
|
2133
|
+
const getDefaultParser = () => import_main$1.parse;
|
|
1358
2134
|
//#endregion
|
|
1359
|
-
//#region node_modules/.pnpm
|
|
1360
|
-
var
|
|
1361
|
-
|
|
1362
|
-
|
|
2135
|
+
//#region node_modules/.pnpm/@nestjs+config@12.0.0_@nestjs+common@12.0.1_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/config.service.js
|
|
2136
|
+
var __decorate$2 = function(decorators, target, key, desc) {
|
|
2137
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2138
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2139
|
+
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;
|
|
2140
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2141
|
+
};
|
|
2142
|
+
var __metadata = function(k, v) {
|
|
2143
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2144
|
+
};
|
|
2145
|
+
var __param = function(paramIndex, decorator) {
|
|
2146
|
+
return function(target, key) {
|
|
2147
|
+
decorator(target, key, paramIndex);
|
|
2148
|
+
};
|
|
2149
|
+
};
|
|
2150
|
+
/**
|
|
2151
|
+
* @publicApi
|
|
2152
|
+
*/
|
|
2153
|
+
let ConfigService = class ConfigService {
|
|
2154
|
+
set isCacheEnabled(value) {
|
|
2155
|
+
this._isCacheEnabled = value;
|
|
2156
|
+
}
|
|
2157
|
+
get isCacheEnabled() {
|
|
2158
|
+
return this._isCacheEnabled;
|
|
2159
|
+
}
|
|
2160
|
+
set skipProcessEnv(value) {
|
|
2161
|
+
this._skipProcessEnv = value;
|
|
2162
|
+
}
|
|
2163
|
+
get skipProcessEnv() {
|
|
2164
|
+
return this._skipProcessEnv;
|
|
2165
|
+
}
|
|
2166
|
+
constructor(internalConfig = {}) {
|
|
2167
|
+
this.internalConfig = internalConfig;
|
|
2168
|
+
this.cache = {};
|
|
2169
|
+
this._changes$ = new rxjs.Subject();
|
|
2170
|
+
this._skipProcessEnv = false;
|
|
2171
|
+
this._isCacheEnabled = false;
|
|
2172
|
+
this.envFilePaths = [];
|
|
2173
|
+
this.parser = getDefaultParser();
|
|
2174
|
+
}
|
|
2175
|
+
/**
|
|
2176
|
+
* Returns a stream of configuration changes.
|
|
2177
|
+
* Each event contains the attribute path, the old value and the new value.
|
|
2178
|
+
*/
|
|
2179
|
+
get changes$() {
|
|
2180
|
+
return this._changes$.asObservable();
|
|
2181
|
+
}
|
|
2182
|
+
/**
|
|
2183
|
+
* Get a configuration value (either custom configuration or process environment variable)
|
|
2184
|
+
* based on property path (you can use dot notation to traverse nested object, e.g. "database.host").
|
|
2185
|
+
* It returns a default value if the key does not exist.
|
|
2186
|
+
* @param propertyPath
|
|
2187
|
+
* @param defaultValueOrOptions
|
|
2188
|
+
*/
|
|
2189
|
+
get(propertyPath, defaultValueOrOptions, options) {
|
|
2190
|
+
const internalValue = this.getFromInternalConfig(propertyPath);
|
|
2191
|
+
if (!(0, _nestjs_common_utils_shared_utils_js.isUndefined)(internalValue)) return internalValue;
|
|
2192
|
+
const validatedEnvValue = this.getFromValidatedEnv(propertyPath);
|
|
2193
|
+
if (!(0, _nestjs_common_utils_shared_utils_js.isUndefined)(validatedEnvValue)) return validatedEnvValue;
|
|
2194
|
+
const defaultValue = this.isGetOptionsObject(defaultValueOrOptions) && !options ? void 0 : defaultValueOrOptions;
|
|
2195
|
+
if (!this._skipProcessEnv) {
|
|
2196
|
+
const processEnvValue = this.getFromProcessEnv(propertyPath, defaultValue);
|
|
2197
|
+
if (!(0, _nestjs_common_utils_shared_utils_js.isUndefined)(processEnvValue)) return processEnvValue;
|
|
2198
|
+
}
|
|
2199
|
+
return defaultValue;
|
|
2200
|
+
}
|
|
2201
|
+
/**
|
|
2202
|
+
* Get a configuration value (either custom configuration or process environment variable)
|
|
2203
|
+
* based on property path (you can use dot notation to traverse nested object, e.g. "database.host").
|
|
2204
|
+
* It returns a default value if the key does not exist.
|
|
2205
|
+
* If the default value is undefined an exception will be thrown.
|
|
2206
|
+
* @param propertyPath
|
|
2207
|
+
* @param defaultValueOrOptions
|
|
2208
|
+
*/
|
|
2209
|
+
getOrThrow(propertyPath, defaultValueOrOptions, options) {
|
|
2210
|
+
const value = this.get(propertyPath, defaultValueOrOptions, options);
|
|
2211
|
+
if ((0, _nestjs_common_utils_shared_utils_js.isUndefined)(value)) throw new TypeError(`Configuration key "${propertyPath.toString()}" does not exist`);
|
|
2212
|
+
return value;
|
|
2213
|
+
}
|
|
2214
|
+
/**
|
|
2215
|
+
* Sets a configuration value based on property path.
|
|
2216
|
+
* @param propertyPath
|
|
2217
|
+
* @param value
|
|
2218
|
+
*/
|
|
2219
|
+
set(propertyPath, value) {
|
|
2220
|
+
const oldValue = this.get(propertyPath);
|
|
2221
|
+
set(this.internalConfig, propertyPath, value);
|
|
2222
|
+
if (typeof propertyPath === "string") {
|
|
2223
|
+
process.env[propertyPath] = String(value);
|
|
2224
|
+
this.updateInterpolatedEnv(propertyPath, String(value));
|
|
2225
|
+
}
|
|
2226
|
+
if (this.isCacheEnabled) this.setInCacheIfDefined(propertyPath, value);
|
|
2227
|
+
this._changes$.next({
|
|
2228
|
+
path: propertyPath,
|
|
2229
|
+
oldValue,
|
|
2230
|
+
newValue: value
|
|
2231
|
+
});
|
|
1363
2232
|
}
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
let result = value;
|
|
1371
|
-
let match;
|
|
1372
|
-
const seen = /* @__PURE__ */ new Set();
|
|
1373
|
-
while ((match = regex.exec(result)) !== null) {
|
|
1374
|
-
seen.add(result);
|
|
1375
|
-
const [template, bracedExpression, unbracedExpression] = match;
|
|
1376
|
-
const expression = bracedExpression || unbracedExpression;
|
|
1377
|
-
const opMatch = expression.match(/(:\+|\+|:-|-)/);
|
|
1378
|
-
const splitter = opMatch ? opMatch[0] : null;
|
|
1379
|
-
const r = expression.split(splitter);
|
|
1380
|
-
let defaultValue;
|
|
1381
|
-
let value;
|
|
1382
|
-
const key = r.shift();
|
|
1383
|
-
if ([":+", "+"].includes(splitter)) {
|
|
1384
|
-
defaultValue = env[key] ? r.join(splitter) : "";
|
|
1385
|
-
value = null;
|
|
1386
|
-
} else {
|
|
1387
|
-
defaultValue = r.join(splitter);
|
|
1388
|
-
value = env[key];
|
|
1389
|
-
}
|
|
1390
|
-
if (value) if (seen.has(value)) result = result.replace(template, defaultValue);
|
|
1391
|
-
else result = result.replace(template, value);
|
|
1392
|
-
else result = result.replace(template, defaultValue);
|
|
1393
|
-
if (result === runningParsed[key]) break;
|
|
1394
|
-
regex.lastIndex = 0;
|
|
1395
|
-
}
|
|
1396
|
-
return result;
|
|
2233
|
+
/**
|
|
2234
|
+
* Sets env file paths from `config.module.ts` to parse.
|
|
2235
|
+
* @param paths
|
|
2236
|
+
*/
|
|
2237
|
+
setEnvFilePaths(paths) {
|
|
2238
|
+
this.envFilePaths = paths;
|
|
1397
2239
|
}
|
|
1398
|
-
function expand(options) {
|
|
1399
|
-
const runningParsed = {};
|
|
1400
|
-
let processEnv = process.env;
|
|
1401
|
-
if (options && options.processEnv != null) processEnv = options.processEnv;
|
|
1402
|
-
for (const key in options.parsed) {
|
|
1403
|
-
let value = options.parsed[key];
|
|
1404
|
-
if (processEnv[key] && processEnv[key] !== value) value = processEnv[key];
|
|
1405
|
-
else value = expandValue(value, processEnv, runningParsed);
|
|
1406
|
-
options.parsed[key] = _resolveEscapeSequences(value);
|
|
1407
|
-
runningParsed[key] = _resolveEscapeSequences(value);
|
|
1408
|
-
}
|
|
1409
|
-
for (const processKey in options.parsed) processEnv[processKey] = options.parsed[processKey];
|
|
1410
|
-
return options;
|
|
1411
|
-
}
|
|
1412
|
-
module.exports.expand = expand;
|
|
1413
|
-
}));
|
|
1414
|
-
//#endregion
|
|
1415
|
-
//#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/config.constants.js
|
|
1416
|
-
var require_config_constants = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1417
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1418
|
-
exports.AS_PROVIDER_METHOD_KEY = exports.VALIDATED_ENV_PROPNAME = exports.PARTIAL_CONFIGURATION_PROPNAME = exports.PARTIAL_CONFIGURATION_KEY = exports.VALIDATED_ENV_LOADER = exports.CONFIGURATION_LOADER = exports.CONFIGURATION_TOKEN = exports.CONFIGURATION_SERVICE_TOKEN = void 0;
|
|
1419
|
-
/**
|
|
1420
|
-
* Injection tokens
|
|
1421
|
-
*/
|
|
1422
|
-
exports.CONFIGURATION_SERVICE_TOKEN = Symbol("CONFIG_SERVICE");
|
|
1423
|
-
exports.CONFIGURATION_TOKEN = "CONFIGURATION_TOKEN";
|
|
1424
|
-
exports.CONFIGURATION_LOADER = "CONFIGURATION_LOADER";
|
|
1425
|
-
exports.VALIDATED_ENV_LOADER = "VALIDATED_ENV_LOADER";
|
|
1426
|
-
exports.PARTIAL_CONFIGURATION_KEY = "PARTIAL_CONFIGURATION_KEY";
|
|
1427
|
-
exports.PARTIAL_CONFIGURATION_PROPNAME = "KEY";
|
|
1428
|
-
exports.VALIDATED_ENV_PROPNAME = "_PROCESS_ENV_VALIDATED";
|
|
1429
|
-
exports.AS_PROVIDER_METHOD_KEY = "asProvider";
|
|
1430
|
-
}));
|
|
1431
|
-
//#endregion
|
|
1432
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArray.js
|
|
1433
|
-
var require_isArray = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1434
|
-
module.exports = Array.isArray;
|
|
1435
|
-
}));
|
|
1436
|
-
//#endregion
|
|
1437
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_freeGlobal.js
|
|
1438
|
-
var require__freeGlobal = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1439
|
-
module.exports = typeof global == "object" && global && global.Object === Object && global;
|
|
1440
|
-
}));
|
|
1441
|
-
//#endregion
|
|
1442
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_root.js
|
|
1443
|
-
var require__root = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1444
|
-
var freeGlobal = require__freeGlobal();
|
|
1445
|
-
/** Detect free variable `self`. */
|
|
1446
|
-
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
1447
|
-
module.exports = freeGlobal || freeSelf || Function("return this")();
|
|
1448
|
-
}));
|
|
1449
|
-
//#endregion
|
|
1450
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Symbol.js
|
|
1451
|
-
var require__Symbol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1452
|
-
module.exports = require__root().Symbol;
|
|
1453
|
-
}));
|
|
1454
|
-
//#endregion
|
|
1455
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getRawTag.js
|
|
1456
|
-
var require__getRawTag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1457
|
-
var Symbol = require__Symbol();
|
|
1458
|
-
/** Used for built-in method references. */
|
|
1459
|
-
var objectProto = Object.prototype;
|
|
1460
|
-
/** Used to check objects for own properties. */
|
|
1461
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1462
|
-
/**
|
|
1463
|
-
* Used to resolve the
|
|
1464
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
1465
|
-
* of values.
|
|
1466
|
-
*/
|
|
1467
|
-
var nativeObjectToString = objectProto.toString;
|
|
1468
|
-
/** Built-in value references. */
|
|
1469
|
-
var symToStringTag = Symbol ? Symbol.toStringTag : void 0;
|
|
1470
|
-
/**
|
|
1471
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
1472
|
-
*
|
|
1473
|
-
* @private
|
|
1474
|
-
* @param {*} value The value to query.
|
|
1475
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
1476
|
-
*/
|
|
1477
|
-
function getRawTag(value) {
|
|
1478
|
-
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
1479
|
-
try {
|
|
1480
|
-
value[symToStringTag] = void 0;
|
|
1481
|
-
var unmasked = true;
|
|
1482
|
-
} catch (e) {}
|
|
1483
|
-
var result = nativeObjectToString.call(value);
|
|
1484
|
-
if (unmasked) if (isOwn) value[symToStringTag] = tag;
|
|
1485
|
-
else delete value[symToStringTag];
|
|
1486
|
-
return result;
|
|
1487
|
-
}
|
|
1488
|
-
module.exports = getRawTag;
|
|
1489
|
-
}));
|
|
1490
|
-
//#endregion
|
|
1491
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_objectToString.js
|
|
1492
|
-
var require__objectToString = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1493
|
-
/**
|
|
1494
|
-
* Used to resolve the
|
|
1495
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
1496
|
-
* of values.
|
|
1497
|
-
*/
|
|
1498
|
-
var nativeObjectToString = Object.prototype.toString;
|
|
1499
|
-
/**
|
|
1500
|
-
* Converts `value` to a string using `Object.prototype.toString`.
|
|
1501
|
-
*
|
|
1502
|
-
* @private
|
|
1503
|
-
* @param {*} value The value to convert.
|
|
1504
|
-
* @returns {string} Returns the converted string.
|
|
1505
|
-
*/
|
|
1506
|
-
function objectToString(value) {
|
|
1507
|
-
return nativeObjectToString.call(value);
|
|
1508
|
-
}
|
|
1509
|
-
module.exports = objectToString;
|
|
1510
|
-
}));
|
|
1511
|
-
//#endregion
|
|
1512
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseGetTag.js
|
|
1513
|
-
var require__baseGetTag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1514
|
-
var Symbol = require__Symbol();
|
|
1515
|
-
var getRawTag = require__getRawTag();
|
|
1516
|
-
var objectToString = require__objectToString();
|
|
1517
|
-
/** `Object#toString` result references. */
|
|
1518
|
-
var nullTag = "[object Null]";
|
|
1519
|
-
var undefinedTag = "[object Undefined]";
|
|
1520
|
-
/** Built-in value references. */
|
|
1521
|
-
var symToStringTag = Symbol ? Symbol.toStringTag : void 0;
|
|
1522
|
-
/**
|
|
1523
|
-
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
1524
|
-
*
|
|
1525
|
-
* @private
|
|
1526
|
-
* @param {*} value The value to query.
|
|
1527
|
-
* @returns {string} Returns the `toStringTag`.
|
|
1528
|
-
*/
|
|
1529
|
-
function baseGetTag(value) {
|
|
1530
|
-
if (value == null) return value === void 0 ? undefinedTag : nullTag;
|
|
1531
|
-
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
1532
|
-
}
|
|
1533
|
-
module.exports = baseGetTag;
|
|
1534
|
-
}));
|
|
1535
|
-
//#endregion
|
|
1536
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObjectLike.js
|
|
1537
|
-
var require_isObjectLike = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1538
|
-
/**
|
|
1539
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
1540
|
-
* and has a `typeof` result of "object".
|
|
1541
|
-
*
|
|
1542
|
-
* @static
|
|
1543
|
-
* @memberOf _
|
|
1544
|
-
* @since 4.0.0
|
|
1545
|
-
* @category Lang
|
|
1546
|
-
* @param {*} value The value to check.
|
|
1547
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
1548
|
-
* @example
|
|
1549
|
-
*
|
|
1550
|
-
* _.isObjectLike({});
|
|
1551
|
-
* // => true
|
|
1552
|
-
*
|
|
1553
|
-
* _.isObjectLike([1, 2, 3]);
|
|
1554
|
-
* // => true
|
|
1555
|
-
*
|
|
1556
|
-
* _.isObjectLike(_.noop);
|
|
1557
|
-
* // => false
|
|
1558
|
-
*
|
|
1559
|
-
* _.isObjectLike(null);
|
|
1560
|
-
* // => false
|
|
1561
|
-
*/
|
|
1562
|
-
function isObjectLike(value) {
|
|
1563
|
-
return value != null && typeof value == "object";
|
|
1564
|
-
}
|
|
1565
|
-
module.exports = isObjectLike;
|
|
1566
|
-
}));
|
|
1567
|
-
//#endregion
|
|
1568
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isSymbol.js
|
|
1569
|
-
var require_isSymbol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1570
|
-
var baseGetTag = require__baseGetTag();
|
|
1571
|
-
var isObjectLike = require_isObjectLike();
|
|
1572
|
-
/** `Object#toString` result references. */
|
|
1573
|
-
var symbolTag = "[object Symbol]";
|
|
1574
|
-
/**
|
|
1575
|
-
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
1576
|
-
*
|
|
1577
|
-
* @static
|
|
1578
|
-
* @memberOf _
|
|
1579
|
-
* @since 4.0.0
|
|
1580
|
-
* @category Lang
|
|
1581
|
-
* @param {*} value The value to check.
|
|
1582
|
-
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
1583
|
-
* @example
|
|
1584
|
-
*
|
|
1585
|
-
* _.isSymbol(Symbol.iterator);
|
|
1586
|
-
* // => true
|
|
1587
|
-
*
|
|
1588
|
-
* _.isSymbol('abc');
|
|
1589
|
-
* // => false
|
|
1590
|
-
*/
|
|
1591
|
-
function isSymbol(value) {
|
|
1592
|
-
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
1593
|
-
}
|
|
1594
|
-
module.exports = isSymbol;
|
|
1595
|
-
}));
|
|
1596
|
-
//#endregion
|
|
1597
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isKey.js
|
|
1598
|
-
var require__isKey = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1599
|
-
var isArray = require_isArray();
|
|
1600
|
-
var isSymbol = require_isSymbol();
|
|
1601
|
-
/** Used to match property names within property paths. */
|
|
1602
|
-
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
1603
|
-
var reIsPlainProp = /^\w*$/;
|
|
1604
|
-
/**
|
|
1605
|
-
* Checks if `value` is a property name and not a property path.
|
|
1606
|
-
*
|
|
1607
|
-
* @private
|
|
1608
|
-
* @param {*} value The value to check.
|
|
1609
|
-
* @param {Object} [object] The object to query keys on.
|
|
1610
|
-
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
1611
|
-
*/
|
|
1612
|
-
function isKey(value, object) {
|
|
1613
|
-
if (isArray(value)) return false;
|
|
1614
|
-
var type = typeof value;
|
|
1615
|
-
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) return true;
|
|
1616
|
-
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
|
|
1617
|
-
}
|
|
1618
|
-
module.exports = isKey;
|
|
1619
|
-
}));
|
|
1620
|
-
//#endregion
|
|
1621
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObject.js
|
|
1622
|
-
var require_isObject = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1623
|
-
/**
|
|
1624
|
-
* Checks if `value` is the
|
|
1625
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
1626
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
1627
|
-
*
|
|
1628
|
-
* @static
|
|
1629
|
-
* @memberOf _
|
|
1630
|
-
* @since 0.1.0
|
|
1631
|
-
* @category Lang
|
|
1632
|
-
* @param {*} value The value to check.
|
|
1633
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
1634
|
-
* @example
|
|
1635
|
-
*
|
|
1636
|
-
* _.isObject({});
|
|
1637
|
-
* // => true
|
|
1638
|
-
*
|
|
1639
|
-
* _.isObject([1, 2, 3]);
|
|
1640
|
-
* // => true
|
|
1641
|
-
*
|
|
1642
|
-
* _.isObject(_.noop);
|
|
1643
|
-
* // => true
|
|
1644
|
-
*
|
|
1645
|
-
* _.isObject(null);
|
|
1646
|
-
* // => false
|
|
1647
|
-
*/
|
|
1648
|
-
function isObject(value) {
|
|
1649
|
-
var type = typeof value;
|
|
1650
|
-
return value != null && (type == "object" || type == "function");
|
|
1651
|
-
}
|
|
1652
|
-
module.exports = isObject;
|
|
1653
|
-
}));
|
|
1654
|
-
//#endregion
|
|
1655
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isFunction.js
|
|
1656
|
-
var require_isFunction = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1657
|
-
var baseGetTag = require__baseGetTag();
|
|
1658
|
-
var isObject = require_isObject();
|
|
1659
|
-
/** `Object#toString` result references. */
|
|
1660
|
-
var asyncTag = "[object AsyncFunction]";
|
|
1661
|
-
var funcTag = "[object Function]";
|
|
1662
|
-
var genTag = "[object GeneratorFunction]";
|
|
1663
|
-
var proxyTag = "[object Proxy]";
|
|
1664
|
-
/**
|
|
1665
|
-
* Checks if `value` is classified as a `Function` object.
|
|
1666
|
-
*
|
|
1667
|
-
* @static
|
|
1668
|
-
* @memberOf _
|
|
1669
|
-
* @since 0.1.0
|
|
1670
|
-
* @category Lang
|
|
1671
|
-
* @param {*} value The value to check.
|
|
1672
|
-
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
1673
|
-
* @example
|
|
1674
|
-
*
|
|
1675
|
-
* _.isFunction(_);
|
|
1676
|
-
* // => true
|
|
1677
|
-
*
|
|
1678
|
-
* _.isFunction(/abc/);
|
|
1679
|
-
* // => false
|
|
1680
|
-
*/
|
|
1681
|
-
function isFunction(value) {
|
|
1682
|
-
if (!isObject(value)) return false;
|
|
1683
|
-
var tag = baseGetTag(value);
|
|
1684
|
-
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
1685
|
-
}
|
|
1686
|
-
module.exports = isFunction;
|
|
1687
|
-
}));
|
|
1688
|
-
//#endregion
|
|
1689
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_coreJsData.js
|
|
1690
|
-
var require__coreJsData = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1691
|
-
module.exports = require__root()["__core-js_shared__"];
|
|
1692
|
-
}));
|
|
1693
|
-
//#endregion
|
|
1694
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isMasked.js
|
|
1695
|
-
var require__isMasked = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1696
|
-
var coreJsData = require__coreJsData();
|
|
1697
|
-
/** Used to detect methods masquerading as native. */
|
|
1698
|
-
var maskSrcKey = function() {
|
|
1699
|
-
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
1700
|
-
return uid ? "Symbol(src)_1." + uid : "";
|
|
1701
|
-
}();
|
|
1702
|
-
/**
|
|
1703
|
-
* Checks if `func` has its source masked.
|
|
1704
|
-
*
|
|
1705
|
-
* @private
|
|
1706
|
-
* @param {Function} func The function to check.
|
|
1707
|
-
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
1708
|
-
*/
|
|
1709
|
-
function isMasked(func) {
|
|
1710
|
-
return !!maskSrcKey && maskSrcKey in func;
|
|
1711
|
-
}
|
|
1712
|
-
module.exports = isMasked;
|
|
1713
|
-
}));
|
|
1714
|
-
//#endregion
|
|
1715
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_toSource.js
|
|
1716
|
-
var require__toSource = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1717
|
-
/** Used to resolve the decompiled source of functions. */
|
|
1718
|
-
var funcToString = Function.prototype.toString;
|
|
1719
|
-
/**
|
|
1720
|
-
* Converts `func` to its source code.
|
|
1721
|
-
*
|
|
1722
|
-
* @private
|
|
1723
|
-
* @param {Function} func The function to convert.
|
|
1724
|
-
* @returns {string} Returns the source code.
|
|
1725
|
-
*/
|
|
1726
|
-
function toSource(func) {
|
|
1727
|
-
if (func != null) {
|
|
1728
|
-
try {
|
|
1729
|
-
return funcToString.call(func);
|
|
1730
|
-
} catch (e) {}
|
|
1731
|
-
try {
|
|
1732
|
-
return func + "";
|
|
1733
|
-
} catch (e) {}
|
|
1734
|
-
}
|
|
1735
|
-
return "";
|
|
1736
|
-
}
|
|
1737
|
-
module.exports = toSource;
|
|
1738
|
-
}));
|
|
1739
|
-
//#endregion
|
|
1740
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsNative.js
|
|
1741
|
-
var require__baseIsNative = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1742
|
-
var isFunction = require_isFunction();
|
|
1743
|
-
var isMasked = require__isMasked();
|
|
1744
|
-
var isObject = require_isObject();
|
|
1745
|
-
var toSource = require__toSource();
|
|
1746
|
-
/**
|
|
1747
|
-
* Used to match `RegExp`
|
|
1748
|
-
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
1749
|
-
*/
|
|
1750
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
1751
|
-
/** Used to detect host constructors (Safari). */
|
|
1752
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
1753
|
-
/** Used for built-in method references. */
|
|
1754
|
-
var funcProto = Function.prototype;
|
|
1755
|
-
var objectProto = Object.prototype;
|
|
1756
|
-
/** Used to resolve the decompiled source of functions. */
|
|
1757
|
-
var funcToString = funcProto.toString;
|
|
1758
|
-
/** Used to check objects for own properties. */
|
|
1759
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1760
|
-
/** Used to detect if a method is native. */
|
|
1761
|
-
var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
1762
|
-
/**
|
|
1763
|
-
* The base implementation of `_.isNative` without bad shim checks.
|
|
1764
|
-
*
|
|
1765
|
-
* @private
|
|
1766
|
-
* @param {*} value The value to check.
|
|
1767
|
-
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
1768
|
-
* else `false`.
|
|
1769
|
-
*/
|
|
1770
|
-
function baseIsNative(value) {
|
|
1771
|
-
if (!isObject(value) || isMasked(value)) return false;
|
|
1772
|
-
return (isFunction(value) ? reIsNative : reIsHostCtor).test(toSource(value));
|
|
1773
|
-
}
|
|
1774
|
-
module.exports = baseIsNative;
|
|
1775
|
-
}));
|
|
1776
|
-
//#endregion
|
|
1777
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getValue.js
|
|
1778
|
-
var require__getValue = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1779
|
-
/**
|
|
1780
|
-
* Gets the value at `key` of `object`.
|
|
1781
|
-
*
|
|
1782
|
-
* @private
|
|
1783
|
-
* @param {Object} [object] The object to query.
|
|
1784
|
-
* @param {string} key The key of the property to get.
|
|
1785
|
-
* @returns {*} Returns the property value.
|
|
1786
|
-
*/
|
|
1787
|
-
function getValue(object, key) {
|
|
1788
|
-
return object == null ? void 0 : object[key];
|
|
1789
|
-
}
|
|
1790
|
-
module.exports = getValue;
|
|
1791
|
-
}));
|
|
1792
|
-
//#endregion
|
|
1793
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getNative.js
|
|
1794
|
-
var require__getNative = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1795
|
-
var baseIsNative = require__baseIsNative();
|
|
1796
|
-
var getValue = require__getValue();
|
|
1797
|
-
/**
|
|
1798
|
-
* Gets the native function at `key` of `object`.
|
|
1799
|
-
*
|
|
1800
|
-
* @private
|
|
1801
|
-
* @param {Object} object The object to query.
|
|
1802
|
-
* @param {string} key The key of the method to get.
|
|
1803
|
-
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
1804
|
-
*/
|
|
1805
|
-
function getNative(object, key) {
|
|
1806
|
-
var value = getValue(object, key);
|
|
1807
|
-
return baseIsNative(value) ? value : void 0;
|
|
1808
|
-
}
|
|
1809
|
-
module.exports = getNative;
|
|
1810
|
-
}));
|
|
1811
|
-
//#endregion
|
|
1812
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_nativeCreate.js
|
|
1813
|
-
var require__nativeCreate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1814
|
-
module.exports = require__getNative()(Object, "create");
|
|
1815
|
-
}));
|
|
1816
|
-
//#endregion
|
|
1817
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashClear.js
|
|
1818
|
-
var require__hashClear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1819
|
-
var nativeCreate = require__nativeCreate();
|
|
1820
|
-
/**
|
|
1821
|
-
* Removes all key-value entries from the hash.
|
|
1822
|
-
*
|
|
1823
|
-
* @private
|
|
1824
|
-
* @name clear
|
|
1825
|
-
* @memberOf Hash
|
|
1826
|
-
*/
|
|
1827
|
-
function hashClear() {
|
|
1828
|
-
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
1829
|
-
this.size = 0;
|
|
1830
|
-
}
|
|
1831
|
-
module.exports = hashClear;
|
|
1832
|
-
}));
|
|
1833
|
-
//#endregion
|
|
1834
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashDelete.js
|
|
1835
|
-
var require__hashDelete = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1836
|
-
/**
|
|
1837
|
-
* Removes `key` and its value from the hash.
|
|
1838
|
-
*
|
|
1839
|
-
* @private
|
|
1840
|
-
* @name delete
|
|
1841
|
-
* @memberOf Hash
|
|
1842
|
-
* @param {Object} hash The hash to modify.
|
|
1843
|
-
* @param {string} key The key of the value to remove.
|
|
1844
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1845
|
-
*/
|
|
1846
|
-
function hashDelete(key) {
|
|
1847
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
1848
|
-
this.size -= result ? 1 : 0;
|
|
1849
|
-
return result;
|
|
1850
|
-
}
|
|
1851
|
-
module.exports = hashDelete;
|
|
1852
|
-
}));
|
|
1853
|
-
//#endregion
|
|
1854
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashGet.js
|
|
1855
|
-
var require__hashGet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1856
|
-
var nativeCreate = require__nativeCreate();
|
|
1857
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
1858
|
-
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
1859
|
-
/** Used to check objects for own properties. */
|
|
1860
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1861
|
-
/**
|
|
1862
|
-
* Gets the hash value for `key`.
|
|
1863
|
-
*
|
|
1864
|
-
* @private
|
|
1865
|
-
* @name get
|
|
1866
|
-
* @memberOf Hash
|
|
1867
|
-
* @param {string} key The key of the value to get.
|
|
1868
|
-
* @returns {*} Returns the entry value.
|
|
1869
|
-
*/
|
|
1870
|
-
function hashGet(key) {
|
|
1871
|
-
var data = this.__data__;
|
|
1872
|
-
if (nativeCreate) {
|
|
1873
|
-
var result = data[key];
|
|
1874
|
-
return result === HASH_UNDEFINED ? void 0 : result;
|
|
1875
|
-
}
|
|
1876
|
-
return hasOwnProperty.call(data, key) ? data[key] : void 0;
|
|
1877
|
-
}
|
|
1878
|
-
module.exports = hashGet;
|
|
1879
|
-
}));
|
|
1880
|
-
//#endregion
|
|
1881
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashHas.js
|
|
1882
|
-
var require__hashHas = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1883
|
-
var nativeCreate = require__nativeCreate();
|
|
1884
|
-
/** Used to check objects for own properties. */
|
|
1885
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1886
|
-
/**
|
|
1887
|
-
* Checks if a hash value for `key` exists.
|
|
1888
|
-
*
|
|
1889
|
-
* @private
|
|
1890
|
-
* @name has
|
|
1891
|
-
* @memberOf Hash
|
|
1892
|
-
* @param {string} key The key of the entry to check.
|
|
1893
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1894
|
-
*/
|
|
1895
|
-
function hashHas(key) {
|
|
1896
|
-
var data = this.__data__;
|
|
1897
|
-
return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
|
|
1898
|
-
}
|
|
1899
|
-
module.exports = hashHas;
|
|
1900
|
-
}));
|
|
1901
|
-
//#endregion
|
|
1902
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashSet.js
|
|
1903
|
-
var require__hashSet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1904
|
-
var nativeCreate = require__nativeCreate();
|
|
1905
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
1906
|
-
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
1907
|
-
/**
|
|
1908
|
-
* Sets the hash `key` to `value`.
|
|
1909
|
-
*
|
|
1910
|
-
* @private
|
|
1911
|
-
* @name set
|
|
1912
|
-
* @memberOf Hash
|
|
1913
|
-
* @param {string} key The key of the value to set.
|
|
1914
|
-
* @param {*} value The value to set.
|
|
1915
|
-
* @returns {Object} Returns the hash instance.
|
|
1916
|
-
*/
|
|
1917
|
-
function hashSet(key, value) {
|
|
1918
|
-
var data = this.__data__;
|
|
1919
|
-
this.size += this.has(key) ? 0 : 1;
|
|
1920
|
-
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
|
|
1921
|
-
return this;
|
|
1922
|
-
}
|
|
1923
|
-
module.exports = hashSet;
|
|
1924
|
-
}));
|
|
1925
|
-
//#endregion
|
|
1926
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Hash.js
|
|
1927
|
-
var require__Hash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1928
|
-
var hashClear = require__hashClear();
|
|
1929
|
-
var hashDelete = require__hashDelete();
|
|
1930
|
-
var hashGet = require__hashGet();
|
|
1931
|
-
var hashHas = require__hashHas();
|
|
1932
|
-
var hashSet = require__hashSet();
|
|
1933
|
-
/**
|
|
1934
|
-
* Creates a hash object.
|
|
1935
|
-
*
|
|
1936
|
-
* @private
|
|
1937
|
-
* @constructor
|
|
1938
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
1939
|
-
*/
|
|
1940
|
-
function Hash(entries) {
|
|
1941
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
1942
|
-
this.clear();
|
|
1943
|
-
while (++index < length) {
|
|
1944
|
-
var entry = entries[index];
|
|
1945
|
-
this.set(entry[0], entry[1]);
|
|
1946
|
-
}
|
|
1947
|
-
}
|
|
1948
|
-
Hash.prototype.clear = hashClear;
|
|
1949
|
-
Hash.prototype["delete"] = hashDelete;
|
|
1950
|
-
Hash.prototype.get = hashGet;
|
|
1951
|
-
Hash.prototype.has = hashHas;
|
|
1952
|
-
Hash.prototype.set = hashSet;
|
|
1953
|
-
module.exports = Hash;
|
|
1954
|
-
}));
|
|
1955
|
-
//#endregion
|
|
1956
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheClear.js
|
|
1957
|
-
var require__listCacheClear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1958
|
-
/**
|
|
1959
|
-
* Removes all key-value entries from the list cache.
|
|
1960
|
-
*
|
|
1961
|
-
* @private
|
|
1962
|
-
* @name clear
|
|
1963
|
-
* @memberOf ListCache
|
|
1964
|
-
*/
|
|
1965
|
-
function listCacheClear() {
|
|
1966
|
-
this.__data__ = [];
|
|
1967
|
-
this.size = 0;
|
|
1968
|
-
}
|
|
1969
|
-
module.exports = listCacheClear;
|
|
1970
|
-
}));
|
|
1971
|
-
//#endregion
|
|
1972
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/eq.js
|
|
1973
|
-
var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1974
|
-
/**
|
|
1975
|
-
* Performs a
|
|
1976
|
-
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
1977
|
-
* comparison between two values to determine if they are equivalent.
|
|
1978
|
-
*
|
|
1979
|
-
* @static
|
|
1980
|
-
* @memberOf _
|
|
1981
|
-
* @since 4.0.0
|
|
1982
|
-
* @category Lang
|
|
1983
|
-
* @param {*} value The value to compare.
|
|
1984
|
-
* @param {*} other The other value to compare.
|
|
1985
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
1986
|
-
* @example
|
|
1987
|
-
*
|
|
1988
|
-
* var object = { 'a': 1 };
|
|
1989
|
-
* var other = { 'a': 1 };
|
|
1990
|
-
*
|
|
1991
|
-
* _.eq(object, object);
|
|
1992
|
-
* // => true
|
|
1993
|
-
*
|
|
1994
|
-
* _.eq(object, other);
|
|
1995
|
-
* // => false
|
|
1996
|
-
*
|
|
1997
|
-
* _.eq('a', 'a');
|
|
1998
|
-
* // => true
|
|
1999
|
-
*
|
|
2000
|
-
* _.eq('a', Object('a'));
|
|
2001
|
-
* // => false
|
|
2002
|
-
*
|
|
2003
|
-
* _.eq(NaN, NaN);
|
|
2004
|
-
* // => true
|
|
2005
|
-
*/
|
|
2006
|
-
function eq(value, other) {
|
|
2007
|
-
return value === other || value !== value && other !== other;
|
|
2008
|
-
}
|
|
2009
|
-
module.exports = eq;
|
|
2010
|
-
}));
|
|
2011
|
-
//#endregion
|
|
2012
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_assocIndexOf.js
|
|
2013
|
-
var require__assocIndexOf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2014
|
-
var eq = require_eq();
|
|
2015
|
-
/**
|
|
2016
|
-
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
2017
|
-
*
|
|
2018
|
-
* @private
|
|
2019
|
-
* @param {Array} array The array to inspect.
|
|
2020
|
-
* @param {*} key The key to search for.
|
|
2021
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
2022
|
-
*/
|
|
2023
|
-
function assocIndexOf(array, key) {
|
|
2024
|
-
var length = array.length;
|
|
2025
|
-
while (length--) if (eq(array[length][0], key)) return length;
|
|
2026
|
-
return -1;
|
|
2027
|
-
}
|
|
2028
|
-
module.exports = assocIndexOf;
|
|
2029
|
-
}));
|
|
2030
|
-
//#endregion
|
|
2031
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheDelete.js
|
|
2032
|
-
var require__listCacheDelete = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2033
|
-
var assocIndexOf = require__assocIndexOf();
|
|
2034
|
-
/** Built-in value references. */
|
|
2035
|
-
var splice = Array.prototype.splice;
|
|
2036
|
-
/**
|
|
2037
|
-
* Removes `key` and its value from the list cache.
|
|
2038
|
-
*
|
|
2039
|
-
* @private
|
|
2040
|
-
* @name delete
|
|
2041
|
-
* @memberOf ListCache
|
|
2042
|
-
* @param {string} key The key of the value to remove.
|
|
2043
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
2044
|
-
*/
|
|
2045
|
-
function listCacheDelete(key) {
|
|
2046
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
2047
|
-
if (index < 0) return false;
|
|
2048
|
-
if (index == data.length - 1) data.pop();
|
|
2049
|
-
else splice.call(data, index, 1);
|
|
2050
|
-
--this.size;
|
|
2051
|
-
return true;
|
|
2052
|
-
}
|
|
2053
|
-
module.exports = listCacheDelete;
|
|
2054
|
-
}));
|
|
2055
|
-
//#endregion
|
|
2056
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheGet.js
|
|
2057
|
-
var require__listCacheGet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2058
|
-
var assocIndexOf = require__assocIndexOf();
|
|
2059
|
-
/**
|
|
2060
|
-
* Gets the list cache value for `key`.
|
|
2061
|
-
*
|
|
2062
|
-
* @private
|
|
2063
|
-
* @name get
|
|
2064
|
-
* @memberOf ListCache
|
|
2065
|
-
* @param {string} key The key of the value to get.
|
|
2066
|
-
* @returns {*} Returns the entry value.
|
|
2067
|
-
*/
|
|
2068
|
-
function listCacheGet(key) {
|
|
2069
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
2070
|
-
return index < 0 ? void 0 : data[index][1];
|
|
2071
|
-
}
|
|
2072
|
-
module.exports = listCacheGet;
|
|
2073
|
-
}));
|
|
2074
|
-
//#endregion
|
|
2075
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheHas.js
|
|
2076
|
-
var require__listCacheHas = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2077
|
-
var assocIndexOf = require__assocIndexOf();
|
|
2078
|
-
/**
|
|
2079
|
-
* Checks if a list cache value for `key` exists.
|
|
2080
|
-
*
|
|
2081
|
-
* @private
|
|
2082
|
-
* @name has
|
|
2083
|
-
* @memberOf ListCache
|
|
2084
|
-
* @param {string} key The key of the entry to check.
|
|
2085
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
2086
|
-
*/
|
|
2087
|
-
function listCacheHas(key) {
|
|
2088
|
-
return assocIndexOf(this.__data__, key) > -1;
|
|
2089
|
-
}
|
|
2090
|
-
module.exports = listCacheHas;
|
|
2091
|
-
}));
|
|
2092
|
-
//#endregion
|
|
2093
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheSet.js
|
|
2094
|
-
var require__listCacheSet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2095
|
-
var assocIndexOf = require__assocIndexOf();
|
|
2096
|
-
/**
|
|
2097
|
-
* Sets the list cache `key` to `value`.
|
|
2098
|
-
*
|
|
2099
|
-
* @private
|
|
2100
|
-
* @name set
|
|
2101
|
-
* @memberOf ListCache
|
|
2102
|
-
* @param {string} key The key of the value to set.
|
|
2103
|
-
* @param {*} value The value to set.
|
|
2104
|
-
* @returns {Object} Returns the list cache instance.
|
|
2105
|
-
*/
|
|
2106
|
-
function listCacheSet(key, value) {
|
|
2107
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
2108
|
-
if (index < 0) {
|
|
2109
|
-
++this.size;
|
|
2110
|
-
data.push([key, value]);
|
|
2111
|
-
} else data[index][1] = value;
|
|
2112
|
-
return this;
|
|
2113
|
-
}
|
|
2114
|
-
module.exports = listCacheSet;
|
|
2115
|
-
}));
|
|
2116
|
-
//#endregion
|
|
2117
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_ListCache.js
|
|
2118
|
-
var require__ListCache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2119
|
-
var listCacheClear = require__listCacheClear();
|
|
2120
|
-
var listCacheDelete = require__listCacheDelete();
|
|
2121
|
-
var listCacheGet = require__listCacheGet();
|
|
2122
|
-
var listCacheHas = require__listCacheHas();
|
|
2123
|
-
var listCacheSet = require__listCacheSet();
|
|
2124
|
-
/**
|
|
2125
|
-
* Creates an list cache object.
|
|
2126
|
-
*
|
|
2127
|
-
* @private
|
|
2128
|
-
* @constructor
|
|
2129
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
2130
|
-
*/
|
|
2131
|
-
function ListCache(entries) {
|
|
2132
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
2133
|
-
this.clear();
|
|
2134
|
-
while (++index < length) {
|
|
2135
|
-
var entry = entries[index];
|
|
2136
|
-
this.set(entry[0], entry[1]);
|
|
2137
|
-
}
|
|
2138
|
-
}
|
|
2139
|
-
ListCache.prototype.clear = listCacheClear;
|
|
2140
|
-
ListCache.prototype["delete"] = listCacheDelete;
|
|
2141
|
-
ListCache.prototype.get = listCacheGet;
|
|
2142
|
-
ListCache.prototype.has = listCacheHas;
|
|
2143
|
-
ListCache.prototype.set = listCacheSet;
|
|
2144
|
-
module.exports = ListCache;
|
|
2145
|
-
}));
|
|
2146
|
-
//#endregion
|
|
2147
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Map.js
|
|
2148
|
-
var require__Map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2149
|
-
module.exports = require__getNative()(require__root(), "Map");
|
|
2150
|
-
}));
|
|
2151
|
-
//#endregion
|
|
2152
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheClear.js
|
|
2153
|
-
var require__mapCacheClear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2154
|
-
var Hash = require__Hash();
|
|
2155
|
-
var ListCache = require__ListCache();
|
|
2156
|
-
var Map = require__Map();
|
|
2157
|
-
/**
|
|
2158
|
-
* Removes all key-value entries from the map.
|
|
2159
|
-
*
|
|
2160
|
-
* @private
|
|
2161
|
-
* @name clear
|
|
2162
|
-
* @memberOf MapCache
|
|
2163
|
-
*/
|
|
2164
|
-
function mapCacheClear() {
|
|
2165
|
-
this.size = 0;
|
|
2166
|
-
this.__data__ = {
|
|
2167
|
-
"hash": new Hash(),
|
|
2168
|
-
"map": new (Map || ListCache)(),
|
|
2169
|
-
"string": new Hash()
|
|
2170
|
-
};
|
|
2171
|
-
}
|
|
2172
|
-
module.exports = mapCacheClear;
|
|
2173
|
-
}));
|
|
2174
|
-
//#endregion
|
|
2175
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isKeyable.js
|
|
2176
|
-
var require__isKeyable = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2177
|
-
/**
|
|
2178
|
-
* Checks if `value` is suitable for use as unique object key.
|
|
2179
|
-
*
|
|
2180
|
-
* @private
|
|
2181
|
-
* @param {*} value The value to check.
|
|
2182
|
-
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
2183
|
-
*/
|
|
2184
|
-
function isKeyable(value) {
|
|
2185
|
-
var type = typeof value;
|
|
2186
|
-
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
2187
|
-
}
|
|
2188
|
-
module.exports = isKeyable;
|
|
2189
|
-
}));
|
|
2190
|
-
//#endregion
|
|
2191
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getMapData.js
|
|
2192
|
-
var require__getMapData = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2193
|
-
var isKeyable = require__isKeyable();
|
|
2194
|
-
/**
|
|
2195
|
-
* Gets the data for `map`.
|
|
2196
|
-
*
|
|
2197
|
-
* @private
|
|
2198
|
-
* @param {Object} map The map to query.
|
|
2199
|
-
* @param {string} key The reference key.
|
|
2200
|
-
* @returns {*} Returns the map data.
|
|
2201
|
-
*/
|
|
2202
|
-
function getMapData(map, key) {
|
|
2203
|
-
var data = map.__data__;
|
|
2204
|
-
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
2205
|
-
}
|
|
2206
|
-
module.exports = getMapData;
|
|
2207
|
-
}));
|
|
2208
|
-
//#endregion
|
|
2209
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheDelete.js
|
|
2210
|
-
var require__mapCacheDelete = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2211
|
-
var getMapData = require__getMapData();
|
|
2212
|
-
/**
|
|
2213
|
-
* Removes `key` and its value from the map.
|
|
2214
|
-
*
|
|
2215
|
-
* @private
|
|
2216
|
-
* @name delete
|
|
2217
|
-
* @memberOf MapCache
|
|
2218
|
-
* @param {string} key The key of the value to remove.
|
|
2219
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
2220
|
-
*/
|
|
2221
|
-
function mapCacheDelete(key) {
|
|
2222
|
-
var result = getMapData(this, key)["delete"](key);
|
|
2223
|
-
this.size -= result ? 1 : 0;
|
|
2224
|
-
return result;
|
|
2225
|
-
}
|
|
2226
|
-
module.exports = mapCacheDelete;
|
|
2227
|
-
}));
|
|
2228
|
-
//#endregion
|
|
2229
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheGet.js
|
|
2230
|
-
var require__mapCacheGet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2231
|
-
var getMapData = require__getMapData();
|
|
2232
|
-
/**
|
|
2233
|
-
* Gets the map value for `key`.
|
|
2234
|
-
*
|
|
2235
|
-
* @private
|
|
2236
|
-
* @name get
|
|
2237
|
-
* @memberOf MapCache
|
|
2238
|
-
* @param {string} key The key of the value to get.
|
|
2239
|
-
* @returns {*} Returns the entry value.
|
|
2240
|
-
*/
|
|
2241
|
-
function mapCacheGet(key) {
|
|
2242
|
-
return getMapData(this, key).get(key);
|
|
2243
|
-
}
|
|
2244
|
-
module.exports = mapCacheGet;
|
|
2245
|
-
}));
|
|
2246
|
-
//#endregion
|
|
2247
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheHas.js
|
|
2248
|
-
var require__mapCacheHas = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2249
|
-
var getMapData = require__getMapData();
|
|
2250
|
-
/**
|
|
2251
|
-
* Checks if a map value for `key` exists.
|
|
2252
|
-
*
|
|
2253
|
-
* @private
|
|
2254
|
-
* @name has
|
|
2255
|
-
* @memberOf MapCache
|
|
2256
|
-
* @param {string} key The key of the entry to check.
|
|
2257
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
2258
|
-
*/
|
|
2259
|
-
function mapCacheHas(key) {
|
|
2260
|
-
return getMapData(this, key).has(key);
|
|
2261
|
-
}
|
|
2262
|
-
module.exports = mapCacheHas;
|
|
2263
|
-
}));
|
|
2264
|
-
//#endregion
|
|
2265
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheSet.js
|
|
2266
|
-
var require__mapCacheSet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2267
|
-
var getMapData = require__getMapData();
|
|
2268
|
-
/**
|
|
2269
|
-
* Sets the map `key` to `value`.
|
|
2270
|
-
*
|
|
2271
|
-
* @private
|
|
2272
|
-
* @name set
|
|
2273
|
-
* @memberOf MapCache
|
|
2274
|
-
* @param {string} key The key of the value to set.
|
|
2275
|
-
* @param {*} value The value to set.
|
|
2276
|
-
* @returns {Object} Returns the map cache instance.
|
|
2277
|
-
*/
|
|
2278
|
-
function mapCacheSet(key, value) {
|
|
2279
|
-
var data = getMapData(this, key), size = data.size;
|
|
2280
|
-
data.set(key, value);
|
|
2281
|
-
this.size += data.size == size ? 0 : 1;
|
|
2282
|
-
return this;
|
|
2283
|
-
}
|
|
2284
|
-
module.exports = mapCacheSet;
|
|
2285
|
-
}));
|
|
2286
|
-
//#endregion
|
|
2287
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_MapCache.js
|
|
2288
|
-
var require__MapCache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2289
|
-
var mapCacheClear = require__mapCacheClear();
|
|
2290
|
-
var mapCacheDelete = require__mapCacheDelete();
|
|
2291
|
-
var mapCacheGet = require__mapCacheGet();
|
|
2292
|
-
var mapCacheHas = require__mapCacheHas();
|
|
2293
|
-
var mapCacheSet = require__mapCacheSet();
|
|
2294
|
-
/**
|
|
2295
|
-
* Creates a map cache object to store key-value pairs.
|
|
2296
|
-
*
|
|
2297
|
-
* @private
|
|
2298
|
-
* @constructor
|
|
2299
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
2300
|
-
*/
|
|
2301
|
-
function MapCache(entries) {
|
|
2302
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
2303
|
-
this.clear();
|
|
2304
|
-
while (++index < length) {
|
|
2305
|
-
var entry = entries[index];
|
|
2306
|
-
this.set(entry[0], entry[1]);
|
|
2307
|
-
}
|
|
2308
|
-
}
|
|
2309
|
-
MapCache.prototype.clear = mapCacheClear;
|
|
2310
|
-
MapCache.prototype["delete"] = mapCacheDelete;
|
|
2311
|
-
MapCache.prototype.get = mapCacheGet;
|
|
2312
|
-
MapCache.prototype.has = mapCacheHas;
|
|
2313
|
-
MapCache.prototype.set = mapCacheSet;
|
|
2314
|
-
module.exports = MapCache;
|
|
2315
|
-
}));
|
|
2316
|
-
//#endregion
|
|
2317
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/memoize.js
|
|
2318
|
-
var require_memoize = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2319
|
-
var MapCache = require__MapCache();
|
|
2320
|
-
/** Error message constants. */
|
|
2321
|
-
var FUNC_ERROR_TEXT = "Expected a function";
|
|
2322
|
-
/**
|
|
2323
|
-
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
2324
|
-
* provided, it determines the cache key for storing the result based on the
|
|
2325
|
-
* arguments provided to the memoized function. By default, the first argument
|
|
2326
|
-
* provided to the memoized function is used as the map cache key. The `func`
|
|
2327
|
-
* is invoked with the `this` binding of the memoized function.
|
|
2328
|
-
*
|
|
2329
|
-
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
2330
|
-
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
2331
|
-
* constructor with one whose instances implement the
|
|
2332
|
-
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
2333
|
-
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
2334
|
-
*
|
|
2335
|
-
* @static
|
|
2336
|
-
* @memberOf _
|
|
2337
|
-
* @since 0.1.0
|
|
2338
|
-
* @category Function
|
|
2339
|
-
* @param {Function} func The function to have its output memoized.
|
|
2340
|
-
* @param {Function} [resolver] The function to resolve the cache key.
|
|
2341
|
-
* @returns {Function} Returns the new memoized function.
|
|
2342
|
-
* @example
|
|
2343
|
-
*
|
|
2344
|
-
* var object = { 'a': 1, 'b': 2 };
|
|
2345
|
-
* var other = { 'c': 3, 'd': 4 };
|
|
2346
|
-
*
|
|
2347
|
-
* var values = _.memoize(_.values);
|
|
2348
|
-
* values(object);
|
|
2349
|
-
* // => [1, 2]
|
|
2350
|
-
*
|
|
2351
|
-
* values(other);
|
|
2352
|
-
* // => [3, 4]
|
|
2353
|
-
*
|
|
2354
|
-
* object.a = 2;
|
|
2355
|
-
* values(object);
|
|
2356
|
-
* // => [1, 2]
|
|
2357
|
-
*
|
|
2358
|
-
* // Modify the result cache.
|
|
2359
|
-
* values.cache.set(object, ['a', 'b']);
|
|
2360
|
-
* values(object);
|
|
2361
|
-
* // => ['a', 'b']
|
|
2362
|
-
*
|
|
2363
|
-
* // Replace `_.memoize.Cache`.
|
|
2364
|
-
* _.memoize.Cache = WeakMap;
|
|
2365
|
-
*/
|
|
2366
|
-
function memoize(func, resolver) {
|
|
2367
|
-
if (typeof func != "function" || resolver != null && typeof resolver != "function") throw new TypeError(FUNC_ERROR_TEXT);
|
|
2368
|
-
var memoized = function() {
|
|
2369
|
-
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
|
2370
|
-
if (cache.has(key)) return cache.get(key);
|
|
2371
|
-
var result = func.apply(this, args);
|
|
2372
|
-
memoized.cache = cache.set(key, result) || cache;
|
|
2373
|
-
return result;
|
|
2374
|
-
};
|
|
2375
|
-
memoized.cache = new (memoize.Cache || MapCache)();
|
|
2376
|
-
return memoized;
|
|
2377
|
-
}
|
|
2378
|
-
memoize.Cache = MapCache;
|
|
2379
|
-
module.exports = memoize;
|
|
2380
|
-
}));
|
|
2381
|
-
//#endregion
|
|
2382
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_memoizeCapped.js
|
|
2383
|
-
var require__memoizeCapped = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2384
|
-
var memoize = require_memoize();
|
|
2385
|
-
/** Used as the maximum memoize cache size. */
|
|
2386
|
-
var MAX_MEMOIZE_SIZE = 500;
|
|
2387
|
-
/**
|
|
2388
|
-
* A specialized version of `_.memoize` which clears the memoized function's
|
|
2389
|
-
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
|
|
2390
|
-
*
|
|
2391
|
-
* @private
|
|
2392
|
-
* @param {Function} func The function to have its output memoized.
|
|
2393
|
-
* @returns {Function} Returns the new memoized function.
|
|
2394
|
-
*/
|
|
2395
|
-
function memoizeCapped(func) {
|
|
2396
|
-
var result = memoize(func, function(key) {
|
|
2397
|
-
if (cache.size === MAX_MEMOIZE_SIZE) cache.clear();
|
|
2398
|
-
return key;
|
|
2399
|
-
});
|
|
2400
|
-
var cache = result.cache;
|
|
2401
|
-
return result;
|
|
2402
|
-
}
|
|
2403
|
-
module.exports = memoizeCapped;
|
|
2404
|
-
}));
|
|
2405
|
-
//#endregion
|
|
2406
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_stringToPath.js
|
|
2407
|
-
var require__stringToPath = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2408
|
-
var memoizeCapped = require__memoizeCapped();
|
|
2409
|
-
/** Used to match property names within property paths. */
|
|
2410
|
-
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
2411
|
-
/** Used to match backslashes in property paths. */
|
|
2412
|
-
var reEscapeChar = /\\(\\)?/g;
|
|
2413
|
-
module.exports = memoizeCapped(function(string) {
|
|
2414
|
-
var result = [];
|
|
2415
|
-
if (string.charCodeAt(0) === 46) result.push("");
|
|
2416
|
-
string.replace(rePropName, function(match, number, quote, subString) {
|
|
2417
|
-
result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
|
|
2418
|
-
});
|
|
2419
|
-
return result;
|
|
2420
|
-
});
|
|
2421
|
-
}));
|
|
2422
|
-
//#endregion
|
|
2423
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_arrayMap.js
|
|
2424
|
-
var require__arrayMap = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2425
|
-
/**
|
|
2426
|
-
* A specialized version of `_.map` for arrays without support for iteratee
|
|
2427
|
-
* shorthands.
|
|
2428
|
-
*
|
|
2429
|
-
* @private
|
|
2430
|
-
* @param {Array} [array] The array to iterate over.
|
|
2431
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
2432
|
-
* @returns {Array} Returns the new mapped array.
|
|
2433
|
-
*/
|
|
2434
|
-
function arrayMap(array, iteratee) {
|
|
2435
|
-
var index = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
2436
|
-
while (++index < length) result[index] = iteratee(array[index], index, array);
|
|
2437
|
-
return result;
|
|
2438
|
-
}
|
|
2439
|
-
module.exports = arrayMap;
|
|
2440
|
-
}));
|
|
2441
|
-
//#endregion
|
|
2442
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseToString.js
|
|
2443
|
-
var require__baseToString = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2444
|
-
var Symbol = require__Symbol();
|
|
2445
|
-
var arrayMap = require__arrayMap();
|
|
2446
|
-
var isArray = require_isArray();
|
|
2447
|
-
var isSymbol = require_isSymbol();
|
|
2448
|
-
/** Used as references for various `Number` constants. */
|
|
2449
|
-
var INFINITY = Infinity;
|
|
2450
|
-
/** Used to convert symbols to primitives and strings. */
|
|
2451
|
-
var symbolProto = Symbol ? Symbol.prototype : void 0;
|
|
2452
|
-
var symbolToString = symbolProto ? symbolProto.toString : void 0;
|
|
2453
|
-
/**
|
|
2454
|
-
* The base implementation of `_.toString` which doesn't convert nullish
|
|
2455
|
-
* values to empty strings.
|
|
2456
|
-
*
|
|
2457
|
-
* @private
|
|
2458
|
-
* @param {*} value The value to process.
|
|
2459
|
-
* @returns {string} Returns the string.
|
|
2460
|
-
*/
|
|
2461
|
-
function baseToString(value) {
|
|
2462
|
-
if (typeof value == "string") return value;
|
|
2463
|
-
if (isArray(value)) return arrayMap(value, baseToString) + "";
|
|
2464
|
-
if (isSymbol(value)) return symbolToString ? symbolToString.call(value) : "";
|
|
2465
|
-
var result = value + "";
|
|
2466
|
-
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
2467
|
-
}
|
|
2468
|
-
module.exports = baseToString;
|
|
2469
|
-
}));
|
|
2470
|
-
//#endregion
|
|
2471
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/toString.js
|
|
2472
|
-
var require_toString = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2473
|
-
var baseToString = require__baseToString();
|
|
2474
|
-
/**
|
|
2475
|
-
* Converts `value` to a string. An empty string is returned for `null`
|
|
2476
|
-
* and `undefined` values. The sign of `-0` is preserved.
|
|
2477
|
-
*
|
|
2478
|
-
* @static
|
|
2479
|
-
* @memberOf _
|
|
2480
|
-
* @since 4.0.0
|
|
2481
|
-
* @category Lang
|
|
2482
|
-
* @param {*} value The value to convert.
|
|
2483
|
-
* @returns {string} Returns the converted string.
|
|
2484
|
-
* @example
|
|
2485
|
-
*
|
|
2486
|
-
* _.toString(null);
|
|
2487
|
-
* // => ''
|
|
2488
|
-
*
|
|
2489
|
-
* _.toString(-0);
|
|
2490
|
-
* // => '-0'
|
|
2491
|
-
*
|
|
2492
|
-
* _.toString([1, 2, 3]);
|
|
2493
|
-
* // => '1,2,3'
|
|
2494
|
-
*/
|
|
2495
|
-
function toString(value) {
|
|
2496
|
-
return value == null ? "" : baseToString(value);
|
|
2497
|
-
}
|
|
2498
|
-
module.exports = toString;
|
|
2499
|
-
}));
|
|
2500
|
-
//#endregion
|
|
2501
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_castPath.js
|
|
2502
|
-
var require__castPath = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2503
|
-
var isArray = require_isArray();
|
|
2504
|
-
var isKey = require__isKey();
|
|
2505
|
-
var stringToPath = require__stringToPath();
|
|
2506
|
-
var toString = require_toString();
|
|
2507
|
-
/**
|
|
2508
|
-
* Casts `value` to a path array if it's not one.
|
|
2509
|
-
*
|
|
2510
|
-
* @private
|
|
2511
|
-
* @param {*} value The value to inspect.
|
|
2512
|
-
* @param {Object} [object] The object to query keys on.
|
|
2513
|
-
* @returns {Array} Returns the cast property path array.
|
|
2514
|
-
*/
|
|
2515
|
-
function castPath(value, object) {
|
|
2516
|
-
if (isArray(value)) return value;
|
|
2517
|
-
return isKey(value, object) ? [value] : stringToPath(toString(value));
|
|
2518
|
-
}
|
|
2519
|
-
module.exports = castPath;
|
|
2520
|
-
}));
|
|
2521
|
-
//#endregion
|
|
2522
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_toKey.js
|
|
2523
|
-
var require__toKey = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2524
|
-
var isSymbol = require_isSymbol();
|
|
2525
|
-
/** Used as references for various `Number` constants. */
|
|
2526
|
-
var INFINITY = Infinity;
|
|
2527
|
-
/**
|
|
2528
|
-
* Converts `value` to a string key if it's not a string or symbol.
|
|
2529
|
-
*
|
|
2530
|
-
* @private
|
|
2531
|
-
* @param {*} value The value to inspect.
|
|
2532
|
-
* @returns {string|symbol} Returns the key.
|
|
2533
|
-
*/
|
|
2534
|
-
function toKey(value) {
|
|
2535
|
-
if (typeof value == "string" || isSymbol(value)) return value;
|
|
2536
|
-
var result = value + "";
|
|
2537
|
-
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
2538
|
-
}
|
|
2539
|
-
module.exports = toKey;
|
|
2540
|
-
}));
|
|
2541
|
-
//#endregion
|
|
2542
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseGet.js
|
|
2543
|
-
var require__baseGet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2544
|
-
var castPath = require__castPath();
|
|
2545
|
-
var toKey = require__toKey();
|
|
2546
|
-
/**
|
|
2547
|
-
* The base implementation of `_.get` without support for default values.
|
|
2548
|
-
*
|
|
2549
|
-
* @private
|
|
2550
|
-
* @param {Object} object The object to query.
|
|
2551
|
-
* @param {Array|string} path The path of the property to get.
|
|
2552
|
-
* @returns {*} Returns the resolved value.
|
|
2553
|
-
*/
|
|
2554
|
-
function baseGet(object, path) {
|
|
2555
|
-
path = castPath(path, object);
|
|
2556
|
-
var index = 0, length = path.length;
|
|
2557
|
-
while (object != null && index < length) object = object[toKey(path[index++])];
|
|
2558
|
-
return index && index == length ? object : void 0;
|
|
2559
|
-
}
|
|
2560
|
-
module.exports = baseGet;
|
|
2561
|
-
}));
|
|
2562
|
-
//#endregion
|
|
2563
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/get.js
|
|
2564
|
-
var require_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2565
|
-
var baseGet = require__baseGet();
|
|
2566
|
-
/**
|
|
2567
|
-
* Gets the value at `path` of `object`. If the resolved value is
|
|
2568
|
-
* `undefined`, the `defaultValue` is returned in its place.
|
|
2569
|
-
*
|
|
2570
|
-
* @static
|
|
2571
|
-
* @memberOf _
|
|
2572
|
-
* @since 3.7.0
|
|
2573
|
-
* @category Object
|
|
2574
|
-
* @param {Object} object The object to query.
|
|
2575
|
-
* @param {Array|string} path The path of the property to get.
|
|
2576
|
-
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
|
2577
|
-
* @returns {*} Returns the resolved value.
|
|
2578
|
-
* @example
|
|
2579
|
-
*
|
|
2580
|
-
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
2581
|
-
*
|
|
2582
|
-
* _.get(object, 'a[0].b.c');
|
|
2583
|
-
* // => 3
|
|
2584
|
-
*
|
|
2585
|
-
* _.get(object, ['a', '0', 'b', 'c']);
|
|
2586
|
-
* // => 3
|
|
2587
|
-
*
|
|
2588
|
-
* _.get(object, 'a.b.c', 'default');
|
|
2589
|
-
* // => 'default'
|
|
2590
|
-
*/
|
|
2591
|
-
function get(object, path, defaultValue) {
|
|
2592
|
-
var result = object == null ? void 0 : baseGet(object, path);
|
|
2593
|
-
return result === void 0 ? defaultValue : result;
|
|
2594
|
-
}
|
|
2595
|
-
module.exports = get;
|
|
2596
|
-
}));
|
|
2597
|
-
//#endregion
|
|
2598
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseHas.js
|
|
2599
|
-
var require__baseHas = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2600
|
-
/** Used to check objects for own properties. */
|
|
2601
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2602
2240
|
/**
|
|
2603
|
-
*
|
|
2604
|
-
*
|
|
2605
|
-
* @private
|
|
2606
|
-
* @param {Object} [object] The object to query.
|
|
2607
|
-
* @param {Array|string} key The key to check.
|
|
2608
|
-
* @returns {boolean} Returns `true` if `key` exists, else `false`.
|
|
2609
|
-
*/
|
|
2610
|
-
function baseHas(object, key) {
|
|
2611
|
-
return object != null && hasOwnProperty.call(object, key);
|
|
2612
|
-
}
|
|
2613
|
-
module.exports = baseHas;
|
|
2614
|
-
}));
|
|
2615
|
-
//#endregion
|
|
2616
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsArguments.js
|
|
2617
|
-
var require__baseIsArguments = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2618
|
-
var baseGetTag = require__baseGetTag();
|
|
2619
|
-
var isObjectLike = require_isObjectLike();
|
|
2620
|
-
/** `Object#toString` result references. */
|
|
2621
|
-
var argsTag = "[object Arguments]";
|
|
2622
|
-
/**
|
|
2623
|
-
* The base implementation of `_.isArguments`.
|
|
2624
|
-
*
|
|
2625
|
-
* @private
|
|
2626
|
-
* @param {*} value The value to check.
|
|
2627
|
-
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
2241
|
+
* Sets parser from `config.module.ts`.
|
|
2242
|
+
* @param parser
|
|
2628
2243
|
*/
|
|
2629
|
-
|
|
2630
|
-
|
|
2244
|
+
setParser(parser) {
|
|
2245
|
+
this.parser = parser;
|
|
2631
2246
|
}
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArguments.js
|
|
2636
|
-
var require_isArguments = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2637
|
-
var baseIsArguments = require__baseIsArguments();
|
|
2638
|
-
var isObjectLike = require_isObjectLike();
|
|
2639
|
-
/** Used for built-in method references. */
|
|
2640
|
-
var objectProto = Object.prototype;
|
|
2641
|
-
/** Used to check objects for own properties. */
|
|
2642
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2643
|
-
/** Built-in value references. */
|
|
2644
|
-
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
2645
|
-
module.exports = baseIsArguments(function() {
|
|
2646
|
-
return arguments;
|
|
2647
|
-
}()) ? baseIsArguments : function(value) {
|
|
2648
|
-
return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
2649
|
-
};
|
|
2650
|
-
}));
|
|
2651
|
-
//#endregion
|
|
2652
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isIndex.js
|
|
2653
|
-
var require__isIndex = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2654
|
-
/** Used as references for various `Number` constants. */
|
|
2655
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
2656
|
-
/** Used to detect unsigned integer values. */
|
|
2657
|
-
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
2658
|
-
/**
|
|
2659
|
-
* Checks if `value` is a valid array-like index.
|
|
2660
|
-
*
|
|
2661
|
-
* @private
|
|
2662
|
-
* @param {*} value The value to check.
|
|
2663
|
-
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
2664
|
-
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
2665
|
-
*/
|
|
2666
|
-
function isIndex(value, length) {
|
|
2667
|
-
var type = typeof value;
|
|
2668
|
-
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
2669
|
-
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
|
|
2247
|
+
getFromCache(propertyPath, defaultValue) {
|
|
2248
|
+
const cachedValue = get(this.cache, propertyPath);
|
|
2249
|
+
return (0, _nestjs_common_utils_shared_utils_js.isUndefined)(cachedValue) ? defaultValue : cachedValue;
|
|
2670
2250
|
}
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
//#endregion
|
|
2674
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isLength.js
|
|
2675
|
-
var require_isLength = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2676
|
-
/** Used as references for various `Number` constants. */
|
|
2677
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
2678
|
-
/**
|
|
2679
|
-
* Checks if `value` is a valid array-like length.
|
|
2680
|
-
*
|
|
2681
|
-
* **Note:** This method is loosely based on
|
|
2682
|
-
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
2683
|
-
*
|
|
2684
|
-
* @static
|
|
2685
|
-
* @memberOf _
|
|
2686
|
-
* @since 4.0.0
|
|
2687
|
-
* @category Lang
|
|
2688
|
-
* @param {*} value The value to check.
|
|
2689
|
-
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
2690
|
-
* @example
|
|
2691
|
-
*
|
|
2692
|
-
* _.isLength(3);
|
|
2693
|
-
* // => true
|
|
2694
|
-
*
|
|
2695
|
-
* _.isLength(Number.MIN_VALUE);
|
|
2696
|
-
* // => false
|
|
2697
|
-
*
|
|
2698
|
-
* _.isLength(Infinity);
|
|
2699
|
-
* // => false
|
|
2700
|
-
*
|
|
2701
|
-
* _.isLength('3');
|
|
2702
|
-
* // => false
|
|
2703
|
-
*/
|
|
2704
|
-
function isLength(value) {
|
|
2705
|
-
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
2251
|
+
getFromValidatedEnv(propertyPath) {
|
|
2252
|
+
return get(this.internalConfig[VALIDATED_ENV_PROPNAME], propertyPath);
|
|
2706
2253
|
}
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
var require__hasPath = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2712
|
-
var castPath = require__castPath();
|
|
2713
|
-
var isArguments = require_isArguments();
|
|
2714
|
-
var isArray = require_isArray();
|
|
2715
|
-
var isIndex = require__isIndex();
|
|
2716
|
-
var isLength = require_isLength();
|
|
2717
|
-
var toKey = require__toKey();
|
|
2718
|
-
/**
|
|
2719
|
-
* Checks if `path` exists on `object`.
|
|
2720
|
-
*
|
|
2721
|
-
* @private
|
|
2722
|
-
* @param {Object} object The object to query.
|
|
2723
|
-
* @param {Array|string} path The path to check.
|
|
2724
|
-
* @param {Function} hasFunc The function to check properties.
|
|
2725
|
-
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
|
2726
|
-
*/
|
|
2727
|
-
function hasPath(object, path, hasFunc) {
|
|
2728
|
-
path = castPath(path, object);
|
|
2729
|
-
var index = -1, length = path.length, result = false;
|
|
2730
|
-
while (++index < length) {
|
|
2731
|
-
var key = toKey(path[index]);
|
|
2732
|
-
if (!(result = object != null && hasFunc(object, key))) break;
|
|
2733
|
-
object = object[key];
|
|
2254
|
+
getFromProcessEnv(propertyPath, defaultValue) {
|
|
2255
|
+
if (this.isCacheEnabled && has(this.cache, propertyPath)) {
|
|
2256
|
+
const cachedValue = this.getFromCache(propertyPath, defaultValue);
|
|
2257
|
+
return !(0, _nestjs_common_utils_shared_utils_js.isUndefined)(cachedValue) ? cachedValue : defaultValue;
|
|
2734
2258
|
}
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
return
|
|
2738
|
-
}
|
|
2739
|
-
module.exports = hasPath;
|
|
2740
|
-
}));
|
|
2741
|
-
//#endregion
|
|
2742
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/has.js
|
|
2743
|
-
var require_has = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2744
|
-
var baseHas = require__baseHas();
|
|
2745
|
-
var hasPath = require__hasPath();
|
|
2746
|
-
/**
|
|
2747
|
-
* Checks if `path` is a direct property of `object`.
|
|
2748
|
-
*
|
|
2749
|
-
* @static
|
|
2750
|
-
* @since 0.1.0
|
|
2751
|
-
* @memberOf _
|
|
2752
|
-
* @category Object
|
|
2753
|
-
* @param {Object} object The object to query.
|
|
2754
|
-
* @param {Array|string} path The path to check.
|
|
2755
|
-
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
|
2756
|
-
* @example
|
|
2757
|
-
*
|
|
2758
|
-
* var object = { 'a': { 'b': 2 } };
|
|
2759
|
-
* var other = _.create({ 'a': _.create({ 'b': 2 }) });
|
|
2760
|
-
*
|
|
2761
|
-
* _.has(object, 'a');
|
|
2762
|
-
* // => true
|
|
2763
|
-
*
|
|
2764
|
-
* _.has(object, 'a.b');
|
|
2765
|
-
* // => true
|
|
2766
|
-
*
|
|
2767
|
-
* _.has(object, ['a', 'b']);
|
|
2768
|
-
* // => true
|
|
2769
|
-
*
|
|
2770
|
-
* _.has(other, 'a');
|
|
2771
|
-
* // => false
|
|
2772
|
-
*/
|
|
2773
|
-
function has(object, path) {
|
|
2774
|
-
return object != null && hasPath(object, path, baseHas);
|
|
2259
|
+
const processValue = get(process.env, propertyPath);
|
|
2260
|
+
this.setInCacheIfDefined(propertyPath, processValue);
|
|
2261
|
+
return processValue;
|
|
2775
2262
|
}
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
//#endregion
|
|
2779
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_defineProperty.js
|
|
2780
|
-
var require__defineProperty = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2781
|
-
var getNative = require__getNative();
|
|
2782
|
-
module.exports = function() {
|
|
2783
|
-
try {
|
|
2784
|
-
var func = getNative(Object, "defineProperty");
|
|
2785
|
-
func({}, "", {});
|
|
2786
|
-
return func;
|
|
2787
|
-
} catch (e) {}
|
|
2788
|
-
}();
|
|
2789
|
-
}));
|
|
2790
|
-
//#endregion
|
|
2791
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseAssignValue.js
|
|
2792
|
-
var require__baseAssignValue = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2793
|
-
var defineProperty = require__defineProperty();
|
|
2794
|
-
/**
|
|
2795
|
-
* The base implementation of `assignValue` and `assignMergeValue` without
|
|
2796
|
-
* value checks.
|
|
2797
|
-
*
|
|
2798
|
-
* @private
|
|
2799
|
-
* @param {Object} object The object to modify.
|
|
2800
|
-
* @param {string} key The key of the property to assign.
|
|
2801
|
-
* @param {*} value The value to assign.
|
|
2802
|
-
*/
|
|
2803
|
-
function baseAssignValue(object, key, value) {
|
|
2804
|
-
if (key == "__proto__" && defineProperty) defineProperty(object, key, {
|
|
2805
|
-
"configurable": true,
|
|
2806
|
-
"enumerable": true,
|
|
2807
|
-
"value": value,
|
|
2808
|
-
"writable": true
|
|
2809
|
-
});
|
|
2810
|
-
else object[key] = value;
|
|
2263
|
+
getFromInternalConfig(propertyPath) {
|
|
2264
|
+
return get(this.internalConfig, propertyPath);
|
|
2811
2265
|
}
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_assignValue.js
|
|
2816
|
-
var require__assignValue = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2817
|
-
var baseAssignValue = require__baseAssignValue();
|
|
2818
|
-
var eq = require_eq();
|
|
2819
|
-
/** Used to check objects for own properties. */
|
|
2820
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2821
|
-
/**
|
|
2822
|
-
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
|
2823
|
-
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
2824
|
-
* for equality comparisons.
|
|
2825
|
-
*
|
|
2826
|
-
* @private
|
|
2827
|
-
* @param {Object} object The object to modify.
|
|
2828
|
-
* @param {string} key The key of the property to assign.
|
|
2829
|
-
* @param {*} value The value to assign.
|
|
2830
|
-
*/
|
|
2831
|
-
function assignValue(object, key, value) {
|
|
2832
|
-
var objValue = object[key];
|
|
2833
|
-
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) baseAssignValue(object, key, value);
|
|
2266
|
+
setInCacheIfDefined(propertyPath, value) {
|
|
2267
|
+
if (typeof value === "undefined") return;
|
|
2268
|
+
set(this.cache, propertyPath, value);
|
|
2834
2269
|
}
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
//#endregion
|
|
2838
|
-
//#region node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseSet.js
|
|
2839
|
-
var require__baseSet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2840
|
-
var assignValue = require__assignValue();
|
|
2841
|
-
var castPath = require__castPath();
|
|
2842
|
-
var isIndex = require__isIndex();
|
|
2843
|
-
var isObject = require_isObject();
|
|
2844
|
-
var toKey = require__toKey();
|
|
2845
|
-
/**
|
|
2846
|
-
* The base implementation of `_.set`.
|
|
2847
|
-
*
|
|
2848
|
-
* @private
|
|
2849
|
-
* @param {Object} object The object to modify.
|
|
2850
|
-
* @param {Array|string} path The path of the property to set.
|
|
2851
|
-
* @param {*} value The value to set.
|
|
2852
|
-
* @param {Function} [customizer] The function to customize path creation.
|
|
2853
|
-
* @returns {Object} Returns `object`.
|
|
2854
|
-
*/
|
|
2855
|
-
function baseSet(object, path, value, customizer) {
|
|
2856
|
-
if (!isObject(object)) return object;
|
|
2857
|
-
path = castPath(path, object);
|
|
2858
|
-
var index = -1, length = path.length, lastIndex = length - 1, nested = object;
|
|
2859
|
-
while (nested != null && ++index < length) {
|
|
2860
|
-
var key = toKey(path[index]), newValue = value;
|
|
2861
|
-
if (key === "__proto__" || key === "constructor" || key === "prototype") return object;
|
|
2862
|
-
if (index != lastIndex) {
|
|
2863
|
-
var objValue = nested[key];
|
|
2864
|
-
newValue = customizer ? customizer(objValue, key, nested) : void 0;
|
|
2865
|
-
if (newValue === void 0) newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
|
|
2866
|
-
}
|
|
2867
|
-
assignValue(nested, key, newValue);
|
|
2868
|
-
nested = nested[key];
|
|
2869
|
-
}
|
|
2870
|
-
return object;
|
|
2270
|
+
isGetOptionsObject(options) {
|
|
2271
|
+
return options && options?.infer && Object.keys(options).length === 1;
|
|
2871
2272
|
}
|
|
2872
|
-
|
|
2873
|
-
}
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
var baseSet = require__baseSet();
|
|
2878
|
-
/**
|
|
2879
|
-
* Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
|
|
2880
|
-
* it's created. Arrays are created for missing index properties while objects
|
|
2881
|
-
* are created for all other missing properties. Use `_.setWith` to customize
|
|
2882
|
-
* `path` creation.
|
|
2883
|
-
*
|
|
2884
|
-
* **Note:** This method mutates `object`.
|
|
2885
|
-
*
|
|
2886
|
-
* @static
|
|
2887
|
-
* @memberOf _
|
|
2888
|
-
* @since 3.7.0
|
|
2889
|
-
* @category Object
|
|
2890
|
-
* @param {Object} object The object to modify.
|
|
2891
|
-
* @param {Array|string} path The path of the property to set.
|
|
2892
|
-
* @param {*} value The value to set.
|
|
2893
|
-
* @returns {Object} Returns `object`.
|
|
2894
|
-
* @example
|
|
2895
|
-
*
|
|
2896
|
-
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
2897
|
-
*
|
|
2898
|
-
* _.set(object, 'a[0].b.c', 4);
|
|
2899
|
-
* console.log(object.a[0].b.c);
|
|
2900
|
-
* // => 4
|
|
2901
|
-
*
|
|
2902
|
-
* _.set(object, ['x', '0', 'y', 'z'], 5);
|
|
2903
|
-
* console.log(object.x[0].y.z);
|
|
2904
|
-
* // => 5
|
|
2905
|
-
*/
|
|
2906
|
-
function set(object, path, value) {
|
|
2907
|
-
return object == null ? object : baseSet(object, path, value);
|
|
2273
|
+
updateInterpolatedEnv(propertyPath, value) {
|
|
2274
|
+
let config = {};
|
|
2275
|
+
for (const envFilePath of this.envFilePaths) if (fs.default.existsSync(envFilePath)) config = Object.assign(this.parser(fs.default.readFileSync(envFilePath)), config);
|
|
2276
|
+
const regex = new RegExp(`\\$\\{?${propertyPath}\\}?`, "g");
|
|
2277
|
+
for (const [k, v] of Object.entries(config)) if (regex.test(v)) process.env[k] = v.replace(regex, value);
|
|
2908
2278
|
}
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2917
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
2918
|
-
enumerable: true,
|
|
2919
|
-
get: function() {
|
|
2920
|
-
return m[k];
|
|
2921
|
-
}
|
|
2922
|
-
};
|
|
2923
|
-
Object.defineProperty(o, k2, desc);
|
|
2924
|
-
}) : (function(o, m, k, k2) {
|
|
2925
|
-
if (k2 === void 0) k2 = k;
|
|
2926
|
-
o[k2] = m[k];
|
|
2927
|
-
}));
|
|
2928
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
2929
|
-
Object.defineProperty(o, "default", {
|
|
2930
|
-
enumerable: true,
|
|
2931
|
-
value: v
|
|
2932
|
-
});
|
|
2933
|
-
}) : function(o, v) {
|
|
2934
|
-
o["default"] = v;
|
|
2935
|
-
});
|
|
2936
|
-
var __decorate = exports && exports.__decorate || function(decorators, target, key, desc) {
|
|
2937
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2938
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2939
|
-
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;
|
|
2940
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2941
|
-
};
|
|
2942
|
-
var __importStar = exports && exports.__importStar || (function() {
|
|
2943
|
-
var ownKeys = function(o) {
|
|
2944
|
-
ownKeys = Object.getOwnPropertyNames || function(o) {
|
|
2945
|
-
var ar = [];
|
|
2946
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
2947
|
-
return ar;
|
|
2948
|
-
};
|
|
2949
|
-
return ownKeys(o);
|
|
2950
|
-
};
|
|
2951
|
-
return function(mod) {
|
|
2952
|
-
if (mod && mod.__esModule) return mod;
|
|
2953
|
-
var result = {};
|
|
2954
|
-
if (mod != null) {
|
|
2955
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
2956
|
-
}
|
|
2957
|
-
__setModuleDefault(result, mod);
|
|
2958
|
-
return result;
|
|
2959
|
-
};
|
|
2960
|
-
})();
|
|
2961
|
-
var __metadata = exports && exports.__metadata || function(k, v) {
|
|
2962
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2963
|
-
};
|
|
2964
|
-
var __param = exports && exports.__param || function(paramIndex, decorator) {
|
|
2965
|
-
return function(target, key) {
|
|
2966
|
-
decorator(target, key, paramIndex);
|
|
2967
|
-
};
|
|
2968
|
-
};
|
|
2969
|
-
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
2970
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
2971
|
-
};
|
|
2972
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2973
|
-
exports.ConfigService = void 0;
|
|
2974
|
-
const common_1$3 = require("@nestjs/common");
|
|
2975
|
-
const shared_utils_1$1 = require("@nestjs/common/utils/shared.utils");
|
|
2976
|
-
const dotenv = __importStar(require_main$1());
|
|
2977
|
-
const fs_1 = __importDefault(require("fs"));
|
|
2978
|
-
const get_1 = __importDefault(require_get());
|
|
2979
|
-
const has_1 = __importDefault(require_has());
|
|
2980
|
-
const set_1 = __importDefault(require_set());
|
|
2981
|
-
const rxjs_1 = require("rxjs");
|
|
2982
|
-
const config_constants_1 = require_config_constants();
|
|
2983
|
-
/**
|
|
2984
|
-
* @publicApi
|
|
2985
|
-
*/
|
|
2986
|
-
let ConfigService = class ConfigService {
|
|
2987
|
-
set isCacheEnabled(value) {
|
|
2988
|
-
this._isCacheEnabled = value;
|
|
2989
|
-
}
|
|
2990
|
-
get isCacheEnabled() {
|
|
2991
|
-
return this._isCacheEnabled;
|
|
2992
|
-
}
|
|
2993
|
-
set skipProcessEnv(value) {
|
|
2994
|
-
this._skipProcessEnv = value;
|
|
2995
|
-
}
|
|
2996
|
-
get skipProcessEnv() {
|
|
2997
|
-
return this._skipProcessEnv;
|
|
2998
|
-
}
|
|
2999
|
-
constructor(internalConfig = {}) {
|
|
3000
|
-
this.internalConfig = internalConfig;
|
|
3001
|
-
this.cache = {};
|
|
3002
|
-
this._changes$ = new rxjs_1.Subject();
|
|
3003
|
-
this._skipProcessEnv = false;
|
|
3004
|
-
this._isCacheEnabled = false;
|
|
3005
|
-
this.envFilePaths = [];
|
|
3006
|
-
}
|
|
3007
|
-
/**
|
|
3008
|
-
* Returns a stream of configuration changes.
|
|
3009
|
-
* Each event contains the attribute path, the old value and the new value.
|
|
3010
|
-
*/
|
|
3011
|
-
get changes$() {
|
|
3012
|
-
return this._changes$.asObservable();
|
|
3013
|
-
}
|
|
3014
|
-
/**
|
|
3015
|
-
* Get a configuration value (either custom configuration or process environment variable)
|
|
3016
|
-
* based on property path (you can use dot notation to traverse nested object, e.g. "database.host").
|
|
3017
|
-
* It returns a default value if the key does not exist.
|
|
3018
|
-
* @param propertyPath
|
|
3019
|
-
* @param defaultValueOrOptions
|
|
3020
|
-
*/
|
|
3021
|
-
get(propertyPath, defaultValueOrOptions, options) {
|
|
3022
|
-
const internalValue = this.getFromInternalConfig(propertyPath);
|
|
3023
|
-
if (!(0, shared_utils_1$1.isUndefined)(internalValue)) return internalValue;
|
|
3024
|
-
const validatedEnvValue = this.getFromValidatedEnv(propertyPath);
|
|
3025
|
-
if (!(0, shared_utils_1$1.isUndefined)(validatedEnvValue)) return validatedEnvValue;
|
|
3026
|
-
const defaultValue = this.isGetOptionsObject(defaultValueOrOptions) && !options ? void 0 : defaultValueOrOptions;
|
|
3027
|
-
if (!this._skipProcessEnv) {
|
|
3028
|
-
const processEnvValue = this.getFromProcessEnv(propertyPath, defaultValue);
|
|
3029
|
-
if (!(0, shared_utils_1$1.isUndefined)(processEnvValue)) return processEnvValue;
|
|
3030
|
-
}
|
|
3031
|
-
return defaultValue;
|
|
3032
|
-
}
|
|
3033
|
-
/**
|
|
3034
|
-
* Get a configuration value (either custom configuration or process environment variable)
|
|
3035
|
-
* based on property path (you can use dot notation to traverse nested object, e.g. "database.host").
|
|
3036
|
-
* It returns a default value if the key does not exist.
|
|
3037
|
-
* If the default value is undefined an exception will be thrown.
|
|
3038
|
-
* @param propertyPath
|
|
3039
|
-
* @param defaultValueOrOptions
|
|
3040
|
-
*/
|
|
3041
|
-
getOrThrow(propertyPath, defaultValueOrOptions, options) {
|
|
3042
|
-
const value = this.get(propertyPath, defaultValueOrOptions, options);
|
|
3043
|
-
if ((0, shared_utils_1$1.isUndefined)(value)) throw new TypeError(`Configuration key "${propertyPath.toString()}" does not exist`);
|
|
3044
|
-
return value;
|
|
3045
|
-
}
|
|
3046
|
-
/**
|
|
3047
|
-
* Sets a configuration value based on property path.
|
|
3048
|
-
* @param propertyPath
|
|
3049
|
-
* @param value
|
|
3050
|
-
*/
|
|
3051
|
-
set(propertyPath, value) {
|
|
3052
|
-
const oldValue = this.get(propertyPath);
|
|
3053
|
-
(0, set_1.default)(this.internalConfig, propertyPath, value);
|
|
3054
|
-
if (typeof propertyPath === "string") {
|
|
3055
|
-
process.env[propertyPath] = String(value);
|
|
3056
|
-
this.updateInterpolatedEnv(propertyPath, String(value));
|
|
3057
|
-
}
|
|
3058
|
-
if (this.isCacheEnabled) this.setInCacheIfDefined(propertyPath, value);
|
|
3059
|
-
this._changes$.next({
|
|
3060
|
-
path: propertyPath,
|
|
3061
|
-
oldValue,
|
|
3062
|
-
newValue: value
|
|
3063
|
-
});
|
|
3064
|
-
}
|
|
3065
|
-
/**
|
|
3066
|
-
* Sets env file paths from `config.module.ts` to parse.
|
|
3067
|
-
* @param paths
|
|
3068
|
-
*/
|
|
3069
|
-
setEnvFilePaths(paths) {
|
|
3070
|
-
this.envFilePaths = paths;
|
|
3071
|
-
}
|
|
3072
|
-
getFromCache(propertyPath, defaultValue) {
|
|
3073
|
-
const cachedValue = (0, get_1.default)(this.cache, propertyPath);
|
|
3074
|
-
return (0, shared_utils_1$1.isUndefined)(cachedValue) ? defaultValue : cachedValue;
|
|
3075
|
-
}
|
|
3076
|
-
getFromValidatedEnv(propertyPath) {
|
|
3077
|
-
return (0, get_1.default)(this.internalConfig[config_constants_1.VALIDATED_ENV_PROPNAME], propertyPath);
|
|
3078
|
-
}
|
|
3079
|
-
getFromProcessEnv(propertyPath, defaultValue) {
|
|
3080
|
-
if (this.isCacheEnabled && (0, has_1.default)(this.cache, propertyPath)) {
|
|
3081
|
-
const cachedValue = this.getFromCache(propertyPath, defaultValue);
|
|
3082
|
-
return !(0, shared_utils_1$1.isUndefined)(cachedValue) ? cachedValue : defaultValue;
|
|
3083
|
-
}
|
|
3084
|
-
const processValue = (0, get_1.default)(process.env, propertyPath);
|
|
3085
|
-
this.setInCacheIfDefined(propertyPath, processValue);
|
|
3086
|
-
return processValue;
|
|
3087
|
-
}
|
|
3088
|
-
getFromInternalConfig(propertyPath) {
|
|
3089
|
-
return (0, get_1.default)(this.internalConfig, propertyPath);
|
|
3090
|
-
}
|
|
3091
|
-
setInCacheIfDefined(propertyPath, value) {
|
|
3092
|
-
if (typeof value === "undefined") return;
|
|
3093
|
-
(0, set_1.default)(this.cache, propertyPath, value);
|
|
3094
|
-
}
|
|
3095
|
-
isGetOptionsObject(options) {
|
|
3096
|
-
return options && options?.infer && Object.keys(options).length === 1;
|
|
3097
|
-
}
|
|
3098
|
-
updateInterpolatedEnv(propertyPath, value) {
|
|
3099
|
-
let config = {};
|
|
3100
|
-
for (const envFilePath of this.envFilePaths) if (fs_1.default.existsSync(envFilePath)) config = Object.assign(dotenv.parse(fs_1.default.readFileSync(envFilePath)), config);
|
|
3101
|
-
const regex = new RegExp(`\\$\\{?${propertyPath}\\}?`, "g");
|
|
3102
|
-
for (const [k, v] of Object.entries(config)) if (regex.test(v)) process.env[k] = v.replace(regex, value);
|
|
3103
|
-
}
|
|
3104
|
-
};
|
|
3105
|
-
exports.ConfigService = ConfigService;
|
|
3106
|
-
exports.ConfigService = ConfigService = __decorate([
|
|
3107
|
-
(0, common_1$3.Injectable)(),
|
|
3108
|
-
__param(0, (0, common_1$3.Optional)()),
|
|
3109
|
-
__param(0, (0, common_1$3.Inject)(config_constants_1.CONFIGURATION_TOKEN)),
|
|
3110
|
-
__metadata("design:paramtypes", [Object])
|
|
3111
|
-
], ConfigService);
|
|
3112
|
-
}));
|
|
2279
|
+
};
|
|
2280
|
+
ConfigService = __decorate$2([
|
|
2281
|
+
(0, _nestjs_common.Injectable)(),
|
|
2282
|
+
__param(0, (0, _nestjs_common.Optional)()),
|
|
2283
|
+
__param(0, (0, _nestjs_common.Inject)(CONFIGURATION_TOKEN)),
|
|
2284
|
+
__metadata("design:paramtypes", [Object])
|
|
2285
|
+
], ConfigService);
|
|
3113
2286
|
//#endregion
|
|
3114
|
-
//#region node_modules/.pnpm/@nestjs+config@
|
|
3115
|
-
var
|
|
3116
|
-
var
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
2287
|
+
//#region node_modules/.pnpm/@nestjs+config@12.0.0_@nestjs+common@12.0.1_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/config-host.module.js
|
|
2288
|
+
var __decorate$1 = function(decorators, target, key, desc) {
|
|
2289
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2290
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2291
|
+
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;
|
|
2292
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2293
|
+
};
|
|
2294
|
+
/**
|
|
2295
|
+
* @publicApi
|
|
2296
|
+
*/
|
|
2297
|
+
let ConfigHostModule = class ConfigHostModule {};
|
|
2298
|
+
ConfigHostModule = __decorate$1([(0, _nestjs_common.Global)(), (0, _nestjs_common.Module)({
|
|
2299
|
+
providers: [{
|
|
2300
|
+
provide: CONFIGURATION_TOKEN,
|
|
2301
|
+
useFactory: () => ({})
|
|
2302
|
+
}, {
|
|
2303
|
+
provide: CONFIGURATION_SERVICE_TOKEN,
|
|
2304
|
+
useClass: ConfigService
|
|
2305
|
+
}],
|
|
2306
|
+
exports: [CONFIGURATION_TOKEN, CONFIGURATION_SERVICE_TOKEN]
|
|
2307
|
+
})], ConfigHostModule);
|
|
2308
|
+
//#endregion
|
|
2309
|
+
//#region node_modules/.pnpm/@nestjs+config@12.0.0_@nestjs+common@12.0.1_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/create-config-factory.util.js
|
|
2310
|
+
/**
|
|
2311
|
+
* @publicApi
|
|
2312
|
+
*/
|
|
2313
|
+
function createConfigProvider(factory) {
|
|
2314
|
+
return {
|
|
2315
|
+
provide: factory.KEY || getConfigToken((0, crypto.randomUUID)()),
|
|
2316
|
+
useFactory: factory,
|
|
2317
|
+
inject: []
|
|
3121
2318
|
};
|
|
3122
|
-
|
|
3123
|
-
exports.ConfigHostModule = void 0;
|
|
3124
|
-
const common_1$2 = require("@nestjs/common");
|
|
3125
|
-
const config_constants_1 = require_config_constants();
|
|
3126
|
-
const config_service_1 = require_config_service();
|
|
3127
|
-
/**
|
|
3128
|
-
* @publicApi
|
|
3129
|
-
*/
|
|
3130
|
-
let ConfigHostModule = class ConfigHostModule {};
|
|
3131
|
-
exports.ConfigHostModule = ConfigHostModule;
|
|
3132
|
-
exports.ConfigHostModule = ConfigHostModule = __decorate([(0, common_1$2.Global)(), (0, common_1$2.Module)({
|
|
3133
|
-
providers: [{
|
|
3134
|
-
provide: config_constants_1.CONFIGURATION_TOKEN,
|
|
3135
|
-
useFactory: () => ({})
|
|
3136
|
-
}, {
|
|
3137
|
-
provide: config_constants_1.CONFIGURATION_SERVICE_TOKEN,
|
|
3138
|
-
useClass: config_service_1.ConfigService
|
|
3139
|
-
}],
|
|
3140
|
-
exports: [config_constants_1.CONFIGURATION_TOKEN, config_constants_1.CONFIGURATION_SERVICE_TOKEN]
|
|
3141
|
-
})], ConfigHostModule);
|
|
3142
|
-
}));
|
|
3143
|
-
//#endregion
|
|
3144
|
-
//#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/get-config-token.util.js
|
|
3145
|
-
var require_get_config_token_util = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3146
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3147
|
-
exports.getConfigToken = getConfigToken;
|
|
3148
|
-
/**
|
|
3149
|
-
* @publicApi
|
|
3150
|
-
*/
|
|
3151
|
-
function getConfigToken(token) {
|
|
3152
|
-
return `CONFIGURATION(${token.toString()})`;
|
|
3153
|
-
}
|
|
3154
|
-
}));
|
|
2319
|
+
}
|
|
3155
2320
|
//#endregion
|
|
3156
|
-
//#region node_modules/.pnpm/@nestjs+config@
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
* @publicApi
|
|
3164
|
-
*/
|
|
3165
|
-
function createConfigProvider(factory) {
|
|
3166
|
-
return {
|
|
3167
|
-
provide: factory.KEY || (0, get_config_token_util_1.getConfigToken)((0, crypto_1.randomUUID)()),
|
|
3168
|
-
useFactory: factory,
|
|
3169
|
-
inject: []
|
|
3170
|
-
};
|
|
3171
|
-
}
|
|
3172
|
-
}));
|
|
2321
|
+
//#region node_modules/.pnpm/@nestjs+config@12.0.0_@nestjs+common@12.0.1_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/get-registration-token.util.js
|
|
2322
|
+
/**
|
|
2323
|
+
* @publicApi
|
|
2324
|
+
*/
|
|
2325
|
+
function getRegistrationToken(config) {
|
|
2326
|
+
return config[PARTIAL_CONFIGURATION_KEY];
|
|
2327
|
+
}
|
|
3173
2328
|
//#endregion
|
|
3174
|
-
//#region node_modules/.pnpm/@nestjs+config@
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
function getRegistrationToken(config) {
|
|
3183
|
-
return config[config_constants_1.PARTIAL_CONFIGURATION_KEY];
|
|
2329
|
+
//#region node_modules/.pnpm/@nestjs+config@12.0.0_@nestjs+common@12.0.1_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/merge-configs.util.js
|
|
2330
|
+
/**
|
|
2331
|
+
* @publicApi
|
|
2332
|
+
*/
|
|
2333
|
+
function mergeConfigObject(host, partial, token) {
|
|
2334
|
+
if (token) {
|
|
2335
|
+
set(host, token, partial);
|
|
2336
|
+
return partial;
|
|
3184
2337
|
}
|
|
3185
|
-
|
|
2338
|
+
Object.assign(host, partial);
|
|
2339
|
+
}
|
|
3186
2340
|
//#endregion
|
|
3187
|
-
//#region node_modules/.pnpm/@nestjs+config@
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
2341
|
+
//#region node_modules/.pnpm/@nestjs+config@12.0.0_@nestjs+common@12.0.1_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/validate-with-schema.util.js
|
|
2342
|
+
/**
|
|
2343
|
+
* Joi defaults to `allowUnknown: false` and `abortEarly: true`, which would
|
|
2344
|
+
* reject the unrelated variables that are always present in `process.env` and
|
|
2345
|
+
* report only the first failure. Previous versions of this package overrode
|
|
2346
|
+
* both, so they remain the defaults for Joi schemas unless the user opts out.
|
|
2347
|
+
*/
|
|
2348
|
+
const JOI_DEFAULT_LIBRARY_OPTIONS = {
|
|
2349
|
+
abortEarly: false,
|
|
2350
|
+
allowUnknown: true
|
|
2351
|
+
};
|
|
2352
|
+
/**
|
|
2353
|
+
* Validates config using a Standard Schema (e.g. Zod, Arktype).
|
|
2354
|
+
* @see https://standardschema.dev/
|
|
2355
|
+
*/
|
|
2356
|
+
async function validateWithStandardSchema(schema, config, options) {
|
|
2357
|
+
const result = await schema["~standard"].validate(config, getLibraryOptions(schema, options));
|
|
2358
|
+
if (result.issues) return {
|
|
2359
|
+
error: new Error(formatIssues(result.issues)),
|
|
2360
|
+
value: config
|
|
3191
2361
|
};
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
return partial;
|
|
2362
|
+
return { value: result.value };
|
|
2363
|
+
}
|
|
2364
|
+
function getLibraryOptions(schema, options) {
|
|
2365
|
+
if (schema["~standard"].vendor !== "joi") return options;
|
|
2366
|
+
return {
|
|
2367
|
+
...options,
|
|
2368
|
+
libraryOptions: {
|
|
2369
|
+
...JOI_DEFAULT_LIBRARY_OPTIONS,
|
|
2370
|
+
...options?.libraryOptions
|
|
3202
2371
|
}
|
|
3203
|
-
Object.assign(host, partial);
|
|
3204
|
-
}
|
|
3205
|
-
}));
|
|
3206
|
-
//#endregion
|
|
3207
|
-
//#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/config.module.js
|
|
3208
|
-
var require_config_module = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3209
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
3210
|
-
if (k2 === void 0) k2 = k;
|
|
3211
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3212
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
3213
|
-
enumerable: true,
|
|
3214
|
-
get: function() {
|
|
3215
|
-
return m[k];
|
|
3216
|
-
}
|
|
3217
|
-
};
|
|
3218
|
-
Object.defineProperty(o, k2, desc);
|
|
3219
|
-
}) : (function(o, m, k, k2) {
|
|
3220
|
-
if (k2 === void 0) k2 = k;
|
|
3221
|
-
o[k2] = m[k];
|
|
3222
|
-
}));
|
|
3223
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
3224
|
-
Object.defineProperty(o, "default", {
|
|
3225
|
-
enumerable: true,
|
|
3226
|
-
value: v
|
|
3227
|
-
});
|
|
3228
|
-
}) : function(o, v) {
|
|
3229
|
-
o["default"] = v;
|
|
3230
|
-
});
|
|
3231
|
-
var __decorate = exports && exports.__decorate || function(decorators, target, key, desc) {
|
|
3232
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3233
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3234
|
-
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;
|
|
3235
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3236
2372
|
};
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
2373
|
+
}
|
|
2374
|
+
function formatIssues(issues) {
|
|
2375
|
+
return issues.map((issue) => {
|
|
2376
|
+
const path = formatIssuePath(issue.path);
|
|
2377
|
+
return path ? `${path}: ${issue.message}` : issue.message;
|
|
2378
|
+
}).join("\n");
|
|
2379
|
+
}
|
|
2380
|
+
function formatIssuePath(path) {
|
|
2381
|
+
return (path ?? []).map((segment) => typeof segment === "object" && segment !== null ? String(segment.key) : String(segment)).join(".");
|
|
2382
|
+
}
|
|
2383
|
+
//#endregion
|
|
2384
|
+
//#region node_modules/.pnpm/@nestjs+config@12.0.0_@nestjs+common@12.0.1_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/config.module.js
|
|
2385
|
+
var __decorate = function(decorators, target, key, desc) {
|
|
2386
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2387
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2388
|
+
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;
|
|
2389
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2390
|
+
};
|
|
2391
|
+
var ConfigModule_1;
|
|
2392
|
+
/**
|
|
2393
|
+
* @publicApi
|
|
2394
|
+
*/
|
|
2395
|
+
let ConfigModule = ConfigModule_1 = class ConfigModule {
|
|
2396
|
+
/**
|
|
2397
|
+
* This promise resolves when parser completes loading environment variables.
|
|
2398
|
+
* When "ignoreEnvFile" is set to true, then it will resolve immediately after the
|
|
2399
|
+
* "ConfigModule#forRoot" method is called.
|
|
2400
|
+
*/
|
|
2401
|
+
static get envVariablesLoaded() {
|
|
2402
|
+
return this._envVariablesLoaded;
|
|
2403
|
+
}
|
|
2404
|
+
/**
|
|
2405
|
+
* Loads environment variables based on the "ignoreEnvFile" flag and "envFilePath" value.
|
|
2406
|
+
* Additionally, registers custom configurations globally.
|
|
2407
|
+
* @param options
|
|
2408
|
+
*/
|
|
2409
|
+
static async forRoot(options = {}) {
|
|
2410
|
+
const envFilePaths = Array.isArray(options.envFilePath) ? options.envFilePath : [options.envFilePath || (0, path.resolve)(process.cwd(), ".env")];
|
|
2411
|
+
const parser = options.parser ?? getDefaultParser();
|
|
2412
|
+
let validatedEnvConfig = void 0;
|
|
2413
|
+
let config = options.ignoreEnvFile ? {} : this.loadEnvFile(envFilePaths, parser, options);
|
|
2414
|
+
if (!options.ignoreEnvVars && options.validatePredefined !== false) config = options.override ? {
|
|
2415
|
+
...process.env,
|
|
2416
|
+
...config
|
|
2417
|
+
} : {
|
|
2418
|
+
...config,
|
|
2419
|
+
...process.env
|
|
3254
2420
|
};
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
const fs = __importStar(require("fs"));
|
|
3264
|
-
const path_1 = require("path");
|
|
3265
|
-
const config_host_module_1 = require_config_host_module();
|
|
3266
|
-
const config_constants_1 = require_config_constants();
|
|
3267
|
-
const config_service_1 = require_config_service();
|
|
3268
|
-
const create_config_factory_util_1 = require_create_config_factory_util();
|
|
3269
|
-
const get_registration_token_util_1 = require_get_registration_token_util();
|
|
3270
|
-
const merge_configs_util_1 = require_merge_configs_util();
|
|
3271
|
-
/**
|
|
3272
|
-
* @publicApi
|
|
3273
|
-
*/
|
|
3274
|
-
let ConfigModule = ConfigModule_1 = class ConfigModule {
|
|
3275
|
-
/**
|
|
3276
|
-
* This promise resolves when "dotenv" completes loading environment variables.
|
|
3277
|
-
* When "ignoreEnvFile" is set to true, then it will resolve immediately after the
|
|
3278
|
-
* "ConfigModule#forRoot" method is called.
|
|
3279
|
-
*/
|
|
3280
|
-
static get envVariablesLoaded() {
|
|
3281
|
-
return this._envVariablesLoaded;
|
|
3282
|
-
}
|
|
3283
|
-
/**
|
|
3284
|
-
* Loads environment variables based on the "ignoreEnvFile" flag and "envFilePath" value.
|
|
3285
|
-
* Additionally, registers custom configurations globally.
|
|
3286
|
-
* @param options
|
|
3287
|
-
*/
|
|
3288
|
-
static async forRoot(options = {}) {
|
|
3289
|
-
const envFilePaths = Array.isArray(options.envFilePath) ? options.envFilePath : [options.envFilePath || (0, path_1.resolve)(process.cwd(), ".env")];
|
|
3290
|
-
let validatedEnvConfig = void 0;
|
|
3291
|
-
let config = options.ignoreEnvFile ? {} : this.loadEnvFile(envFilePaths, options);
|
|
3292
|
-
if (!options.ignoreEnvVars && options.validatePredefined !== false) config = {
|
|
2421
|
+
if (options.validate) {
|
|
2422
|
+
const validatedConfig = options.validate(config);
|
|
2423
|
+
validatedEnvConfig = validatedConfig;
|
|
2424
|
+
this.assignVariablesToProcess(validatedConfig, options.override);
|
|
2425
|
+
} else if (options.validationSchema) {
|
|
2426
|
+
const { error, value: validatedConfig } = await validateWithStandardSchema(options.validationSchema, config, options.validationOptions);
|
|
2427
|
+
if (error) throw new Error(`Config validation error: ${error.message}`);
|
|
2428
|
+
validatedEnvConfig = {
|
|
3293
2429
|
...config,
|
|
3294
|
-
...
|
|
2430
|
+
...validatedConfig
|
|
3295
2431
|
};
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
2432
|
+
this.assignVariablesToProcess(validatedEnvConfig, options.override);
|
|
2433
|
+
} else this.assignVariablesToProcess(config, options.override);
|
|
2434
|
+
const isConfigToLoad = options.load && options.load.length;
|
|
2435
|
+
const providers = (await Promise.all(options.load || [])).map((factory) => createConfigProvider(factory)).filter((item) => item);
|
|
2436
|
+
const configProviderTokens = providers.map((item) => item.provide);
|
|
2437
|
+
const configServiceProvider = {
|
|
2438
|
+
provide: ConfigService,
|
|
2439
|
+
useFactory: (configService) => {
|
|
2440
|
+
const untypedConfigService = configService;
|
|
2441
|
+
if (options.cache) untypedConfigService.isCacheEnabled = true;
|
|
2442
|
+
if (options.skipProcessEnv) untypedConfigService.skipProcessEnv = true;
|
|
2443
|
+
configService.setEnvFilePaths(envFilePaths);
|
|
2444
|
+
configService.setParser(parser);
|
|
2445
|
+
return configService;
|
|
2446
|
+
},
|
|
2447
|
+
inject: [CONFIGURATION_SERVICE_TOKEN, ...configProviderTokens]
|
|
2448
|
+
};
|
|
2449
|
+
providers.push(configServiceProvider);
|
|
2450
|
+
if (validatedEnvConfig) {
|
|
2451
|
+
const validatedEnvConfigLoader = {
|
|
2452
|
+
provide: VALIDATED_ENV_LOADER,
|
|
2453
|
+
useFactory: (host) => {
|
|
2454
|
+
host[VALIDATED_ENV_PROPNAME] = validatedEnvConfig;
|
|
3318
2455
|
},
|
|
3319
|
-
inject: [
|
|
3320
|
-
};
|
|
3321
|
-
providers.push(configServiceProvider);
|
|
3322
|
-
if (validatedEnvConfig) {
|
|
3323
|
-
const validatedEnvConfigLoader = {
|
|
3324
|
-
provide: config_constants_1.VALIDATED_ENV_LOADER,
|
|
3325
|
-
useFactory: (host) => {
|
|
3326
|
-
host[config_constants_1.VALIDATED_ENV_PROPNAME] = validatedEnvConfig;
|
|
3327
|
-
},
|
|
3328
|
-
inject: [config_constants_1.CONFIGURATION_TOKEN]
|
|
3329
|
-
};
|
|
3330
|
-
providers.push(validatedEnvConfigLoader);
|
|
3331
|
-
}
|
|
3332
|
-
this.environmentVariablesLoadedSignal();
|
|
3333
|
-
return {
|
|
3334
|
-
module: ConfigModule_1,
|
|
3335
|
-
global: options.isGlobal,
|
|
3336
|
-
providers: isConfigToLoad ? [...providers, {
|
|
3337
|
-
provide: config_constants_1.CONFIGURATION_LOADER,
|
|
3338
|
-
useFactory: (host, ...configurations) => {
|
|
3339
|
-
configurations.forEach((item, index) => this.mergePartial(host, item, providers[index]));
|
|
3340
|
-
},
|
|
3341
|
-
inject: [config_constants_1.CONFIGURATION_TOKEN, ...configProviderTokens]
|
|
3342
|
-
}] : providers,
|
|
3343
|
-
exports: [config_service_1.ConfigService, ...configProviderTokens]
|
|
3344
|
-
};
|
|
3345
|
-
}
|
|
3346
|
-
/**
|
|
3347
|
-
* Registers configuration object (partial registration).
|
|
3348
|
-
* @param config
|
|
3349
|
-
*/
|
|
3350
|
-
static forFeature(config) {
|
|
3351
|
-
const configProvider = (0, create_config_factory_util_1.createConfigProvider)(config);
|
|
3352
|
-
const serviceProvider = {
|
|
3353
|
-
provide: config_service_1.ConfigService,
|
|
3354
|
-
useFactory: (configService) => configService,
|
|
3355
|
-
inject: [config_constants_1.CONFIGURATION_SERVICE_TOKEN, configProvider.provide]
|
|
3356
|
-
};
|
|
3357
|
-
return {
|
|
3358
|
-
module: ConfigModule_1,
|
|
3359
|
-
providers: [
|
|
3360
|
-
configProvider,
|
|
3361
|
-
serviceProvider,
|
|
3362
|
-
{
|
|
3363
|
-
provide: config_constants_1.CONFIGURATION_LOADER,
|
|
3364
|
-
useFactory: (host, partialConfig) => {
|
|
3365
|
-
this.mergePartial(host, partialConfig, configProvider);
|
|
3366
|
-
},
|
|
3367
|
-
inject: [config_constants_1.CONFIGURATION_TOKEN, configProvider.provide]
|
|
3368
|
-
}
|
|
3369
|
-
],
|
|
3370
|
-
exports: [config_service_1.ConfigService, configProvider.provide]
|
|
3371
|
-
};
|
|
3372
|
-
}
|
|
3373
|
-
static loadEnvFile(envFilePaths, options) {
|
|
3374
|
-
let config = {};
|
|
3375
|
-
for (const envFilePath of envFilePaths) if (fs.existsSync(envFilePath)) {
|
|
3376
|
-
config = Object.assign(dotenv.parse(fs.readFileSync(envFilePath)), config);
|
|
3377
|
-
if (options.expandVariables) {
|
|
3378
|
-
const expandOptions = typeof options.expandVariables === "object" ? options.expandVariables : {};
|
|
3379
|
-
config = (0, dotenv_expand_1.expand)({
|
|
3380
|
-
...expandOptions,
|
|
3381
|
-
parsed: config
|
|
3382
|
-
}).parsed || config;
|
|
3383
|
-
}
|
|
3384
|
-
}
|
|
3385
|
-
return config;
|
|
3386
|
-
}
|
|
3387
|
-
static assignVariablesToProcess(config) {
|
|
3388
|
-
if (!(0, shared_utils_1.isObject)(config)) return;
|
|
3389
|
-
Object.keys(config).filter((key) => !(key in process.env)).forEach((key) => {
|
|
3390
|
-
const value = config[key];
|
|
3391
|
-
if (typeof value === "string") process.env[key] = value;
|
|
3392
|
-
else if (typeof value === "boolean" || typeof value === "number") process.env[key] = `${value}`;
|
|
3393
|
-
});
|
|
3394
|
-
}
|
|
3395
|
-
static mergePartial(host, item, provider) {
|
|
3396
|
-
const factoryRef = provider.useFactory;
|
|
3397
|
-
const token = (0, get_registration_token_util_1.getRegistrationToken)(factoryRef);
|
|
3398
|
-
(0, merge_configs_util_1.mergeConfigObject)(host, item, token);
|
|
3399
|
-
}
|
|
3400
|
-
static getSchemaValidationOptions(options) {
|
|
3401
|
-
if (options.validationOptions) {
|
|
3402
|
-
if (typeof options.validationOptions.allowUnknown === "undefined") options.validationOptions.allowUnknown = true;
|
|
3403
|
-
return options.validationOptions;
|
|
3404
|
-
}
|
|
3405
|
-
return {
|
|
3406
|
-
abortEarly: false,
|
|
3407
|
-
allowUnknown: true
|
|
3408
|
-
};
|
|
3409
|
-
}
|
|
3410
|
-
};
|
|
3411
|
-
exports.ConfigModule = ConfigModule;
|
|
3412
|
-
ConfigModule._envVariablesLoaded = new Promise((resolve) => ConfigModule_1.environmentVariablesLoadedSignal = resolve);
|
|
3413
|
-
exports.ConfigModule = ConfigModule = ConfigModule_1 = __decorate([(0, common_1$1.Module)({
|
|
3414
|
-
imports: [config_host_module_1.ConfigHostModule],
|
|
3415
|
-
providers: [{
|
|
3416
|
-
provide: config_service_1.ConfigService,
|
|
3417
|
-
useExisting: config_constants_1.CONFIGURATION_SERVICE_TOKEN
|
|
3418
|
-
}],
|
|
3419
|
-
exports: [config_host_module_1.ConfigHostModule, config_service_1.ConfigService]
|
|
3420
|
-
})], ConfigModule);
|
|
3421
|
-
}));
|
|
3422
|
-
//#endregion
|
|
3423
|
-
//#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/conditional.module.js
|
|
3424
|
-
var require_conditional_module = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3425
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3426
|
-
exports.ConditionalModule = void 0;
|
|
3427
|
-
const common_1 = require("@nestjs/common");
|
|
3428
|
-
const config_module_1 = require_config_module();
|
|
3429
|
-
/**
|
|
3430
|
-
* Same logic as in `@nestjs/core` package.
|
|
3431
|
-
* @param instance The instance which should get the name from
|
|
3432
|
-
* @returns The name of an instance or `undefined`
|
|
3433
|
-
*/
|
|
3434
|
-
const getInstanceName = (instance) => {
|
|
3435
|
-
if (instance?.forwardRef) return instance.forwardRef()?.name;
|
|
3436
|
-
if (instance.module) return instance.module?.name;
|
|
3437
|
-
return instance.name;
|
|
3438
|
-
};
|
|
3439
|
-
exports.ConditionalModule = class ConditionalModule {
|
|
3440
|
-
/**
|
|
3441
|
-
* @publicApi
|
|
3442
|
-
*/
|
|
3443
|
-
static async registerWhen(module$1, condition, options) {
|
|
3444
|
-
const { timeout = 5e3, debug = true } = options ?? {};
|
|
3445
|
-
const moduleName = getInstanceName(module$1) || module$1.toString();
|
|
3446
|
-
const timer = setTimeout(() => {
|
|
3447
|
-
throw new Error(`Nest was not able to resolve the config variables within ${timeout} milliseconds. Bause of this, the ConditionalModule was not able to determine if ${moduleName} should be registered or not`);
|
|
3448
|
-
}, timeout);
|
|
3449
|
-
timer.unref();
|
|
3450
|
-
const returnModule = {
|
|
3451
|
-
module: ConditionalModule,
|
|
3452
|
-
imports: [],
|
|
3453
|
-
exports: []
|
|
2456
|
+
inject: [CONFIGURATION_TOKEN]
|
|
3454
2457
|
};
|
|
3455
|
-
|
|
3456
|
-
const key = condition;
|
|
3457
|
-
condition = (env) => {
|
|
3458
|
-
return env[key]?.toLowerCase() !== "false";
|
|
3459
|
-
};
|
|
3460
|
-
}
|
|
3461
|
-
await config_module_1.ConfigModule.envVariablesLoaded;
|
|
3462
|
-
clearTimeout(timer);
|
|
3463
|
-
if (condition(process.env)) {
|
|
3464
|
-
returnModule.imports.push(module$1);
|
|
3465
|
-
returnModule.exports.push(module$1);
|
|
3466
|
-
} else if (debug) common_1.Logger.debug(`${condition.toString()} evaluated to false. Skipping the registration of ${moduleName}`, ConditionalModule.name);
|
|
3467
|
-
return returnModule;
|
|
2458
|
+
providers.push(validatedEnvConfigLoader);
|
|
3468
2459
|
}
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
//#endregion
|
|
3482
|
-
//#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/no-infer.type.js
|
|
3483
|
-
var require_no_infer_type = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3484
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3485
|
-
}));
|
|
3486
|
-
//#endregion
|
|
3487
|
-
//#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/path-value.type.js
|
|
3488
|
-
var require_path_value_type = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3489
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3490
|
-
}));
|
|
3491
|
-
//#endregion
|
|
3492
|
-
//#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/types/index.js
|
|
3493
|
-
var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3494
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
3495
|
-
if (k2 === void 0) k2 = k;
|
|
3496
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3497
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
3498
|
-
enumerable: true,
|
|
3499
|
-
get: function() {
|
|
3500
|
-
return m[k];
|
|
3501
|
-
}
|
|
2460
|
+
this.environmentVariablesLoadedSignal();
|
|
2461
|
+
return {
|
|
2462
|
+
module: ConfigModule_1,
|
|
2463
|
+
global: options.isGlobal,
|
|
2464
|
+
providers: isConfigToLoad ? [...providers, {
|
|
2465
|
+
provide: CONFIGURATION_LOADER,
|
|
2466
|
+
useFactory: (host, ...configurations) => {
|
|
2467
|
+
configurations.forEach((item, index) => this.mergePartial(host, item, providers[index]));
|
|
2468
|
+
},
|
|
2469
|
+
inject: [CONFIGURATION_TOKEN, ...configProviderTokens]
|
|
2470
|
+
}] : providers,
|
|
2471
|
+
exports: [ConfigService, ...configProviderTokens]
|
|
3502
2472
|
};
|
|
3503
|
-
|
|
3504
|
-
}) : (function(o, m, k, k2) {
|
|
3505
|
-
if (k2 === void 0) k2 = k;
|
|
3506
|
-
o[k2] = m[k];
|
|
3507
|
-
}));
|
|
3508
|
-
var __exportStar = exports && exports.__exportStar || function(m, exports$4) {
|
|
3509
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$4, p)) __createBinding(exports$4, m, p);
|
|
3510
|
-
};
|
|
3511
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3512
|
-
__exportStar(require_config_object_type(), exports);
|
|
3513
|
-
__exportStar(require_config_type(), exports);
|
|
3514
|
-
__exportStar(require_no_infer_type(), exports);
|
|
3515
|
-
__exportStar(require_path_value_type(), exports);
|
|
3516
|
-
}));
|
|
3517
|
-
//#endregion
|
|
3518
|
-
//#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/register-as.util.js
|
|
3519
|
-
var require_register_as_util = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3520
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3521
|
-
exports.registerAs = registerAs;
|
|
3522
|
-
const __1 = require_dist();
|
|
3523
|
-
const config_constants_1 = require_config_constants();
|
|
3524
|
-
const get_config_token_util_1 = require_get_config_token_util();
|
|
2473
|
+
}
|
|
3525
2474
|
/**
|
|
3526
|
-
*
|
|
3527
|
-
*
|
|
3528
|
-
* Registers the configuration object behind a specified token.
|
|
2475
|
+
* Registers configuration object (partial registration).
|
|
2476
|
+
* @param config
|
|
3529
2477
|
*/
|
|
3530
|
-
|
|
3531
|
-
const
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
writable: false
|
|
3537
|
-
});
|
|
3538
|
-
};
|
|
3539
|
-
defineProperty(config_constants_1.PARTIAL_CONFIGURATION_KEY, token);
|
|
3540
|
-
defineProperty(config_constants_1.PARTIAL_CONFIGURATION_PROPNAME, (0, get_config_token_util_1.getConfigToken)(token));
|
|
3541
|
-
defineProperty(config_constants_1.AS_PROVIDER_METHOD_KEY, () => ({
|
|
3542
|
-
imports: [__1.ConfigModule.forFeature(configFactory)],
|
|
3543
|
-
useFactory: (config) => config,
|
|
3544
|
-
inject: [(0, get_config_token_util_1.getConfigToken)(token)]
|
|
3545
|
-
}));
|
|
3546
|
-
return configFactory;
|
|
3547
|
-
}
|
|
3548
|
-
}));
|
|
3549
|
-
//#endregion
|
|
3550
|
-
//#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/utils/index.js
|
|
3551
|
-
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3552
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
3553
|
-
if (k2 === void 0) k2 = k;
|
|
3554
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3555
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
3556
|
-
enumerable: true,
|
|
3557
|
-
get: function() {
|
|
3558
|
-
return m[k];
|
|
3559
|
-
}
|
|
2478
|
+
static forFeature(config) {
|
|
2479
|
+
const configProvider = createConfigProvider(config);
|
|
2480
|
+
const serviceProvider = {
|
|
2481
|
+
provide: ConfigService,
|
|
2482
|
+
useFactory: (configService) => configService,
|
|
2483
|
+
inject: [CONFIGURATION_SERVICE_TOKEN, configProvider.provide]
|
|
3560
2484
|
};
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
}
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
var require_config_change_event_interface = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3576
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3577
|
-
}));
|
|
3578
|
-
//#endregion
|
|
3579
|
-
//#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/interfaces/config-factory.interface.js
|
|
3580
|
-
var require_config_factory_interface = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3581
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3582
|
-
}));
|
|
3583
|
-
//#endregion
|
|
3584
|
-
//#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/interfaces/config-module-options.interface.js
|
|
3585
|
-
var require_config_module_options_interface = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3586
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3587
|
-
}));
|
|
3588
|
-
//#endregion
|
|
3589
|
-
//#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/interfaces/index.js
|
|
3590
|
-
var require_interfaces = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3591
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
3592
|
-
if (k2 === void 0) k2 = k;
|
|
3593
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3594
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
3595
|
-
enumerable: true,
|
|
3596
|
-
get: function() {
|
|
3597
|
-
return m[k];
|
|
3598
|
-
}
|
|
2485
|
+
return {
|
|
2486
|
+
module: ConfigModule_1,
|
|
2487
|
+
providers: [
|
|
2488
|
+
configProvider,
|
|
2489
|
+
serviceProvider,
|
|
2490
|
+
{
|
|
2491
|
+
provide: CONFIGURATION_LOADER,
|
|
2492
|
+
useFactory: (host, partialConfig) => {
|
|
2493
|
+
this.mergePartial(host, partialConfig, configProvider);
|
|
2494
|
+
},
|
|
2495
|
+
inject: [CONFIGURATION_TOKEN, configProvider.provide]
|
|
2496
|
+
}
|
|
2497
|
+
],
|
|
2498
|
+
exports: [ConfigService, configProvider.provide]
|
|
3599
2499
|
};
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
__exportStar(require_config_module_options_interface(), exports);
|
|
3612
|
-
}));
|
|
3613
|
-
//#endregion
|
|
3614
|
-
//#region node_modules/.pnpm/@nestjs+config@4.0.4_@nestjs+common@11.1.27_reflect-metadata@0.2.2_rxjs@7.8.2_supports-color@8.1.1__rxjs@7.8.2/node_modules/@nestjs/config/dist/index.js
|
|
3615
|
-
var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3616
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
3617
|
-
if (k2 === void 0) k2 = k;
|
|
3618
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3619
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
3620
|
-
enumerable: true,
|
|
3621
|
-
get: function() {
|
|
3622
|
-
return m[k];
|
|
2500
|
+
}
|
|
2501
|
+
static loadEnvFile(envFilePaths, parser, options) {
|
|
2502
|
+
let config = {};
|
|
2503
|
+
for (const envFilePath of envFilePaths) if (fs.existsSync(envFilePath)) {
|
|
2504
|
+
config = Object.assign(parser(fs.readFileSync(envFilePath)), config);
|
|
2505
|
+
if (options.expandVariables) {
|
|
2506
|
+
const expandOptions = typeof options.expandVariables === "object" ? options.expandVariables : {};
|
|
2507
|
+
config = (0, import_main.expand)({
|
|
2508
|
+
...expandOptions,
|
|
2509
|
+
parsed: config
|
|
2510
|
+
}).parsed || config;
|
|
3623
2511
|
}
|
|
3624
|
-
}
|
|
3625
|
-
|
|
3626
|
-
}
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
2512
|
+
}
|
|
2513
|
+
return config;
|
|
2514
|
+
}
|
|
2515
|
+
static assignVariablesToProcess(config, override) {
|
|
2516
|
+
if (!(0, _nestjs_common_utils_shared_utils_js.isObject)(config)) return;
|
|
2517
|
+
(override ? Object.keys(config) : Object.keys(config).filter((key) => !(key in process.env))).forEach((key) => {
|
|
2518
|
+
const value = config[key];
|
|
2519
|
+
if (typeof value === "string") process.env[key] = value;
|
|
2520
|
+
else if (typeof value === "boolean" || typeof value === "number") process.env[key] = `${value}`;
|
|
2521
|
+
});
|
|
2522
|
+
}
|
|
2523
|
+
static mergePartial(host, item, provider) {
|
|
2524
|
+
const factoryRef = provider.useFactory;
|
|
2525
|
+
mergeConfigObject(host, item, getRegistrationToken(factoryRef));
|
|
2526
|
+
}
|
|
2527
|
+
};
|
|
2528
|
+
ConfigModule._envVariablesLoaded = new Promise((resolve) => ConfigModule_1.environmentVariablesLoadedSignal = resolve);
|
|
2529
|
+
ConfigModule = ConfigModule_1 = __decorate([(0, _nestjs_common.Module)({
|
|
2530
|
+
imports: [ConfigHostModule],
|
|
2531
|
+
providers: [{
|
|
2532
|
+
provide: ConfigService,
|
|
2533
|
+
useExisting: CONFIGURATION_SERVICE_TOKEN
|
|
2534
|
+
}],
|
|
2535
|
+
exports: [ConfigHostModule, ConfigService]
|
|
2536
|
+
})], ConfigModule);
|
|
3641
2537
|
//#endregion
|
|
3642
2538
|
//#region src/puppeteer/puppeteer.module.ts
|
|
3643
|
-
var import_config = (/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3644
|
-
function __export(m) {
|
|
3645
|
-
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
3646
|
-
}
|
|
3647
|
-
exports.__esModule = true;
|
|
3648
|
-
__export(require_dist());
|
|
3649
|
-
})))();
|
|
3650
2539
|
var _PuppeteerModule;
|
|
3651
2540
|
let PuppeteerModule = _PuppeteerModule = class PuppeteerModule {
|
|
3652
2541
|
browserService;
|
|
@@ -3664,11 +2553,7 @@ let PuppeteerModule = _PuppeteerModule = class PuppeteerModule {
|
|
|
3664
2553
|
provide: PDF_PARAMETERS,
|
|
3665
2554
|
useValue: pdfParameters
|
|
3666
2555
|
},
|
|
3667
|
-
|
|
3668
|
-
provide: HANDLEBARS_PARAMETERS,
|
|
3669
|
-
useValue: pdfParameters.hbsOptions ?? {}
|
|
3670
|
-
},
|
|
3671
|
-
_gboutte_nestjs_hbs.HandlebarsService,
|
|
2556
|
+
HandlebarsService,
|
|
3672
2557
|
MjmlService,
|
|
3673
2558
|
PugService,
|
|
3674
2559
|
EjsService,
|
|
@@ -3678,7 +2563,7 @@ let PuppeteerModule = _PuppeteerModule = class PuppeteerModule {
|
|
|
3678
2563
|
];
|
|
3679
2564
|
return {
|
|
3680
2565
|
module: _PuppeteerModule,
|
|
3681
|
-
imports: [
|
|
2566
|
+
imports: [ConfigModule.forRoot()],
|
|
3682
2567
|
providers,
|
|
3683
2568
|
exports: [
|
|
3684
2569
|
PuppeteerService,
|
|
@@ -3697,20 +2582,14 @@ let PuppeteerModule = _PuppeteerModule = class PuppeteerModule {
|
|
|
3697
2582
|
inject: options.inject ?? [],
|
|
3698
2583
|
useFactory: async (...args) => options.useFactory(...args)
|
|
3699
2584
|
};
|
|
3700
|
-
const hbsParamsProvider = {
|
|
3701
|
-
provide: HANDLEBARS_PARAMETERS,
|
|
3702
|
-
inject: [PDF_PARAMETERS],
|
|
3703
|
-
useFactory: (params) => params.hbsOptions ?? {}
|
|
3704
|
-
};
|
|
3705
2585
|
return {
|
|
3706
2586
|
module: _PuppeteerModule,
|
|
3707
|
-
imports: [...options.imports ?? [],
|
|
2587
|
+
imports: [...options.imports ?? [], ConfigModule.forRoot()],
|
|
3708
2588
|
providers: [
|
|
3709
2589
|
pdfParamsProvider,
|
|
3710
|
-
hbsParamsProvider,
|
|
3711
2590
|
PuppeteerService,
|
|
3712
2591
|
BrowserService,
|
|
3713
|
-
|
|
2592
|
+
HandlebarsService,
|
|
3714
2593
|
MjmlService,
|
|
3715
2594
|
PugService,
|
|
3716
2595
|
EjsService,
|
|
@@ -3730,7 +2609,7 @@ let PuppeteerModule = _PuppeteerModule = class PuppeteerModule {
|
|
|
3730
2609
|
};
|
|
3731
2610
|
}
|
|
3732
2611
|
};
|
|
3733
|
-
PuppeteerModule = _PuppeteerModule = __decorate([
|
|
2612
|
+
PuppeteerModule = _PuppeteerModule = __decorate$3([
|
|
3734
2613
|
(0, _nestjs_common.Module)({
|
|
3735
2614
|
providers: [
|
|
3736
2615
|
PuppeteerService,
|
|
@@ -3776,7 +2655,7 @@ let NestjsPdfModule = _NestjsPdfModule = class NestjsPdfModule {
|
|
|
3776
2655
|
};
|
|
3777
2656
|
}
|
|
3778
2657
|
};
|
|
3779
|
-
NestjsPdfModule = _NestjsPdfModule = __decorate([(0, _nestjs_common.Module)({})], NestjsPdfModule);
|
|
2658
|
+
NestjsPdfModule = _NestjsPdfModule = __decorate$3([(0, _nestjs_common.Module)({})], NestjsPdfModule);
|
|
3780
2659
|
//#endregion
|
|
3781
2660
|
Object.defineProperty(exports, "EjsService", {
|
|
3782
2661
|
enumerable: true,
|
|
@@ -3790,6 +2669,12 @@ Object.defineProperty(exports, "EtaService", {
|
|
|
3790
2669
|
return EtaService;
|
|
3791
2670
|
}
|
|
3792
2671
|
});
|
|
2672
|
+
Object.defineProperty(exports, "HandlebarsService", {
|
|
2673
|
+
enumerable: true,
|
|
2674
|
+
get: function() {
|
|
2675
|
+
return HandlebarsService;
|
|
2676
|
+
}
|
|
2677
|
+
});
|
|
3793
2678
|
Object.defineProperty(exports, "MjmlService", {
|
|
3794
2679
|
enumerable: true,
|
|
3795
2680
|
get: function() {
|