@sentio/runtime 2.57.12-rc.g → 2.57.12-rc.i

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.
@@ -3,7 +3,6 @@ import { createRequire as createRequireShim } from 'module'; const require = cre
3
3
  import {
4
4
  DiagConsoleLogger,
5
5
  DiagLogLevel,
6
- Endpoints,
7
6
  GLOBAL_CONFIG,
8
7
  INVALID_SPAN_CONTEXT,
9
8
  LRUCache,
@@ -17,6 +16,7 @@ import {
17
16
  ValueType,
18
17
  baggageEntryMetadataFromString,
19
18
  compareSemver,
19
+ configureEndpoints,
20
20
  context,
21
21
  createContextKey,
22
22
  createNoopMeter,
@@ -39,11 +39,12 @@ import {
39
39
  require_lib,
40
40
  require_lib2,
41
41
  require_lib3,
42
+ require_lib4,
42
43
  require_lodash,
43
44
  require_src,
44
45
  trace,
45
46
  withAbort
46
- } from "./chunk-IAGVEBAE.js";
47
+ } from "./chunk-CAKQS6AI.js";
47
48
  import {
48
49
  ExecutionConfig,
49
50
  HandlerType,
@@ -60,2124 +61,6 @@ import {
60
61
  require_minimal2 as require_minimal
61
62
  } from "./chunk-XR3EZ6FB.js";
62
63
 
63
- // ../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js
64
- var require_universalify = __commonJS({
65
- "../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js"(exports) {
66
- "use strict";
67
- exports.fromCallback = function(fn) {
68
- return Object.defineProperty(function(...args) {
69
- if (typeof args[args.length - 1] === "function") fn.apply(this, args);
70
- else {
71
- return new Promise((resolve, reject) => {
72
- args.push((err, res) => err != null ? reject(err) : resolve(res));
73
- fn.apply(this, args);
74
- });
75
- }
76
- }, "name", { value: fn.name });
77
- };
78
- exports.fromPromise = function(fn) {
79
- return Object.defineProperty(function(...args) {
80
- const cb = args[args.length - 1];
81
- if (typeof cb !== "function") return fn.apply(this, args);
82
- else {
83
- args.pop();
84
- fn.apply(this, args).then((r) => cb(null, r), cb);
85
- }
86
- }, "name", { value: fn.name });
87
- };
88
- }
89
- });
90
-
91
- // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js
92
- var require_polyfills = __commonJS({
93
- "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports, module) {
94
- "use strict";
95
- var constants = __require("constants");
96
- var origCwd = process.cwd;
97
- var cwd = null;
98
- var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
99
- process.cwd = function() {
100
- if (!cwd)
101
- cwd = origCwd.call(process);
102
- return cwd;
103
- };
104
- try {
105
- process.cwd();
106
- } catch (er) {
107
- }
108
- if (typeof process.chdir === "function") {
109
- chdir = process.chdir;
110
- process.chdir = function(d) {
111
- cwd = null;
112
- chdir.call(process, d);
113
- };
114
- if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
115
- }
116
- var chdir;
117
- module.exports = patch;
118
- function patch(fs3) {
119
- if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
120
- patchLchmod(fs3);
121
- }
122
- if (!fs3.lutimes) {
123
- patchLutimes(fs3);
124
- }
125
- fs3.chown = chownFix(fs3.chown);
126
- fs3.fchown = chownFix(fs3.fchown);
127
- fs3.lchown = chownFix(fs3.lchown);
128
- fs3.chmod = chmodFix(fs3.chmod);
129
- fs3.fchmod = chmodFix(fs3.fchmod);
130
- fs3.lchmod = chmodFix(fs3.lchmod);
131
- fs3.chownSync = chownFixSync(fs3.chownSync);
132
- fs3.fchownSync = chownFixSync(fs3.fchownSync);
133
- fs3.lchownSync = chownFixSync(fs3.lchownSync);
134
- fs3.chmodSync = chmodFixSync(fs3.chmodSync);
135
- fs3.fchmodSync = chmodFixSync(fs3.fchmodSync);
136
- fs3.lchmodSync = chmodFixSync(fs3.lchmodSync);
137
- fs3.stat = statFix(fs3.stat);
138
- fs3.fstat = statFix(fs3.fstat);
139
- fs3.lstat = statFix(fs3.lstat);
140
- fs3.statSync = statFixSync(fs3.statSync);
141
- fs3.fstatSync = statFixSync(fs3.fstatSync);
142
- fs3.lstatSync = statFixSync(fs3.lstatSync);
143
- if (fs3.chmod && !fs3.lchmod) {
144
- fs3.lchmod = function(path3, mode, cb) {
145
- if (cb) process.nextTick(cb);
146
- };
147
- fs3.lchmodSync = function() {
148
- };
149
- }
150
- if (fs3.chown && !fs3.lchown) {
151
- fs3.lchown = function(path3, uid, gid, cb) {
152
- if (cb) process.nextTick(cb);
153
- };
154
- fs3.lchownSync = function() {
155
- };
156
- }
157
- if (platform === "win32") {
158
- fs3.rename = typeof fs3.rename !== "function" ? fs3.rename : function(fs$rename) {
159
- function rename(from2, to, cb) {
160
- var start = Date.now();
161
- var backoff = 0;
162
- fs$rename(from2, to, function CB(er) {
163
- if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
164
- setTimeout(function() {
165
- fs3.stat(to, function(stater, st) {
166
- if (stater && stater.code === "ENOENT")
167
- fs$rename(from2, to, CB);
168
- else
169
- cb(er);
170
- });
171
- }, backoff);
172
- if (backoff < 100)
173
- backoff += 10;
174
- return;
175
- }
176
- if (cb) cb(er);
177
- });
178
- }
179
- if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
180
- return rename;
181
- }(fs3.rename);
182
- }
183
- fs3.read = typeof fs3.read !== "function" ? fs3.read : function(fs$read) {
184
- function read(fd, buffer, offset, length, position, callback_) {
185
- var callback;
186
- if (callback_ && typeof callback_ === "function") {
187
- var eagCounter = 0;
188
- callback = function(er, _, __) {
189
- if (er && er.code === "EAGAIN" && eagCounter < 10) {
190
- eagCounter++;
191
- return fs$read.call(fs3, fd, buffer, offset, length, position, callback);
192
- }
193
- callback_.apply(this, arguments);
194
- };
195
- }
196
- return fs$read.call(fs3, fd, buffer, offset, length, position, callback);
197
- }
198
- if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
199
- return read;
200
- }(fs3.read);
201
- fs3.readSync = typeof fs3.readSync !== "function" ? fs3.readSync : /* @__PURE__ */ function(fs$readSync) {
202
- return function(fd, buffer, offset, length, position) {
203
- var eagCounter = 0;
204
- while (true) {
205
- try {
206
- return fs$readSync.call(fs3, fd, buffer, offset, length, position);
207
- } catch (er) {
208
- if (er.code === "EAGAIN" && eagCounter < 10) {
209
- eagCounter++;
210
- continue;
211
- }
212
- throw er;
213
- }
214
- }
215
- };
216
- }(fs3.readSync);
217
- function patchLchmod(fs4) {
218
- fs4.lchmod = function(path3, mode, callback) {
219
- fs4.open(
220
- path3,
221
- constants.O_WRONLY | constants.O_SYMLINK,
222
- mode,
223
- function(err, fd) {
224
- if (err) {
225
- if (callback) callback(err);
226
- return;
227
- }
228
- fs4.fchmod(fd, mode, function(err2) {
229
- fs4.close(fd, function(err22) {
230
- if (callback) callback(err2 || err22);
231
- });
232
- });
233
- }
234
- );
235
- };
236
- fs4.lchmodSync = function(path3, mode) {
237
- var fd = fs4.openSync(path3, constants.O_WRONLY | constants.O_SYMLINK, mode);
238
- var threw = true;
239
- var ret;
240
- try {
241
- ret = fs4.fchmodSync(fd, mode);
242
- threw = false;
243
- } finally {
244
- if (threw) {
245
- try {
246
- fs4.closeSync(fd);
247
- } catch (er) {
248
- }
249
- } else {
250
- fs4.closeSync(fd);
251
- }
252
- }
253
- return ret;
254
- };
255
- }
256
- function patchLutimes(fs4) {
257
- if (constants.hasOwnProperty("O_SYMLINK") && fs4.futimes) {
258
- fs4.lutimes = function(path3, at, mt, cb) {
259
- fs4.open(path3, constants.O_SYMLINK, function(er, fd) {
260
- if (er) {
261
- if (cb) cb(er);
262
- return;
263
- }
264
- fs4.futimes(fd, at, mt, function(er2) {
265
- fs4.close(fd, function(er22) {
266
- if (cb) cb(er2 || er22);
267
- });
268
- });
269
- });
270
- };
271
- fs4.lutimesSync = function(path3, at, mt) {
272
- var fd = fs4.openSync(path3, constants.O_SYMLINK);
273
- var ret;
274
- var threw = true;
275
- try {
276
- ret = fs4.futimesSync(fd, at, mt);
277
- threw = false;
278
- } finally {
279
- if (threw) {
280
- try {
281
- fs4.closeSync(fd);
282
- } catch (er) {
283
- }
284
- } else {
285
- fs4.closeSync(fd);
286
- }
287
- }
288
- return ret;
289
- };
290
- } else if (fs4.futimes) {
291
- fs4.lutimes = function(_a2, _b, _c, cb) {
292
- if (cb) process.nextTick(cb);
293
- };
294
- fs4.lutimesSync = function() {
295
- };
296
- }
297
- }
298
- function chmodFix(orig) {
299
- if (!orig) return orig;
300
- return function(target, mode, cb) {
301
- return orig.call(fs3, target, mode, function(er) {
302
- if (chownErOk(er)) er = null;
303
- if (cb) cb.apply(this, arguments);
304
- });
305
- };
306
- }
307
- function chmodFixSync(orig) {
308
- if (!orig) return orig;
309
- return function(target, mode) {
310
- try {
311
- return orig.call(fs3, target, mode);
312
- } catch (er) {
313
- if (!chownErOk(er)) throw er;
314
- }
315
- };
316
- }
317
- function chownFix(orig) {
318
- if (!orig) return orig;
319
- return function(target, uid, gid, cb) {
320
- return orig.call(fs3, target, uid, gid, function(er) {
321
- if (chownErOk(er)) er = null;
322
- if (cb) cb.apply(this, arguments);
323
- });
324
- };
325
- }
326
- function chownFixSync(orig) {
327
- if (!orig) return orig;
328
- return function(target, uid, gid) {
329
- try {
330
- return orig.call(fs3, target, uid, gid);
331
- } catch (er) {
332
- if (!chownErOk(er)) throw er;
333
- }
334
- };
335
- }
336
- function statFix(orig) {
337
- if (!orig) return orig;
338
- return function(target, options2, cb) {
339
- if (typeof options2 === "function") {
340
- cb = options2;
341
- options2 = null;
342
- }
343
- function callback(er, stats) {
344
- if (stats) {
345
- if (stats.uid < 0) stats.uid += 4294967296;
346
- if (stats.gid < 0) stats.gid += 4294967296;
347
- }
348
- if (cb) cb.apply(this, arguments);
349
- }
350
- return options2 ? orig.call(fs3, target, options2, callback) : orig.call(fs3, target, callback);
351
- };
352
- }
353
- function statFixSync(orig) {
354
- if (!orig) return orig;
355
- return function(target, options2) {
356
- var stats = options2 ? orig.call(fs3, target, options2) : orig.call(fs3, target);
357
- if (stats) {
358
- if (stats.uid < 0) stats.uid += 4294967296;
359
- if (stats.gid < 0) stats.gid += 4294967296;
360
- }
361
- return stats;
362
- };
363
- }
364
- function chownErOk(er) {
365
- if (!er)
366
- return true;
367
- if (er.code === "ENOSYS")
368
- return true;
369
- var nonroot = !process.getuid || process.getuid() !== 0;
370
- if (nonroot) {
371
- if (er.code === "EINVAL" || er.code === "EPERM")
372
- return true;
373
- }
374
- return false;
375
- }
376
- }
377
- }
378
- });
379
-
380
- // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js
381
- var require_legacy_streams = __commonJS({
382
- "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module) {
383
- "use strict";
384
- var Stream = __require("stream").Stream;
385
- module.exports = legacy;
386
- function legacy(fs3) {
387
- return {
388
- ReadStream,
389
- WriteStream
390
- };
391
- function ReadStream(path3, options2) {
392
- if (!(this instanceof ReadStream)) return new ReadStream(path3, options2);
393
- Stream.call(this);
394
- var self2 = this;
395
- this.path = path3;
396
- this.fd = null;
397
- this.readable = true;
398
- this.paused = false;
399
- this.flags = "r";
400
- this.mode = 438;
401
- this.bufferSize = 64 * 1024;
402
- options2 = options2 || {};
403
- var keys = Object.keys(options2);
404
- for (var index = 0, length = keys.length; index < length; index++) {
405
- var key = keys[index];
406
- this[key] = options2[key];
407
- }
408
- if (this.encoding) this.setEncoding(this.encoding);
409
- if (this.start !== void 0) {
410
- if ("number" !== typeof this.start) {
411
- throw TypeError("start must be a Number");
412
- }
413
- if (this.end === void 0) {
414
- this.end = Infinity;
415
- } else if ("number" !== typeof this.end) {
416
- throw TypeError("end must be a Number");
417
- }
418
- if (this.start > this.end) {
419
- throw new Error("start must be <= end");
420
- }
421
- this.pos = this.start;
422
- }
423
- if (this.fd !== null) {
424
- process.nextTick(function() {
425
- self2._read();
426
- });
427
- return;
428
- }
429
- fs3.open(this.path, this.flags, this.mode, function(err, fd) {
430
- if (err) {
431
- self2.emit("error", err);
432
- self2.readable = false;
433
- return;
434
- }
435
- self2.fd = fd;
436
- self2.emit("open", fd);
437
- self2._read();
438
- });
439
- }
440
- function WriteStream(path3, options2) {
441
- if (!(this instanceof WriteStream)) return new WriteStream(path3, options2);
442
- Stream.call(this);
443
- this.path = path3;
444
- this.fd = null;
445
- this.writable = true;
446
- this.flags = "w";
447
- this.encoding = "binary";
448
- this.mode = 438;
449
- this.bytesWritten = 0;
450
- options2 = options2 || {};
451
- var keys = Object.keys(options2);
452
- for (var index = 0, length = keys.length; index < length; index++) {
453
- var key = keys[index];
454
- this[key] = options2[key];
455
- }
456
- if (this.start !== void 0) {
457
- if ("number" !== typeof this.start) {
458
- throw TypeError("start must be a Number");
459
- }
460
- if (this.start < 0) {
461
- throw new Error("start must be >= zero");
462
- }
463
- this.pos = this.start;
464
- }
465
- this.busy = false;
466
- this._queue = [];
467
- if (this.fd === null) {
468
- this._open = fs3.open;
469
- this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
470
- this.flush();
471
- }
472
- }
473
- }
474
- }
475
- });
476
-
477
- // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js
478
- var require_clone = __commonJS({
479
- "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports, module) {
480
- "use strict";
481
- module.exports = clone;
482
- var getPrototypeOf = Object.getPrototypeOf || function(obj) {
483
- return obj.__proto__;
484
- };
485
- function clone(obj) {
486
- if (obj === null || typeof obj !== "object")
487
- return obj;
488
- if (obj instanceof Object)
489
- var copy = { __proto__: getPrototypeOf(obj) };
490
- else
491
- var copy = /* @__PURE__ */ Object.create(null);
492
- Object.getOwnPropertyNames(obj).forEach(function(key) {
493
- Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
494
- });
495
- return copy;
496
- }
497
- }
498
- });
499
-
500
- // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
501
- var require_graceful_fs = __commonJS({
502
- "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module) {
503
- "use strict";
504
- var fs3 = __require("fs");
505
- var polyfills = require_polyfills();
506
- var legacy = require_legacy_streams();
507
- var clone = require_clone();
508
- var util = __require("util");
509
- var gracefulQueue;
510
- var previousSymbol;
511
- if (typeof Symbol === "function" && typeof Symbol.for === "function") {
512
- gracefulQueue = Symbol.for("graceful-fs.queue");
513
- previousSymbol = Symbol.for("graceful-fs.previous");
514
- } else {
515
- gracefulQueue = "___graceful-fs.queue";
516
- previousSymbol = "___graceful-fs.previous";
517
- }
518
- function noop() {
519
- }
520
- function publishQueue(context2, queue2) {
521
- Object.defineProperty(context2, gracefulQueue, {
522
- get: function() {
523
- return queue2;
524
- }
525
- });
526
- }
527
- var debug = noop;
528
- if (util.debuglog)
529
- debug = util.debuglog("gfs4");
530
- else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
531
- debug = function() {
532
- var m = util.format.apply(util, arguments);
533
- m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
534
- console.error(m);
535
- };
536
- if (!fs3[gracefulQueue]) {
537
- queue = global[gracefulQueue] || [];
538
- publishQueue(fs3, queue);
539
- fs3.close = function(fs$close) {
540
- function close(fd, cb) {
541
- return fs$close.call(fs3, fd, function(err) {
542
- if (!err) {
543
- resetQueue();
544
- }
545
- if (typeof cb === "function")
546
- cb.apply(this, arguments);
547
- });
548
- }
549
- Object.defineProperty(close, previousSymbol, {
550
- value: fs$close
551
- });
552
- return close;
553
- }(fs3.close);
554
- fs3.closeSync = function(fs$closeSync) {
555
- function closeSync(fd) {
556
- fs$closeSync.apply(fs3, arguments);
557
- resetQueue();
558
- }
559
- Object.defineProperty(closeSync, previousSymbol, {
560
- value: fs$closeSync
561
- });
562
- return closeSync;
563
- }(fs3.closeSync);
564
- if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
565
- process.on("exit", function() {
566
- debug(fs3[gracefulQueue]);
567
- __require("assert").equal(fs3[gracefulQueue].length, 0);
568
- });
569
- }
570
- }
571
- var queue;
572
- if (!global[gracefulQueue]) {
573
- publishQueue(global, fs3[gracefulQueue]);
574
- }
575
- module.exports = patch(clone(fs3));
576
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs3.__patched) {
577
- module.exports = patch(fs3);
578
- fs3.__patched = true;
579
- }
580
- function patch(fs4) {
581
- polyfills(fs4);
582
- fs4.gracefulify = patch;
583
- fs4.createReadStream = createReadStream;
584
- fs4.createWriteStream = createWriteStream;
585
- var fs$readFile = fs4.readFile;
586
- fs4.readFile = readFile;
587
- function readFile(path3, options2, cb) {
588
- if (typeof options2 === "function")
589
- cb = options2, options2 = null;
590
- return go$readFile(path3, options2, cb);
591
- function go$readFile(path4, options3, cb2, startTime) {
592
- return fs$readFile(path4, options3, function(err) {
593
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
594
- enqueue([go$readFile, [path4, options3, cb2], err, startTime || Date.now(), Date.now()]);
595
- else {
596
- if (typeof cb2 === "function")
597
- cb2.apply(this, arguments);
598
- }
599
- });
600
- }
601
- }
602
- var fs$writeFile = fs4.writeFile;
603
- fs4.writeFile = writeFile;
604
- function writeFile(path3, data, options2, cb) {
605
- if (typeof options2 === "function")
606
- cb = options2, options2 = null;
607
- return go$writeFile(path3, data, options2, cb);
608
- function go$writeFile(path4, data2, options3, cb2, startTime) {
609
- return fs$writeFile(path4, data2, options3, function(err) {
610
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
611
- enqueue([go$writeFile, [path4, data2, options3, cb2], err, startTime || Date.now(), Date.now()]);
612
- else {
613
- if (typeof cb2 === "function")
614
- cb2.apply(this, arguments);
615
- }
616
- });
617
- }
618
- }
619
- var fs$appendFile = fs4.appendFile;
620
- if (fs$appendFile)
621
- fs4.appendFile = appendFile;
622
- function appendFile(path3, data, options2, cb) {
623
- if (typeof options2 === "function")
624
- cb = options2, options2 = null;
625
- return go$appendFile(path3, data, options2, cb);
626
- function go$appendFile(path4, data2, options3, cb2, startTime) {
627
- return fs$appendFile(path4, data2, options3, function(err) {
628
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
629
- enqueue([go$appendFile, [path4, data2, options3, cb2], err, startTime || Date.now(), Date.now()]);
630
- else {
631
- if (typeof cb2 === "function")
632
- cb2.apply(this, arguments);
633
- }
634
- });
635
- }
636
- }
637
- var fs$copyFile = fs4.copyFile;
638
- if (fs$copyFile)
639
- fs4.copyFile = copyFile;
640
- function copyFile(src, dest, flags, cb) {
641
- if (typeof flags === "function") {
642
- cb = flags;
643
- flags = 0;
644
- }
645
- return go$copyFile(src, dest, flags, cb);
646
- function go$copyFile(src2, dest2, flags2, cb2, startTime) {
647
- return fs$copyFile(src2, dest2, flags2, function(err) {
648
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
649
- enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
650
- else {
651
- if (typeof cb2 === "function")
652
- cb2.apply(this, arguments);
653
- }
654
- });
655
- }
656
- }
657
- var fs$readdir = fs4.readdir;
658
- fs4.readdir = readdir;
659
- var noReaddirOptionVersions = /^v[0-5]\./;
660
- function readdir(path3, options2, cb) {
661
- if (typeof options2 === "function")
662
- cb = options2, options2 = null;
663
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path4, options3, cb2, startTime) {
664
- return fs$readdir(path4, fs$readdirCallback(
665
- path4,
666
- options3,
667
- cb2,
668
- startTime
669
- ));
670
- } : function go$readdir2(path4, options3, cb2, startTime) {
671
- return fs$readdir(path4, options3, fs$readdirCallback(
672
- path4,
673
- options3,
674
- cb2,
675
- startTime
676
- ));
677
- };
678
- return go$readdir(path3, options2, cb);
679
- function fs$readdirCallback(path4, options3, cb2, startTime) {
680
- return function(err, files) {
681
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
682
- enqueue([
683
- go$readdir,
684
- [path4, options3, cb2],
685
- err,
686
- startTime || Date.now(),
687
- Date.now()
688
- ]);
689
- else {
690
- if (files && files.sort)
691
- files.sort();
692
- if (typeof cb2 === "function")
693
- cb2.call(this, err, files);
694
- }
695
- };
696
- }
697
- }
698
- if (process.version.substr(0, 4) === "v0.8") {
699
- var legStreams = legacy(fs4);
700
- ReadStream = legStreams.ReadStream;
701
- WriteStream = legStreams.WriteStream;
702
- }
703
- var fs$ReadStream = fs4.ReadStream;
704
- if (fs$ReadStream) {
705
- ReadStream.prototype = Object.create(fs$ReadStream.prototype);
706
- ReadStream.prototype.open = ReadStream$open;
707
- }
708
- var fs$WriteStream = fs4.WriteStream;
709
- if (fs$WriteStream) {
710
- WriteStream.prototype = Object.create(fs$WriteStream.prototype);
711
- WriteStream.prototype.open = WriteStream$open;
712
- }
713
- Object.defineProperty(fs4, "ReadStream", {
714
- get: function() {
715
- return ReadStream;
716
- },
717
- set: function(val) {
718
- ReadStream = val;
719
- },
720
- enumerable: true,
721
- configurable: true
722
- });
723
- Object.defineProperty(fs4, "WriteStream", {
724
- get: function() {
725
- return WriteStream;
726
- },
727
- set: function(val) {
728
- WriteStream = val;
729
- },
730
- enumerable: true,
731
- configurable: true
732
- });
733
- var FileReadStream = ReadStream;
734
- Object.defineProperty(fs4, "FileReadStream", {
735
- get: function() {
736
- return FileReadStream;
737
- },
738
- set: function(val) {
739
- FileReadStream = val;
740
- },
741
- enumerable: true,
742
- configurable: true
743
- });
744
- var FileWriteStream = WriteStream;
745
- Object.defineProperty(fs4, "FileWriteStream", {
746
- get: function() {
747
- return FileWriteStream;
748
- },
749
- set: function(val) {
750
- FileWriteStream = val;
751
- },
752
- enumerable: true,
753
- configurable: true
754
- });
755
- function ReadStream(path3, options2) {
756
- if (this instanceof ReadStream)
757
- return fs$ReadStream.apply(this, arguments), this;
758
- else
759
- return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
760
- }
761
- function ReadStream$open() {
762
- var that = this;
763
- open(that.path, that.flags, that.mode, function(err, fd) {
764
- if (err) {
765
- if (that.autoClose)
766
- that.destroy();
767
- that.emit("error", err);
768
- } else {
769
- that.fd = fd;
770
- that.emit("open", fd);
771
- that.read();
772
- }
773
- });
774
- }
775
- function WriteStream(path3, options2) {
776
- if (this instanceof WriteStream)
777
- return fs$WriteStream.apply(this, arguments), this;
778
- else
779
- return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
780
- }
781
- function WriteStream$open() {
782
- var that = this;
783
- open(that.path, that.flags, that.mode, function(err, fd) {
784
- if (err) {
785
- that.destroy();
786
- that.emit("error", err);
787
- } else {
788
- that.fd = fd;
789
- that.emit("open", fd);
790
- }
791
- });
792
- }
793
- function createReadStream(path3, options2) {
794
- return new fs4.ReadStream(path3, options2);
795
- }
796
- function createWriteStream(path3, options2) {
797
- return new fs4.WriteStream(path3, options2);
798
- }
799
- var fs$open = fs4.open;
800
- fs4.open = open;
801
- function open(path3, flags, mode, cb) {
802
- if (typeof mode === "function")
803
- cb = mode, mode = null;
804
- return go$open(path3, flags, mode, cb);
805
- function go$open(path4, flags2, mode2, cb2, startTime) {
806
- return fs$open(path4, flags2, mode2, function(err, fd) {
807
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
808
- enqueue([go$open, [path4, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
809
- else {
810
- if (typeof cb2 === "function")
811
- cb2.apply(this, arguments);
812
- }
813
- });
814
- }
815
- }
816
- return fs4;
817
- }
818
- function enqueue(elem) {
819
- debug("ENQUEUE", elem[0].name, elem[1]);
820
- fs3[gracefulQueue].push(elem);
821
- retry();
822
- }
823
- var retryTimer;
824
- function resetQueue() {
825
- var now = Date.now();
826
- for (var i = 0; i < fs3[gracefulQueue].length; ++i) {
827
- if (fs3[gracefulQueue][i].length > 2) {
828
- fs3[gracefulQueue][i][3] = now;
829
- fs3[gracefulQueue][i][4] = now;
830
- }
831
- }
832
- retry();
833
- }
834
- function retry() {
835
- clearTimeout(retryTimer);
836
- retryTimer = void 0;
837
- if (fs3[gracefulQueue].length === 0)
838
- return;
839
- var elem = fs3[gracefulQueue].shift();
840
- var fn = elem[0];
841
- var args = elem[1];
842
- var err = elem[2];
843
- var startTime = elem[3];
844
- var lastTime = elem[4];
845
- if (startTime === void 0) {
846
- debug("RETRY", fn.name, args);
847
- fn.apply(null, args);
848
- } else if (Date.now() - startTime >= 6e4) {
849
- debug("TIMEOUT", fn.name, args);
850
- var cb = args.pop();
851
- if (typeof cb === "function")
852
- cb.call(null, err);
853
- } else {
854
- var sinceAttempt = Date.now() - lastTime;
855
- var sinceStart = Math.max(lastTime - startTime, 1);
856
- var desiredDelay = Math.min(sinceStart * 1.2, 100);
857
- if (sinceAttempt >= desiredDelay) {
858
- debug("RETRY", fn.name, args);
859
- fn.apply(null, args.concat([startTime]));
860
- } else {
861
- fs3[gracefulQueue].push(elem);
862
- }
863
- }
864
- if (retryTimer === void 0) {
865
- retryTimer = setTimeout(retry, 0);
866
- }
867
- }
868
- }
869
- });
870
-
871
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/fs/index.js
872
- var require_fs = __commonJS({
873
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/fs/index.js"(exports) {
874
- "use strict";
875
- var u = require_universalify().fromCallback;
876
- var fs3 = require_graceful_fs();
877
- var api = [
878
- "access",
879
- "appendFile",
880
- "chmod",
881
- "chown",
882
- "close",
883
- "copyFile",
884
- "fchmod",
885
- "fchown",
886
- "fdatasync",
887
- "fstat",
888
- "fsync",
889
- "ftruncate",
890
- "futimes",
891
- "lchmod",
892
- "lchown",
893
- "link",
894
- "lstat",
895
- "mkdir",
896
- "mkdtemp",
897
- "open",
898
- "opendir",
899
- "readdir",
900
- "readFile",
901
- "readlink",
902
- "realpath",
903
- "rename",
904
- "rm",
905
- "rmdir",
906
- "stat",
907
- "symlink",
908
- "truncate",
909
- "unlink",
910
- "utimes",
911
- "writeFile"
912
- ].filter((key) => {
913
- return typeof fs3[key] === "function";
914
- });
915
- Object.assign(exports, fs3);
916
- api.forEach((method) => {
917
- exports[method] = u(fs3[method]);
918
- });
919
- exports.exists = function(filename, callback) {
920
- if (typeof callback === "function") {
921
- return fs3.exists(filename, callback);
922
- }
923
- return new Promise((resolve) => {
924
- return fs3.exists(filename, resolve);
925
- });
926
- };
927
- exports.read = function(fd, buffer, offset, length, position, callback) {
928
- if (typeof callback === "function") {
929
- return fs3.read(fd, buffer, offset, length, position, callback);
930
- }
931
- return new Promise((resolve, reject) => {
932
- fs3.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
933
- if (err) return reject(err);
934
- resolve({ bytesRead, buffer: buffer2 });
935
- });
936
- });
937
- };
938
- exports.write = function(fd, buffer, ...args) {
939
- if (typeof args[args.length - 1] === "function") {
940
- return fs3.write(fd, buffer, ...args);
941
- }
942
- return new Promise((resolve, reject) => {
943
- fs3.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
944
- if (err) return reject(err);
945
- resolve({ bytesWritten, buffer: buffer2 });
946
- });
947
- });
948
- };
949
- exports.readv = function(fd, buffers, ...args) {
950
- if (typeof args[args.length - 1] === "function") {
951
- return fs3.readv(fd, buffers, ...args);
952
- }
953
- return new Promise((resolve, reject) => {
954
- fs3.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
955
- if (err) return reject(err);
956
- resolve({ bytesRead, buffers: buffers2 });
957
- });
958
- });
959
- };
960
- exports.writev = function(fd, buffers, ...args) {
961
- if (typeof args[args.length - 1] === "function") {
962
- return fs3.writev(fd, buffers, ...args);
963
- }
964
- return new Promise((resolve, reject) => {
965
- fs3.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
966
- if (err) return reject(err);
967
- resolve({ bytesWritten, buffers: buffers2 });
968
- });
969
- });
970
- };
971
- if (typeof fs3.realpath.native === "function") {
972
- exports.realpath.native = u(fs3.realpath.native);
973
- } else {
974
- process.emitWarning(
975
- "fs.realpath.native is not a function. Is fs being monkey-patched?",
976
- "Warning",
977
- "fs-extra-WARN0003"
978
- );
979
- }
980
- }
981
- });
982
-
983
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js
984
- var require_utils = __commonJS({
985
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module) {
986
- "use strict";
987
- var path3 = __require("path");
988
- module.exports.checkPath = function checkPath(pth) {
989
- if (process.platform === "win32") {
990
- const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path3.parse(pth).root, ""));
991
- if (pathHasInvalidWinCharacters) {
992
- const error = new Error(`Path contains invalid characters: ${pth}`);
993
- error.code = "EINVAL";
994
- throw error;
995
- }
996
- }
997
- };
998
- }
999
- });
1000
-
1001
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/make-dir.js
1002
- var require_make_dir = __commonJS({
1003
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module) {
1004
- "use strict";
1005
- var fs3 = require_fs();
1006
- var { checkPath } = require_utils();
1007
- var getMode = (options2) => {
1008
- const defaults = { mode: 511 };
1009
- if (typeof options2 === "number") return options2;
1010
- return { ...defaults, ...options2 }.mode;
1011
- };
1012
- module.exports.makeDir = async (dir, options2) => {
1013
- checkPath(dir);
1014
- return fs3.mkdir(dir, {
1015
- mode: getMode(options2),
1016
- recursive: true
1017
- });
1018
- };
1019
- module.exports.makeDirSync = (dir, options2) => {
1020
- checkPath(dir);
1021
- return fs3.mkdirSync(dir, {
1022
- mode: getMode(options2),
1023
- recursive: true
1024
- });
1025
- };
1026
- }
1027
- });
1028
-
1029
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/index.js
1030
- var require_mkdirs = __commonJS({
1031
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module) {
1032
- "use strict";
1033
- var u = require_universalify().fromPromise;
1034
- var { makeDir: _makeDir, makeDirSync } = require_make_dir();
1035
- var makeDir = u(_makeDir);
1036
- module.exports = {
1037
- mkdirs: makeDir,
1038
- mkdirsSync: makeDirSync,
1039
- // alias
1040
- mkdirp: makeDir,
1041
- mkdirpSync: makeDirSync,
1042
- ensureDir: makeDir,
1043
- ensureDirSync: makeDirSync
1044
- };
1045
- }
1046
- });
1047
-
1048
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/path-exists/index.js
1049
- var require_path_exists = __commonJS({
1050
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/path-exists/index.js"(exports, module) {
1051
- "use strict";
1052
- var u = require_universalify().fromPromise;
1053
- var fs3 = require_fs();
1054
- function pathExists(path3) {
1055
- return fs3.access(path3).then(() => true).catch(() => false);
1056
- }
1057
- module.exports = {
1058
- pathExists: u(pathExists),
1059
- pathExistsSync: fs3.existsSync
1060
- };
1061
- }
1062
- });
1063
-
1064
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/utimes.js
1065
- var require_utimes = __commonJS({
1066
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/utimes.js"(exports, module) {
1067
- "use strict";
1068
- var fs3 = require_fs();
1069
- var u = require_universalify().fromPromise;
1070
- async function utimesMillis(path3, atime, mtime) {
1071
- const fd = await fs3.open(path3, "r+");
1072
- let closeErr = null;
1073
- try {
1074
- await fs3.futimes(fd, atime, mtime);
1075
- } finally {
1076
- try {
1077
- await fs3.close(fd);
1078
- } catch (e) {
1079
- closeErr = e;
1080
- }
1081
- }
1082
- if (closeErr) {
1083
- throw closeErr;
1084
- }
1085
- }
1086
- function utimesMillisSync(path3, atime, mtime) {
1087
- const fd = fs3.openSync(path3, "r+");
1088
- fs3.futimesSync(fd, atime, mtime);
1089
- return fs3.closeSync(fd);
1090
- }
1091
- module.exports = {
1092
- utimesMillis: u(utimesMillis),
1093
- utimesMillisSync
1094
- };
1095
- }
1096
- });
1097
-
1098
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js
1099
- var require_stat = __commonJS({
1100
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js"(exports, module) {
1101
- "use strict";
1102
- var fs3 = require_fs();
1103
- var path3 = __require("path");
1104
- var u = require_universalify().fromPromise;
1105
- function getStats(src, dest, opts) {
1106
- const statFunc = opts.dereference ? (file) => fs3.stat(file, { bigint: true }) : (file) => fs3.lstat(file, { bigint: true });
1107
- return Promise.all([
1108
- statFunc(src),
1109
- statFunc(dest).catch((err) => {
1110
- if (err.code === "ENOENT") return null;
1111
- throw err;
1112
- })
1113
- ]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
1114
- }
1115
- function getStatsSync(src, dest, opts) {
1116
- let destStat;
1117
- const statFunc = opts.dereference ? (file) => fs3.statSync(file, { bigint: true }) : (file) => fs3.lstatSync(file, { bigint: true });
1118
- const srcStat = statFunc(src);
1119
- try {
1120
- destStat = statFunc(dest);
1121
- } catch (err) {
1122
- if (err.code === "ENOENT") return { srcStat, destStat: null };
1123
- throw err;
1124
- }
1125
- return { srcStat, destStat };
1126
- }
1127
- async function checkPaths(src, dest, funcName, opts) {
1128
- const { srcStat, destStat } = await getStats(src, dest, opts);
1129
- if (destStat) {
1130
- if (areIdentical(srcStat, destStat)) {
1131
- const srcBaseName = path3.basename(src);
1132
- const destBaseName = path3.basename(dest);
1133
- if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1134
- return { srcStat, destStat, isChangingCase: true };
1135
- }
1136
- throw new Error("Source and destination must not be the same.");
1137
- }
1138
- if (srcStat.isDirectory() && !destStat.isDirectory()) {
1139
- throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
1140
- }
1141
- if (!srcStat.isDirectory() && destStat.isDirectory()) {
1142
- throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
1143
- }
1144
- }
1145
- if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
1146
- throw new Error(errMsg(src, dest, funcName));
1147
- }
1148
- return { srcStat, destStat };
1149
- }
1150
- function checkPathsSync(src, dest, funcName, opts) {
1151
- const { srcStat, destStat } = getStatsSync(src, dest, opts);
1152
- if (destStat) {
1153
- if (areIdentical(srcStat, destStat)) {
1154
- const srcBaseName = path3.basename(src);
1155
- const destBaseName = path3.basename(dest);
1156
- if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1157
- return { srcStat, destStat, isChangingCase: true };
1158
- }
1159
- throw new Error("Source and destination must not be the same.");
1160
- }
1161
- if (srcStat.isDirectory() && !destStat.isDirectory()) {
1162
- throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
1163
- }
1164
- if (!srcStat.isDirectory() && destStat.isDirectory()) {
1165
- throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
1166
- }
1167
- }
1168
- if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
1169
- throw new Error(errMsg(src, dest, funcName));
1170
- }
1171
- return { srcStat, destStat };
1172
- }
1173
- async function checkParentPaths(src, srcStat, dest, funcName) {
1174
- const srcParent = path3.resolve(path3.dirname(src));
1175
- const destParent = path3.resolve(path3.dirname(dest));
1176
- if (destParent === srcParent || destParent === path3.parse(destParent).root) return;
1177
- let destStat;
1178
- try {
1179
- destStat = await fs3.stat(destParent, { bigint: true });
1180
- } catch (err) {
1181
- if (err.code === "ENOENT") return;
1182
- throw err;
1183
- }
1184
- if (areIdentical(srcStat, destStat)) {
1185
- throw new Error(errMsg(src, dest, funcName));
1186
- }
1187
- return checkParentPaths(src, srcStat, destParent, funcName);
1188
- }
1189
- function checkParentPathsSync(src, srcStat, dest, funcName) {
1190
- const srcParent = path3.resolve(path3.dirname(src));
1191
- const destParent = path3.resolve(path3.dirname(dest));
1192
- if (destParent === srcParent || destParent === path3.parse(destParent).root) return;
1193
- let destStat;
1194
- try {
1195
- destStat = fs3.statSync(destParent, { bigint: true });
1196
- } catch (err) {
1197
- if (err.code === "ENOENT") return;
1198
- throw err;
1199
- }
1200
- if (areIdentical(srcStat, destStat)) {
1201
- throw new Error(errMsg(src, dest, funcName));
1202
- }
1203
- return checkParentPathsSync(src, srcStat, destParent, funcName);
1204
- }
1205
- function areIdentical(srcStat, destStat) {
1206
- return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
1207
- }
1208
- function isSrcSubdir(src, dest) {
1209
- const srcArr = path3.resolve(src).split(path3.sep).filter((i) => i);
1210
- const destArr = path3.resolve(dest).split(path3.sep).filter((i) => i);
1211
- return srcArr.every((cur, i) => destArr[i] === cur);
1212
- }
1213
- function errMsg(src, dest, funcName) {
1214
- return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
1215
- }
1216
- module.exports = {
1217
- // checkPaths
1218
- checkPaths: u(checkPaths),
1219
- checkPathsSync,
1220
- // checkParent
1221
- checkParentPaths: u(checkParentPaths),
1222
- checkParentPathsSync,
1223
- // Misc
1224
- isSrcSubdir,
1225
- areIdentical
1226
- };
1227
- }
1228
- });
1229
-
1230
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js
1231
- var require_copy = __commonJS({
1232
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js"(exports, module) {
1233
- "use strict";
1234
- var fs3 = require_fs();
1235
- var path3 = __require("path");
1236
- var { mkdirs } = require_mkdirs();
1237
- var { pathExists } = require_path_exists();
1238
- var { utimesMillis } = require_utimes();
1239
- var stat = require_stat();
1240
- async function copy(src, dest, opts = {}) {
1241
- if (typeof opts === "function") {
1242
- opts = { filter: opts };
1243
- }
1244
- opts.clobber = "clobber" in opts ? !!opts.clobber : true;
1245
- opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
1246
- if (opts.preserveTimestamps && process.arch === "ia32") {
1247
- process.emitWarning(
1248
- "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
1249
- "Warning",
1250
- "fs-extra-WARN0001"
1251
- );
1252
- }
1253
- const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts);
1254
- await stat.checkParentPaths(src, srcStat, dest, "copy");
1255
- const include = await runFilter(src, dest, opts);
1256
- if (!include) return;
1257
- const destParent = path3.dirname(dest);
1258
- const dirExists = await pathExists(destParent);
1259
- if (!dirExists) {
1260
- await mkdirs(destParent);
1261
- }
1262
- await getStatsAndPerformCopy(destStat, src, dest, opts);
1263
- }
1264
- async function runFilter(src, dest, opts) {
1265
- if (!opts.filter) return true;
1266
- return opts.filter(src, dest);
1267
- }
1268
- async function getStatsAndPerformCopy(destStat, src, dest, opts) {
1269
- const statFn = opts.dereference ? fs3.stat : fs3.lstat;
1270
- const srcStat = await statFn(src);
1271
- if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
1272
- if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
1273
- if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
1274
- if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
1275
- if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
1276
- throw new Error(`Unknown file: ${src}`);
1277
- }
1278
- async function onFile(srcStat, destStat, src, dest, opts) {
1279
- if (!destStat) return copyFile(srcStat, src, dest, opts);
1280
- if (opts.overwrite) {
1281
- await fs3.unlink(dest);
1282
- return copyFile(srcStat, src, dest, opts);
1283
- }
1284
- if (opts.errorOnExist) {
1285
- throw new Error(`'${dest}' already exists`);
1286
- }
1287
- }
1288
- async function copyFile(srcStat, src, dest, opts) {
1289
- await fs3.copyFile(src, dest);
1290
- if (opts.preserveTimestamps) {
1291
- if (fileIsNotWritable(srcStat.mode)) {
1292
- await makeFileWritable(dest, srcStat.mode);
1293
- }
1294
- const updatedSrcStat = await fs3.stat(src);
1295
- await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
1296
- }
1297
- return fs3.chmod(dest, srcStat.mode);
1298
- }
1299
- function fileIsNotWritable(srcMode) {
1300
- return (srcMode & 128) === 0;
1301
- }
1302
- function makeFileWritable(dest, srcMode) {
1303
- return fs3.chmod(dest, srcMode | 128);
1304
- }
1305
- async function onDir(srcStat, destStat, src, dest, opts) {
1306
- if (!destStat) {
1307
- await fs3.mkdir(dest);
1308
- }
1309
- const items = await fs3.readdir(src);
1310
- await Promise.all(items.map(async (item) => {
1311
- const srcItem = path3.join(src, item);
1312
- const destItem = path3.join(dest, item);
1313
- const include = await runFilter(srcItem, destItem, opts);
1314
- if (!include) return;
1315
- const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
1316
- return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
1317
- }));
1318
- if (!destStat) {
1319
- await fs3.chmod(dest, srcStat.mode);
1320
- }
1321
- }
1322
- async function onLink(destStat, src, dest, opts) {
1323
- let resolvedSrc = await fs3.readlink(src);
1324
- if (opts.dereference) {
1325
- resolvedSrc = path3.resolve(process.cwd(), resolvedSrc);
1326
- }
1327
- if (!destStat) {
1328
- return fs3.symlink(resolvedSrc, dest);
1329
- }
1330
- let resolvedDest = null;
1331
- try {
1332
- resolvedDest = await fs3.readlink(dest);
1333
- } catch (e) {
1334
- if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs3.symlink(resolvedSrc, dest);
1335
- throw e;
1336
- }
1337
- if (opts.dereference) {
1338
- resolvedDest = path3.resolve(process.cwd(), resolvedDest);
1339
- }
1340
- if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1341
- throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
1342
- }
1343
- if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
1344
- throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
1345
- }
1346
- await fs3.unlink(dest);
1347
- return fs3.symlink(resolvedSrc, dest);
1348
- }
1349
- module.exports = copy;
1350
- }
1351
- });
1352
-
1353
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js
1354
- var require_copy_sync = __commonJS({
1355
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module) {
1356
- "use strict";
1357
- var fs3 = require_graceful_fs();
1358
- var path3 = __require("path");
1359
- var mkdirsSync = require_mkdirs().mkdirsSync;
1360
- var utimesMillisSync = require_utimes().utimesMillisSync;
1361
- var stat = require_stat();
1362
- function copySync(src, dest, opts) {
1363
- if (typeof opts === "function") {
1364
- opts = { filter: opts };
1365
- }
1366
- opts = opts || {};
1367
- opts.clobber = "clobber" in opts ? !!opts.clobber : true;
1368
- opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
1369
- if (opts.preserveTimestamps && process.arch === "ia32") {
1370
- process.emitWarning(
1371
- "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
1372
- "Warning",
1373
- "fs-extra-WARN0002"
1374
- );
1375
- }
1376
- const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
1377
- stat.checkParentPathsSync(src, srcStat, dest, "copy");
1378
- if (opts.filter && !opts.filter(src, dest)) return;
1379
- const destParent = path3.dirname(dest);
1380
- if (!fs3.existsSync(destParent)) mkdirsSync(destParent);
1381
- return getStats(destStat, src, dest, opts);
1382
- }
1383
- function getStats(destStat, src, dest, opts) {
1384
- const statSync = opts.dereference ? fs3.statSync : fs3.lstatSync;
1385
- const srcStat = statSync(src);
1386
- if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
1387
- else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
1388
- else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
1389
- else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
1390
- else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
1391
- throw new Error(`Unknown file: ${src}`);
1392
- }
1393
- function onFile(srcStat, destStat, src, dest, opts) {
1394
- if (!destStat) return copyFile(srcStat, src, dest, opts);
1395
- return mayCopyFile(srcStat, src, dest, opts);
1396
- }
1397
- function mayCopyFile(srcStat, src, dest, opts) {
1398
- if (opts.overwrite) {
1399
- fs3.unlinkSync(dest);
1400
- return copyFile(srcStat, src, dest, opts);
1401
- } else if (opts.errorOnExist) {
1402
- throw new Error(`'${dest}' already exists`);
1403
- }
1404
- }
1405
- function copyFile(srcStat, src, dest, opts) {
1406
- fs3.copyFileSync(src, dest);
1407
- if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
1408
- return setDestMode(dest, srcStat.mode);
1409
- }
1410
- function handleTimestamps(srcMode, src, dest) {
1411
- if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode);
1412
- return setDestTimestamps(src, dest);
1413
- }
1414
- function fileIsNotWritable(srcMode) {
1415
- return (srcMode & 128) === 0;
1416
- }
1417
- function makeFileWritable(dest, srcMode) {
1418
- return setDestMode(dest, srcMode | 128);
1419
- }
1420
- function setDestMode(dest, srcMode) {
1421
- return fs3.chmodSync(dest, srcMode);
1422
- }
1423
- function setDestTimestamps(src, dest) {
1424
- const updatedSrcStat = fs3.statSync(src);
1425
- return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
1426
- }
1427
- function onDir(srcStat, destStat, src, dest, opts) {
1428
- if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts);
1429
- return copyDir(src, dest, opts);
1430
- }
1431
- function mkDirAndCopy(srcMode, src, dest, opts) {
1432
- fs3.mkdirSync(dest);
1433
- copyDir(src, dest, opts);
1434
- return setDestMode(dest, srcMode);
1435
- }
1436
- function copyDir(src, dest, opts) {
1437
- fs3.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
1438
- }
1439
- function copyDirItem(item, src, dest, opts) {
1440
- const srcItem = path3.join(src, item);
1441
- const destItem = path3.join(dest, item);
1442
- if (opts.filter && !opts.filter(srcItem, destItem)) return;
1443
- const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
1444
- return getStats(destStat, srcItem, destItem, opts);
1445
- }
1446
- function onLink(destStat, src, dest, opts) {
1447
- let resolvedSrc = fs3.readlinkSync(src);
1448
- if (opts.dereference) {
1449
- resolvedSrc = path3.resolve(process.cwd(), resolvedSrc);
1450
- }
1451
- if (!destStat) {
1452
- return fs3.symlinkSync(resolvedSrc, dest);
1453
- } else {
1454
- let resolvedDest;
1455
- try {
1456
- resolvedDest = fs3.readlinkSync(dest);
1457
- } catch (err) {
1458
- if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs3.symlinkSync(resolvedSrc, dest);
1459
- throw err;
1460
- }
1461
- if (opts.dereference) {
1462
- resolvedDest = path3.resolve(process.cwd(), resolvedDest);
1463
- }
1464
- if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1465
- throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
1466
- }
1467
- if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
1468
- throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
1469
- }
1470
- return copyLink(resolvedSrc, dest);
1471
- }
1472
- }
1473
- function copyLink(resolvedSrc, dest) {
1474
- fs3.unlinkSync(dest);
1475
- return fs3.symlinkSync(resolvedSrc, dest);
1476
- }
1477
- module.exports = copySync;
1478
- }
1479
- });
1480
-
1481
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/index.js
1482
- var require_copy2 = __commonJS({
1483
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/index.js"(exports, module) {
1484
- "use strict";
1485
- var u = require_universalify().fromPromise;
1486
- module.exports = {
1487
- copy: u(require_copy()),
1488
- copySync: require_copy_sync()
1489
- };
1490
- }
1491
- });
1492
-
1493
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/remove/index.js
1494
- var require_remove = __commonJS({
1495
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/remove/index.js"(exports, module) {
1496
- "use strict";
1497
- var fs3 = require_graceful_fs();
1498
- var u = require_universalify().fromCallback;
1499
- function remove(path3, callback) {
1500
- fs3.rm(path3, { recursive: true, force: true }, callback);
1501
- }
1502
- function removeSync(path3) {
1503
- fs3.rmSync(path3, { recursive: true, force: true });
1504
- }
1505
- module.exports = {
1506
- remove: u(remove),
1507
- removeSync
1508
- };
1509
- }
1510
- });
1511
-
1512
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/empty/index.js
1513
- var require_empty = __commonJS({
1514
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/empty/index.js"(exports, module) {
1515
- "use strict";
1516
- var u = require_universalify().fromPromise;
1517
- var fs3 = require_fs();
1518
- var path3 = __require("path");
1519
- var mkdir = require_mkdirs();
1520
- var remove = require_remove();
1521
- var emptyDir = u(async function emptyDir2(dir) {
1522
- let items;
1523
- try {
1524
- items = await fs3.readdir(dir);
1525
- } catch {
1526
- return mkdir.mkdirs(dir);
1527
- }
1528
- return Promise.all(items.map((item) => remove.remove(path3.join(dir, item))));
1529
- });
1530
- function emptyDirSync(dir) {
1531
- let items;
1532
- try {
1533
- items = fs3.readdirSync(dir);
1534
- } catch {
1535
- return mkdir.mkdirsSync(dir);
1536
- }
1537
- items.forEach((item) => {
1538
- item = path3.join(dir, item);
1539
- remove.removeSync(item);
1540
- });
1541
- }
1542
- module.exports = {
1543
- emptyDirSync,
1544
- emptydirSync: emptyDirSync,
1545
- emptyDir,
1546
- emptydir: emptyDir
1547
- };
1548
- }
1549
- });
1550
-
1551
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js
1552
- var require_file = __commonJS({
1553
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js"(exports, module) {
1554
- "use strict";
1555
- var u = require_universalify().fromPromise;
1556
- var path3 = __require("path");
1557
- var fs3 = require_fs();
1558
- var mkdir = require_mkdirs();
1559
- async function createFile(file) {
1560
- let stats;
1561
- try {
1562
- stats = await fs3.stat(file);
1563
- } catch {
1564
- }
1565
- if (stats && stats.isFile()) return;
1566
- const dir = path3.dirname(file);
1567
- let dirStats = null;
1568
- try {
1569
- dirStats = await fs3.stat(dir);
1570
- } catch (err) {
1571
- if (err.code === "ENOENT") {
1572
- await mkdir.mkdirs(dir);
1573
- await fs3.writeFile(file, "");
1574
- return;
1575
- } else {
1576
- throw err;
1577
- }
1578
- }
1579
- if (dirStats.isDirectory()) {
1580
- await fs3.writeFile(file, "");
1581
- } else {
1582
- await fs3.readdir(dir);
1583
- }
1584
- }
1585
- function createFileSync(file) {
1586
- let stats;
1587
- try {
1588
- stats = fs3.statSync(file);
1589
- } catch {
1590
- }
1591
- if (stats && stats.isFile()) return;
1592
- const dir = path3.dirname(file);
1593
- try {
1594
- if (!fs3.statSync(dir).isDirectory()) {
1595
- fs3.readdirSync(dir);
1596
- }
1597
- } catch (err) {
1598
- if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
1599
- else throw err;
1600
- }
1601
- fs3.writeFileSync(file, "");
1602
- }
1603
- module.exports = {
1604
- createFile: u(createFile),
1605
- createFileSync
1606
- };
1607
- }
1608
- });
1609
-
1610
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js
1611
- var require_link = __commonJS({
1612
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js"(exports, module) {
1613
- "use strict";
1614
- var u = require_universalify().fromPromise;
1615
- var path3 = __require("path");
1616
- var fs3 = require_fs();
1617
- var mkdir = require_mkdirs();
1618
- var { pathExists } = require_path_exists();
1619
- var { areIdentical } = require_stat();
1620
- async function createLink(srcpath, dstpath) {
1621
- let dstStat;
1622
- try {
1623
- dstStat = await fs3.lstat(dstpath);
1624
- } catch {
1625
- }
1626
- let srcStat;
1627
- try {
1628
- srcStat = await fs3.lstat(srcpath);
1629
- } catch (err) {
1630
- err.message = err.message.replace("lstat", "ensureLink");
1631
- throw err;
1632
- }
1633
- if (dstStat && areIdentical(srcStat, dstStat)) return;
1634
- const dir = path3.dirname(dstpath);
1635
- const dirExists = await pathExists(dir);
1636
- if (!dirExists) {
1637
- await mkdir.mkdirs(dir);
1638
- }
1639
- await fs3.link(srcpath, dstpath);
1640
- }
1641
- function createLinkSync(srcpath, dstpath) {
1642
- let dstStat;
1643
- try {
1644
- dstStat = fs3.lstatSync(dstpath);
1645
- } catch {
1646
- }
1647
- try {
1648
- const srcStat = fs3.lstatSync(srcpath);
1649
- if (dstStat && areIdentical(srcStat, dstStat)) return;
1650
- } catch (err) {
1651
- err.message = err.message.replace("lstat", "ensureLink");
1652
- throw err;
1653
- }
1654
- const dir = path3.dirname(dstpath);
1655
- const dirExists = fs3.existsSync(dir);
1656
- if (dirExists) return fs3.linkSync(srcpath, dstpath);
1657
- mkdir.mkdirsSync(dir);
1658
- return fs3.linkSync(srcpath, dstpath);
1659
- }
1660
- module.exports = {
1661
- createLink: u(createLink),
1662
- createLinkSync
1663
- };
1664
- }
1665
- });
1666
-
1667
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js
1668
- var require_symlink_paths = __commonJS({
1669
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module) {
1670
- "use strict";
1671
- var path3 = __require("path");
1672
- var fs3 = require_fs();
1673
- var { pathExists } = require_path_exists();
1674
- var u = require_universalify().fromPromise;
1675
- async function symlinkPaths(srcpath, dstpath) {
1676
- if (path3.isAbsolute(srcpath)) {
1677
- try {
1678
- await fs3.lstat(srcpath);
1679
- } catch (err) {
1680
- err.message = err.message.replace("lstat", "ensureSymlink");
1681
- throw err;
1682
- }
1683
- return {
1684
- toCwd: srcpath,
1685
- toDst: srcpath
1686
- };
1687
- }
1688
- const dstdir = path3.dirname(dstpath);
1689
- const relativeToDst = path3.join(dstdir, srcpath);
1690
- const exists = await pathExists(relativeToDst);
1691
- if (exists) {
1692
- return {
1693
- toCwd: relativeToDst,
1694
- toDst: srcpath
1695
- };
1696
- }
1697
- try {
1698
- await fs3.lstat(srcpath);
1699
- } catch (err) {
1700
- err.message = err.message.replace("lstat", "ensureSymlink");
1701
- throw err;
1702
- }
1703
- return {
1704
- toCwd: srcpath,
1705
- toDst: path3.relative(dstdir, srcpath)
1706
- };
1707
- }
1708
- function symlinkPathsSync(srcpath, dstpath) {
1709
- if (path3.isAbsolute(srcpath)) {
1710
- const exists2 = fs3.existsSync(srcpath);
1711
- if (!exists2) throw new Error("absolute srcpath does not exist");
1712
- return {
1713
- toCwd: srcpath,
1714
- toDst: srcpath
1715
- };
1716
- }
1717
- const dstdir = path3.dirname(dstpath);
1718
- const relativeToDst = path3.join(dstdir, srcpath);
1719
- const exists = fs3.existsSync(relativeToDst);
1720
- if (exists) {
1721
- return {
1722
- toCwd: relativeToDst,
1723
- toDst: srcpath
1724
- };
1725
- }
1726
- const srcExists = fs3.existsSync(srcpath);
1727
- if (!srcExists) throw new Error("relative srcpath does not exist");
1728
- return {
1729
- toCwd: srcpath,
1730
- toDst: path3.relative(dstdir, srcpath)
1731
- };
1732
- }
1733
- module.exports = {
1734
- symlinkPaths: u(symlinkPaths),
1735
- symlinkPathsSync
1736
- };
1737
- }
1738
- });
1739
-
1740
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-type.js
1741
- var require_symlink_type = __commonJS({
1742
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module) {
1743
- "use strict";
1744
- var fs3 = require_fs();
1745
- var u = require_universalify().fromPromise;
1746
- async function symlinkType(srcpath, type) {
1747
- if (type) return type;
1748
- let stats;
1749
- try {
1750
- stats = await fs3.lstat(srcpath);
1751
- } catch {
1752
- return "file";
1753
- }
1754
- return stats && stats.isDirectory() ? "dir" : "file";
1755
- }
1756
- function symlinkTypeSync(srcpath, type) {
1757
- if (type) return type;
1758
- let stats;
1759
- try {
1760
- stats = fs3.lstatSync(srcpath);
1761
- } catch {
1762
- return "file";
1763
- }
1764
- return stats && stats.isDirectory() ? "dir" : "file";
1765
- }
1766
- module.exports = {
1767
- symlinkType: u(symlinkType),
1768
- symlinkTypeSync
1769
- };
1770
- }
1771
- });
1772
-
1773
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js
1774
- var require_symlink = __commonJS({
1775
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module) {
1776
- "use strict";
1777
- var u = require_universalify().fromPromise;
1778
- var path3 = __require("path");
1779
- var fs3 = require_fs();
1780
- var { mkdirs, mkdirsSync } = require_mkdirs();
1781
- var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
1782
- var { symlinkType, symlinkTypeSync } = require_symlink_type();
1783
- var { pathExists } = require_path_exists();
1784
- var { areIdentical } = require_stat();
1785
- async function createSymlink(srcpath, dstpath, type) {
1786
- let stats;
1787
- try {
1788
- stats = await fs3.lstat(dstpath);
1789
- } catch {
1790
- }
1791
- if (stats && stats.isSymbolicLink()) {
1792
- const [srcStat, dstStat] = await Promise.all([
1793
- fs3.stat(srcpath),
1794
- fs3.stat(dstpath)
1795
- ]);
1796
- if (areIdentical(srcStat, dstStat)) return;
1797
- }
1798
- const relative = await symlinkPaths(srcpath, dstpath);
1799
- srcpath = relative.toDst;
1800
- const toType = await symlinkType(relative.toCwd, type);
1801
- const dir = path3.dirname(dstpath);
1802
- if (!await pathExists(dir)) {
1803
- await mkdirs(dir);
1804
- }
1805
- return fs3.symlink(srcpath, dstpath, toType);
1806
- }
1807
- function createSymlinkSync(srcpath, dstpath, type) {
1808
- let stats;
1809
- try {
1810
- stats = fs3.lstatSync(dstpath);
1811
- } catch {
1812
- }
1813
- if (stats && stats.isSymbolicLink()) {
1814
- const srcStat = fs3.statSync(srcpath);
1815
- const dstStat = fs3.statSync(dstpath);
1816
- if (areIdentical(srcStat, dstStat)) return;
1817
- }
1818
- const relative = symlinkPathsSync(srcpath, dstpath);
1819
- srcpath = relative.toDst;
1820
- type = symlinkTypeSync(relative.toCwd, type);
1821
- const dir = path3.dirname(dstpath);
1822
- const exists = fs3.existsSync(dir);
1823
- if (exists) return fs3.symlinkSync(srcpath, dstpath, type);
1824
- mkdirsSync(dir);
1825
- return fs3.symlinkSync(srcpath, dstpath, type);
1826
- }
1827
- module.exports = {
1828
- createSymlink: u(createSymlink),
1829
- createSymlinkSync
1830
- };
1831
- }
1832
- });
1833
-
1834
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/index.js
1835
- var require_ensure = __commonJS({
1836
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/index.js"(exports, module) {
1837
- "use strict";
1838
- var { createFile, createFileSync } = require_file();
1839
- var { createLink, createLinkSync } = require_link();
1840
- var { createSymlink, createSymlinkSync } = require_symlink();
1841
- module.exports = {
1842
- // file
1843
- createFile,
1844
- createFileSync,
1845
- ensureFile: createFile,
1846
- ensureFileSync: createFileSync,
1847
- // link
1848
- createLink,
1849
- createLinkSync,
1850
- ensureLink: createLink,
1851
- ensureLinkSync: createLinkSync,
1852
- // symlink
1853
- createSymlink,
1854
- createSymlinkSync,
1855
- ensureSymlink: createSymlink,
1856
- ensureSymlinkSync: createSymlinkSync
1857
- };
1858
- }
1859
- });
1860
-
1861
- // ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js
1862
- var require_utils2 = __commonJS({
1863
- "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js"(exports, module) {
1864
- "use strict";
1865
- function stringify2(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
1866
- const EOF = finalEOL ? EOL : "";
1867
- const str = JSON.stringify(obj, replacer, spaces);
1868
- return str.replace(/\n/g, EOL) + EOF;
1869
- }
1870
- function stripBom(content) {
1871
- if (Buffer.isBuffer(content)) content = content.toString("utf8");
1872
- return content.replace(/^\uFEFF/, "");
1873
- }
1874
- module.exports = { stringify: stringify2, stripBom };
1875
- }
1876
- });
1877
-
1878
- // ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js
1879
- var require_jsonfile = __commonJS({
1880
- "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js"(exports, module) {
1881
- "use strict";
1882
- var _fs;
1883
- try {
1884
- _fs = require_graceful_fs();
1885
- } catch (_) {
1886
- _fs = __require("fs");
1887
- }
1888
- var universalify = require_universalify();
1889
- var { stringify: stringify2, stripBom } = require_utils2();
1890
- async function _readFile(file, options2 = {}) {
1891
- if (typeof options2 === "string") {
1892
- options2 = { encoding: options2 };
1893
- }
1894
- const fs3 = options2.fs || _fs;
1895
- const shouldThrow = "throws" in options2 ? options2.throws : true;
1896
- let data = await universalify.fromCallback(fs3.readFile)(file, options2);
1897
- data = stripBom(data);
1898
- let obj;
1899
- try {
1900
- obj = JSON.parse(data, options2 ? options2.reviver : null);
1901
- } catch (err) {
1902
- if (shouldThrow) {
1903
- err.message = `${file}: ${err.message}`;
1904
- throw err;
1905
- } else {
1906
- return null;
1907
- }
1908
- }
1909
- return obj;
1910
- }
1911
- var readFile = universalify.fromPromise(_readFile);
1912
- function readFileSync(file, options2 = {}) {
1913
- if (typeof options2 === "string") {
1914
- options2 = { encoding: options2 };
1915
- }
1916
- const fs3 = options2.fs || _fs;
1917
- const shouldThrow = "throws" in options2 ? options2.throws : true;
1918
- try {
1919
- let content = fs3.readFileSync(file, options2);
1920
- content = stripBom(content);
1921
- return JSON.parse(content, options2.reviver);
1922
- } catch (err) {
1923
- if (shouldThrow) {
1924
- err.message = `${file}: ${err.message}`;
1925
- throw err;
1926
- } else {
1927
- return null;
1928
- }
1929
- }
1930
- }
1931
- async function _writeFile(file, obj, options2 = {}) {
1932
- const fs3 = options2.fs || _fs;
1933
- const str = stringify2(obj, options2);
1934
- await universalify.fromCallback(fs3.writeFile)(file, str, options2);
1935
- }
1936
- var writeFile = universalify.fromPromise(_writeFile);
1937
- function writeFileSync(file, obj, options2 = {}) {
1938
- const fs3 = options2.fs || _fs;
1939
- const str = stringify2(obj, options2);
1940
- return fs3.writeFileSync(file, str, options2);
1941
- }
1942
- var jsonfile = {
1943
- readFile,
1944
- readFileSync,
1945
- writeFile,
1946
- writeFileSync
1947
- };
1948
- module.exports = jsonfile;
1949
- }
1950
- });
1951
-
1952
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/jsonfile.js
1953
- var require_jsonfile2 = __commonJS({
1954
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module) {
1955
- "use strict";
1956
- var jsonFile = require_jsonfile();
1957
- module.exports = {
1958
- // jsonfile exports
1959
- readJson: jsonFile.readFile,
1960
- readJsonSync: jsonFile.readFileSync,
1961
- writeJson: jsonFile.writeFile,
1962
- writeJsonSync: jsonFile.writeFileSync
1963
- };
1964
- }
1965
- });
1966
-
1967
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/output-file/index.js
1968
- var require_output_file = __commonJS({
1969
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/output-file/index.js"(exports, module) {
1970
- "use strict";
1971
- var u = require_universalify().fromPromise;
1972
- var fs3 = require_fs();
1973
- var path3 = __require("path");
1974
- var mkdir = require_mkdirs();
1975
- var pathExists = require_path_exists().pathExists;
1976
- async function outputFile(file, data, encoding = "utf-8") {
1977
- const dir = path3.dirname(file);
1978
- if (!await pathExists(dir)) {
1979
- await mkdir.mkdirs(dir);
1980
- }
1981
- return fs3.writeFile(file, data, encoding);
1982
- }
1983
- function outputFileSync(file, ...args) {
1984
- const dir = path3.dirname(file);
1985
- if (!fs3.existsSync(dir)) {
1986
- mkdir.mkdirsSync(dir);
1987
- }
1988
- fs3.writeFileSync(file, ...args);
1989
- }
1990
- module.exports = {
1991
- outputFile: u(outputFile),
1992
- outputFileSync
1993
- };
1994
- }
1995
- });
1996
-
1997
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json.js
1998
- var require_output_json = __commonJS({
1999
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json.js"(exports, module) {
2000
- "use strict";
2001
- var { stringify: stringify2 } = require_utils2();
2002
- var { outputFile } = require_output_file();
2003
- async function outputJson(file, data, options2 = {}) {
2004
- const str = stringify2(data, options2);
2005
- await outputFile(file, str, options2);
2006
- }
2007
- module.exports = outputJson;
2008
- }
2009
- });
2010
-
2011
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json-sync.js
2012
- var require_output_json_sync = __commonJS({
2013
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module) {
2014
- "use strict";
2015
- var { stringify: stringify2 } = require_utils2();
2016
- var { outputFileSync } = require_output_file();
2017
- function outputJsonSync(file, data, options2) {
2018
- const str = stringify2(data, options2);
2019
- outputFileSync(file, str, options2);
2020
- }
2021
- module.exports = outputJsonSync;
2022
- }
2023
- });
2024
-
2025
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/index.js
2026
- var require_json = __commonJS({
2027
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/index.js"(exports, module) {
2028
- "use strict";
2029
- var u = require_universalify().fromPromise;
2030
- var jsonFile = require_jsonfile2();
2031
- jsonFile.outputJson = u(require_output_json());
2032
- jsonFile.outputJsonSync = require_output_json_sync();
2033
- jsonFile.outputJSON = jsonFile.outputJson;
2034
- jsonFile.outputJSONSync = jsonFile.outputJsonSync;
2035
- jsonFile.writeJSON = jsonFile.writeJson;
2036
- jsonFile.writeJSONSync = jsonFile.writeJsonSync;
2037
- jsonFile.readJSON = jsonFile.readJson;
2038
- jsonFile.readJSONSync = jsonFile.readJsonSync;
2039
- module.exports = jsonFile;
2040
- }
2041
- });
2042
-
2043
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js
2044
- var require_move = __commonJS({
2045
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js"(exports, module) {
2046
- "use strict";
2047
- var fs3 = require_fs();
2048
- var path3 = __require("path");
2049
- var { copy } = require_copy2();
2050
- var { remove } = require_remove();
2051
- var { mkdirp } = require_mkdirs();
2052
- var { pathExists } = require_path_exists();
2053
- var stat = require_stat();
2054
- async function move(src, dest, opts = {}) {
2055
- const overwrite = opts.overwrite || opts.clobber || false;
2056
- const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
2057
- await stat.checkParentPaths(src, srcStat, dest, "move");
2058
- const destParent = path3.dirname(dest);
2059
- const parsedParentPath = path3.parse(destParent);
2060
- if (parsedParentPath.root !== destParent) {
2061
- await mkdirp(destParent);
2062
- }
2063
- return doRename(src, dest, overwrite, isChangingCase);
2064
- }
2065
- async function doRename(src, dest, overwrite, isChangingCase) {
2066
- if (!isChangingCase) {
2067
- if (overwrite) {
2068
- await remove(dest);
2069
- } else if (await pathExists(dest)) {
2070
- throw new Error("dest already exists.");
2071
- }
2072
- }
2073
- try {
2074
- await fs3.rename(src, dest);
2075
- } catch (err) {
2076
- if (err.code !== "EXDEV") {
2077
- throw err;
2078
- }
2079
- await moveAcrossDevice(src, dest, overwrite);
2080
- }
2081
- }
2082
- async function moveAcrossDevice(src, dest, overwrite) {
2083
- const opts = {
2084
- overwrite,
2085
- errorOnExist: true,
2086
- preserveTimestamps: true
2087
- };
2088
- await copy(src, dest, opts);
2089
- return remove(src);
2090
- }
2091
- module.exports = move;
2092
- }
2093
- });
2094
-
2095
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js
2096
- var require_move_sync = __commonJS({
2097
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js"(exports, module) {
2098
- "use strict";
2099
- var fs3 = require_graceful_fs();
2100
- var path3 = __require("path");
2101
- var copySync = require_copy2().copySync;
2102
- var removeSync = require_remove().removeSync;
2103
- var mkdirpSync = require_mkdirs().mkdirpSync;
2104
- var stat = require_stat();
2105
- function moveSync(src, dest, opts) {
2106
- opts = opts || {};
2107
- const overwrite = opts.overwrite || opts.clobber || false;
2108
- const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
2109
- stat.checkParentPathsSync(src, srcStat, dest, "move");
2110
- if (!isParentRoot(dest)) mkdirpSync(path3.dirname(dest));
2111
- return doRename(src, dest, overwrite, isChangingCase);
2112
- }
2113
- function isParentRoot(dest) {
2114
- const parent = path3.dirname(dest);
2115
- const parsedPath = path3.parse(parent);
2116
- return parsedPath.root === parent;
2117
- }
2118
- function doRename(src, dest, overwrite, isChangingCase) {
2119
- if (isChangingCase) return rename(src, dest, overwrite);
2120
- if (overwrite) {
2121
- removeSync(dest);
2122
- return rename(src, dest, overwrite);
2123
- }
2124
- if (fs3.existsSync(dest)) throw new Error("dest already exists.");
2125
- return rename(src, dest, overwrite);
2126
- }
2127
- function rename(src, dest, overwrite) {
2128
- try {
2129
- fs3.renameSync(src, dest);
2130
- } catch (err) {
2131
- if (err.code !== "EXDEV") throw err;
2132
- return moveAcrossDevice(src, dest, overwrite);
2133
- }
2134
- }
2135
- function moveAcrossDevice(src, dest, overwrite) {
2136
- const opts = {
2137
- overwrite,
2138
- errorOnExist: true,
2139
- preserveTimestamps: true
2140
- };
2141
- copySync(src, dest, opts);
2142
- return removeSync(src);
2143
- }
2144
- module.exports = moveSync;
2145
- }
2146
- });
2147
-
2148
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/index.js
2149
- var require_move2 = __commonJS({
2150
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/index.js"(exports, module) {
2151
- "use strict";
2152
- var u = require_universalify().fromPromise;
2153
- module.exports = {
2154
- move: u(require_move()),
2155
- moveSync: require_move_sync()
2156
- };
2157
- }
2158
- });
2159
-
2160
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/index.js
2161
- var require_lib4 = __commonJS({
2162
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/index.js"(exports, module) {
2163
- "use strict";
2164
- module.exports = {
2165
- // Export promiseified graceful-fs:
2166
- ...require_fs(),
2167
- // Export extra methods:
2168
- ...require_copy2(),
2169
- ...require_empty(),
2170
- ...require_ensure(),
2171
- ...require_json(),
2172
- ...require_mkdirs(),
2173
- ...require_move2(),
2174
- ...require_output_file(),
2175
- ...require_path_exists(),
2176
- ...require_remove()
2177
- };
2178
- }
2179
- });
2180
-
2181
64
  // ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.25.1/node_modules/@opentelemetry/semantic-conventions/build/esm/internal/utils.js
2182
65
  // @__NO_SIDE_EFFECTS__
2183
66
  function createConstMap(values) {
@@ -4660,7 +2543,7 @@ var require_attributes = __commonJS({
4660
2543
  exports.getPeerAttributes = exports.getStatusAttributes = exports.getMethodAttributes = void 0;
4661
2544
  var semantic_conventions_1 = (init_esm2(), __toCommonJS(esm_exports2));
4662
2545
  var ipaddr = require_ipaddr();
4663
- var nice_grpc_common_1 = require_lib();
2546
+ var nice_grpc_common_1 = require_lib2();
4664
2547
  function getMethodAttributes(methodPath) {
4665
2548
  const [, service, method] = methodPath.split("/");
4666
2549
  return {
@@ -4792,7 +2675,7 @@ var require_server = __commonJS({
4792
2675
  var api_1 = (init_esm(), __toCommonJS(esm_exports));
4793
2676
  var semantic_conventions_1 = (init_esm2(), __toCommonJS(esm_exports2));
4794
2677
  var abort_controller_x_1 = (init_es(), __toCommonJS(es_exports));
4795
- var nice_grpc_common_1 = require_lib();
2678
+ var nice_grpc_common_1 = require_lib2();
4796
2679
  var attributes_1 = require_attributes();
4797
2680
  var propagation_1 = require_propagation();
4798
2681
  var traces_1 = require_traces();
@@ -4861,7 +2744,7 @@ var require_client = __commonJS({
4861
2744
  var api_1 = (init_esm(), __toCommonJS(esm_exports));
4862
2745
  var semantic_conventions_1 = (init_esm2(), __toCommonJS(esm_exports2));
4863
2746
  var abort_controller_x_1 = (init_es(), __toCommonJS(es_exports));
4864
- var nice_grpc_common_1 = require_lib();
2747
+ var nice_grpc_common_1 = require_lib2();
4865
2748
  var attributes_1 = require_attributes();
4866
2749
  var propagation_1 = require_propagation();
4867
2750
  var traces_1 = require_traces();
@@ -6632,7 +4515,7 @@ ${originalIndentation}`;
6632
4515
  });
6633
4516
 
6634
4517
  // ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/json.js
6635
- var require_json2 = __commonJS({
4518
+ var require_json = __commonJS({
6636
4519
  "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/json.js"(exports, module) {
6637
4520
  "use strict";
6638
4521
  var format3 = require_format();
@@ -7499,7 +5382,7 @@ var require_logform = __commonJS({
7499
5382
  return require_colorize();
7500
5383
  });
7501
5384
  exposeFormat("json", function() {
7502
- return require_json2();
5385
+ return require_json();
7503
5386
  });
7504
5387
  exposeFormat("label", function() {
7505
5388
  return require_label();
@@ -12621,15 +10504,15 @@ var require_route = __commonJS({
12621
10504
  };
12622
10505
  }
12623
10506
  function wrapConversion(toModel, graph) {
12624
- var path3 = [graph[toModel].parent, toModel];
10507
+ var path2 = [graph[toModel].parent, toModel];
12625
10508
  var fn = conversions[graph[toModel].parent][toModel];
12626
10509
  var cur = graph[toModel].parent;
12627
10510
  while (graph[cur].parent) {
12628
- path3.unshift(graph[cur].parent);
10511
+ path2.unshift(graph[cur].parent);
12629
10512
  fn = link(conversions[graph[cur].parent][cur], fn);
12630
10513
  cur = graph[cur].parent;
12631
10514
  }
12632
- fn.conversion = path3;
10515
+ fn.conversion = path2;
12633
10516
  return fn;
12634
10517
  }
12635
10518
  module.exports = function(fromModel) {
@@ -13380,11 +11263,11 @@ var require_tail_file = __commonJS({
13380
11263
  });
13381
11264
 
13382
11265
  // ../../node_modules/.pnpm/winston@3.13.0/node_modules/winston/lib/winston/transports/file.js
13383
- var require_file2 = __commonJS({
11266
+ var require_file = __commonJS({
13384
11267
  "../../node_modules/.pnpm/winston@3.13.0/node_modules/winston/lib/winston/transports/file.js"(exports, module) {
13385
11268
  "use strict";
13386
11269
  var fs3 = __require("fs");
13387
- var path3 = __require("path");
11270
+ var path2 = __require("path");
13388
11271
  var asyncSeries = require_series();
13389
11272
  var zlib2 = __require("zlib");
13390
11273
  var { MESSAGE } = require_triple_beam();
@@ -13414,14 +11297,14 @@ var require_file2 = __commonJS({
13414
11297
  this._onError = this._onError.bind(this);
13415
11298
  if (options2.filename || options2.dirname) {
13416
11299
  throwIf("filename or dirname", "stream");
13417
- this._basename = this.filename = options2.filename ? path3.basename(options2.filename) : "winston.log";
13418
- this.dirname = options2.dirname || path3.dirname(options2.filename);
11300
+ this._basename = this.filename = options2.filename ? path2.basename(options2.filename) : "winston.log";
11301
+ this.dirname = options2.dirname || path2.dirname(options2.filename);
13419
11302
  this.options = options2.options || { flags: "a" };
13420
11303
  } else if (options2.stream) {
13421
11304
  console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream");
13422
11305
  throwIf("stream", "filename", "maxsize");
13423
11306
  this._dest = this._stream.pipe(this._setupStream(options2.stream));
13424
- this.dirname = path3.dirname(this._dest.path);
11307
+ this.dirname = path2.dirname(this._dest.path);
13425
11308
  } else {
13426
11309
  throw new Error("Cannot log to file without filename or stream.");
13427
11310
  }
@@ -13562,7 +11445,7 @@ var require_file2 = __commonJS({
13562
11445
  options2 = {};
13563
11446
  }
13564
11447
  options2 = normalizeQuery(options2);
13565
- const file = path3.join(this.dirname, this.filename);
11448
+ const file = path2.join(this.dirname, this.filename);
13566
11449
  let buff = "";
13567
11450
  let results = [];
13568
11451
  let row = 0;
@@ -13667,7 +11550,7 @@ var require_file2 = __commonJS({
13667
11550
  * TODO: Refactor me.
13668
11551
  */
13669
11552
  stream(options2 = {}) {
13670
- const file = path3.join(this.dirname, this.filename);
11553
+ const file = path2.join(this.dirname, this.filename);
13671
11554
  const stream = new Stream();
13672
11555
  const tail = {
13673
11556
  file,
@@ -13719,7 +11602,7 @@ var require_file2 = __commonJS({
13719
11602
  */
13720
11603
  stat(callback) {
13721
11604
  const target = this._getFile();
13722
- const fullpath = path3.join(this.dirname, target);
11605
+ const fullpath = path2.join(this.dirname, target);
13723
11606
  fs3.stat(fullpath, (err, stat) => {
13724
11607
  if (err && err.code === "ENOENT") {
13725
11608
  debug("ENOENT\xA0ok", fullpath);
@@ -13823,7 +11706,7 @@ var require_file2 = __commonJS({
13823
11706
  * @returns {WritableStream} Stream that writes to disk for the active file.
13824
11707
  */
13825
11708
  _createStream(source) {
13826
- const fullpath = path3.join(this.dirname, this.filename);
11709
+ const fullpath = path2.join(this.dirname, this.filename);
13827
11710
  debug("create stream start", fullpath, this.options);
13828
11711
  const dest = fs3.createWriteStream(fullpath, this.options).on("error", (err) => debug(err)).on("close", () => debug("close", dest.path, dest.bytesWritten)).on("open", () => {
13829
11712
  debug("file open ok", fullpath);
@@ -13848,16 +11731,16 @@ var require_file2 = __commonJS({
13848
11731
  */
13849
11732
  _incFile(callback) {
13850
11733
  debug("_incFile", this.filename);
13851
- const ext = path3.extname(this._basename);
13852
- const basename = path3.basename(this._basename, ext);
11734
+ const ext = path2.extname(this._basename);
11735
+ const basename = path2.basename(this._basename, ext);
13853
11736
  const tasks = [];
13854
11737
  if (this.zippedArchive) {
13855
11738
  tasks.push(
13856
11739
  function(cb) {
13857
11740
  const num = this._created > 0 && !this.tailable ? this._created : "";
13858
11741
  this._compressFile(
13859
- path3.join(this.dirname, `${basename}${num}${ext}`),
13860
- path3.join(this.dirname, `${basename}${num}${ext}.gz`),
11742
+ path2.join(this.dirname, `${basename}${num}${ext}`),
11743
+ path2.join(this.dirname, `${basename}${num}${ext}.gz`),
13861
11744
  cb
13862
11745
  );
13863
11746
  }.bind(this)
@@ -13882,8 +11765,8 @@ var require_file2 = __commonJS({
13882
11765
  * @private
13883
11766
  */
13884
11767
  _getFile() {
13885
- const ext = path3.extname(this._basename);
13886
- const basename = path3.basename(this._basename, ext);
11768
+ const ext = path2.extname(this._basename);
11769
+ const basename = path2.basename(this._basename, ext);
13887
11770
  const isRotation = this.rotationFormat ? this.rotationFormat() : this._created;
13888
11771
  return !this.tailable && this._created ? `${basename}${isRotation}${ext}` : `${basename}${ext}`;
13889
11772
  }
@@ -13903,7 +11786,7 @@ var require_file2 = __commonJS({
13903
11786
  const isOldest = oldest !== 0 ? oldest : "";
13904
11787
  const isZipped = this.zippedArchive ? ".gz" : "";
13905
11788
  const filePath = `${basename}${isOldest}${ext}${isZipped}`;
13906
- const target = path3.join(this.dirname, filePath);
11789
+ const target = path2.join(this.dirname, filePath);
13907
11790
  fs3.unlink(target, callback);
13908
11791
  }
13909
11792
  /**
@@ -13926,20 +11809,20 @@ var require_file2 = __commonJS({
13926
11809
  for (let x = this.maxFiles - 1; x > 1; x--) {
13927
11810
  tasks.push(function(i, cb) {
13928
11811
  let fileName = `${basename}${i - 1}${ext}${isZipped}`;
13929
- const tmppath = path3.join(this.dirname, fileName);
11812
+ const tmppath = path2.join(this.dirname, fileName);
13930
11813
  fs3.exists(tmppath, (exists) => {
13931
11814
  if (!exists) {
13932
11815
  return cb(null);
13933
11816
  }
13934
11817
  fileName = `${basename}${i}${ext}${isZipped}`;
13935
- fs3.rename(tmppath, path3.join(this.dirname, fileName), cb);
11818
+ fs3.rename(tmppath, path2.join(this.dirname, fileName), cb);
13936
11819
  });
13937
11820
  }.bind(this, x));
13938
11821
  }
13939
11822
  asyncSeries(tasks, () => {
13940
11823
  fs3.rename(
13941
- path3.join(this.dirname, `${basename}${ext}${isZipped}`),
13942
- path3.join(this.dirname, `${basename}1${ext}${isZipped}`),
11824
+ path2.join(this.dirname, `${basename}${ext}${isZipped}`),
11825
+ path2.join(this.dirname, `${basename}1${ext}${isZipped}`),
13943
11826
  callback
13944
11827
  );
13945
11828
  });
@@ -14052,9 +11935,9 @@ var require_http = __commonJS({
14052
11935
  };
14053
11936
  const auth = options2.params.auth || null;
14054
11937
  delete options2.params.auth;
14055
- const path3 = options2.params.path || null;
11938
+ const path2 = options2.params.path || null;
14056
11939
  delete options2.params.path;
14057
- this._request(options2, auth, path3, (err, res, body) => {
11940
+ this._request(options2, auth, path2, (err, res, body) => {
14058
11941
  if (res && res.statusCode !== 200) {
14059
11942
  err = new Error(`Invalid HTTP Status Code: ${res.statusCode}`);
14060
11943
  }
@@ -14082,12 +11965,12 @@ var require_http = __commonJS({
14082
11965
  method: "stream",
14083
11966
  params: options2
14084
11967
  };
14085
- const path3 = options2.params.path || null;
11968
+ const path2 = options2.params.path || null;
14086
11969
  delete options2.params.path;
14087
11970
  const auth = options2.params.auth || null;
14088
11971
  delete options2.params.auth;
14089
11972
  let buff = "";
14090
- const req = this._request(options2, auth, path3);
11973
+ const req = this._request(options2, auth, path2);
14091
11974
  stream.destroy = () => req.destroy();
14092
11975
  req.on("data", (data) => {
14093
11976
  data = (buff + data).split(/\n+/);
@@ -14113,14 +11996,14 @@ var require_http = __commonJS({
14113
11996
  * @param {string} path - request path
14114
11997
  * @param {function} callback - Continuation to respond to when complete.
14115
11998
  */
14116
- _request(options2, auth, path3, callback) {
11999
+ _request(options2, auth, path2, callback) {
14117
12000
  options2 = options2 || {};
14118
12001
  auth = auth || this.auth;
14119
- path3 = path3 || this.path || "";
12002
+ path2 = path2 || this.path || "";
14120
12003
  if (this.batch) {
14121
- this._doBatch(options2, callback, auth, path3);
12004
+ this._doBatch(options2, callback, auth, path2);
14122
12005
  } else {
14123
- this._doRequest(options2, callback, auth, path3);
12006
+ this._doRequest(options2, callback, auth, path2);
14124
12007
  }
14125
12008
  }
14126
12009
  /**
@@ -14130,18 +12013,18 @@ var require_http = __commonJS({
14130
12013
  * @param {Object?} auth - authentication options
14131
12014
  * @param {string} path - request path
14132
12015
  */
14133
- _doBatch(options2, callback, auth, path3) {
12016
+ _doBatch(options2, callback, auth, path2) {
14134
12017
  this.batchOptions.push(options2);
14135
12018
  if (this.batchOptions.length === 1) {
14136
12019
  const me = this;
14137
12020
  this.batchCallback = callback;
14138
12021
  this.batchTimeoutID = setTimeout(function() {
14139
12022
  me.batchTimeoutID = -1;
14140
- me._doBatchRequest(me.batchCallback, auth, path3);
12023
+ me._doBatchRequest(me.batchCallback, auth, path2);
14141
12024
  }, this.batchInterval);
14142
12025
  }
14143
12026
  if (this.batchOptions.length === this.batchCount) {
14144
- this._doBatchRequest(this.batchCallback, auth, path3);
12027
+ this._doBatchRequest(this.batchCallback, auth, path2);
14145
12028
  }
14146
12029
  }
14147
12030
  /**
@@ -14150,14 +12033,14 @@ var require_http = __commonJS({
14150
12033
  * @param {Object?} auth - authentication options
14151
12034
  * @param {string} path - request path
14152
12035
  */
14153
- _doBatchRequest(callback, auth, path3) {
12036
+ _doBatchRequest(callback, auth, path2) {
14154
12037
  if (this.batchTimeoutID > 0) {
14155
12038
  clearTimeout(this.batchTimeoutID);
14156
12039
  this.batchTimeoutID = -1;
14157
12040
  }
14158
12041
  const batchOptionsCopy = this.batchOptions.slice();
14159
12042
  this.batchOptions = [];
14160
- this._doRequest(batchOptionsCopy, callback, auth, path3);
12043
+ this._doRequest(batchOptionsCopy, callback, auth, path2);
14161
12044
  }
14162
12045
  /**
14163
12046
  * Make a request to a winstond server or any http server which can
@@ -14167,7 +12050,7 @@ var require_http = __commonJS({
14167
12050
  * @param {Object?} auth - authentication options
14168
12051
  * @param {string} path - request path
14169
12052
  */
14170
- _doRequest(options2, callback, auth, path3) {
12053
+ _doRequest(options2, callback, auth, path2) {
14171
12054
  const headers = Object.assign({}, this.headers);
14172
12055
  if (auth && auth.bearer) {
14173
12056
  headers.Authorization = `Bearer ${auth.bearer}`;
@@ -14177,7 +12060,7 @@ var require_http = __commonJS({
14177
12060
  method: "POST",
14178
12061
  host: this.host,
14179
12062
  port: this.port,
14180
- path: `/${path3.replace(/^\//, "")}`,
12063
+ path: `/${path2.replace(/^\//, "")}`,
14181
12064
  headers,
14182
12065
  auth: auth && auth.username && auth.password ? `${auth.username}:${auth.password}` : "",
14183
12066
  agent: this.agent
@@ -14270,7 +12153,7 @@ var require_transports = __commonJS({
14270
12153
  configurable: true,
14271
12154
  enumerable: true,
14272
12155
  get() {
14273
- return require_file2();
12156
+ return require_file();
14274
12157
  }
14275
12158
  });
14276
12159
  Object.defineProperty(exports, "Http", {
@@ -15165,7 +13048,7 @@ var require_logger = __commonJS({
15165
13048
  this.clear();
15166
13049
  }
15167
13050
  this.silent = silent;
15168
- this.format = format3 || this.format || require_json2()();
13051
+ this.format = format3 || this.format || require_json()();
15169
13052
  this.defaultMeta = defaultMeta || null;
15170
13053
  this.levels = levels || this.levels || config.npm.levels;
15171
13054
  this.level = level;
@@ -32830,7 +30713,7 @@ function appendRootPathToUrlIfNeeded(url) {
32830
30713
  return void 0;
32831
30714
  }
32832
30715
  }
32833
- function appendResourcePathToUrl(url, path3) {
30716
+ function appendResourcePathToUrl(url, path2) {
32834
30717
  try {
32835
30718
  new URL(url);
32836
30719
  } catch (_a2) {
@@ -32840,11 +30723,11 @@ function appendResourcePathToUrl(url, path3) {
32840
30723
  if (!url.endsWith("/")) {
32841
30724
  url = url + "/";
32842
30725
  }
32843
- url += path3;
30726
+ url += path2;
32844
30727
  try {
32845
30728
  new URL(url);
32846
30729
  } catch (_b) {
32847
- diag.warn("Configuration: Provided URL appended with '" + path3 + "' is not a valid URL, using 'undefined' instead of '" + url + "'");
30730
+ diag.warn("Configuration: Provided URL appended with '" + path2 + "' is not a valid URL, using 'undefined' instead of '" + url + "'");
32848
30731
  return void 0;
32849
30732
  }
32850
30733
  return url;
@@ -33040,10 +30923,10 @@ var require_create_service_client_constructor = __commonJS({
33040
30923
  Object.defineProperty(exports, "__esModule", { value: true });
33041
30924
  exports.createServiceClientConstructor = void 0;
33042
30925
  var grpc = require_src();
33043
- function createServiceClientConstructor(path3, name) {
30926
+ function createServiceClientConstructor(path2, name) {
33044
30927
  const serviceDefinition = {
33045
30928
  export: {
33046
- path: path3,
30929
+ path: path2,
33047
30930
  requestStream: false,
33048
30931
  responseStream: false,
33049
30932
  requestSerialize: (arg) => {
@@ -33259,7 +31142,7 @@ var require_otlp_grpc_env_configuration = __commonJS({
33259
31142
  var grpc_exporter_transport_1 = require_grpc_exporter_transport();
33260
31143
  var node_http_1 = (init_index_node_http(), __toCommonJS(index_node_http_exports));
33261
31144
  var fs3 = __require("fs");
33262
- var path3 = __require("path");
31145
+ var path2 = __require("path");
33263
31146
  var api_1 = (init_esm(), __toCommonJS(esm_exports));
33264
31147
  function fallbackIfNullishOrBlank(signalSpecific, nonSignalSpecific) {
33265
31148
  if (signalSpecific != null && signalSpecific !== "") {
@@ -33312,7 +31195,7 @@ var require_otlp_grpc_env_configuration = __commonJS({
33312
31195
  const filePath = fallbackIfNullishOrBlank(signalSpecificPath, nonSignalSpecificPath);
33313
31196
  if (filePath != null) {
33314
31197
  try {
33315
- return fs3.readFileSync(path3.resolve(process.cwd(), filePath));
31198
+ return fs3.readFileSync(path2.resolve(process.cwd(), filePath));
33316
31199
  } catch (_c) {
33317
31200
  api_1.diag.warn(warningMessage);
33318
31201
  return void 0;
@@ -38250,9 +36133,8 @@ var require_src7 = __commonJS({
38250
36133
  });
38251
36134
 
38252
36135
  // src/processor-runner.ts
38253
- var import_fs_extra2 = __toESM(require_lib4(), 1);
36136
+ var import_fs_extra2 = __toESM(require_lib(), 1);
38254
36137
  var import_grpc_js = __toESM(require_src(), 1);
38255
- import path2 from "path";
38256
36138
 
38257
36139
  // ../../node_modules/.pnpm/array-back@6.2.2/node_modules/array-back/index.js
38258
36140
  function isObject(input) {
@@ -38961,15 +36843,15 @@ function commandLineArgs(optionDefinitions2, options2) {
38961
36843
  var command_line_args_default = commandLineArgs;
38962
36844
 
38963
36845
  // src/processor-runner.ts
38964
- var import_nice_grpc2 = __toESM(require_lib2(), 1);
38965
- var import_nice_grpc_error_details2 = __toESM(require_lib3(), 1);
36846
+ var import_nice_grpc2 = __toESM(require_lib3(), 1);
36847
+ var import_nice_grpc_error_details2 = __toESM(require_lib4(), 1);
38966
36848
  var import_nice_grpc_opentelemetry = __toESM(require_lib5(), 1);
38967
36849
  import http2 from "http";
38968
36850
  import { Session } from "node:inspector/promises";
38969
36851
 
38970
36852
  // src/full-service.ts
38971
36853
  import { createRequire } from "module";
38972
- var import_fs_extra = __toESM(require_lib4(), 1);
36854
+ var import_fs_extra = __toESM(require_lib(), 1);
38973
36855
  import path from "path";
38974
36856
  import os from "os";
38975
36857
  var require2 = createRequire(import.meta.url);
@@ -39328,8 +37210,8 @@ var ActionServer = class {
39328
37210
  import("node:process").then((p) => p.stdout.write(""));
39329
37211
 
39330
37212
  // src/service-manager.ts
39331
- var import_nice_grpc = __toESM(require_lib2(), 1);
39332
- var import_nice_grpc_error_details = __toESM(require_lib3(), 1);
37213
+ var import_nice_grpc = __toESM(require_lib3(), 1);
37214
+ var import_nice_grpc_error_details = __toESM(require_lib4(), 1);
39333
37215
  import { Piscina } from "piscina";
39334
37216
  var import_rxjs = __toESM(require_cjs(), 1);
39335
37217
  var { process_binding_count, process_binding_time, process_binding_error } = processMetrics;
@@ -39537,27 +37419,7 @@ setupLogger(options["log-format"] === "json", logLevel === "debug" ? true : opti
39537
37419
  console.debug("Starting with", options.target);
39538
37420
  await setupOTLP(options["otlp-debug"]);
39539
37421
  Error.stackTraceLimit = 20;
39540
- var fullPath = path2.resolve(options["chains-config"]);
39541
- var chainsConfig = import_fs_extra2.default.readJsonSync(fullPath);
39542
- var concurrencyOverride = process.env["OVERRIDE_CONCURRENCY"] ? parseInt(process.env["OVERRIDE_CONCURRENCY"]) : void 0;
39543
- var batchCountOverride = process.env["OVERRIDE_BATCH_COUNT"] ? parseInt(process.env["OVERRIDE_BATCH_COUNT"]) : void 0;
39544
- Endpoints.INSTANCE.concurrency = concurrencyOverride ?? options.concurrency;
39545
- Endpoints.INSTANCE.batchCount = batchCountOverride ?? options["batch-count"];
39546
- Endpoints.INSTANCE.chainQueryAPI = options["chainquery-server"];
39547
- Endpoints.INSTANCE.priceFeedAPI = options["pricefeed-server"];
39548
- for (const [id, config] of Object.entries(chainsConfig)) {
39549
- const chainConfig = config;
39550
- if (chainConfig.ChainServer) {
39551
- Endpoints.INSTANCE.chainServer.set(id, chainConfig.ChainServer);
39552
- } else {
39553
- const http3 = chainConfig.Https?.[0];
39554
- if (http3) {
39555
- Endpoints.INSTANCE.chainServer.set(id, http3);
39556
- } else {
39557
- console.error("not valid config for chain", id);
39558
- }
39559
- }
39560
- }
37422
+ configureEndpoints(options);
39561
37423
  console.debug("Starting Server", options);
39562
37424
  var server;
39563
37425
  var baseService;