affect-cli 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2014 -307
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -510,6 +510,7 @@ function compareHashed(self, that, hashOf, equivalent) {
|
|
|
510
510
|
var entryHash = (entry) => hash(entry[0]);
|
|
511
511
|
var equalEntries = (self, that) => compareBoth(self[0], that[0]) && compareBoth(self[1], that[1]);
|
|
512
512
|
var isEqual = (u) => hasProperty(u, symbol2) && typeof u[symbol2] === "function";
|
|
513
|
+
var asEquivalence = () => equals;
|
|
513
514
|
|
|
514
515
|
// node_modules/effect/dist/Redactable.js
|
|
515
516
|
var symbolRedactable = /* @__PURE__ */ Symbol.for("~effect/Redactable");
|
|
@@ -746,6 +747,15 @@ var BaseProto = {
|
|
|
746
747
|
}
|
|
747
748
|
};
|
|
748
749
|
|
|
750
|
+
class Class2 {
|
|
751
|
+
[NodeInspectSymbol]() {
|
|
752
|
+
return this.toJSON();
|
|
753
|
+
}
|
|
754
|
+
toString() {
|
|
755
|
+
return format(this.toJSON());
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
|
|
749
759
|
// node_modules/effect/dist/internal/stackTraceLimit.js
|
|
750
760
|
var isStackTraceLimitWritable = () => {
|
|
751
761
|
const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
|
|
@@ -1250,6 +1260,35 @@ var Prototype2 = (options) => makePrimitiveProto({
|
|
|
1250
1260
|
[evaluate]: options.evaluate
|
|
1251
1261
|
});
|
|
1252
1262
|
|
|
1263
|
+
// node_modules/effect/dist/Equivalence.js
|
|
1264
|
+
var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
|
|
1265
|
+
var isStrictEquivalent = (x, y) => x === y;
|
|
1266
|
+
var strictEqual = () => isStrictEquivalent;
|
|
1267
|
+
function Tuple(elements) {
|
|
1268
|
+
return make((self, that) => {
|
|
1269
|
+
if (self.length !== that.length) {
|
|
1270
|
+
return false;
|
|
1271
|
+
}
|
|
1272
|
+
for (let i = 0;i < self.length; i++) {
|
|
1273
|
+
if (!elements[i](self[i], that[i])) {
|
|
1274
|
+
return false;
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
return true;
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
function Array_(item) {
|
|
1281
|
+
return make((self, that) => {
|
|
1282
|
+
if (self.length !== that.length)
|
|
1283
|
+
return false;
|
|
1284
|
+
for (let i = 0;i < self.length; i++) {
|
|
1285
|
+
if (!item(self[i], that[i]))
|
|
1286
|
+
return false;
|
|
1287
|
+
}
|
|
1288
|
+
return true;
|
|
1289
|
+
});
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1253
1292
|
// node_modules/effect/dist/internal/option.js
|
|
1254
1293
|
var TypeId = "~effect/Option";
|
|
1255
1294
|
var CommonProto = {
|
|
@@ -1383,11 +1422,11 @@ SuccessImpl.prototype = SuccessProto;
|
|
|
1383
1422
|
var succeed = (success) => new SuccessImpl(success);
|
|
1384
1423
|
|
|
1385
1424
|
// node_modules/effect/dist/Order.js
|
|
1386
|
-
function
|
|
1425
|
+
function make2(compare) {
|
|
1387
1426
|
return (self, that) => self === that ? 0 : compare(self, that);
|
|
1388
1427
|
}
|
|
1389
|
-
var String2 = /* @__PURE__ */
|
|
1390
|
-
var Number2 = /* @__PURE__ */
|
|
1428
|
+
var String2 = /* @__PURE__ */ make2((self, that) => self < that ? -1 : 1);
|
|
1429
|
+
var Number2 = /* @__PURE__ */ make2((self, that) => {
|
|
1391
1430
|
if (globalThis.Number.isNaN(self) && globalThis.Number.isNaN(that))
|
|
1392
1431
|
return 0;
|
|
1393
1432
|
if (globalThis.Number.isNaN(self))
|
|
@@ -1396,7 +1435,7 @@ var Number2 = /* @__PURE__ */ make((self, that) => {
|
|
|
1396
1435
|
return 1;
|
|
1397
1436
|
return self < that ? -1 : 1;
|
|
1398
1437
|
});
|
|
1399
|
-
var mapInput = /* @__PURE__ */ dual(2, (self, f) =>
|
|
1438
|
+
var mapInput = /* @__PURE__ */ dual(2, (self, f) => make2((b1, b2) => self(f(b1), f(b2))));
|
|
1400
1439
|
var isGreaterThan = (O) => dual(2, (self, that) => O(self, that) === 1);
|
|
1401
1440
|
|
|
1402
1441
|
// node_modules/effect/dist/Option.js
|
|
@@ -1457,7 +1496,7 @@ var ServiceProto = {
|
|
|
1457
1496
|
return self;
|
|
1458
1497
|
},
|
|
1459
1498
|
context(self) {
|
|
1460
|
-
return
|
|
1499
|
+
return make3(this, self);
|
|
1461
1500
|
},
|
|
1462
1501
|
use(f) {
|
|
1463
1502
|
return withFiber((fiber) => f(get(fiber.context, this)));
|
|
@@ -1561,7 +1600,7 @@ var isContext = (u) => hasProperty(u, TypeId3);
|
|
|
1561
1600
|
var isReference = (u) => !!u[ReferenceTypeId];
|
|
1562
1601
|
var empty = () => emptyContext2;
|
|
1563
1602
|
var emptyContext2 = /* @__PURE__ */ makeUnsafe(/* @__PURE__ */ new Map);
|
|
1564
|
-
var
|
|
1603
|
+
var make3 = (key, service) => makeUnsafe(new Map([[key.key, service]]));
|
|
1565
1604
|
var add = /* @__PURE__ */ dual(3, (self, key, service) => addUnsafe(self, key.key, service));
|
|
1566
1605
|
var addUnsafe = (self, key, service) => {
|
|
1567
1606
|
const impl = self;
|
|
@@ -1645,6 +1684,21 @@ var normalize = (n) => n > 0 ? Math.floor(n) : 0;
|
|
|
1645
1684
|
// node_modules/effect/dist/Result.js
|
|
1646
1685
|
var succeed2 = succeed;
|
|
1647
1686
|
var fail2 = fail;
|
|
1687
|
+
var try_ = (evaluate) => {
|
|
1688
|
+
if (isFunction(evaluate)) {
|
|
1689
|
+
try {
|
|
1690
|
+
return succeed2(evaluate());
|
|
1691
|
+
} catch (e) {
|
|
1692
|
+
return fail2(e);
|
|
1693
|
+
}
|
|
1694
|
+
} else {
|
|
1695
|
+
try {
|
|
1696
|
+
return succeed2(evaluate.try());
|
|
1697
|
+
} catch (e) {
|
|
1698
|
+
return fail2(evaluate.catch(e));
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
};
|
|
1648
1702
|
var isFailure2 = isFailure;
|
|
1649
1703
|
var isSuccess2 = isSuccess;
|
|
1650
1704
|
var match2 = /* @__PURE__ */ dual(2, (self, {
|
|
@@ -1659,6 +1713,9 @@ var getOrThrowWith = /* @__PURE__ */ dual(2, (self, onFailure) => {
|
|
|
1659
1713
|
});
|
|
1660
1714
|
var getOrThrow = /* @__PURE__ */ getOrThrowWith(identity);
|
|
1661
1715
|
|
|
1716
|
+
// node_modules/effect/dist/Tuple.js
|
|
1717
|
+
var makeEquivalence = Tuple;
|
|
1718
|
+
|
|
1662
1719
|
// node_modules/effect/dist/Iterable.js
|
|
1663
1720
|
var findFirst = /* @__PURE__ */ dual(2, (self, f) => {
|
|
1664
1721
|
let i = 0;
|
|
@@ -1700,7 +1757,29 @@ var collect = /* @__PURE__ */ dual(2, (self, f) => {
|
|
|
1700
1757
|
return out;
|
|
1701
1758
|
});
|
|
1702
1759
|
var toEntries = /* @__PURE__ */ collect((key, value) => [key, value]);
|
|
1760
|
+
var has = /* @__PURE__ */ dual(2, (self, key) => Object.hasOwn(self, key));
|
|
1761
|
+
var map2 = /* @__PURE__ */ dual(2, (self, f) => {
|
|
1762
|
+
const out = {
|
|
1763
|
+
...self
|
|
1764
|
+
};
|
|
1765
|
+
for (const key of keys(self)) {
|
|
1766
|
+
assignProperty(out, key, f(self[key], key));
|
|
1767
|
+
}
|
|
1768
|
+
return out;
|
|
1769
|
+
});
|
|
1703
1770
|
var keys = (self) => Object.keys(self);
|
|
1771
|
+
var isSubrecordBy = (equivalence) => dual(2, (self, that) => {
|
|
1772
|
+
for (const key of keys(self)) {
|
|
1773
|
+
if (!has(that, key) || !equivalence(self[key], that[key])) {
|
|
1774
|
+
return false;
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
return true;
|
|
1778
|
+
});
|
|
1779
|
+
var makeEquivalence2 = (equivalence) => {
|
|
1780
|
+
const is = isSubrecordBy(equivalence);
|
|
1781
|
+
return (self, that) => is(self, that) && is(that, self);
|
|
1782
|
+
};
|
|
1704
1783
|
|
|
1705
1784
|
// node_modules/effect/dist/Array.js
|
|
1706
1785
|
var Array2 = globalThis.Array;
|
|
@@ -1750,11 +1829,31 @@ var sort = /* @__PURE__ */ dual(2, (self, O) => {
|
|
|
1750
1829
|
out.sort(O);
|
|
1751
1830
|
return out;
|
|
1752
1831
|
});
|
|
1832
|
+
var containsWith = (isEquivalent) => dual(2, (self, a) => {
|
|
1833
|
+
for (const i of self) {
|
|
1834
|
+
if (isEquivalent(a, i)) {
|
|
1835
|
+
return true;
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
return false;
|
|
1839
|
+
});
|
|
1840
|
+
var contains = /* @__PURE__ */ containsWith(/* @__PURE__ */ asEquivalence());
|
|
1753
1841
|
var empty2 = () => [];
|
|
1754
1842
|
var of = (a) => [a];
|
|
1755
|
-
var
|
|
1843
|
+
var map3 = /* @__PURE__ */ dual(2, (self, f) => self.map(f));
|
|
1844
|
+
var filter = /* @__PURE__ */ dual(2, (self, predicate) => {
|
|
1845
|
+
const as = fromIterable(self);
|
|
1846
|
+
const out = [];
|
|
1847
|
+
for (let i = 0;i < as.length; i++) {
|
|
1848
|
+
if (predicate(as[i], i)) {
|
|
1849
|
+
out.push(as[i]);
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
return out;
|
|
1853
|
+
});
|
|
1756
1854
|
var reduce = /* @__PURE__ */ dual(3, (self, b, f) => fromIterable(self).reduce((b, a, i) => f(b, a, i), b));
|
|
1757
1855
|
var some3 = /* @__PURE__ */ dual(2, (self, predicate) => self.some(predicate));
|
|
1856
|
+
var makeEquivalence3 = Array_;
|
|
1758
1857
|
var join = /* @__PURE__ */ dual(2, (self, sep) => fromIterable(self).join(sep));
|
|
1759
1858
|
|
|
1760
1859
|
// node_modules/effect/dist/Duration.js
|
|
@@ -1772,7 +1871,7 @@ var bigintNanosPerDay = /* @__PURE__ */ BigInt(86400000000000);
|
|
|
1772
1871
|
var bigintNanosPerWeek = /* @__PURE__ */ BigInt(604800000000000);
|
|
1773
1872
|
var roundTiesAwayFromZero = (input) => BigInt(Math.sign(input) * Math.round(Math.abs(input)));
|
|
1774
1873
|
var roundMillisToNanos = (millis) => Number.isInteger(millis) ? BigInt(millis) * bigint1e6 : roundTiesAwayFromZero(millis * 1e6);
|
|
1775
|
-
var fromNanosNumber = (nanos) =>
|
|
1874
|
+
var fromNanosNumber = (nanos) => make4(Number.isFinite(nanos) ? roundTiesAwayFromZero(nanos) : nanos);
|
|
1776
1875
|
var nanosToUnit = (nanos, divisor) => {
|
|
1777
1876
|
const value = Number(nanos);
|
|
1778
1877
|
if (Number.isFinite(value))
|
|
@@ -1798,9 +1897,9 @@ var divideTiesAwayFromZero = (numerator, denominator) => {
|
|
|
1798
1897
|
var fromMillisString = (input, scale) => {
|
|
1799
1898
|
const millis = Number(input) * scale;
|
|
1800
1899
|
if (!Number.isFinite(millis))
|
|
1801
|
-
return
|
|
1900
|
+
return make4(millis);
|
|
1802
1901
|
const nanos = parseNanos(input, BigInt(scale) * bigint1e6);
|
|
1803
|
-
return
|
|
1902
|
+
return make4(Number.isInteger(millis) && BigInt(millis) * bigint1e6 === nanos ? millis : nanos);
|
|
1804
1903
|
};
|
|
1805
1904
|
var DURATION_REGEXP = /^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/;
|
|
1806
1905
|
var fromInputUnsafe = (input) => {
|
|
@@ -1867,7 +1966,7 @@ var fromInputUnsafe = (input) => {
|
|
|
1867
1966
|
return infinity;
|
|
1868
1967
|
}
|
|
1869
1968
|
const nanos = input[0] * 1e9 + input[1];
|
|
1870
|
-
return Number.isFinite(nanos) && Number.isInteger(input[0]) && Number.isInteger(input[1]) ?
|
|
1969
|
+
return Number.isFinite(nanos) && Number.isInteger(input[0]) && Number.isInteger(input[1]) ? make4(BigInt(input[0]) * bigint1e9 + BigInt(input[1])) : fromNanosNumber(nanos);
|
|
1871
1970
|
}
|
|
1872
1971
|
const obj = input;
|
|
1873
1972
|
let millis = 0;
|
|
@@ -1885,13 +1984,13 @@ var fromInputUnsafe = (input) => {
|
|
|
1885
1984
|
millis += obj.milliseconds;
|
|
1886
1985
|
if (!obj.microseconds && !obj.nanoseconds) {
|
|
1887
1986
|
if (!Number.isFinite(millis))
|
|
1888
|
-
return
|
|
1987
|
+
return make4(millis);
|
|
1889
1988
|
const exact = sumObjectNanos(obj);
|
|
1890
|
-
return exact === undefined || BigInt(millis) * bigint1e6 === exact ?
|
|
1989
|
+
return exact === undefined || BigInt(millis) * bigint1e6 === exact ? make4(millis) : make4(exact);
|
|
1891
1990
|
}
|
|
1892
1991
|
const nanos = millis * 1e6 + (obj.microseconds ?? 0) * 1000 + (obj.nanoseconds ?? 0);
|
|
1893
1992
|
const exact = Number.isFinite(nanos) ? sumObjectNanos(obj) : undefined;
|
|
1894
|
-
return exact === undefined ? fromNanosNumber(nanos) :
|
|
1993
|
+
return exact === undefined ? fromNanosNumber(nanos) : make4(exact);
|
|
1895
1994
|
}
|
|
1896
1995
|
}
|
|
1897
1996
|
return invalid(input);
|
|
@@ -1992,7 +2091,7 @@ var DurationProto = {
|
|
|
1992
2091
|
return pipeArguments(this, arguments);
|
|
1993
2092
|
}
|
|
1994
2093
|
};
|
|
1995
|
-
var
|
|
2094
|
+
var make4 = (input) => {
|
|
1996
2095
|
const duration = Object.create(DurationProto);
|
|
1997
2096
|
if (typeof input === "number") {
|
|
1998
2097
|
if (isNaN(input) || input === 0 || Object.is(input, -0)) {
|
|
@@ -2022,11 +2121,12 @@ var make3 = (input) => {
|
|
|
2022
2121
|
};
|
|
2023
2122
|
var isDuration = (u) => hasProperty(u, TypeId4);
|
|
2024
2123
|
var isFinite = (self) => self.value._tag !== "Infinity" && self.value._tag !== "NegativeInfinity";
|
|
2025
|
-
var zero = /* @__PURE__ */
|
|
2026
|
-
var infinity = /* @__PURE__ */
|
|
2027
|
-
var negativeInfinity = /* @__PURE__ */
|
|
2028
|
-
var nanos = (nanos) =>
|
|
2029
|
-
var millis = (millis) =>
|
|
2124
|
+
var zero = /* @__PURE__ */ make4(0);
|
|
2125
|
+
var infinity = /* @__PURE__ */ make4(Infinity);
|
|
2126
|
+
var negativeInfinity = /* @__PURE__ */ make4(-Infinity);
|
|
2127
|
+
var nanos = (nanos) => make4(nanos);
|
|
2128
|
+
var millis = (millis) => make4(millis);
|
|
2129
|
+
var seconds = (seconds) => make4(seconds * 1000);
|
|
2030
2130
|
var toMillis = (self) => match4(fromInputUnsafe(self), {
|
|
2031
2131
|
onMillis: identity,
|
|
2032
2132
|
onNanos: (nanos) => nanosToUnit(nanos, 1e6),
|
|
@@ -2267,7 +2367,7 @@ class ParentSpan extends (/* @__PURE__ */ Service()(ParentSpanKey, {
|
|
|
2267
2367
|
fiberCached: true
|
|
2268
2368
|
})) {
|
|
2269
2369
|
}
|
|
2270
|
-
var
|
|
2370
|
+
var make5 = (options) => options;
|
|
2271
2371
|
var DisablePropagation = /* @__PURE__ */ Reference("effect/Tracer/DisablePropagation", {
|
|
2272
2372
|
defaultValue: constFalse
|
|
2273
2373
|
});
|
|
@@ -2278,7 +2378,7 @@ var MinimumTraceLevel = /* @__PURE__ */ Reference("effect/Tracer/MinimumTraceLev
|
|
|
2278
2378
|
defaultValue: () => "All"
|
|
2279
2379
|
});
|
|
2280
2380
|
var TracerKey = "effect/Tracer";
|
|
2281
|
-
var nativeTracer = /* @__PURE__ */
|
|
2381
|
+
var nativeTracer = /* @__PURE__ */ make5({
|
|
2282
2382
|
span: (options) => new NativeSpan(options)
|
|
2283
2383
|
});
|
|
2284
2384
|
|
|
@@ -2388,6 +2488,27 @@ var CurrentLogSpans = /* @__PURE__ */ Reference("effect/References/CurrentLogSpa
|
|
|
2388
2488
|
});
|
|
2389
2489
|
|
|
2390
2490
|
// node_modules/effect/dist/internal/tracer.js
|
|
2491
|
+
var addSpanStackTrace = (options) => {
|
|
2492
|
+
if (options?.captureStackTrace === false) {
|
|
2493
|
+
return options;
|
|
2494
|
+
} else if (options?.captureStackTrace !== undefined && typeof options.captureStackTrace !== "boolean") {
|
|
2495
|
+
return options;
|
|
2496
|
+
}
|
|
2497
|
+
const limit = getStackTraceLimit();
|
|
2498
|
+
if (limit === 0 && options?.captureStackTrace !== true) {
|
|
2499
|
+
return {
|
|
2500
|
+
...options,
|
|
2501
|
+
captureStackTrace: false
|
|
2502
|
+
};
|
|
2503
|
+
}
|
|
2504
|
+
setStackTraceLimit(3);
|
|
2505
|
+
const traceError = new Error;
|
|
2506
|
+
setStackTraceLimit(limit);
|
|
2507
|
+
return {
|
|
2508
|
+
...options,
|
|
2509
|
+
captureStackTrace: spanCleaner(() => traceError.stack)
|
|
2510
|
+
};
|
|
2511
|
+
};
|
|
2391
2512
|
var makeStackCleaner = (line) => (stack) => {
|
|
2392
2513
|
let cache;
|
|
2393
2514
|
return () => {
|
|
@@ -2404,6 +2525,7 @@ var makeStackCleaner = (line) => (stack) => {
|
|
|
2404
2525
|
}
|
|
2405
2526
|
};
|
|
2406
2527
|
};
|
|
2528
|
+
var spanCleaner = /* @__PURE__ */ makeStackCleaner(3);
|
|
2407
2529
|
|
|
2408
2530
|
// node_modules/effect/dist/internal/effect.js
|
|
2409
2531
|
class Interrupt extends ReasonBase {
|
|
@@ -2442,6 +2564,19 @@ var hasDies = (self) => self.reasons.some(isDieReason);
|
|
|
2442
2564
|
var causeElectDefects = (self) => hasDies(self) && hasFails(self) ? causeFromReasons(self.reasons.map((reason) => reason._tag === "Fail" && !isDone(reason.error) ? new Die(reason.error, reason.annotations) : reason)) : self;
|
|
2443
2565
|
var findRecoverableError = (self) => hasDies(self) ? fail2(causeElectDefects(self)) : findError(self);
|
|
2444
2566
|
var hasInterrupts = (self) => self.reasons.some(isInterruptReason);
|
|
2567
|
+
var causeFilterInterruptors = (self) => {
|
|
2568
|
+
let interruptors;
|
|
2569
|
+
for (let i = 0;i < self.reasons.length; i++) {
|
|
2570
|
+
const f = self.reasons[i];
|
|
2571
|
+
if (f._tag !== "Interrupt")
|
|
2572
|
+
continue;
|
|
2573
|
+
interruptors ??= new Set;
|
|
2574
|
+
if (f.fiberId !== undefined) {
|
|
2575
|
+
interruptors.add(f.fiberId);
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
return interruptors ? succeed2(interruptors) : fail2(self);
|
|
2579
|
+
};
|
|
2445
2580
|
var hasInterruptsOnly = (self) => self.reasons.length > 0 && self.reasons.every(isInterruptReason);
|
|
2446
2581
|
var reasonAnnotations = (self) => makeUnsafe(self.annotations);
|
|
2447
2582
|
var causeMap = /* @__PURE__ */ dual(2, (self, f) => {
|
|
@@ -2590,9 +2725,9 @@ var currentStackTrace = (frame) => {
|
|
|
2590
2725
|
if (stack) {
|
|
2591
2726
|
const locationMatchAll = stack.matchAll(locationRegExp);
|
|
2592
2727
|
let match = false;
|
|
2593
|
-
for (const [,
|
|
2728
|
+
for (const [, location2] of locationMatchAll) {
|
|
2594
2729
|
match = true;
|
|
2595
|
-
out.push(` at ${current.name} (${
|
|
2730
|
+
out.push(` at ${current.name} (${location2})`);
|
|
2596
2731
|
}
|
|
2597
2732
|
if (!match) {
|
|
2598
2733
|
out.push(` at ${current.name} (${stack.replace(/^at /, "")})`);
|
|
@@ -2697,7 +2832,7 @@ class FiberImpl {
|
|
|
2697
2832
|
}
|
|
2698
2833
|
let cause = causeInterrupt(fiberId);
|
|
2699
2834
|
if (this.cache.stackFrame) {
|
|
2700
|
-
cause = causeAnnotate(cause,
|
|
2835
|
+
cause = causeAnnotate(cause, make3(StackTraceKey, this.cache.stackFrame));
|
|
2701
2836
|
}
|
|
2702
2837
|
if (annotations) {
|
|
2703
2838
|
cause = causeAnnotate(cause, annotations);
|
|
@@ -3009,7 +3144,7 @@ var failCauseSync = (evaluate) => suspend(() => failCause(evaluate()));
|
|
|
3009
3144
|
var die = (defect) => exitDie(defect);
|
|
3010
3145
|
var failSync = (error) => suspend(() => fail3(error()));
|
|
3011
3146
|
var void_ = /* @__PURE__ */ succeed3(undefined);
|
|
3012
|
-
var
|
|
3147
|
+
var try_2 = (options) => {
|
|
3013
3148
|
const evaluate = typeof options === "function" ? options : options.try;
|
|
3014
3149
|
const catcher = typeof options === "function" ? (cause) => new UnknownError(cause, "An error occurred in Effect.try") : options.catch;
|
|
3015
3150
|
return suspend(() => {
|
|
@@ -3020,6 +3155,9 @@ var try_ = (options) => {
|
|
|
3020
3155
|
}
|
|
3021
3156
|
});
|
|
3022
3157
|
};
|
|
3158
|
+
var promise = (evaluate) => callbackOptions(function(resume, signal) {
|
|
3159
|
+
evaluate(signal).then((a) => resume(succeed3(a)), (e) => resume(die(e)));
|
|
3160
|
+
}, evaluate.length !== 0);
|
|
3023
3161
|
var tryPromise = (options) => {
|
|
3024
3162
|
const f = typeof options === "function" ? options : options.try;
|
|
3025
3163
|
const catcher = typeof options === "function" ? (cause) => new UnknownError(cause, "An error occurred in Effect.tryPromise") : options.catch;
|
|
@@ -3337,8 +3475,8 @@ var flatMapEager = /* @__PURE__ */ dual(2, (self, f) => {
|
|
|
3337
3475
|
}
|
|
3338
3476
|
return flatMap2(self, f);
|
|
3339
3477
|
});
|
|
3340
|
-
var
|
|
3341
|
-
var mapEager = /* @__PURE__ */ dual(2, (self, f) => effectIsExit(self) ? exitMap(self, f) :
|
|
3478
|
+
var map4 = /* @__PURE__ */ dual(2, (self, f) => new ContImpl(self, mapCont, f));
|
|
3479
|
+
var mapEager = /* @__PURE__ */ dual(2, (self, f) => effectIsExit(self) ? exitMap(self, f) : map4(self, f));
|
|
3342
3480
|
var mapErrorEager = /* @__PURE__ */ dual(2, (self, f) => effectIsExit(self) ? exitMapError(self, f) : mapError(self, f));
|
|
3343
3481
|
var catchEager = /* @__PURE__ */ dual(2, (self, f) => {
|
|
3344
3482
|
if (effectIsExit(self)) {
|
|
@@ -3408,9 +3546,9 @@ var provideService = function() {
|
|
|
3408
3546
|
return dual(3, (self, service, impl) => provideServiceImpl(self, service, impl)).apply(this, arguments);
|
|
3409
3547
|
};
|
|
3410
3548
|
var provideServiceImpl = (self, service, implementation) => updateContext(self, add(service, implementation));
|
|
3411
|
-
var zipWith = /* @__PURE__ */ dual((args) => isEffect(args[1]), (self, that, f, options) => options?.concurrent ?
|
|
3549
|
+
var zipWith = /* @__PURE__ */ dual((args) => isEffect(args[1]), (self, that, f, options) => options?.concurrent ? map4(all([self, that], {
|
|
3412
3550
|
concurrency: 2
|
|
3413
|
-
}), ([a, a2]) => f(a, a2)) : flatMap2(self, (a) =>
|
|
3551
|
+
}), ([a, a2]) => f(a, a2)) : flatMap2(self, (a) => map4(that, (a2) => f(a, a2))));
|
|
3414
3552
|
var forever = /* @__PURE__ */ dual((args) => isEffect(args[0]), (self, options) => whileLoop({
|
|
3415
3553
|
while: constTrue,
|
|
3416
3554
|
body: constant(options?.disableYield ? self : flatMap2(self, (_) => yieldNow)),
|
|
@@ -3773,6 +3911,14 @@ var onExitFilter = /* @__PURE__ */ dual(3, (self, filter, f) => onExit(self, (ex
|
|
|
3773
3911
|
return isFailure2(b) ? void_ : f(b.success, exit);
|
|
3774
3912
|
}));
|
|
3775
3913
|
var onError = /* @__PURE__ */ dual(2, (self, f) => onExitFilter(self, exitFilterCause, f));
|
|
3914
|
+
var onErrorFilter = /* @__PURE__ */ dual(3, (self, filter, f) => onExit(self, (exit) => {
|
|
3915
|
+
if (exit._tag !== "Failure") {
|
|
3916
|
+
return void_;
|
|
3917
|
+
}
|
|
3918
|
+
const result = filter(exit.cause);
|
|
3919
|
+
return isFailure2(result) ? void_ : f(result.success, exit.cause);
|
|
3920
|
+
}));
|
|
3921
|
+
var onInterrupt = /* @__PURE__ */ dual(2, (self, finalizer) => onErrorFilter(causeFilterInterruptors, finalizer)(self));
|
|
3776
3922
|
var infiniteTTL = /* @__PURE__ */ constant(Infinity);
|
|
3777
3923
|
var makeCachedUnsafe = (self, ttlMillis) => {
|
|
3778
3924
|
let expiresAt = 0;
|
|
@@ -3873,7 +4019,7 @@ var all = (arg, options) => {
|
|
|
3873
4019
|
} else if (options?.discard) {
|
|
3874
4020
|
return options.mode === "result" ? forEach(Object.values(arg), result, options) : forEach(Object.values(arg), identity, options);
|
|
3875
4021
|
}
|
|
3876
|
-
return suspend(() =>
|
|
4022
|
+
return suspend(() => map4(forEach(Object.entries(arg), ([key, effect]) => map4(options?.mode === "result" ? result(effect) : effect, (value) => [key, value]), {
|
|
3877
4023
|
concurrency: options?.concurrency
|
|
3878
4024
|
}), Object.fromEntries));
|
|
3879
4025
|
};
|
|
@@ -4144,6 +4290,25 @@ var fiberRunIn = /* @__PURE__ */ dual(2, (self, scope) => {
|
|
|
4144
4290
|
return self;
|
|
4145
4291
|
});
|
|
4146
4292
|
var runFork = /* @__PURE__ */ runForkWith(/* @__PURE__ */ empty());
|
|
4293
|
+
var runPromiseExitWith = (context) => {
|
|
4294
|
+
const runFork = runForkWith(context);
|
|
4295
|
+
return (effect, options) => {
|
|
4296
|
+
const fiber = runFork(effect, options);
|
|
4297
|
+
return new Promise((resolve) => {
|
|
4298
|
+
fiber.addObserver((exit) => resolve(exit));
|
|
4299
|
+
});
|
|
4300
|
+
};
|
|
4301
|
+
};
|
|
4302
|
+
var runPromiseWith = (context) => {
|
|
4303
|
+
const runPromiseExit = runPromiseExitWith(context);
|
|
4304
|
+
return (effect, options) => runPromiseExit(effect, options).then((exit) => {
|
|
4305
|
+
if (exit._tag === "Failure") {
|
|
4306
|
+
throw causeSquash(exit.cause);
|
|
4307
|
+
}
|
|
4308
|
+
return exit.value;
|
|
4309
|
+
});
|
|
4310
|
+
};
|
|
4311
|
+
var runPromise = /* @__PURE__ */ runPromiseWith(/* @__PURE__ */ empty());
|
|
4147
4312
|
var runSyncExitWith = (context) => {
|
|
4148
4313
|
const runFork = runForkWith(context);
|
|
4149
4314
|
return (effect) => {
|
|
@@ -4158,6 +4323,16 @@ var runSyncExitWith = (context) => {
|
|
|
4158
4323
|
};
|
|
4159
4324
|
};
|
|
4160
4325
|
var runSyncExit = /* @__PURE__ */ runSyncExitWith(/* @__PURE__ */ empty());
|
|
4326
|
+
var runSyncWith = (context) => {
|
|
4327
|
+
const runSyncExit = runSyncExitWith(context);
|
|
4328
|
+
return (effect) => {
|
|
4329
|
+
const exit = runSyncExit(effect);
|
|
4330
|
+
if (exit._tag === "Failure")
|
|
4331
|
+
throw causeSquash(exit.cause);
|
|
4332
|
+
return exit.value;
|
|
4333
|
+
};
|
|
4334
|
+
};
|
|
4335
|
+
var runSync = /* @__PURE__ */ runSyncWith(/* @__PURE__ */ empty());
|
|
4161
4336
|
var succeedTrue = /* @__PURE__ */ succeed3(true);
|
|
4162
4337
|
var succeedFalse = /* @__PURE__ */ succeed3(false);
|
|
4163
4338
|
|
|
@@ -4309,6 +4484,14 @@ var makeSpanUnsafe = (fiber, name, options) => {
|
|
|
4309
4484
|
}
|
|
4310
4485
|
return span;
|
|
4311
4486
|
};
|
|
4487
|
+
var provideSpanStackFrame = (name, stack) => {
|
|
4488
|
+
stack = typeof stack === "function" ? stack : constUndefined;
|
|
4489
|
+
return updateService(CurrentStackFrame, (parent) => ({
|
|
4490
|
+
name,
|
|
4491
|
+
stack,
|
|
4492
|
+
parent
|
|
4493
|
+
}));
|
|
4494
|
+
};
|
|
4312
4495
|
var endSpan = (span, exit, clock, timingEnabled) => sync(() => {
|
|
4313
4496
|
if (span.status._tag === "Ended")
|
|
4314
4497
|
return;
|
|
@@ -4326,6 +4509,20 @@ var useSpan = (name, ...args) => {
|
|
|
4326
4509
|
});
|
|
4327
4510
|
};
|
|
4328
4511
|
var provideParentSpan = /* @__PURE__ */ provideService(ParentSpan);
|
|
4512
|
+
var withParentSpan = function() {
|
|
4513
|
+
const dataFirst = isEffect(arguments[0]);
|
|
4514
|
+
const span = dataFirst ? arguments[1] : arguments[0];
|
|
4515
|
+
let options = dataFirst ? arguments[2] : arguments[1];
|
|
4516
|
+
let provideStackFrame = identity;
|
|
4517
|
+
if (span._tag === "Span") {
|
|
4518
|
+
options = addSpanStackTrace(options);
|
|
4519
|
+
provideStackFrame = provideSpanStackFrame(span.name, options?.captureStackTrace);
|
|
4520
|
+
}
|
|
4521
|
+
if (dataFirst) {
|
|
4522
|
+
return provideParentSpan(provideStackFrame(arguments[0]), span);
|
|
4523
|
+
}
|
|
4524
|
+
return (self) => provideParentSpan(provideStackFrame(self), span);
|
|
4525
|
+
};
|
|
4329
4526
|
var ClockRef = /* @__PURE__ */ Reference("effect/Clock", {
|
|
4330
4527
|
defaultValue: () => new ClockImpl
|
|
4331
4528
|
});
|
|
@@ -4591,8 +4788,9 @@ var die2 = causeDie;
|
|
|
4591
4788
|
var makeFailReason = (error) => new Fail(error);
|
|
4592
4789
|
var makeDieReason = (defect) => new Die(defect);
|
|
4593
4790
|
var hasInterruptsOnly2 = hasInterruptsOnly;
|
|
4594
|
-
var
|
|
4791
|
+
var map5 = causeMap;
|
|
4595
4792
|
var squash = causeSquash;
|
|
4793
|
+
var hasInterrupts2 = hasInterrupts;
|
|
4596
4794
|
var isDone2 = isDone;
|
|
4597
4795
|
var Done2 = Done;
|
|
4598
4796
|
var done2 = done;
|
|
@@ -4659,6 +4857,7 @@ var doneUnsafe = (self, effect) => {
|
|
|
4659
4857
|
|
|
4660
4858
|
// node_modules/effect/dist/References.js
|
|
4661
4859
|
var MinimumLogLevel2 = MinimumLogLevel;
|
|
4860
|
+
var TracerTimingEnabled2 = TracerTimingEnabled;
|
|
4662
4861
|
|
|
4663
4862
|
// node_modules/effect/dist/Scope.js
|
|
4664
4863
|
var Scope = scopeTag;
|
|
@@ -4762,13 +4961,13 @@ class CurrentMemoMap extends (/* @__PURE__ */ Service()("effect/Layer/CurrentMem
|
|
|
4762
4961
|
return current ? forkMemoMapUnsafe(current) : makeMemoMapUnsafe();
|
|
4763
4962
|
}
|
|
4764
4963
|
}
|
|
4765
|
-
var buildWithMemoMap = /* @__PURE__ */ dual(3, (self, memoMap, scope) => provideService(
|
|
4964
|
+
var buildWithMemoMap = /* @__PURE__ */ dual(3, (self, memoMap, scope) => provideService(map4(suspend(() => self.build(memoMap, scope)), add(CurrentMemoMap, memoMap)), CurrentMemoMap, memoMap));
|
|
4766
4965
|
var buildWithScope = /* @__PURE__ */ dual(2, (self, scope) => withFiber((fiber) => buildWithMemoMap(self, CurrentMemoMap.forkOrCreate(fiber.context), scope)));
|
|
4767
4966
|
var succeed5 = function() {
|
|
4768
4967
|
if (arguments.length === 1) {
|
|
4769
|
-
return (resource) => succeedContext(
|
|
4968
|
+
return (resource) => succeedContext(make3(arguments[0], resource));
|
|
4770
4969
|
}
|
|
4771
|
-
return succeedContext(
|
|
4970
|
+
return succeedContext(make3(arguments[0], arguments[1]));
|
|
4772
4971
|
};
|
|
4773
4972
|
var succeedContext = (context) => fromBuildUnsafe(constant(succeed3(context)));
|
|
4774
4973
|
var effect = function() {
|
|
@@ -4777,18 +4976,21 @@ var effect = function() {
|
|
|
4777
4976
|
}
|
|
4778
4977
|
return effectImpl(arguments[0], arguments[1]);
|
|
4779
4978
|
};
|
|
4780
|
-
var effectImpl = (service, effect) => effectContext(
|
|
4979
|
+
var effectImpl = (service, effect) => effectContext(map4(effect, (value) => make3(service, value)));
|
|
4781
4980
|
var effectContext = (effect) => fromBuildMemo((_, scope) => provide(effect, scope));
|
|
4782
4981
|
var mergeAllEffect = (layers, memoMap, scope) => {
|
|
4783
4982
|
const parentScope = forkUnsafe2(scope, "parallel");
|
|
4784
4983
|
return forEach(layers, (layer) => layer.build(memoMap, forkUnsafe2(parentScope, "sequential")), {
|
|
4785
4984
|
concurrency: layers.length
|
|
4786
|
-
}).pipe(
|
|
4985
|
+
}).pipe(map4((context) => mergeAll(...context)));
|
|
4787
4986
|
};
|
|
4788
4987
|
var mergeAll2 = (...layers) => fromBuildMemo((memoMap, scope) => mergeAllEffect(layers, memoMap, scope));
|
|
4789
|
-
var provideWith = (self, that, f) => fromBuildMemo((memoMap, scope) => flatMap2(Array.isArray(that) ? mergeAllEffect(that, memoMap, scope) : that.build(memoMap, scope), (context) => self.build(memoMap, scope).pipe(provideContext(context),
|
|
4988
|
+
var provideWith = (self, that, f) => fromBuildMemo((memoMap, scope) => flatMap2(Array.isArray(that) ? mergeAllEffect(that, memoMap, scope) : that.build(memoMap, scope), (context) => self.build(memoMap, scope).pipe(provideContext(context), map4((merged) => f(merged, context)))));
|
|
4790
4989
|
var provideMerge = /* @__PURE__ */ dual(2, (self, that) => provideWith(self, that, (self, that) => merge(that, self)));
|
|
4791
4990
|
|
|
4991
|
+
// node_modules/effect/dist/Clock.js
|
|
4992
|
+
var Clock = ClockRef;
|
|
4993
|
+
|
|
4792
4994
|
// node_modules/effect/dist/Number.js
|
|
4793
4995
|
var Number3 = globalThis.Number;
|
|
4794
4996
|
var round = /* @__PURE__ */ dual(2, (self, precision) => {
|
|
@@ -4839,6 +5041,7 @@ var isEffect2 = isEffect;
|
|
|
4839
5041
|
var all2 = all;
|
|
4840
5042
|
var forEach2 = forEach;
|
|
4841
5043
|
var whileLoop2 = whileLoop;
|
|
5044
|
+
var promise2 = promise;
|
|
4842
5045
|
var tryPromise2 = tryPromise;
|
|
4843
5046
|
var succeed6 = succeed3;
|
|
4844
5047
|
var suspend2 = suspend;
|
|
@@ -4852,14 +5055,14 @@ var failSync2 = failSync;
|
|
|
4852
5055
|
var failCause3 = failCause;
|
|
4853
5056
|
var failCauseSync2 = failCauseSync;
|
|
4854
5057
|
var die3 = die;
|
|
4855
|
-
var
|
|
5058
|
+
var try_3 = try_2;
|
|
4856
5059
|
var withFiber2 = withFiber;
|
|
4857
5060
|
var fromResult2 = fromResult;
|
|
4858
5061
|
var flatMap3 = flatMap2;
|
|
4859
5062
|
var andThen2 = andThen;
|
|
4860
5063
|
var tap2 = tap;
|
|
4861
5064
|
var exit2 = exit;
|
|
4862
|
-
var
|
|
5065
|
+
var map6 = map4;
|
|
4863
5066
|
var as2 = as;
|
|
4864
5067
|
var asVoid2 = asVoid;
|
|
4865
5068
|
var zipWith2 = zipWith;
|
|
@@ -4886,6 +5089,7 @@ var contextWith2 = contextWith;
|
|
|
4886
5089
|
var provide3 = provide2;
|
|
4887
5090
|
var provideContext2 = provideContext;
|
|
4888
5091
|
var serviceOption2 = serviceOption;
|
|
5092
|
+
var updateContext2 = updateContext;
|
|
4889
5093
|
var provideService2 = provideService;
|
|
4890
5094
|
var scope2 = scope;
|
|
4891
5095
|
var scoped2 = scoped;
|
|
@@ -4898,14 +5102,19 @@ var onExitPrimitive2 = onExitPrimitive;
|
|
|
4898
5102
|
var onExit2 = onExit;
|
|
4899
5103
|
var cached2 = cached;
|
|
4900
5104
|
var interrupt2 = interrupt;
|
|
5105
|
+
var onInterrupt2 = onInterrupt;
|
|
4901
5106
|
var uninterruptible2 = uninterruptible;
|
|
4902
5107
|
var uninterruptibleMask2 = uninterruptibleMask;
|
|
4903
5108
|
var forever2 = forever;
|
|
5109
|
+
var useSpan2 = useSpan;
|
|
5110
|
+
var withParentSpan2 = withParentSpan;
|
|
4904
5111
|
var forkChild2 = forkChild;
|
|
4905
5112
|
var forkIn2 = forkIn;
|
|
4906
5113
|
var forkScoped2 = forkScoped;
|
|
4907
5114
|
var runFork2 = runFork;
|
|
4908
5115
|
var runForkWith2 = runForkWith;
|
|
5116
|
+
var runPromise2 = runPromise;
|
|
5117
|
+
var runSync2 = runSync;
|
|
4909
5118
|
var runSyncExit2 = runSyncExit;
|
|
4910
5119
|
var fnUntraced2 = fnUntraced;
|
|
4911
5120
|
var fn2 = fn;
|
|
@@ -5106,7 +5315,7 @@ var binaryUnits = [decimalUnits[0], {
|
|
|
5106
5315
|
}];
|
|
5107
5316
|
var allUnits = [...decimalUnits, .../* @__PURE__ */ binaryUnits.slice(1)];
|
|
5108
5317
|
var unitsByName = /* @__PURE__ */ new Map(/* @__PURE__ */ allUnits.flatMap((unit) => unit.names.map((name) => [name, unit])));
|
|
5109
|
-
var
|
|
5318
|
+
var make6 = (value) => value;
|
|
5110
5319
|
var invalid2 = (message) => {
|
|
5111
5320
|
throw new Error(`Invalid ByteSize: ${message}`);
|
|
5112
5321
|
};
|
|
@@ -5114,7 +5323,7 @@ var fromNumber = (input) => {
|
|
|
5114
5323
|
if (!Number.isSafeInteger(input) || input < 0) {
|
|
5115
5324
|
return invalid2(`expected a non-negative safe integer, received ${input}`);
|
|
5116
5325
|
}
|
|
5117
|
-
return
|
|
5326
|
+
return make6(BigInt(input));
|
|
5118
5327
|
};
|
|
5119
5328
|
var fromStringUnsafe = (input) => {
|
|
5120
5329
|
const match = /^\s*(\d+)(?:\.(\d+))?\s*([A-Za-z]+)\s*$/.exec(input);
|
|
@@ -5129,14 +5338,14 @@ var fromStringUnsafe = (input) => {
|
|
|
5129
5338
|
if (numerator % scale !== bigint03) {
|
|
5130
5339
|
return invalid2(`${JSON.stringify(input)} does not represent an integral number of bytes`);
|
|
5131
5340
|
}
|
|
5132
|
-
return
|
|
5341
|
+
return make6(numerator / scale);
|
|
5133
5342
|
};
|
|
5134
5343
|
var fromInputUnsafe2 = (input) => {
|
|
5135
5344
|
switch (typeof input) {
|
|
5136
5345
|
case "bigint":
|
|
5137
5346
|
if (input < bigint03)
|
|
5138
5347
|
return invalid2(`expected a non-negative bigint, received ${input}`);
|
|
5139
|
-
return
|
|
5348
|
+
return make6(input);
|
|
5140
5349
|
case "number":
|
|
5141
5350
|
return fromNumber(input);
|
|
5142
5351
|
case "string":
|
|
@@ -5698,7 +5907,7 @@ var isIgnorable = (error) => isMissing(error) || error.reason._tag === "Permissi
|
|
|
5698
5907
|
var isNotLink = (error) => isIgnorable(error) || error.reason._tag === "Unknown";
|
|
5699
5908
|
var DIRECTORY_CONCURRENCY = 16;
|
|
5700
5909
|
var byName = /* @__PURE__ */ mapInput(String2, (entry) => entry.name);
|
|
5701
|
-
var
|
|
5910
|
+
var make7 = (fs) => (pattern, options) => walk(fs, compile([pattern], options?.dot ?? false), options);
|
|
5702
5911
|
var walk = /* @__PURE__ */ fnUntraced2(function* (fs, compiled, options) {
|
|
5703
5912
|
if (compiled.initial.size === 0) {
|
|
5704
5913
|
return [];
|
|
@@ -5710,7 +5919,7 @@ var walk = /* @__PURE__ */ fnUntraced2(function* (fs, compiled, options) {
|
|
|
5710
5919
|
const isUnlisted = (value) => value === "." || value === ".." || isRoot(value);
|
|
5711
5920
|
const probe = (parent, name, named) => {
|
|
5712
5921
|
const path = toFsPath(join3(parent, name));
|
|
5713
|
-
return fs.stat(path).pipe(
|
|
5922
|
+
return fs.stat(path).pipe(map6((info) => info.type), catchReason2("PlatformError", "NotFound", () => fs.readLink(path).pipe(as2("SymbolicLink"), catchIf2(isNotLink, () => succeed6(undefined)))), catchIf2(named ? isMissing : isIgnorable, () => succeed6(undefined)), map6((type) => type === undefined ? undefined : {
|
|
5714
5923
|
name,
|
|
5715
5924
|
type
|
|
5716
5925
|
}));
|
|
@@ -5765,7 +5974,7 @@ var walk = /* @__PURE__ */ fnUntraced2(function* (fs, compiled, options) {
|
|
|
5765
5974
|
return child(type === "Directory", false);
|
|
5766
5975
|
}
|
|
5767
5976
|
const path = toFsPath(relative);
|
|
5768
|
-
return fs.stat(path).pipe(
|
|
5977
|
+
return fs.stat(path).pipe(map6((info) => info.type === "Directory"), catchIf2(isIgnorable, () => succeed6(false)), flatMap3((isDirectory) => {
|
|
5769
5978
|
const resolved = child(isDirectory, type === "SymbolicLink");
|
|
5770
5979
|
if (type === "SymbolicLink" || resolved?.next === undefined || result.globstar.size === 0) {
|
|
5771
5980
|
return succeed6(resolved);
|
|
@@ -5791,7 +6000,7 @@ var walk = /* @__PURE__ */ fnUntraced2(function* (fs, compiled, options) {
|
|
|
5791
6000
|
const child = visit(entry, relative, states, excluded);
|
|
5792
6001
|
if (isEffect2(child)) {
|
|
5793
6002
|
const index = children.push(undefined) - 1;
|
|
5794
|
-
pending.push(
|
|
6003
|
+
pending.push(map6(child, (child) => {
|
|
5795
6004
|
children[index] = child;
|
|
5796
6005
|
}));
|
|
5797
6006
|
} else {
|
|
@@ -5895,7 +6104,7 @@ var MutableRefProto = {
|
|
|
5895
6104
|
};
|
|
5896
6105
|
}
|
|
5897
6106
|
};
|
|
5898
|
-
var
|
|
6107
|
+
var make8 = (value) => {
|
|
5899
6108
|
const ref = Object.create(MutableRefProto);
|
|
5900
6109
|
ref.current = value;
|
|
5901
6110
|
return ref;
|
|
@@ -5903,7 +6112,7 @@ var make7 = (value) => {
|
|
|
5903
6112
|
|
|
5904
6113
|
// node_modules/effect/dist/MutableList.js
|
|
5905
6114
|
var Empty = /* @__PURE__ */ Symbol.for("effect/MutableList/Empty");
|
|
5906
|
-
var
|
|
6115
|
+
var make9 = () => ({
|
|
5907
6116
|
head: undefined,
|
|
5908
6117
|
tail: undefined,
|
|
5909
6118
|
length: 0
|
|
@@ -6014,12 +6223,12 @@ var QueueProto = {
|
|
|
6014
6223
|
};
|
|
6015
6224
|
}
|
|
6016
6225
|
};
|
|
6017
|
-
var
|
|
6226
|
+
var make10 = (options) => withFiber((fiber) => {
|
|
6018
6227
|
const self = Object.create(QueueProto);
|
|
6019
6228
|
self.dispatcher = fiber.currentDispatcher;
|
|
6020
6229
|
self.capacity = options?.capacity ?? Number.POSITIVE_INFINITY;
|
|
6021
6230
|
self.strategy = options?.strategy ?? "suspend";
|
|
6022
|
-
self.messages =
|
|
6231
|
+
self.messages = make9();
|
|
6023
6232
|
self.scheduleRunning = false;
|
|
6024
6233
|
self.state = {
|
|
6025
6234
|
_tag: "Open",
|
|
@@ -6029,10 +6238,10 @@ var make9 = (options) => withFiber((fiber) => {
|
|
|
6029
6238
|
};
|
|
6030
6239
|
return succeed3(self);
|
|
6031
6240
|
});
|
|
6032
|
-
var bounded = (capacity) =>
|
|
6241
|
+
var bounded = (capacity) => make10({
|
|
6033
6242
|
capacity
|
|
6034
6243
|
});
|
|
6035
|
-
var sliding = (capacity) =>
|
|
6244
|
+
var sliding = (capacity) => make10({
|
|
6036
6245
|
capacity,
|
|
6037
6246
|
strategy: "sliding"
|
|
6038
6247
|
});
|
|
@@ -6302,13 +6511,13 @@ var fromTransformBracket = (f) => fromTransform(fnUntraced2(function* (upstream,
|
|
|
6302
6511
|
return onError2(pull, onCause);
|
|
6303
6512
|
}));
|
|
6304
6513
|
var toTransform = (channel) => channel.transform;
|
|
6305
|
-
var asyncQueue = (scope, f, options) =>
|
|
6514
|
+
var asyncQueue = (scope, f, options) => make10({
|
|
6306
6515
|
capacity: options?.bufferSize,
|
|
6307
6516
|
strategy: options?.strategy
|
|
6308
6517
|
}).pipe(tap2((queue) => addFinalizer2(scope, shutdown(queue))), tap2((queue) => provide(f(queue), scope).pipe(catchCause2((cause) => failCause4(queue, cause)), forkIn2(scope, {
|
|
6309
6518
|
startImmediately: true
|
|
6310
6519
|
}))));
|
|
6311
|
-
var callbackArray = (f, options) => fromTransform((_, scope) =>
|
|
6520
|
+
var callbackArray = (f, options) => fromTransform((_, scope) => map6(asyncQueue(scope, f, options), takeAll2));
|
|
6312
6521
|
var suspend3 = (evaluate) => fromTransform((upstream, scope) => suspend2(() => toTransform(evaluate())(upstream, scope)));
|
|
6313
6522
|
var succeed7 = (value) => fromEffect(succeed6(value));
|
|
6314
6523
|
var empty3 = /* @__PURE__ */ fromPull(/* @__PURE__ */ succeed6(/* @__PURE__ */ done2()));
|
|
@@ -6323,6 +6532,35 @@ var fromEffect = (effect) => fromPull(sync2(() => {
|
|
|
6323
6532
|
});
|
|
6324
6533
|
}));
|
|
6325
6534
|
var fromEffectDrain = (effect) => fromPull(flatMap3(effect, () => done2()));
|
|
6535
|
+
var fromReadableStream = (options) => fromTransform((_, scope) => readableStreamToPullUnsafe({
|
|
6536
|
+
scope,
|
|
6537
|
+
readable: options.evaluate(),
|
|
6538
|
+
onError: options.onError,
|
|
6539
|
+
releaseLockOnEnd: options.releaseLockOnEnd
|
|
6540
|
+
}));
|
|
6541
|
+
var readableStreamToPullUnsafe = (options) => {
|
|
6542
|
+
const reader = options.readable.getReader();
|
|
6543
|
+
const exit = options.exit ?? make8(undefined);
|
|
6544
|
+
const pull = suspend2(() => {
|
|
6545
|
+
if (exit.current)
|
|
6546
|
+
return exit.current;
|
|
6547
|
+
return matchCauseEffect2(tryPromise2({
|
|
6548
|
+
try: () => reader.read(),
|
|
6549
|
+
catch: options.onError
|
|
6550
|
+
}), {
|
|
6551
|
+
onFailure: (cause) => exit.current ?? failCause3(cause),
|
|
6552
|
+
onSuccess: ({
|
|
6553
|
+
done,
|
|
6554
|
+
value
|
|
6555
|
+
}) => {
|
|
6556
|
+
if (exit.current)
|
|
6557
|
+
return exit.current;
|
|
6558
|
+
return done ? done2() : succeed6(of(value));
|
|
6559
|
+
}
|
|
6560
|
+
});
|
|
6561
|
+
});
|
|
6562
|
+
return as2(addFinalizer2(options.scope, options.releaseLockOnEnd ? sync2(() => reader.releaseLock()) : promise2(() => reader.cancel().catch((error) => reader.closed.then(() => Promise.reject(error), constVoid))).pipe(ensuring2(sync2(() => reader.releaseLock())))), pull);
|
|
6563
|
+
};
|
|
6326
6564
|
var mapDone = /* @__PURE__ */ dual(2, (self, f) => mapDoneEffect(self, (o) => succeed6(f(o))));
|
|
6327
6565
|
var mapDoneEffect = /* @__PURE__ */ dual(2, (self, f) => transformPull(self, (pull) => succeed6(catchDone(pull, (done) => flatMap3(f(done), done2)))));
|
|
6328
6566
|
var tapError3 = /* @__PURE__ */ dual(2, (self, f) => transformPull(self, (pull) => succeed6(tapError2(pull, (err) => isDone2(err) ? void_3 : asVoid2(f(err))))));
|
|
@@ -6444,7 +6682,7 @@ var decodeText = (encoding, options) => fromTransform((upstream, _scope) => sync
|
|
|
6444
6682
|
const streamOptions = {
|
|
6445
6683
|
stream: true
|
|
6446
6684
|
};
|
|
6447
|
-
let pull = upstream.pipe(
|
|
6685
|
+
let pull = upstream.pipe(map6(map3((bytes) => decoder.decode(bytes, streamOptions))), catchDone((leftover) => {
|
|
6448
6686
|
pull = done2(leftover);
|
|
6449
6687
|
const last = decoder.decode();
|
|
6450
6688
|
return last.length > 0 ? succeed6(of(last)) : pull;
|
|
@@ -6465,6 +6703,11 @@ var unwrap = (channel) => fromTransform((upstream, scope) => {
|
|
|
6465
6703
|
return channel.pipe(provide(scope), flatMap3((channel) => toTransform(channel)(upstream, scope)), flatMap3((pull_) => pull = pull_));
|
|
6466
6704
|
}));
|
|
6467
6705
|
});
|
|
6706
|
+
var interruptWhen = /* @__PURE__ */ dual(2, (self, effect) => merge2(self, fromPull(succeed6(flatMap3(effect, done2))), {
|
|
6707
|
+
haltStrategy: "either"
|
|
6708
|
+
}));
|
|
6709
|
+
var onExit3 = /* @__PURE__ */ dual(2, (self, finalizer) => fromTransformBracket((upstream, scope, forkedScope) => addFinalizerExit(forkedScope, finalizer).pipe(andThen2(toTransform(self)(upstream, scope)))));
|
|
6710
|
+
var ensuring3 = /* @__PURE__ */ dual(2, (self, finalizer) => onExit3(self, (_) => finalizer));
|
|
6468
6711
|
var runWith = (self, f, onHalt) => suspend2(() => {
|
|
6469
6712
|
const scope = makeUnsafe3();
|
|
6470
6713
|
const makePull = toTransform(self)(done2(), scope);
|
|
@@ -6473,6 +6716,31 @@ var runWith = (self, f, onHalt) => suspend2(() => {
|
|
|
6473
6716
|
var runDrain = (self) => runWith(self, (pull) => forever2(pull, {
|
|
6474
6717
|
disableYield: true
|
|
6475
6718
|
}));
|
|
6719
|
+
var runForEach = /* @__PURE__ */ dual(2, (self, f) => runWith(self, (pull) => forever2(flatMap3(pull, f), {
|
|
6720
|
+
disableYield: true
|
|
6721
|
+
})));
|
|
6722
|
+
var mkUint8Array = (self) => map6(runFold(self, () => ({
|
|
6723
|
+
bytes: 0,
|
|
6724
|
+
arrays: []
|
|
6725
|
+
}), (acc, chunk) => {
|
|
6726
|
+
for (let i = 0;i < chunk.length; i++) {
|
|
6727
|
+
acc.bytes += chunk[i].length;
|
|
6728
|
+
acc.arrays.push(chunk[i]);
|
|
6729
|
+
}
|
|
6730
|
+
return acc;
|
|
6731
|
+
}), ({
|
|
6732
|
+
arrays,
|
|
6733
|
+
bytes
|
|
6734
|
+
}) => {
|
|
6735
|
+
const result = new Uint8Array(bytes);
|
|
6736
|
+
let offset = 0;
|
|
6737
|
+
for (let i = 0;i < arrays.length; i++) {
|
|
6738
|
+
const array = arrays[i];
|
|
6739
|
+
result.set(array, offset);
|
|
6740
|
+
offset += array.length;
|
|
6741
|
+
}
|
|
6742
|
+
return result;
|
|
6743
|
+
});
|
|
6476
6744
|
var runFold = /* @__PURE__ */ dual(3, (self, initial, f) => suspend2(() => {
|
|
6477
6745
|
let state = initial();
|
|
6478
6746
|
return runWith(self, (pull) => whileLoop2({
|
|
@@ -6538,7 +6806,7 @@ var forEach3 = (f) => forEachArray(forEach2((_) => f(_), {
|
|
|
6538
6806
|
var forEachArray = (f) => fromTransform2((upstream) => upstream.pipe(flatMap3(f), forever2({
|
|
6539
6807
|
disableYield: true
|
|
6540
6808
|
}), catchDone(() => endVoid)));
|
|
6541
|
-
var unwrap2 = (effect) => fromChannel2(unwrap(
|
|
6809
|
+
var unwrap2 = (effect) => fromChannel2(unwrap(map6(effect, toChannel)));
|
|
6542
6810
|
|
|
6543
6811
|
// node_modules/effect/dist/internal/rcRef.js
|
|
6544
6812
|
var TypeId13 = "~effect/RcRef";
|
|
@@ -6570,7 +6838,7 @@ class RcRefImpl {
|
|
|
6570
6838
|
this.idleTimeToLive = idleTimeToLive;
|
|
6571
6839
|
}
|
|
6572
6840
|
}
|
|
6573
|
-
var
|
|
6841
|
+
var make11 = (options) => withFiber2((fiber) => {
|
|
6574
6842
|
const context = fiber.context;
|
|
6575
6843
|
const scope = get(context, Scope);
|
|
6576
6844
|
const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive !== undefined ? fromInputUnsafe(options.idleTimeToLive) : undefined);
|
|
@@ -6679,7 +6947,7 @@ var release = (self, state) => {
|
|
|
6679
6947
|
};
|
|
6680
6948
|
|
|
6681
6949
|
// node_modules/effect/dist/RcRef.js
|
|
6682
|
-
var
|
|
6950
|
+
var make12 = make11;
|
|
6683
6951
|
var get3 = get2;
|
|
6684
6952
|
|
|
6685
6953
|
// node_modules/effect/dist/Stream.js
|
|
@@ -6691,7 +6959,7 @@ var transformPull2 = (self, f) => fromChannel3(fromTransform((_, scope) => flatM
|
|
|
6691
6959
|
var toChannel2 = (stream) => stream.channel;
|
|
6692
6960
|
var callback3 = (f, options) => fromChannel3(callbackArray(f, options));
|
|
6693
6961
|
var empty4 = /* @__PURE__ */ fromChannel3(empty3);
|
|
6694
|
-
var
|
|
6962
|
+
var make13 = (...values) => fromArray2(values);
|
|
6695
6963
|
var suspend4 = (stream) => {
|
|
6696
6964
|
const suspended = fromChannel3(suspend3(() => stream().channel));
|
|
6697
6965
|
suspendedStreams.set(suspended, stream);
|
|
@@ -6700,7 +6968,8 @@ var suspend4 = (stream) => {
|
|
|
6700
6968
|
var suspendedStreams = /* @__PURE__ */ new WeakMap;
|
|
6701
6969
|
var fail9 = (error) => fromChannel3(fail8(error));
|
|
6702
6970
|
var fromArray2 = (array) => isReadonlyArrayNonEmpty(array) ? fromChannel3(succeed7(array)) : empty4;
|
|
6703
|
-
var
|
|
6971
|
+
var fromReadableStream2 = (options) => fromChannel3(fromReadableStream(options));
|
|
6972
|
+
var unwrap3 = (effect) => fromChannel3(unwrap(map6(effect, toChannel2)));
|
|
6704
6973
|
var drainFork = /* @__PURE__ */ dual(2, (self, that) => mergeEffect2(self, runDrain2(that)));
|
|
6705
6974
|
var merge3 = /* @__PURE__ */ dual((args) => isStream(args[0]) && isStream(args[1]), (self, that, options) => fromChannel3(merge2(toChannel2(self), toChannel2(that), options)));
|
|
6706
6975
|
var mergeEffect2 = /* @__PURE__ */ dual(2, (self, effect) => self.channel.pipe(mergeEffect(effect), fromChannel3));
|
|
@@ -6719,7 +6988,7 @@ var transduce = /* @__PURE__ */ dual(2, (self, sink) => transformPull2(self, (up
|
|
|
6719
6988
|
done = fail5(error);
|
|
6720
6989
|
return done2();
|
|
6721
6990
|
}));
|
|
6722
|
-
const pull =
|
|
6991
|
+
const pull = map6(suspend2(() => sink.transform(upstreamWithLeftover, scope)), ([value, leftover_]) => {
|
|
6723
6992
|
leftover = leftover_;
|
|
6724
6993
|
return of(value);
|
|
6725
6994
|
});
|
|
@@ -6727,7 +6996,9 @@ var transduce = /* @__PURE__ */ dual(2, (self, sink) => transformPull2(self, (up
|
|
|
6727
6996
|
})));
|
|
6728
6997
|
var decodeText2 = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, options) => self.channel.pipe(pipeTo(decodeText(options?.encoding)), fromChannel3));
|
|
6729
6998
|
var splitLines2 = (self) => self.channel.pipe(pipeTo(splitLines()), fromChannel3);
|
|
6730
|
-
var
|
|
6999
|
+
var interruptWhen2 = /* @__PURE__ */ dual(2, (self, effect) => fromChannel3(interruptWhen(self.channel, effect)));
|
|
7000
|
+
var ensuring4 = /* @__PURE__ */ dual(2, (self, finalizer) => fromChannel3(ensuring3(self.channel, finalizer)));
|
|
7001
|
+
var run = /* @__PURE__ */ dual(2, (self, sink) => scopedWith2((scope) => toPullScoped(self.channel, scope).pipe(flatMap3((upstream) => runSink(sink, upstream, scope)), map6(([a]) => a))));
|
|
6731
7002
|
var runSink = (sink, upstream, scope) => restoreUpstreamFailure(sink.transform(upstreamFailureToDefect(upstream), scope));
|
|
6732
7003
|
var runCollect = (self) => runFold(self.channel, () => [], (acc, chunk) => {
|
|
6733
7004
|
for (let i = 0;i < chunk.length; i++) {
|
|
@@ -6737,16 +7008,68 @@ var runCollect = (self) => runFold(self.channel, () => [], (acc, chunk) => {
|
|
|
6737
7008
|
});
|
|
6738
7009
|
var runDrain2 = (self) => runDrain(self.channel);
|
|
6739
7010
|
var mkString = (self) => runFold(self.channel, () => "", (acc, chunk) => acc + chunk.join(""));
|
|
7011
|
+
var mkArrayBuffer = (self) => map6(mkUint8Array(self.channel), (bytes) => bytes.buffer);
|
|
7012
|
+
var toReadableStreamWith = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, context, options) => {
|
|
7013
|
+
let currentResolve = undefined;
|
|
7014
|
+
let fiber = undefined;
|
|
7015
|
+
let cancelled = false;
|
|
7016
|
+
const latch = makeUnsafe4(false);
|
|
7017
|
+
const signal = options?.signal;
|
|
7018
|
+
const onAbort = () => fiber.interruptUnsafe();
|
|
7019
|
+
return new ReadableStream({
|
|
7020
|
+
start(controller) {
|
|
7021
|
+
fiber = runFork2(provideContext2(runForEach(transformPull(self.channel, (pull) => succeed6(latch.whenOpen(pull))), (chunk) => sync2(() => {
|
|
7022
|
+
latch.closeUnsafe();
|
|
7023
|
+
for (let i = 0;i < chunk.length; i++) {
|
|
7024
|
+
controller.enqueue(chunk[i]);
|
|
7025
|
+
}
|
|
7026
|
+
currentResolve();
|
|
7027
|
+
currentResolve = undefined;
|
|
7028
|
+
})), context));
|
|
7029
|
+
fiber.addObserver((exit) => {
|
|
7030
|
+
signal?.removeEventListener("abort", onAbort);
|
|
7031
|
+
if (cancelled)
|
|
7032
|
+
return;
|
|
7033
|
+
if (exit._tag === "Failure" && signal?.aborted !== true) {
|
|
7034
|
+
controller.error(squash(exit.cause));
|
|
7035
|
+
} else {
|
|
7036
|
+
controller.close();
|
|
7037
|
+
}
|
|
7038
|
+
});
|
|
7039
|
+
if (signal !== undefined && fiber.pollUnsafe() === undefined) {
|
|
7040
|
+
if (signal.aborted)
|
|
7041
|
+
onAbort();
|
|
7042
|
+
else
|
|
7043
|
+
signal.addEventListener("abort", onAbort, {
|
|
7044
|
+
once: true
|
|
7045
|
+
});
|
|
7046
|
+
}
|
|
7047
|
+
},
|
|
7048
|
+
pull() {
|
|
7049
|
+
return new Promise((resolve) => {
|
|
7050
|
+
currentResolve = resolve;
|
|
7051
|
+
latch.openUnsafe();
|
|
7052
|
+
});
|
|
7053
|
+
},
|
|
7054
|
+
cancel() {
|
|
7055
|
+
if (!fiber)
|
|
7056
|
+
return;
|
|
7057
|
+
cancelled = true;
|
|
7058
|
+
return runPromise2(asVoid2(interrupt3(fiber)));
|
|
7059
|
+
}
|
|
7060
|
+
}, options?.strategy);
|
|
7061
|
+
});
|
|
7062
|
+
var toReadableStreamEffect = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, options) => map6(context2(), (context) => toReadableStreamWith(self, context, options)));
|
|
6740
7063
|
|
|
6741
7064
|
// node_modules/effect/dist/FileSystem.js
|
|
6742
7065
|
var TypeId15 = "~effect/FileSystem";
|
|
6743
7066
|
var FileSystem = /* @__PURE__ */ Service("effect/FileSystem");
|
|
6744
|
-
var
|
|
7067
|
+
var make14 = (impl) => FileSystem.of({
|
|
6745
7068
|
...impl,
|
|
6746
7069
|
[TypeId15]: TypeId15,
|
|
6747
|
-
glob:
|
|
7070
|
+
glob: make7(impl),
|
|
6748
7071
|
exists: (path) => pipe(impl.access(path), as2(true), catchTag2("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed6(false) : fail7(e))),
|
|
6749
|
-
readFileString: (path, encoding) => flatMap3(impl.readFile(path), (_) =>
|
|
7072
|
+
readFileString: (path, encoding) => flatMap3(impl.readFile(path), (_) => try_3({
|
|
6750
7073
|
try: () => new TextDecoder(encoding).decode(_),
|
|
6751
7074
|
catch: (cause) => badArgument({
|
|
6752
7075
|
module: "FileSystem",
|
|
@@ -6783,8 +7106,8 @@ var make13 = (impl) => FileSystem.of({
|
|
|
6783
7106
|
sink: (path, options) => pipe(impl.open(path, {
|
|
6784
7107
|
...options,
|
|
6785
7108
|
flag: options?.flag ?? "w"
|
|
6786
|
-
}),
|
|
6787
|
-
writeFileString: (path, data, options) => flatMap3(
|
|
7109
|
+
}), map6((file) => forEach3((_) => file.writeAll(_))), unwrap2),
|
|
7110
|
+
writeFileString: (path, data, options) => flatMap3(try_3({
|
|
6788
7111
|
try: () => new TextEncoder().encode(data),
|
|
6789
7112
|
catch: (cause) => badArgument({
|
|
6790
7113
|
module: "FileSystem",
|
|
@@ -6801,7 +7124,7 @@ class WatchBackend extends (/* @__PURE__ */ Service()("effect/FileSystem/WatchBa
|
|
|
6801
7124
|
// node_modules/effect/dist/Path.js
|
|
6802
7125
|
var TypeId16 = "~effect/Path";
|
|
6803
7126
|
var Path = /* @__PURE__ */ Service("effect/Path");
|
|
6804
|
-
var
|
|
7127
|
+
var make15 = (impl) => Path.of({
|
|
6805
7128
|
...impl,
|
|
6806
7129
|
[TypeId16]: TypeId16,
|
|
6807
7130
|
resolveWithin(root, input) {
|
|
@@ -6973,7 +7296,7 @@ function normalizeFilterOutput(ast, out, input, options) {
|
|
|
6973
7296
|
if (!isReadonlyArrayNonEmpty(out)) {
|
|
6974
7297
|
return;
|
|
6975
7298
|
}
|
|
6976
|
-
return out.length === 1 ? makeFilterIssue(out[0], input, options) : new Composite(ast,
|
|
7299
|
+
return out.length === 1 ? makeFilterIssue(out[0], input, options) : new Composite(ast, map3(out, (entry) => makeFilterIssue(entry, input, options)), input, options);
|
|
6977
7300
|
}
|
|
6978
7301
|
return makeSingle(out, input, options);
|
|
6979
7302
|
}
|
|
@@ -7737,7 +8060,7 @@ var wrapPropertyKeyIssue = (s, ast, key, exit) => {
|
|
|
7737
8060
|
}
|
|
7738
8061
|
const issue = getSchemaIssue(exit.cause);
|
|
7739
8062
|
if (issue === undefined) {
|
|
7740
|
-
return failCause2(
|
|
8063
|
+
return failCause2(map5(exit.cause, (issue) => new Composite(ast, [new Pointer([key], issue)], s.input, s.options)));
|
|
7741
8064
|
}
|
|
7742
8065
|
const pointer = new Pointer([key], issue);
|
|
7743
8066
|
if (s.options.errors === "all") {
|
|
@@ -9078,8 +9401,8 @@ var HandleProto = {
|
|
|
9078
9401
|
var makeHandle = (params) => Object.setPrototypeOf({
|
|
9079
9402
|
...params
|
|
9080
9403
|
}, HandleProto);
|
|
9081
|
-
var
|
|
9082
|
-
const streamString = (command, options) => spawn(command).pipe(
|
|
9404
|
+
var make16 = (spawn) => {
|
|
9405
|
+
const streamString = (command, options) => spawn(command).pipe(map6((handle) => decodeText2(options?.includeStderr === true ? handle.all : drainFork(handle.stdout, handle.stderr))), unwrap3);
|
|
9083
9406
|
const streamLines = (command, options) => splitLines2(streamString(command, options));
|
|
9084
9407
|
return ChildProcessSpawner.of({
|
|
9085
9408
|
spawn,
|
|
@@ -9107,7 +9430,7 @@ var value = (self) => {
|
|
|
9107
9430
|
// node_modules/effect/dist/Redacted.js
|
|
9108
9431
|
var TypeId20 = "~effect/Redacted";
|
|
9109
9432
|
var isRedacted = (u) => hasProperty(u, TypeId20);
|
|
9110
|
-
var
|
|
9433
|
+
var make17 = (value, options) => {
|
|
9111
9434
|
const self = Object.create(Proto2);
|
|
9112
9435
|
if (options?.label) {
|
|
9113
9436
|
self.label = options.label;
|
|
@@ -9251,7 +9574,7 @@ var parseTemplate = (texts, values) => {
|
|
|
9251
9574
|
if (word.length === 0)
|
|
9252
9575
|
return;
|
|
9253
9576
|
const value = word.map(unwrap4).join("");
|
|
9254
|
-
words.push(word.length === 1 && isRedacted(word[0]) ? word[0] : word.some(isRedacted) ?
|
|
9577
|
+
words.push(word.length === 1 && isRedacted(word[0]) ? word[0] : word.some(isRedacted) ? make17(value) : value);
|
|
9255
9578
|
word = [];
|
|
9256
9579
|
plain = true;
|
|
9257
9580
|
braceDepth = 0;
|
|
@@ -9357,7 +9680,7 @@ var makeStandardCommand = (command, args, options) => Object.assign(Object.creat
|
|
|
9357
9680
|
args,
|
|
9358
9681
|
options
|
|
9359
9682
|
});
|
|
9360
|
-
var
|
|
9683
|
+
var make18 = function make(...args) {
|
|
9361
9684
|
if (isTemplateString(args[0])) {
|
|
9362
9685
|
const [templates, ...expressions] = args;
|
|
9363
9686
|
const [command, cmdArgs] = parseTemplate2(templates, expressions);
|
|
@@ -9624,7 +9947,7 @@ var readableToPullUnsafe = (options) => {
|
|
|
9624
9947
|
const readable = options.readable;
|
|
9625
9948
|
const chunkSize = options.chunkSize ?? 4096;
|
|
9626
9949
|
const closeOnDone = options.closeOnDone ?? true;
|
|
9627
|
-
const exit = options.exit ??
|
|
9950
|
+
const exit = options.exit ?? make8(undefined);
|
|
9628
9951
|
const latch = options.latch ?? makeUnsafe4(false);
|
|
9629
9952
|
function onReadable() {
|
|
9630
9953
|
latch.openUnsafe();
|
|
@@ -9728,7 +10051,7 @@ var taskkill = (childProcess, onExit = () => {}) => {
|
|
|
9728
10051
|
windowsHide: true
|
|
9729
10052
|
}, onExit);
|
|
9730
10053
|
};
|
|
9731
|
-
var
|
|
10054
|
+
var make19 = /* @__PURE__ */ gen2(function* () {
|
|
9732
10055
|
const fs = yield* FileSystem;
|
|
9733
10056
|
const path = yield* Path;
|
|
9734
10057
|
const resolveWorkingDirectory = fnUntraced2(function* (options) {
|
|
@@ -9855,7 +10178,7 @@ var make18 = /* @__PURE__ */ gen2(function* () {
|
|
|
9855
10178
|
});
|
|
9856
10179
|
}
|
|
9857
10180
|
if (stream) {
|
|
9858
|
-
return
|
|
10181
|
+
return map6(runInputStream(stream, sink, inputFailure), () => {
|
|
9859
10182
|
inputSinks.set(fd, sink);
|
|
9860
10183
|
});
|
|
9861
10184
|
}
|
|
@@ -9993,7 +10316,7 @@ var make18 = /* @__PURE__ */ gen2(function* () {
|
|
|
9993
10316
|
});
|
|
9994
10317
|
});
|
|
9995
10318
|
}
|
|
9996
|
-
return
|
|
10319
|
+
return try_3({
|
|
9997
10320
|
try: () => {
|
|
9998
10321
|
globalThis.process.kill(-childProcess.pid, signal);
|
|
9999
10322
|
},
|
|
@@ -10148,7 +10471,7 @@ var make18 = /* @__PURE__ */ gen2(function* () {
|
|
|
10148
10471
|
getInputFd,
|
|
10149
10472
|
getOutputFd
|
|
10150
10473
|
} = yield* setupAdditionalFds(cmd, childProcess, resolvedAdditionalFds, inputFailure);
|
|
10151
|
-
const isRunning =
|
|
10474
|
+
const isRunning = map6(isDone3(exitSignal), (done) => !done);
|
|
10152
10475
|
const exitCode = flatMap3(raceFirst2(_await(exitSignal), _await(inputFailure)), ([code, signal]) => {
|
|
10153
10476
|
if (isDoneUnsafe(inputFailure)) {
|
|
10154
10477
|
return _await(inputFailure);
|
|
@@ -10188,7 +10511,7 @@ var make18 = /* @__PURE__ */ gen2(function* () {
|
|
|
10188
10511
|
const sourceStream = unwrap3(succeed6(getSourceStream(handles[handles.length - 1], options.from)));
|
|
10189
10512
|
const toOption = options.to ?? "stdin";
|
|
10190
10513
|
if (toOption === "stdin") {
|
|
10191
|
-
handles.push(yield* spawnCommand(
|
|
10514
|
+
handles.push(yield* spawnCommand(make18(command.command, command.args, {
|
|
10192
10515
|
...command.options,
|
|
10193
10516
|
stdin: {
|
|
10194
10517
|
...stdinConfig,
|
|
@@ -10208,7 +10531,7 @@ var make18 = /* @__PURE__ */ gen2(function* () {
|
|
|
10208
10531
|
type: "input",
|
|
10209
10532
|
stream: sourceStream
|
|
10210
10533
|
};
|
|
10211
|
-
handles.push(yield* spawnCommand(
|
|
10534
|
+
handles.push(yield* spawnCommand(make18(command.command, command.args, {
|
|
10212
10535
|
...command.options,
|
|
10213
10536
|
additionalFds: {
|
|
10214
10537
|
...existingFds,
|
|
@@ -10216,7 +10539,7 @@ var make18 = /* @__PURE__ */ gen2(function* () {
|
|
|
10216
10539
|
}
|
|
10217
10540
|
})));
|
|
10218
10541
|
} else {
|
|
10219
|
-
handles.push(yield* spawnCommand(
|
|
10542
|
+
handles.push(yield* spawnCommand(make18(command.command, command.args, {
|
|
10220
10543
|
...command.options,
|
|
10221
10544
|
stdin: {
|
|
10222
10545
|
...stdinConfig,
|
|
@@ -10255,9 +10578,9 @@ var make18 = /* @__PURE__ */ gen2(function* () {
|
|
|
10255
10578
|
}
|
|
10256
10579
|
}
|
|
10257
10580
|
});
|
|
10258
|
-
return
|
|
10581
|
+
return make16(spawnCommand);
|
|
10259
10582
|
});
|
|
10260
|
-
var layer = /* @__PURE__ */ effect(ChildProcessSpawner,
|
|
10583
|
+
var layer = /* @__PURE__ */ effect(ChildProcessSpawner, make19);
|
|
10261
10584
|
var flattenCommand = (command) => {
|
|
10262
10585
|
const commands = [];
|
|
10263
10586
|
const pipeOptions = [];
|
|
@@ -10307,7 +10630,7 @@ var bigintToNumber = (value, field) => {
|
|
|
10307
10630
|
var bigintToNumberOption = (value) => flatMap(fromNullishOr(value), toNumber);
|
|
10308
10631
|
var toUint64 = (value) => BigInt.asUintN(64, value);
|
|
10309
10632
|
var toUint64Option = (value) => map(fromNullishOr(value), toUint64);
|
|
10310
|
-
var positionToNumber = (position, method) =>
|
|
10633
|
+
var positionToNumber = (position, method) => try_3({
|
|
10311
10634
|
try: () => bigintToNumber(position, "position"),
|
|
10312
10635
|
catch: handleBadArgument(method)
|
|
10313
10636
|
});
|
|
@@ -10429,7 +10752,7 @@ var noFollowFlags = (method, flag) => suspend2(() => {
|
|
|
10429
10752
|
var openFactory = (method) => {
|
|
10430
10753
|
const nodeOpen = effectify(NFS.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
10431
10754
|
const nodeClose = effectify(NFS.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
10432
|
-
return (path, options) => pipe(acquireRelease2(options?.noFollow === true ? flatMap3(noFollowFlags(method, options.flag ?? "r"), (flags) => nodeOpen(path, flags, options.mode)) : nodeOpen(path, options?.flag ?? "r", options?.mode), (fd) => orDie2(nodeClose(fd))),
|
|
10755
|
+
return (path, options) => pipe(acquireRelease2(options?.noFollow === true ? flatMap3(noFollowFlags(method, options.flag ?? "r"), (flags) => nodeOpen(path, flags, options.mode)) : nodeOpen(path, options?.flag ?? "r", options?.mode), (fd) => orDie2(nodeClose(fd))), map6((fd) => makeFile(fd, options?.flag?.startsWith("a") ?? false)));
|
|
10433
10756
|
};
|
|
10434
10757
|
var open2 = /* @__PURE__ */ openFactory("open");
|
|
10435
10758
|
var negativePosition = (method) => badArgument({
|
|
@@ -10490,7 +10813,7 @@ var makeFile = /* @__PURE__ */ (() => {
|
|
|
10490
10813
|
});
|
|
10491
10814
|
}
|
|
10492
10815
|
const position = this.position;
|
|
10493
|
-
return
|
|
10816
|
+
return map6(nodeRead(this.fd, {
|
|
10494
10817
|
buffer,
|
|
10495
10818
|
position
|
|
10496
10819
|
}), (bytesRead) => {
|
|
@@ -10511,7 +10834,7 @@ var makeFile = /* @__PURE__ */ (() => {
|
|
|
10511
10834
|
}
|
|
10512
10835
|
const buffer = Buffer.allocUnsafeSlow(size);
|
|
10513
10836
|
const position = explicit ?? this.position;
|
|
10514
|
-
return
|
|
10837
|
+
return map6(nodeReadAlloc(this.fd, {
|
|
10515
10838
|
buffer,
|
|
10516
10839
|
position
|
|
10517
10840
|
}), (bytesRead) => {
|
|
@@ -10534,7 +10857,7 @@ var makeFile = /* @__PURE__ */ (() => {
|
|
|
10534
10857
|
});
|
|
10535
10858
|
}
|
|
10536
10859
|
truncate(length) {
|
|
10537
|
-
return
|
|
10860
|
+
return map6(nodeTruncate(this.fd, length || undefined), () => {
|
|
10538
10861
|
if (!this.append) {
|
|
10539
10862
|
const len = BigInt(length ?? 0);
|
|
10540
10863
|
if (this.position > len) {
|
|
@@ -10546,7 +10869,7 @@ var makeFile = /* @__PURE__ */ (() => {
|
|
|
10546
10869
|
write(buffer) {
|
|
10547
10870
|
return suspend2(() => {
|
|
10548
10871
|
const position = this.position;
|
|
10549
|
-
return flatMap3(this.append ? succeed6(undefined) : positionToNumber(position, "write"), (nodePosition) =>
|
|
10872
|
+
return flatMap3(this.append ? succeed6(undefined) : positionToNumber(position, "write"), (nodePosition) => map6(nodeWrite(this.fd, buffer, undefined, undefined, nodePosition), (bytesWritten) => {
|
|
10550
10873
|
if (!this.append) {
|
|
10551
10874
|
this.position = position + BigInt(bytesWritten);
|
|
10552
10875
|
}
|
|
@@ -10608,7 +10931,7 @@ var readDirectoryEntries = (path) => tryPromise2({
|
|
|
10608
10931
|
withFileTypes: true
|
|
10609
10932
|
}),
|
|
10610
10933
|
catch: (err) => handleErrnoException("FileSystem", "readDirectoryEntries")(err, [path])
|
|
10611
|
-
}).pipe(
|
|
10934
|
+
}).pipe(map6((entries) => entries.map((entry) => ({
|
|
10612
10935
|
name: entry.name,
|
|
10613
10936
|
type: fileType(entry)
|
|
10614
10937
|
}))));
|
|
@@ -10640,7 +10963,7 @@ var rename2 = /* @__PURE__ */ (() => {
|
|
|
10640
10963
|
return (oldPath, newPath) => nodeRename(oldPath, newPath);
|
|
10641
10964
|
})();
|
|
10642
10965
|
var fileType = (stat) => stat.isFile() ? "File" : stat.isDirectory() ? "Directory" : stat.isSymbolicLink() ? "SymbolicLink" : stat.isBlockDevice() ? "BlockDevice" : stat.isCharacterDevice() ? "CharacterDevice" : stat.isFIFO() ? "FIFO" : stat.isSocket() ? "Socket" : "Unknown";
|
|
10643
|
-
var makeFileInfo = (stat, method = "stat") =>
|
|
10966
|
+
var makeFileInfo = (stat, method = "stat") => try_3({
|
|
10644
10967
|
try: () => ({
|
|
10645
10968
|
type: fileType(stat),
|
|
10646
10969
|
mtime: fromNullishOr(stat.mtime),
|
|
@@ -10723,7 +11046,7 @@ var watchNode = (path, info, options) => callback3((queue) => acquireRelease2(sy
|
|
|
10723
11046
|
});
|
|
10724
11047
|
return watcher;
|
|
10725
11048
|
}), (watcher) => sync2(() => watcher.close())).pipe(tap2(() => sync2(() => options?.onReady?.()))));
|
|
10726
|
-
var watch2 = (backend, path, options) => all2([stat2(path), serviceOption2(WatchBackend)]).pipe(
|
|
11049
|
+
var watch2 = (backend, path, options) => all2([stat2(path), serviceOption2(WatchBackend)]).pipe(map6(([stat, callerBackend]) => orElse(callerBackend, () => backend).pipe(flatMap((_) => _.register(path, stat, options)), getOrElse(() => watchNode(path, stat, options)))), unwrap3);
|
|
10727
11050
|
var writeFile2 = (path, data, options) => callback2((resume, signal) => {
|
|
10728
11051
|
try {
|
|
10729
11052
|
NFS.writeFile(path, data, {
|
|
@@ -10741,7 +11064,7 @@ var writeFile2 = (path, data, options) => callback2((resume, signal) => {
|
|
|
10741
11064
|
resume(fail7(handleBadArgument("writeFile")(err)));
|
|
10742
11065
|
}
|
|
10743
11066
|
});
|
|
10744
|
-
var makeFileSystem = /* @__PURE__ */
|
|
11067
|
+
var makeFileSystem = /* @__PURE__ */ map6(/* @__PURE__ */ serviceOption2(WatchBackend), (backend) => make14({
|
|
10745
11068
|
access: access2,
|
|
10746
11069
|
chmod: chmod2,
|
|
10747
11070
|
chown: chown2,
|
|
@@ -10780,7 +11103,7 @@ var layer3 = layer2;
|
|
|
10780
11103
|
import * as NodePath from "path";
|
|
10781
11104
|
import * as NodeUrl from "url";
|
|
10782
11105
|
var fileUrlOps = (windows) => ({
|
|
10783
|
-
fromFileUrl: (url) =>
|
|
11106
|
+
fromFileUrl: (url) => try_3({
|
|
10784
11107
|
try: () => NodeUrl.fileURLToPath(url, {
|
|
10785
11108
|
windows
|
|
10786
11109
|
}),
|
|
@@ -10790,7 +11113,7 @@ var fileUrlOps = (windows) => ({
|
|
|
10790
11113
|
cause
|
|
10791
11114
|
})
|
|
10792
11115
|
}),
|
|
10793
|
-
toFileUrl: (path) =>
|
|
11116
|
+
toFileUrl: (path) => try_3({
|
|
10794
11117
|
try: () => NodeUrl.pathToFileURL(path, {
|
|
10795
11118
|
windows
|
|
10796
11119
|
}),
|
|
@@ -10801,15 +11124,15 @@ var fileUrlOps = (windows) => ({
|
|
|
10801
11124
|
})
|
|
10802
11125
|
})
|
|
10803
11126
|
});
|
|
10804
|
-
var layerPosix = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */
|
|
11127
|
+
var layerPosix = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */ make15({
|
|
10805
11128
|
...NodePath.posix,
|
|
10806
11129
|
.../* @__PURE__ */ fileUrlOps(false)
|
|
10807
11130
|
}));
|
|
10808
|
-
var layerWin32 = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */
|
|
11131
|
+
var layerWin32 = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */ make15({
|
|
10809
11132
|
...NodePath.win32,
|
|
10810
11133
|
.../* @__PURE__ */ fileUrlOps(true)
|
|
10811
11134
|
}));
|
|
10812
|
-
var layer4 = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */
|
|
11135
|
+
var layer4 = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */ make15({
|
|
10813
11136
|
...NodePath,
|
|
10814
11137
|
.../* @__PURE__ */ fileUrlOps(undefined)
|
|
10815
11138
|
}));
|
|
@@ -10820,7 +11143,7 @@ var layer5 = layer4;
|
|
|
10820
11143
|
// node_modules/effect/dist/Stdio.js
|
|
10821
11144
|
var TypeId22 = "~effect/Stdio";
|
|
10822
11145
|
var Stdio = /* @__PURE__ */ Service(TypeId22);
|
|
10823
|
-
var
|
|
11146
|
+
var make20 = (options) => ({
|
|
10824
11147
|
[TypeId22]: TypeId22,
|
|
10825
11148
|
stdinIsTerminal: succeed6(false),
|
|
10826
11149
|
stdoutIsTerminal: succeed6(false),
|
|
@@ -10829,7 +11152,7 @@ var make19 = (options) => ({
|
|
|
10829
11152
|
});
|
|
10830
11153
|
|
|
10831
11154
|
// node_modules/@effect/platform-node-shared/dist/NodeStdio.js
|
|
10832
|
-
var layer6 = /* @__PURE__ */ succeed5(Stdio, /* @__PURE__ */
|
|
11155
|
+
var layer6 = /* @__PURE__ */ succeed5(Stdio, /* @__PURE__ */ make20({
|
|
10833
11156
|
args: /* @__PURE__ */ sync2(() => process.argv.slice(2)),
|
|
10834
11157
|
stdinIsTerminal: /* @__PURE__ */ sync2(() => process.stdin.isTTY === true),
|
|
10835
11158
|
stdoutIsTerminal: /* @__PURE__ */ sync2(() => process.stdout.isTTY === true),
|
|
@@ -10869,50 +11192,502 @@ var layer6 = /* @__PURE__ */ succeed5(Stdio, /* @__PURE__ */ make19({
|
|
|
10869
11192
|
// node_modules/@effect/platform-bun/dist/BunStdio.js
|
|
10870
11193
|
var layer7 = layer6;
|
|
10871
11194
|
|
|
10872
|
-
// node_modules/effect/dist/
|
|
10873
|
-
var
|
|
10874
|
-
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
|
|
11195
|
+
// node_modules/effect/dist/http/Cookies.js
|
|
11196
|
+
var TypeId23 = "~effect/http/Cookies";
|
|
11197
|
+
var CookieTypeId = "~effect/http/Cookies/Cookie";
|
|
11198
|
+
var Proto4 = {
|
|
11199
|
+
[TypeId23]: TypeId23,
|
|
11200
|
+
...BaseProto,
|
|
11201
|
+
toJSON() {
|
|
11202
|
+
return {
|
|
11203
|
+
_id: "effect/Cookies",
|
|
11204
|
+
cookies: map2(this.cookies, (cookie) => cookie.toJSON())
|
|
11205
|
+
};
|
|
11206
|
+
},
|
|
11207
|
+
pipe() {
|
|
11208
|
+
return pipeArguments(this, arguments);
|
|
11209
|
+
}
|
|
11210
|
+
};
|
|
11211
|
+
var fromReadonlyRecord = (cookies) => {
|
|
11212
|
+
const self = Object.create(Proto4);
|
|
11213
|
+
self.cookies = cookies;
|
|
11214
|
+
return self;
|
|
11215
|
+
};
|
|
11216
|
+
var fromIterable2 = (cookies) => {
|
|
11217
|
+
const record = {};
|
|
11218
|
+
for (const cookie of cookies) {
|
|
11219
|
+
assignProperty(record, cookie.name, cookie);
|
|
11220
|
+
}
|
|
11221
|
+
return fromReadonlyRecord(record);
|
|
11222
|
+
};
|
|
11223
|
+
var fromSetCookie = (headers) => {
|
|
11224
|
+
const arrayHeaders = typeof headers === "string" ? [headers] : headers;
|
|
11225
|
+
const cookies = [];
|
|
11226
|
+
for (const header of arrayHeaders) {
|
|
11227
|
+
const cookie = parseSetCookie(header.trim());
|
|
11228
|
+
if (cookie) {
|
|
11229
|
+
cookies.push(cookie);
|
|
10881
11230
|
}
|
|
10882
|
-
}
|
|
11231
|
+
}
|
|
11232
|
+
return fromIterable2(cookies);
|
|
11233
|
+
};
|
|
11234
|
+
function parseSetCookie(header) {
|
|
11235
|
+
const parts = header.split(";").map((_) => _.trim()).filter((_) => _ !== "");
|
|
11236
|
+
if (parts.length === 0) {
|
|
11237
|
+
return;
|
|
11238
|
+
}
|
|
11239
|
+
const firstEqual = parts[0].indexOf("=");
|
|
11240
|
+
if (firstEqual === -1) {
|
|
11241
|
+
return;
|
|
11242
|
+
}
|
|
11243
|
+
const name = parts[0].slice(0, firstEqual).replace(cookieWhitespaceRegExp, "");
|
|
11244
|
+
if (!cookieNameRegExp.test(name)) {
|
|
11245
|
+
return;
|
|
11246
|
+
}
|
|
11247
|
+
const valueEncoded = parts[0].slice(firstEqual + 1).replace(cookieWhitespaceRegExp, "");
|
|
11248
|
+
const value = tryDecodeURIComponent(valueEncoded);
|
|
11249
|
+
if (parts.length === 1) {
|
|
11250
|
+
return Object.assign(Object.create(CookieProto), {
|
|
11251
|
+
name,
|
|
11252
|
+
value,
|
|
11253
|
+
valueEncoded
|
|
11254
|
+
});
|
|
11255
|
+
}
|
|
11256
|
+
const options = {};
|
|
11257
|
+
for (let i = 1;i < parts.length; i++) {
|
|
11258
|
+
const part = parts[i];
|
|
11259
|
+
const equalIndex = part.indexOf("=");
|
|
11260
|
+
const key = equalIndex === -1 ? part : part.slice(0, equalIndex).trim();
|
|
11261
|
+
const value = equalIndex === -1 ? undefined : part.slice(equalIndex + 1).trim();
|
|
11262
|
+
switch (key.toLowerCase()) {
|
|
11263
|
+
case "domain": {
|
|
11264
|
+
if (value === undefined) {
|
|
11265
|
+
break;
|
|
11266
|
+
}
|
|
11267
|
+
const domain = value.trim().replace(/^\./, "");
|
|
11268
|
+
if (domain) {
|
|
11269
|
+
options.domain = domain;
|
|
11270
|
+
}
|
|
11271
|
+
break;
|
|
11272
|
+
}
|
|
11273
|
+
case "expires": {
|
|
11274
|
+
if (value === undefined) {
|
|
11275
|
+
break;
|
|
11276
|
+
}
|
|
11277
|
+
const date = new Date(value);
|
|
11278
|
+
if (!isNaN(date.getTime())) {
|
|
11279
|
+
options.expires = date;
|
|
11280
|
+
}
|
|
11281
|
+
break;
|
|
11282
|
+
}
|
|
11283
|
+
case "max-age": {
|
|
11284
|
+
if (value === undefined || !maxAgeRegExp.test(value)) {
|
|
11285
|
+
break;
|
|
11286
|
+
}
|
|
11287
|
+
options.maxAge = seconds(parseInt(value, 10));
|
|
11288
|
+
break;
|
|
11289
|
+
}
|
|
11290
|
+
case "path": {
|
|
11291
|
+
if (value === undefined) {
|
|
11292
|
+
break;
|
|
11293
|
+
}
|
|
11294
|
+
if (value[0] === "/") {
|
|
11295
|
+
options.path = value;
|
|
11296
|
+
}
|
|
11297
|
+
break;
|
|
11298
|
+
}
|
|
11299
|
+
case "priority": {
|
|
11300
|
+
if (value === undefined) {
|
|
11301
|
+
break;
|
|
11302
|
+
}
|
|
11303
|
+
switch (value.toLowerCase()) {
|
|
11304
|
+
case "low":
|
|
11305
|
+
options.priority = "low";
|
|
11306
|
+
break;
|
|
11307
|
+
case "medium":
|
|
11308
|
+
options.priority = "medium";
|
|
11309
|
+
break;
|
|
11310
|
+
case "high":
|
|
11311
|
+
options.priority = "high";
|
|
11312
|
+
break;
|
|
11313
|
+
}
|
|
11314
|
+
break;
|
|
11315
|
+
}
|
|
11316
|
+
case "httponly": {
|
|
11317
|
+
options.httpOnly = true;
|
|
11318
|
+
break;
|
|
11319
|
+
}
|
|
11320
|
+
case "secure": {
|
|
11321
|
+
options.secure = true;
|
|
11322
|
+
break;
|
|
11323
|
+
}
|
|
11324
|
+
case "partitioned": {
|
|
11325
|
+
options.partitioned = true;
|
|
11326
|
+
break;
|
|
11327
|
+
}
|
|
11328
|
+
case "samesite": {
|
|
11329
|
+
if (value === undefined) {
|
|
11330
|
+
break;
|
|
11331
|
+
}
|
|
11332
|
+
switch (value.toLowerCase()) {
|
|
11333
|
+
case "lax":
|
|
11334
|
+
options.sameSite = "lax";
|
|
11335
|
+
break;
|
|
11336
|
+
case "strict":
|
|
11337
|
+
options.sameSite = "strict";
|
|
11338
|
+
break;
|
|
11339
|
+
case "none":
|
|
11340
|
+
options.sameSite = "none";
|
|
11341
|
+
break;
|
|
11342
|
+
}
|
|
11343
|
+
break;
|
|
11344
|
+
}
|
|
11345
|
+
}
|
|
11346
|
+
}
|
|
11347
|
+
return Object.assign(Object.create(CookieProto), {
|
|
11348
|
+
name,
|
|
11349
|
+
value,
|
|
11350
|
+
valueEncoded,
|
|
11351
|
+
options: Object.keys(options).length > 0 ? options : undefined
|
|
11352
|
+
});
|
|
10883
11353
|
}
|
|
10884
|
-
|
|
10885
|
-
|
|
10886
|
-
|
|
10887
|
-
|
|
10888
|
-
|
|
11354
|
+
var cookieNameRegExp = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
11355
|
+
var cookieWhitespaceRegExp = /^[\t ]+|[\t ]+$/g;
|
|
11356
|
+
var maxAgeRegExp = /^-?[0-9]+$/;
|
|
11357
|
+
var CookieProto = {
|
|
11358
|
+
[CookieTypeId]: CookieTypeId,
|
|
11359
|
+
...BaseProto,
|
|
11360
|
+
toJSON() {
|
|
11361
|
+
return {
|
|
11362
|
+
_id: "effect/Cookies/Cookie",
|
|
11363
|
+
name: this.name,
|
|
11364
|
+
value: this.value,
|
|
11365
|
+
options: this.options
|
|
10889
11366
|
};
|
|
10890
11367
|
}
|
|
10891
|
-
|
|
10892
|
-
|
|
10893
|
-
|
|
10894
|
-
|
|
10895
|
-
|
|
10896
|
-
|
|
10897
|
-
|
|
11368
|
+
};
|
|
11369
|
+
var tryDecodeURIComponent = (str) => {
|
|
11370
|
+
try {
|
|
11371
|
+
return decodeURIComponent(str);
|
|
11372
|
+
} catch (_) {
|
|
11373
|
+
return str;
|
|
11374
|
+
}
|
|
11375
|
+
};
|
|
11376
|
+
|
|
11377
|
+
// node_modules/effect/dist/http/Headers.js
|
|
11378
|
+
var TypeId24 = /* @__PURE__ */ Symbol.for("~effect/http/Headers");
|
|
11379
|
+
var Proto5 = /* @__PURE__ */ Object.defineProperties(/* @__PURE__ */ Object.create(null), {
|
|
11380
|
+
[TypeId24]: {
|
|
11381
|
+
value: TypeId24
|
|
11382
|
+
},
|
|
11383
|
+
[symbolRedactable]: {
|
|
11384
|
+
value(context) {
|
|
11385
|
+
return redact2(this, get(context, CurrentRedactedNames));
|
|
10898
11386
|
}
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
|
|
11387
|
+
},
|
|
11388
|
+
toJSON: {
|
|
11389
|
+
value() {
|
|
11390
|
+
return redact(this);
|
|
10902
11391
|
}
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
return (
|
|
11392
|
+
},
|
|
11393
|
+
[symbol2]: {
|
|
11394
|
+
value(that) {
|
|
11395
|
+
return Equivalence2(this, that);
|
|
11396
|
+
}
|
|
11397
|
+
},
|
|
11398
|
+
[symbol]: {
|
|
11399
|
+
value() {
|
|
11400
|
+
return structure(this);
|
|
11401
|
+
}
|
|
11402
|
+
},
|
|
11403
|
+
toString: {
|
|
11404
|
+
value: BaseProto.toString
|
|
11405
|
+
},
|
|
11406
|
+
[NodeInspectSymbol]: {
|
|
11407
|
+
value: BaseProto[NodeInspectSymbol]
|
|
10907
11408
|
}
|
|
10908
|
-
}
|
|
10909
|
-
var
|
|
10910
|
-
var
|
|
10911
|
-
|
|
10912
|
-
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
|
|
11409
|
+
});
|
|
11410
|
+
var make21 = (input) => Object.assign(Object.create(Proto5), input);
|
|
11411
|
+
var Equivalence2 = /* @__PURE__ */ makeEquivalence2(/* @__PURE__ */ strictEqual());
|
|
11412
|
+
var empty5 = /* @__PURE__ */ Object.create(Proto5);
|
|
11413
|
+
var fromInput = (input) => {
|
|
11414
|
+
if (input === undefined) {
|
|
11415
|
+
return empty5;
|
|
11416
|
+
} else if (Symbol.iterator in input) {
|
|
11417
|
+
const out = Object.create(Proto5);
|
|
11418
|
+
for (const [k, v] of input) {
|
|
11419
|
+
out[k.toLowerCase()] = v;
|
|
11420
|
+
}
|
|
11421
|
+
return out;
|
|
11422
|
+
}
|
|
11423
|
+
const out = Object.create(Proto5);
|
|
11424
|
+
for (const [k, v] of Object.entries(input)) {
|
|
11425
|
+
if (Array.isArray(v)) {
|
|
11426
|
+
out[k.toLowerCase()] = v.join(", ");
|
|
11427
|
+
} else if (v !== undefined) {
|
|
11428
|
+
out[k.toLowerCase()] = v;
|
|
11429
|
+
}
|
|
11430
|
+
}
|
|
11431
|
+
return out;
|
|
11432
|
+
};
|
|
11433
|
+
var fromRecordUnsafe = (input) => Object.setPrototypeOf(input, Proto5);
|
|
11434
|
+
var set2 = /* @__PURE__ */ dual(3, (self, key, value) => {
|
|
11435
|
+
const out = make21(self);
|
|
11436
|
+
out[key.toLowerCase()] = value;
|
|
11437
|
+
return out;
|
|
11438
|
+
});
|
|
11439
|
+
var setAll = /* @__PURE__ */ dual(2, (self, headers) => make21({
|
|
11440
|
+
...self,
|
|
11441
|
+
...fromInput(headers)
|
|
11442
|
+
}));
|
|
11443
|
+
var merge4 = /* @__PURE__ */ dual(2, (self, headers) => {
|
|
11444
|
+
const out = make21(self);
|
|
11445
|
+
Object.assign(out, headers);
|
|
11446
|
+
return out;
|
|
11447
|
+
});
|
|
11448
|
+
var remove3 = /* @__PURE__ */ dual(2, (self, key) => {
|
|
11449
|
+
const out = make21(self);
|
|
11450
|
+
delete out[key.toLowerCase()];
|
|
11451
|
+
return out;
|
|
11452
|
+
});
|
|
11453
|
+
var redact2 = /* @__PURE__ */ dual(2, (self, key) => {
|
|
11454
|
+
const out = {
|
|
11455
|
+
...self
|
|
11456
|
+
};
|
|
11457
|
+
const modify = (key) => {
|
|
11458
|
+
if (typeof key === "string") {
|
|
11459
|
+
const k = key.toLowerCase();
|
|
11460
|
+
if (k in self) {
|
|
11461
|
+
out[k] = make17(self[k]);
|
|
11462
|
+
}
|
|
11463
|
+
} else {
|
|
11464
|
+
for (const name in self) {
|
|
11465
|
+
if (name.search(key) !== -1) {
|
|
11466
|
+
out[name] = make17(self[name]);
|
|
11467
|
+
}
|
|
11468
|
+
}
|
|
11469
|
+
}
|
|
11470
|
+
};
|
|
11471
|
+
if (Array.isArray(key)) {
|
|
11472
|
+
for (let i = 0;i < key.length; i++) {
|
|
11473
|
+
modify(key[i]);
|
|
11474
|
+
}
|
|
11475
|
+
} else {
|
|
11476
|
+
modify(key);
|
|
11477
|
+
}
|
|
11478
|
+
return out;
|
|
11479
|
+
});
|
|
11480
|
+
var isRedactedName = (name, patterns) => {
|
|
11481
|
+
const lowerName = name.toLowerCase();
|
|
11482
|
+
for (let i = 0;i < patterns.length; i++) {
|
|
11483
|
+
const pattern = patterns[i];
|
|
11484
|
+
if (typeof pattern === "string") {
|
|
11485
|
+
if (pattern.toLowerCase() === lowerName) {
|
|
11486
|
+
return true;
|
|
11487
|
+
}
|
|
11488
|
+
} else if (name.search(pattern) !== -1) {
|
|
11489
|
+
return true;
|
|
11490
|
+
}
|
|
11491
|
+
}
|
|
11492
|
+
return false;
|
|
11493
|
+
};
|
|
11494
|
+
var CurrentRedactedNames = /* @__PURE__ */ Reference("effect/Headers/CurrentRedactedNames", {
|
|
11495
|
+
defaultValue: () => ["authorization", "cookie", "set-cookie", "x-api-key"]
|
|
11496
|
+
});
|
|
11497
|
+
|
|
11498
|
+
// node_modules/effect/dist/http/internal/urlParams.js
|
|
11499
|
+
var unwrap6 = (value) => typeof value === "string" ? value : value2(value);
|
|
11500
|
+
var bodyDecoder = /* @__PURE__ */ new TextDecoder("utf-8", {
|
|
11501
|
+
ignoreBOM: true
|
|
11502
|
+
});
|
|
11503
|
+
var fromBody = (bytes) => new URLSearchParams(bodyDecoder.decode(bytes).replace(/^\?/, "%3F"));
|
|
11504
|
+
|
|
11505
|
+
// node_modules/effect/dist/http/UrlParams.js
|
|
11506
|
+
var TypeId25 = "~effect/http/UrlParams";
|
|
11507
|
+
var isUrlParams = (u) => hasProperty(u, TypeId25);
|
|
11508
|
+
var Proto6 = {
|
|
11509
|
+
...PipeInspectableProto,
|
|
11510
|
+
[TypeId25]: TypeId25,
|
|
11511
|
+
[Symbol.iterator]() {
|
|
11512
|
+
return this.params[Symbol.iterator]();
|
|
11513
|
+
},
|
|
11514
|
+
[symbolRedactable](context) {
|
|
11515
|
+
return {
|
|
11516
|
+
_id: "UrlParams",
|
|
11517
|
+
params: Object.fromEntries(redact3(this, get(context, CurrentRedactedNames2)))
|
|
11518
|
+
};
|
|
11519
|
+
},
|
|
11520
|
+
toJSON() {
|
|
11521
|
+
return redact(this);
|
|
11522
|
+
},
|
|
11523
|
+
[symbol2](that) {
|
|
11524
|
+
return Equivalence3(this, that);
|
|
11525
|
+
},
|
|
11526
|
+
[symbol]() {
|
|
11527
|
+
return array(this.params.flat());
|
|
11528
|
+
}
|
|
11529
|
+
};
|
|
11530
|
+
var make22 = (params) => {
|
|
11531
|
+
const self = Object.create(Proto6);
|
|
11532
|
+
self.params = params;
|
|
11533
|
+
return self;
|
|
11534
|
+
};
|
|
11535
|
+
var fromInput2 = (input) => {
|
|
11536
|
+
if (isUrlParams(input)) {
|
|
11537
|
+
return input;
|
|
11538
|
+
}
|
|
11539
|
+
const parsed = fromInputNested(input);
|
|
11540
|
+
const out = [];
|
|
11541
|
+
for (let i = 0;i < parsed.length; i++) {
|
|
11542
|
+
if (Array.isArray(parsed[i][0])) {
|
|
11543
|
+
const [keys, value] = parsed[i];
|
|
11544
|
+
out.push([`${keys[0]}[${keys.slice(1).join("][")}]`, value]);
|
|
11545
|
+
} else {
|
|
11546
|
+
out.push(parsed[i]);
|
|
11547
|
+
}
|
|
11548
|
+
}
|
|
11549
|
+
return make22(out);
|
|
11550
|
+
};
|
|
11551
|
+
var fromInputNested = (input) => {
|
|
11552
|
+
const entries = typeof input[Symbol.iterator] === "function" ? fromIterable(input) : Object.entries(input);
|
|
11553
|
+
const out = [];
|
|
11554
|
+
for (const [key, value] of entries) {
|
|
11555
|
+
if (Array.isArray(value)) {
|
|
11556
|
+
for (let i = 0;i < value.length; i++) {
|
|
11557
|
+
if (value[i] !== undefined) {
|
|
11558
|
+
out.push([key, coerce(value[i])]);
|
|
11559
|
+
}
|
|
11560
|
+
}
|
|
11561
|
+
} else if (value !== null && typeof value === "object" && !isRedacted(value)) {
|
|
11562
|
+
const nested = fromInputNested(value);
|
|
11563
|
+
for (const [k, v] of nested) {
|
|
11564
|
+
out.push([[key, ...typeof k === "string" ? [k] : k], v]);
|
|
11565
|
+
}
|
|
11566
|
+
} else if (value !== undefined) {
|
|
11567
|
+
out.push([key, coerce(value)]);
|
|
11568
|
+
}
|
|
11569
|
+
}
|
|
11570
|
+
return out;
|
|
11571
|
+
};
|
|
11572
|
+
var coerce = (value) => isRedacted(value) ? value : String(value);
|
|
11573
|
+
var Equivalence3 = /* @__PURE__ */ make((a, b) => arrayEquivalence(a.params, b.params));
|
|
11574
|
+
var arrayEquivalence = /* @__PURE__ */ makeEquivalence3(/* @__PURE__ */ makeEquivalence([/* @__PURE__ */ strictEqual(), /* @__PURE__ */ asEquivalence()]));
|
|
11575
|
+
var empty6 = /* @__PURE__ */ make22([]);
|
|
11576
|
+
var setAll2 = /* @__PURE__ */ dual(2, (self, input) => {
|
|
11577
|
+
const params = fromInput2(input).params.slice();
|
|
11578
|
+
const keys = new Set;
|
|
11579
|
+
for (let i = 0;i < params.length; i++) {
|
|
11580
|
+
keys.add(params[i][0]);
|
|
11581
|
+
}
|
|
11582
|
+
for (let i = 0;i < self.params.length; i++) {
|
|
11583
|
+
if (keys.has(self.params[i][0]))
|
|
11584
|
+
continue;
|
|
11585
|
+
params.push(self.params[i]);
|
|
11586
|
+
}
|
|
11587
|
+
return make22(params);
|
|
11588
|
+
});
|
|
11589
|
+
var redact3 = /* @__PURE__ */ dual(2, (self, key) => {
|
|
11590
|
+
const patterns = Array.isArray(key) ? key : [key];
|
|
11591
|
+
return self.params.map(([name, value]) => [name, typeof value === "string" && isRedactedName2(name, patterns) ? make17(value) : value]);
|
|
11592
|
+
});
|
|
11593
|
+
var isRedactedName2 = isRedactedName;
|
|
11594
|
+
var redactUrl = (url, redactedNames = currentRedactedNames()) => {
|
|
11595
|
+
if (url.includes("@"))
|
|
11596
|
+
url = redactUserinfo(url);
|
|
11597
|
+
const queryStart = url.indexOf("?");
|
|
11598
|
+
if (queryStart === -1 || redactedNames.length === 0)
|
|
11599
|
+
return url;
|
|
11600
|
+
const hashStart = url.indexOf("#");
|
|
11601
|
+
if (hashStart !== -1 && hashStart < queryStart)
|
|
11602
|
+
return url;
|
|
11603
|
+
const queryEnd = hashStart === -1 ? url.length : hashStart;
|
|
11604
|
+
return url.slice(0, queryStart + 1) + redactQuery(url.slice(queryStart + 1, queryEnd), redactedNames) + url.slice(queryEnd);
|
|
11605
|
+
};
|
|
11606
|
+
var authorityStart = /^(?:(https?|ftp|wss?):[/\\]*|[a-z][a-z\d+.-]*:\/\/|[/\\]{2,})/i;
|
|
11607
|
+
var specialAuthorityEnd = /[/\\?#]/;
|
|
11608
|
+
var authorityEnd = /[/?#]/;
|
|
11609
|
+
var redactUserinfo = (url) => {
|
|
11610
|
+
let normalized = "";
|
|
11611
|
+
const offsets = [];
|
|
11612
|
+
for (let i = 0;i < url.length; i++) {
|
|
11613
|
+
const code = url.charCodeAt(i);
|
|
11614
|
+
if (code === 9 || code === 10 || code === 13 || normalized === "" && code <= 32)
|
|
11615
|
+
continue;
|
|
11616
|
+
normalized += url[i];
|
|
11617
|
+
offsets.push(i);
|
|
11618
|
+
}
|
|
11619
|
+
const authority = authorityStart.exec(normalized);
|
|
11620
|
+
if (authority === null)
|
|
11621
|
+
return url;
|
|
11622
|
+
const start = authority[0].length;
|
|
11623
|
+
const special = authority[1] !== undefined || !authority[0].includes(":");
|
|
11624
|
+
const rest = normalized.slice(start);
|
|
11625
|
+
const end = rest.search(special ? specialAuthorityEnd : authorityEnd);
|
|
11626
|
+
const userinfoEnd = (end === -1 ? rest : rest.slice(0, end)).lastIndexOf("@");
|
|
11627
|
+
return userinfoEnd === -1 ? url : url.slice(0, offsets[start]) + "REDACTED:REDACTED" + url.slice(offsets[start + userinfoEnd]);
|
|
11628
|
+
};
|
|
11629
|
+
var redactQuery = (query, redactedNames) => query.split("&").map((part) => {
|
|
11630
|
+
const index = part.indexOf("=");
|
|
11631
|
+
return index !== -1 && isRedactedName2(decodeQueryKey(part.slice(0, index)), redactedNames) ? part.slice(0, index + 1) + "REDACTED" : part;
|
|
11632
|
+
}).join("&");
|
|
11633
|
+
var decodeQueryKey = (key) => {
|
|
11634
|
+
if (!key.includes("%") && !key.includes("+"))
|
|
11635
|
+
return key;
|
|
11636
|
+
try {
|
|
11637
|
+
return decodeURIComponent(key.replace(/\+/g, " "));
|
|
11638
|
+
} catch {
|
|
11639
|
+
return key;
|
|
11640
|
+
}
|
|
11641
|
+
};
|
|
11642
|
+
var currentRedactedNames = () => get(globalThis[currentFiberTypeId]?.context ?? empty(), CurrentRedactedNames2);
|
|
11643
|
+
var CurrentRedactedNames2 = /* @__PURE__ */ Reference("effect/http/UrlParams/CurrentRedactedNames", {
|
|
11644
|
+
defaultValue: () => ["X-Amz-Signature", "X-Amz-Credential", "X-Amz-Security-Token", "AWSAccessKeyId", "Signature", "sig", "X-Goog-Signature"]
|
|
11645
|
+
});
|
|
11646
|
+
|
|
11647
|
+
// node_modules/effect/dist/internal/schema/interpreter.js
|
|
11648
|
+
var flatMapTransformation = (result, current, f) => result === sameExit ? f(current) : flatMapEager2(result, f);
|
|
11649
|
+
function compileTransformation(transformation) {
|
|
11650
|
+
const apply = compileTransformationUnsafe(transformation);
|
|
11651
|
+
return (result, current, options) => {
|
|
11652
|
+
try {
|
|
11653
|
+
return apply(result, current, options);
|
|
11654
|
+
} catch (error) {
|
|
11655
|
+
return die3(error);
|
|
11656
|
+
}
|
|
11657
|
+
};
|
|
11658
|
+
}
|
|
11659
|
+
function compileTransformationUnsafe(transformation) {
|
|
11660
|
+
if (transformation._tag === "Middleware") {
|
|
11661
|
+
return (result, current, options) => {
|
|
11662
|
+
const transformed = result === sameExit ? transformation.decode(succeed8(toOption(current)), options) : transformation.decode(mapEager2(result, toOption), options);
|
|
11663
|
+
return fromOptionalEffect(transformed);
|
|
11664
|
+
};
|
|
11665
|
+
}
|
|
11666
|
+
const getter = transformation.decode;
|
|
11667
|
+
switch (getter._tag) {
|
|
11668
|
+
case "Passthrough":
|
|
11669
|
+
return (result, current) => result === sameExit ? succeed8(current) : result;
|
|
11670
|
+
case "Transform": {
|
|
11671
|
+
const transform = (value) => value === missing ? missingExit : succeed8(getter.transform(value));
|
|
11672
|
+
return (result, current) => flatMapTransformation(result, current, transform);
|
|
11673
|
+
}
|
|
11674
|
+
case "TransformOptional": {
|
|
11675
|
+
const transform = (value) => fromOptionExit(getter.transform(toOption(value)));
|
|
11676
|
+
return (result, current) => flatMapTransformation(result, current, transform);
|
|
11677
|
+
}
|
|
11678
|
+
case "TransformEffect":
|
|
11679
|
+
return (result, current, options) => flatMapTransformation(result, current, (value) => value === missing ? missingExit : getter.transform(value, options));
|
|
11680
|
+
case "TransformOptionalEffect":
|
|
11681
|
+
return (result, current, options) => flatMapTransformation(result, current, (value) => fromOptionalEffect(getter.transform(toOption(value), options)));
|
|
11682
|
+
}
|
|
11683
|
+
}
|
|
11684
|
+
var fromOptionalEffect = (effect) => flatMapEager2(effect, fromOptionExit);
|
|
11685
|
+
var wrapEncoding = (ast, input, options, effect) => catchCause2(effect, (cause) => failCauseSync2(() => map5(cause, (issue) => new Encoding(ast, issue, input, options))));
|
|
11686
|
+
function makeConstructorParser(descriptor, compile) {
|
|
11687
|
+
const transform = compileTransformation(descriptor.link.transformation);
|
|
11688
|
+
let sourceParser;
|
|
11689
|
+
return (input, options) => {
|
|
11690
|
+
if (input === missing)
|
|
10916
11691
|
return missingExit;
|
|
10917
11692
|
if (descriptor.isConstructed(input))
|
|
10918
11693
|
return sameExit;
|
|
@@ -11171,7 +11946,7 @@ function makeOption(schema) {
|
|
|
11171
11946
|
return none2();
|
|
11172
11947
|
};
|
|
11173
11948
|
}
|
|
11174
|
-
function
|
|
11949
|
+
function make23(schema) {
|
|
11175
11950
|
return makeConstructorSync(toType(schema.ast));
|
|
11176
11951
|
}
|
|
11177
11952
|
function is(schema) {
|
|
@@ -11261,7 +12036,7 @@ function runWithCompiler(compiler, ast) {
|
|
|
11261
12036
|
function asExit(parser) {
|
|
11262
12037
|
return (input, options) => runSyncExit2(parser(input, options));
|
|
11263
12038
|
}
|
|
11264
|
-
function
|
|
12039
|
+
function runSync3(effect, message) {
|
|
11265
12040
|
const exit = runSyncExit2(effect);
|
|
11266
12041
|
if (isSuccess3(exit)) {
|
|
11267
12042
|
return exit.value;
|
|
@@ -11299,7 +12074,7 @@ function constructSync(entry, input, options) {
|
|
|
11299
12074
|
if (output !== invalid3 && output !== missing)
|
|
11300
12075
|
return output;
|
|
11301
12076
|
}
|
|
11302
|
-
return
|
|
12077
|
+
return runSync3(parserResult(entry.makeEffect(input, parseOptions), input), constructorDefectMessage);
|
|
11303
12078
|
}
|
|
11304
12079
|
function makeClassSync(ast, input, options, construct) {
|
|
11305
12080
|
const entry = resolve3(ast);
|
|
@@ -11320,12 +12095,12 @@ var normalCompiler = (ast) => resolve3(ast).parser;
|
|
|
11320
12095
|
var constructorCompiler = (ast) => resolve3(ast).makeEffect;
|
|
11321
12096
|
|
|
11322
12097
|
// node_modules/effect/dist/internal/schema/make.js
|
|
11323
|
-
var
|
|
12098
|
+
var TypeId26 = "~effect/Schema/Schema";
|
|
11324
12099
|
var RebuildOptions = /* @__PURE__ */ Symbol();
|
|
11325
12100
|
var SchemaProto = {
|
|
11326
|
-
[
|
|
12101
|
+
[TypeId26]: TypeId26,
|
|
11327
12102
|
get make() {
|
|
11328
|
-
const value =
|
|
12103
|
+
const value = make23(this);
|
|
11329
12104
|
Object.defineProperty(this, "make", {
|
|
11330
12105
|
value,
|
|
11331
12106
|
enumerable: true
|
|
@@ -11361,10 +12136,10 @@ var SchemaProto = {
|
|
|
11361
12136
|
return this.rebuild(appendChecks(this.ast, checks));
|
|
11362
12137
|
},
|
|
11363
12138
|
rebuild(ast) {
|
|
11364
|
-
return
|
|
12139
|
+
return make24(ast, this[RebuildOptions]);
|
|
11365
12140
|
}
|
|
11366
12141
|
};
|
|
11367
|
-
function
|
|
12142
|
+
function make24(ast, options) {
|
|
11368
12143
|
function Schema() {}
|
|
11369
12144
|
const self = Object.setPrototypeOf(Schema, SchemaProto);
|
|
11370
12145
|
if (options && (Object.hasOwn(options, "name") || Object.hasOwn(options, "length") || Object.hasOwn(options, "__proto__"))) {
|
|
@@ -11415,7 +12190,7 @@ function makeReorder(getPriority) {
|
|
|
11415
12190
|
};
|
|
11416
12191
|
}
|
|
11417
12192
|
function toCodecStringTree(schema) {
|
|
11418
|
-
return
|
|
12193
|
+
return make24(toCodecStringTreeAST(schema.ast), {
|
|
11419
12194
|
schema
|
|
11420
12195
|
});
|
|
11421
12196
|
}
|
|
@@ -11435,7 +12210,7 @@ var toStringTreeReorder = /* @__PURE__ */ makeReorder((ast) => {
|
|
|
11435
12210
|
function toCodecStringTreeASTStep(ast, recur, onMissingAnnotation) {
|
|
11436
12211
|
switch (ast._tag) {
|
|
11437
12212
|
case "Declaration": {
|
|
11438
|
-
const typeParameters = ast.typeParameters.map((tp) =>
|
|
12213
|
+
const typeParameters = ast.typeParameters.map((tp) => make24(recur(toEncoded(tp))));
|
|
11439
12214
|
const getStringTreeLink = ast.annotations?.toCodecStringTree;
|
|
11440
12215
|
if (isFunction(getStringTreeLink)) {
|
|
11441
12216
|
const link = getStringTreeLink(typeParameters);
|
|
@@ -11499,10 +12274,10 @@ var lambda = (f) => f;
|
|
|
11499
12274
|
var SchemaErrorTypeId = "~effect/Schema/SchemaError";
|
|
11500
12275
|
|
|
11501
12276
|
// node_modules/effect/dist/Schema.js
|
|
11502
|
-
var
|
|
12277
|
+
var TypeId27 = TypeId26;
|
|
11503
12278
|
function declareConstructor() {
|
|
11504
12279
|
return (typeParameters, run, annotations) => {
|
|
11505
|
-
return
|
|
12280
|
+
return make25(new Declaration(typeParameters.map(getAST), (typeParameters) => run(typeParameters.map((ast) => make25(ast))), annotations));
|
|
11506
12281
|
};
|
|
11507
12282
|
}
|
|
11508
12283
|
function declare(is, annotations) {
|
|
@@ -11541,10 +12316,10 @@ function fromIssueEffect(self) {
|
|
|
11541
12316
|
if (effectIsExit(self)) {
|
|
11542
12317
|
return fromIssueExit(self);
|
|
11543
12318
|
}
|
|
11544
|
-
return catchCause2(self, (cause) => failCauseSync2(() =>
|
|
12319
|
+
return catchCause2(self, (cause) => failCauseSync2(() => map5(cause, (issue) => new SchemaError(issue))));
|
|
11545
12320
|
}
|
|
11546
12321
|
function fromIssueExit(exit) {
|
|
11547
|
-
return isSuccess3(exit) ? exit : failCause2(
|
|
12322
|
+
return isSuccess3(exit) ? exit : failCause2(map5(exit.cause, (issue) => new SchemaError(issue)));
|
|
11548
12323
|
}
|
|
11549
12324
|
var is2 = is;
|
|
11550
12325
|
function decodeUnknownEffect2(schema, options) {
|
|
@@ -11554,21 +12329,21 @@ function decodeUnknownEffect2(schema, options) {
|
|
|
11554
12329
|
};
|
|
11555
12330
|
}
|
|
11556
12331
|
var decodeEffect2 = decodeUnknownEffect2;
|
|
11557
|
-
var
|
|
12332
|
+
var make25 = make24;
|
|
11558
12333
|
function isSchema(u) {
|
|
11559
|
-
return hasProperty(u,
|
|
12334
|
+
return hasProperty(u, TypeId27) && u[TypeId27] === TypeId27;
|
|
11560
12335
|
}
|
|
11561
|
-
var optionalKey2 = /* @__PURE__ */ lambda((schema) =>
|
|
12336
|
+
var optionalKey2 = /* @__PURE__ */ lambda((schema) => make25(optionalKey(schema.ast), {
|
|
11562
12337
|
schema
|
|
11563
12338
|
}));
|
|
11564
12339
|
var optional2 = /* @__PURE__ */ lambda((self) => {
|
|
11565
12340
|
const schema = UndefinedOr(self);
|
|
11566
|
-
return
|
|
12341
|
+
return make25(optional(self.ast), {
|
|
11567
12342
|
schema
|
|
11568
12343
|
});
|
|
11569
12344
|
});
|
|
11570
12345
|
function Literal2(literal) {
|
|
11571
|
-
const out =
|
|
12346
|
+
const out = make25(new Literal(literal), {
|
|
11572
12347
|
literal,
|
|
11573
12348
|
transform(to) {
|
|
11574
12349
|
return out.pipe(decodeTo2(Literal2(to), {
|
|
@@ -11579,13 +12354,13 @@ function Literal2(literal) {
|
|
|
11579
12354
|
});
|
|
11580
12355
|
return out;
|
|
11581
12356
|
}
|
|
11582
|
-
var Unknown2 = /* @__PURE__ */
|
|
11583
|
-
var Undefined2 = /* @__PURE__ */
|
|
11584
|
-
var String5 = /* @__PURE__ */
|
|
11585
|
-
var Number6 = /* @__PURE__ */
|
|
11586
|
-
var Boolean3 = /* @__PURE__ */
|
|
12357
|
+
var Unknown2 = /* @__PURE__ */ make25(unknown);
|
|
12358
|
+
var Undefined2 = /* @__PURE__ */ make25(undefined_2);
|
|
12359
|
+
var String5 = /* @__PURE__ */ make25(string2);
|
|
12360
|
+
var Number6 = /* @__PURE__ */ make25(number2);
|
|
12361
|
+
var Boolean3 = /* @__PURE__ */ make25(boolean);
|
|
11587
12362
|
function makeStruct(ast, fields) {
|
|
11588
|
-
return
|
|
12363
|
+
return make25(ast, {
|
|
11589
12364
|
fields,
|
|
11590
12365
|
mapFields(f, options) {
|
|
11591
12366
|
const fields = f(this.fields);
|
|
@@ -11597,16 +12372,16 @@ function Struct(fields) {
|
|
|
11597
12372
|
return makeStruct(struct(fields, undefined), fields);
|
|
11598
12373
|
}
|
|
11599
12374
|
function Record(key, value) {
|
|
11600
|
-
return
|
|
12375
|
+
return make25(record(key.ast, value.ast), {
|
|
11601
12376
|
key,
|
|
11602
12377
|
value
|
|
11603
12378
|
});
|
|
11604
12379
|
}
|
|
11605
|
-
var ArraySchema = /* @__PURE__ */ lambda((schema) =>
|
|
12380
|
+
var ArraySchema = /* @__PURE__ */ lambda((schema) => make25(new Arrays(false, [], [schema.ast]), {
|
|
11606
12381
|
value: schema
|
|
11607
12382
|
}));
|
|
11608
12383
|
function makeUnion(ast, members) {
|
|
11609
|
-
return
|
|
12384
|
+
return make25(ast, {
|
|
11610
12385
|
members,
|
|
11611
12386
|
mapMembers(f, options) {
|
|
11612
12387
|
const members = f(this.members);
|
|
@@ -11619,7 +12394,7 @@ function Union2(members, options) {
|
|
|
11619
12394
|
}
|
|
11620
12395
|
function Literals(literals) {
|
|
11621
12396
|
const members = literals.map(Literal2);
|
|
11622
|
-
return
|
|
12397
|
+
return make25(union2(members, undefined, undefined), {
|
|
11623
12398
|
literals,
|
|
11624
12399
|
members,
|
|
11625
12400
|
mapMembers(f) {
|
|
@@ -11636,7 +12411,7 @@ function Literals(literals) {
|
|
|
11636
12411
|
var UndefinedOr = /* @__PURE__ */ lambda((self) => Union2([self, Undefined2]));
|
|
11637
12412
|
function decodeTo2(to, transformation) {
|
|
11638
12413
|
return (from) => {
|
|
11639
|
-
return
|
|
12414
|
+
return make25(decodeTo(from.ast, to.ast, transformation ? makeTransformation(transformation) : passthrough2()), {
|
|
11640
12415
|
from,
|
|
11641
12416
|
to
|
|
11642
12417
|
});
|
|
@@ -11649,7 +12424,7 @@ var BooleanLiterals = /* @__PURE__ */ Literals([...TrueLiterals.literals, ...Fal
|
|
|
11649
12424
|
encode: (value) => value ? "true" : "false"
|
|
11650
12425
|
})));
|
|
11651
12426
|
function withConstructorDefault2(defaultValue) {
|
|
11652
|
-
return (schema) =>
|
|
12427
|
+
return (schema) => make25(withConstructorDefault(schema.ast, defaultValue), {
|
|
11653
12428
|
schema
|
|
11654
12429
|
});
|
|
11655
12430
|
}
|
|
@@ -11812,7 +12587,7 @@ var RegExp2 = /* @__PURE__ */ instanceOf(globalThis.RegExp, {
|
|
|
11812
12587
|
source: String5,
|
|
11813
12588
|
flags: String5
|
|
11814
12589
|
}), transformEffect2({
|
|
11815
|
-
decode: (e, options) =>
|
|
12590
|
+
decode: (e, options) => try_3({
|
|
11816
12591
|
try: () => new globalThis.RegExp(e.source, e.flags),
|
|
11817
12592
|
catch: () => new InvalidValue({
|
|
11818
12593
|
expected: "valid RegExp source and flags"
|
|
@@ -11942,7 +12717,7 @@ function makeClass(Inherited, identifier, struct2, annotations, proto) {
|
|
|
11942
12717
|
}
|
|
11943
12718
|
});
|
|
11944
12719
|
}
|
|
11945
|
-
static [
|
|
12720
|
+
static [TypeId27] = TypeId27;
|
|
11946
12721
|
get [ClassTypeId]() {
|
|
11947
12722
|
return ClassTypeId;
|
|
11948
12723
|
}
|
|
@@ -12021,7 +12796,7 @@ function getClassSchemaFactory(from, identifier, annotations) {
|
|
|
12021
12796
|
const ClassTypeId = getClassTypeId(identifier);
|
|
12022
12797
|
const isClassValue = (input) => input instanceof self || hasProperty(input, ClassTypeId);
|
|
12023
12798
|
const transformation = getClassTransformation(self);
|
|
12024
|
-
const to =
|
|
12799
|
+
const to = make25(new Declaration([from.ast], () => (input, ast, options) => {
|
|
12025
12800
|
return isClassValue(input) ? succeed6(input) : fail7(new InvalidType(ast, input, options));
|
|
12026
12801
|
}, {
|
|
12027
12802
|
identifier,
|
|
@@ -12060,7 +12835,7 @@ var TaggedError3 = (identifier) => {
|
|
|
12060
12835
|
};
|
|
12061
12836
|
};
|
|
12062
12837
|
var toCodecStringTree2 = toCodecStringTree;
|
|
12063
|
-
var Json2 = /* @__PURE__ */
|
|
12838
|
+
var Json2 = /* @__PURE__ */ make25(/* @__PURE__ */ annotate(Json, {
|
|
12064
12839
|
toCode: () => ({
|
|
12065
12840
|
runtime: "Schema.Json",
|
|
12066
12841
|
Type: "Schema.Json"
|
|
@@ -12068,7 +12843,7 @@ var Json2 = /* @__PURE__ */ make22(/* @__PURE__ */ annotate(Json, {
|
|
|
12068
12843
|
}));
|
|
12069
12844
|
|
|
12070
12845
|
// node_modules/effect/dist/Terminal.js
|
|
12071
|
-
var
|
|
12846
|
+
var TypeId28 = "~effect/Terminal";
|
|
12072
12847
|
var QuitErrorTypeId = "~effect/Terminal/QuitError";
|
|
12073
12848
|
|
|
12074
12849
|
class QuitError extends (/* @__PURE__ */ Error4("QuitError")({
|
|
@@ -12078,17 +12853,17 @@ class QuitError extends (/* @__PURE__ */ Error4("QuitError")({
|
|
|
12078
12853
|
}
|
|
12079
12854
|
var isQuitError = (u) => hasProperty(u, QuitErrorTypeId);
|
|
12080
12855
|
var Terminal = /* @__PURE__ */ Service("effect/Terminal");
|
|
12081
|
-
var
|
|
12856
|
+
var make26 = (impl) => Terminal.of({
|
|
12082
12857
|
...impl,
|
|
12083
|
-
[
|
|
12858
|
+
[TypeId28]: TypeId28
|
|
12084
12859
|
});
|
|
12085
12860
|
|
|
12086
12861
|
// node_modules/@effect/platform-node-shared/dist/NodeTerminal.js
|
|
12087
12862
|
import * as readline from "readline";
|
|
12088
|
-
var
|
|
12863
|
+
var make27 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQuit) {
|
|
12089
12864
|
const stdin = process.stdin;
|
|
12090
12865
|
const stdout = process.stdout;
|
|
12091
|
-
const lines = yield*
|
|
12866
|
+
const lines = yield* make10();
|
|
12092
12867
|
let inputEnded = stdin.readableEnded;
|
|
12093
12868
|
let readlineActive = false;
|
|
12094
12869
|
const onStdinEnd = () => {
|
|
@@ -12099,7 +12874,7 @@ var make24 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
|
|
|
12099
12874
|
};
|
|
12100
12875
|
stdin.once("end", onStdinEnd);
|
|
12101
12876
|
yield* addFinalizer3(() => sync2(() => stdin.off("end", onStdinEnd)));
|
|
12102
|
-
const rlRef = yield*
|
|
12877
|
+
const rlRef = yield* make12({
|
|
12103
12878
|
acquire: acquireRelease2(sync2(() => {
|
|
12104
12879
|
const rl = readline.createInterface({
|
|
12105
12880
|
input: stdin,
|
|
@@ -12138,7 +12913,7 @@ var make24 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
|
|
|
12138
12913
|
if (stdin.isTTY)
|
|
12139
12914
|
stdin.setRawMode(enabled);
|
|
12140
12915
|
});
|
|
12141
|
-
const rawModeRef = yield*
|
|
12916
|
+
const rawModeRef = yield* make12({
|
|
12142
12917
|
acquire: acquireRelease2(setRawMode(true), () => setRawMode(false)),
|
|
12143
12918
|
idleTimeToLive: "10 millis"
|
|
12144
12919
|
});
|
|
@@ -12159,7 +12934,7 @@ var make24 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
|
|
|
12159
12934
|
return queue;
|
|
12160
12935
|
});
|
|
12161
12936
|
const readInput = gen2(function* () {
|
|
12162
|
-
const queue = yield*
|
|
12937
|
+
const queue = yield* make10();
|
|
12163
12938
|
const handleKeypress = (s, k) => {
|
|
12164
12939
|
const userInput = {
|
|
12165
12940
|
input: fromUndefinedOr(s),
|
|
@@ -12207,7 +12982,7 @@ var make24 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
|
|
|
12207
12982
|
cause: err
|
|
12208
12983
|
}))));
|
|
12209
12984
|
}));
|
|
12210
|
-
return
|
|
12985
|
+
return make26({
|
|
12211
12986
|
columns,
|
|
12212
12987
|
rows,
|
|
12213
12988
|
size,
|
|
@@ -12216,7 +12991,7 @@ var make24 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
|
|
|
12216
12991
|
display
|
|
12217
12992
|
});
|
|
12218
12993
|
});
|
|
12219
|
-
var layer8 = /* @__PURE__ */ effect(Terminal, /* @__PURE__ */
|
|
12994
|
+
var layer8 = /* @__PURE__ */ effect(Terminal, /* @__PURE__ */ make27(defaultShouldQuit));
|
|
12220
12995
|
function defaultShouldQuit(input) {
|
|
12221
12996
|
const key = input.key;
|
|
12222
12997
|
return key.name === "escape" || key.ctrl && (key.name === "c" || key.name === "d");
|
|
@@ -12251,7 +13026,7 @@ function makeArray(length, value) {
|
|
|
12251
13026
|
var ConfigProvider = /* @__PURE__ */ Reference("effect/ConfigProvider", {
|
|
12252
13027
|
defaultValue: () => fromEnv()
|
|
12253
13028
|
});
|
|
12254
|
-
var
|
|
13029
|
+
var Proto7 = {
|
|
12255
13030
|
...PipeInspectableProto,
|
|
12256
13031
|
toJSON() {
|
|
12257
13032
|
return {
|
|
@@ -12261,7 +13036,7 @@ var Proto4 = {
|
|
|
12261
13036
|
};
|
|
12262
13037
|
var identityPath = (path) => path;
|
|
12263
13038
|
function makeProvider(load, mapInput) {
|
|
12264
|
-
const self = Object.create(
|
|
13039
|
+
const self = Object.create(Proto7);
|
|
12265
13040
|
self.load = load;
|
|
12266
13041
|
self.mapInput = mapInput;
|
|
12267
13042
|
return self;
|
|
@@ -12269,7 +13044,7 @@ function makeProvider(load, mapInput) {
|
|
|
12269
13044
|
function makeSource(get, transform) {
|
|
12270
13045
|
return makeProvider((path) => get(transform(path)), (f) => makeSource(get, (path) => f(transform(path))));
|
|
12271
13046
|
}
|
|
12272
|
-
function
|
|
13047
|
+
function make28(get) {
|
|
12273
13048
|
return makeSource(get, identityPath);
|
|
12274
13049
|
}
|
|
12275
13050
|
function emptyStringAsMissing(value, preserveEmptyStrings) {
|
|
@@ -12278,7 +13053,7 @@ function emptyStringAsMissing(value, preserveEmptyStrings) {
|
|
|
12278
13053
|
function fromEnvRecord(env, options) {
|
|
12279
13054
|
const preserveEmptyStrings = options?.preserveEmptyStrings === true;
|
|
12280
13055
|
const trie = buildEnvTrie(env);
|
|
12281
|
-
return
|
|
13056
|
+
return make28((path) => succeed6(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
|
|
12282
13057
|
}
|
|
12283
13058
|
function fromEnv(options) {
|
|
12284
13059
|
const env = options?.env ?? {
|
|
@@ -12331,7 +13106,7 @@ function trieNodeAt(root, path) {
|
|
|
12331
13106
|
}
|
|
12332
13107
|
|
|
12333
13108
|
// node_modules/effect/dist/Config.js
|
|
12334
|
-
var
|
|
13109
|
+
var TypeId29 = "~effect/Config";
|
|
12335
13110
|
class ConfigError {
|
|
12336
13111
|
_tag = "ConfigError";
|
|
12337
13112
|
name = "ConfigError";
|
|
@@ -12346,29 +13121,29 @@ class ConfigError {
|
|
|
12346
13121
|
return `ConfigError(${this.message})`;
|
|
12347
13122
|
}
|
|
12348
13123
|
}
|
|
12349
|
-
var
|
|
13124
|
+
var Proto8 = {
|
|
12350
13125
|
.../* @__PURE__ */ Prototype2({
|
|
12351
13126
|
label: "Config",
|
|
12352
13127
|
evaluate(fiber) {
|
|
12353
13128
|
return this.parse(fiber.getRef(ConfigProvider));
|
|
12354
13129
|
}
|
|
12355
13130
|
}),
|
|
12356
|
-
[
|
|
13131
|
+
[TypeId29]: TypeId29,
|
|
12357
13132
|
toJSON() {
|
|
12358
13133
|
return {
|
|
12359
13134
|
_id: "Config"
|
|
12360
13135
|
};
|
|
12361
13136
|
}
|
|
12362
13137
|
};
|
|
12363
|
-
function
|
|
12364
|
-
const self = Object.create(
|
|
13138
|
+
function make29(evaluator) {
|
|
13139
|
+
const self = Object.create(Proto8);
|
|
12365
13140
|
self.evaluator = evaluator;
|
|
12366
13141
|
self.parse = (provider) => flatMapEager2(evaluator(provider, []), fromResult2);
|
|
12367
13142
|
return self;
|
|
12368
13143
|
}
|
|
12369
13144
|
var evaluateAt = (self, provider, pathPrefix) => self.evaluator(provider, pathPrefix);
|
|
12370
13145
|
var withDefault3 = /* @__PURE__ */ dual(2, (self, defaultValue) => {
|
|
12371
|
-
return
|
|
13146
|
+
return make29((provider, pathPrefix) => mapEager2(evaluateAt(self, provider, pathPrefix), (resolution) => isFailure2(resolution) ? succeed2(defaultValue) : resolution));
|
|
12372
13147
|
});
|
|
12373
13148
|
var isSourceError = (u) => isTagged(u, "SourceError");
|
|
12374
13149
|
var cursorToString = () => "<configuration>";
|
|
@@ -12484,9 +13259,9 @@ var toConfigCursorAST = /* @__PURE__ */ memoize((root) => {
|
|
|
12484
13259
|
function schema(codec, path) {
|
|
12485
13260
|
const codecStringTree = toCodecStringTree2(codec);
|
|
12486
13261
|
const encodedAst = toEncoded(codecStringTree.ast);
|
|
12487
|
-
const decodeCursor = decodeUnknownEffect(
|
|
13262
|
+
const decodeCursor = decodeUnknownEffect(make25(toConfigCursorAST(codecStringTree.ast)));
|
|
12488
13263
|
const localPath = typeof path === "string" ? [path] : path ?? [];
|
|
12489
|
-
return
|
|
13264
|
+
return make29((provider, pathPrefix) => {
|
|
12490
13265
|
const fullPath = [...pathPrefix, ...localPath];
|
|
12491
13266
|
return loadCursor(provider, fullPath).pipe(flatMapEager2((cursor) => decodeCursor(cursor).pipe(mapEager2(succeed2), catchEager2((issue) => {
|
|
12492
13267
|
const error = new ConfigError(new SchemaError(fullPath.length > 0 ? new Pointer(fullPath, issue) : issue));
|
|
@@ -12512,17 +13287,17 @@ var log = (...args) => consoleWith((console) => sync(() => {
|
|
|
12512
13287
|
// node_modules/effect/dist/Logger.js
|
|
12513
13288
|
var LogToStderr2 = LogToStderr;
|
|
12514
13289
|
// node_modules/effect/dist/cli/CliError.js
|
|
12515
|
-
var
|
|
12516
|
-
var isCliError = (u) => hasProperty(u,
|
|
13290
|
+
var TypeId30 = "~effect/cli/CliError";
|
|
13291
|
+
var isCliError = (u) => hasProperty(u, TypeId30);
|
|
12517
13292
|
var userMessage = "~effect/cli/CliError/userMessage";
|
|
12518
13293
|
var getUserMessage = (error) => (userMessage in error) && typeof error[userMessage] === "string" ? error[userMessage] : undefined;
|
|
12519
13294
|
|
|
12520
|
-
class UnrecognizedOption extends (/* @__PURE__ */ TaggedError3(`${
|
|
13295
|
+
class UnrecognizedOption extends (/* @__PURE__ */ TaggedError3(`${TypeId30}/UnrecognizedOption`)("UnrecognizedOption", {
|
|
12521
13296
|
option: String5,
|
|
12522
13297
|
command: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(String5)),
|
|
12523
13298
|
suggestions: /* @__PURE__ */ ArraySchema(String5)
|
|
12524
13299
|
})) {
|
|
12525
|
-
[
|
|
13300
|
+
[TypeId30] = TypeId30;
|
|
12526
13301
|
get message() {
|
|
12527
13302
|
const suggestionText = this.suggestions.length > 0 ? `
|
|
12528
13303
|
|
|
@@ -12534,52 +13309,52 @@ class UnrecognizedOption extends (/* @__PURE__ */ TaggedError3(`${TypeId27}/Unre
|
|
|
12534
13309
|
}
|
|
12535
13310
|
}
|
|
12536
13311
|
|
|
12537
|
-
class DuplicateOption extends (/* @__PURE__ */ TaggedError3(`${
|
|
13312
|
+
class DuplicateOption extends (/* @__PURE__ */ TaggedError3(`${TypeId30}/DuplicateOption`)("DuplicateOption", {
|
|
12538
13313
|
option: String5,
|
|
12539
13314
|
parentCommand: String5,
|
|
12540
13315
|
childCommand: String5
|
|
12541
13316
|
})) {
|
|
12542
|
-
[
|
|
13317
|
+
[TypeId30] = TypeId30;
|
|
12543
13318
|
get message() {
|
|
12544
13319
|
return `Duplicate flag name "${this.option}" in parent command "${this.parentCommand}" and subcommand "${this.childCommand}". ` + `Parent will always claim this flag (Mode A semantics). Consider renaming one of them to avoid confusion.`;
|
|
12545
13320
|
}
|
|
12546
13321
|
}
|
|
12547
13322
|
|
|
12548
|
-
class MissingOption extends (/* @__PURE__ */ TaggedError3(`${
|
|
13323
|
+
class MissingOption extends (/* @__PURE__ */ TaggedError3(`${TypeId30}/MissingOption`)("MissingOption", {
|
|
12549
13324
|
option: String5
|
|
12550
13325
|
})) {
|
|
12551
|
-
[
|
|
13326
|
+
[TypeId30] = TypeId30;
|
|
12552
13327
|
get message() {
|
|
12553
13328
|
return `Missing required flag: --${this.option}`;
|
|
12554
13329
|
}
|
|
12555
13330
|
}
|
|
12556
13331
|
|
|
12557
|
-
class MissingArgument extends (/* @__PURE__ */ TaggedError3(`${
|
|
13332
|
+
class MissingArgument extends (/* @__PURE__ */ TaggedError3(`${TypeId30}/MissingArgument`)("MissingArgument", {
|
|
12558
13333
|
argument: String5
|
|
12559
13334
|
})) {
|
|
12560
|
-
[
|
|
13335
|
+
[TypeId30] = TypeId30;
|
|
12561
13336
|
get message() {
|
|
12562
13337
|
return `Missing required argument: ${this.argument}`;
|
|
12563
13338
|
}
|
|
12564
13339
|
}
|
|
12565
13340
|
|
|
12566
|
-
class UnexpectedArgument extends (/* @__PURE__ */ TaggedError3(`${
|
|
13341
|
+
class UnexpectedArgument extends (/* @__PURE__ */ TaggedError3(`${TypeId30}/UnexpectedArgument`)("UnexpectedArgument", {
|
|
12567
13342
|
arguments: /* @__PURE__ */ ArraySchema(String5)
|
|
12568
13343
|
})) {
|
|
12569
|
-
[
|
|
13344
|
+
[TypeId30] = TypeId30;
|
|
12570
13345
|
get message() {
|
|
12571
13346
|
const label = this.arguments.length === 1 ? "argument" : "arguments";
|
|
12572
13347
|
return `Unexpected positional ${label}: ${this.arguments.map((value) => JSON.stringify(value)).join(", ")}`;
|
|
12573
13348
|
}
|
|
12574
13349
|
}
|
|
12575
13350
|
|
|
12576
|
-
class InvalidValue2 extends (/* @__PURE__ */ TaggedError3(`${
|
|
13351
|
+
class InvalidValue2 extends (/* @__PURE__ */ TaggedError3(`${TypeId30}/InvalidValue`)("InvalidValue", {
|
|
12577
13352
|
option: String5,
|
|
12578
13353
|
value: String5,
|
|
12579
13354
|
expected: String5,
|
|
12580
13355
|
kind: /* @__PURE__ */ Union2([/* @__PURE__ */ Literal2("flag"), /* @__PURE__ */ Literal2("argument")])
|
|
12581
13356
|
})) {
|
|
12582
|
-
[
|
|
13357
|
+
[TypeId30] = TypeId30;
|
|
12583
13358
|
get message() {
|
|
12584
13359
|
const expectation = this.expected.startsWith("Expected ") || this.expected.startsWith("Expected:") ? this.expected : `Expected: ${this.expected}`;
|
|
12585
13360
|
if (this.kind === "argument") {
|
|
@@ -12592,12 +13367,12 @@ class InvalidValue2 extends (/* @__PURE__ */ TaggedError3(`${TypeId27}/InvalidVa
|
|
|
12592
13367
|
}
|
|
12593
13368
|
}
|
|
12594
13369
|
|
|
12595
|
-
class UnknownSubcommand extends (/* @__PURE__ */ TaggedError3(`${
|
|
13370
|
+
class UnknownSubcommand extends (/* @__PURE__ */ TaggedError3(`${TypeId30}/UnknownSubcommand`)("UnknownSubcommand", {
|
|
12596
13371
|
subcommand: String5,
|
|
12597
13372
|
parent: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(String5)),
|
|
12598
13373
|
suggestions: /* @__PURE__ */ ArraySchema(String5)
|
|
12599
13374
|
})) {
|
|
12600
|
-
[
|
|
13375
|
+
[TypeId30] = TypeId30;
|
|
12601
13376
|
get message() {
|
|
12602
13377
|
const suggestionText = this.suggestions.length > 0 ? `
|
|
12603
13378
|
|
|
@@ -12608,17 +13383,17 @@ class UnknownSubcommand extends (/* @__PURE__ */ TaggedError3(`${TypeId27}/Unkno
|
|
|
12608
13383
|
}
|
|
12609
13384
|
}
|
|
12610
13385
|
|
|
12611
|
-
class ValidationError extends (/* @__PURE__ */ TaggedError3(`${
|
|
13386
|
+
class ValidationError extends (/* @__PURE__ */ TaggedError3(`${TypeId30}/ValidationError`)("ValidationError", {
|
|
12612
13387
|
message: String5
|
|
12613
13388
|
})) {
|
|
12614
|
-
[
|
|
13389
|
+
[TypeId30] = TypeId30;
|
|
12615
13390
|
}
|
|
12616
13391
|
|
|
12617
|
-
class UserError extends (/* @__PURE__ */ TaggedError3(`${
|
|
13392
|
+
class UserError extends (/* @__PURE__ */ TaggedError3(`${TypeId30}/UserError`)("UserError", {
|
|
12618
13393
|
cause: /* @__PURE__ */ Defect(),
|
|
12619
13394
|
userMessage: /* @__PURE__ */ optionalKey2(String5)
|
|
12620
13395
|
})) {
|
|
12621
|
-
[
|
|
13396
|
+
[TypeId30] = TypeId30;
|
|
12622
13397
|
[errorReported] = true;
|
|
12623
13398
|
get message() {
|
|
12624
13399
|
if (this.userMessage)
|
|
@@ -12635,11 +13410,11 @@ class UserError extends (/* @__PURE__ */ TaggedError3(`${TypeId27}/UserError`)("
|
|
|
12635
13410
|
}
|
|
12636
13411
|
var NonShowHelpErrors = /* @__PURE__ */ Union2([UnrecognizedOption, DuplicateOption, MissingOption, MissingArgument, UnexpectedArgument, InvalidValue2, UnknownSubcommand, ValidationError, UserError]);
|
|
12637
13412
|
|
|
12638
|
-
class ShowHelp extends (/* @__PURE__ */ TaggedError3(`${
|
|
13413
|
+
class ShowHelp extends (/* @__PURE__ */ TaggedError3(`${TypeId30}/ShowHelp`)("ShowHelp", {
|
|
12639
13414
|
commandPath: /* @__PURE__ */ ArraySchema(String5),
|
|
12640
13415
|
errors: /* @__PURE__ */ ArraySchema(NonShowHelpErrors)
|
|
12641
13416
|
})) {
|
|
12642
|
-
[
|
|
13417
|
+
[TypeId30] = TypeId30;
|
|
12643
13418
|
[errorExitCode] = this.errors.length ? 1 : 0;
|
|
12644
13419
|
[errorReported] = false;
|
|
12645
13420
|
get message() {
|
|
@@ -12648,16 +13423,16 @@ class ShowHelp extends (/* @__PURE__ */ TaggedError3(`${TypeId27}/ShowHelp`)("Sh
|
|
|
12648
13423
|
}
|
|
12649
13424
|
|
|
12650
13425
|
// node_modules/effect/dist/cli/Primitive.js
|
|
12651
|
-
var
|
|
12652
|
-
var
|
|
12653
|
-
[
|
|
13426
|
+
var TypeId31 = "~effect/cli/Primitive";
|
|
13427
|
+
var Proto9 = {
|
|
13428
|
+
[TypeId31]: {
|
|
12654
13429
|
_A: identity
|
|
12655
13430
|
}
|
|
12656
13431
|
};
|
|
12657
13432
|
var isTrueLiteral = /* @__PURE__ */ is2(TrueLiterals);
|
|
12658
13433
|
var isFalseLiteral = /* @__PURE__ */ is2(FalseLiterals);
|
|
12659
13434
|
var isBoolean2 = (p) => p._tag === "Boolean";
|
|
12660
|
-
var makePrimitive2 = (tag, parse) => Object.assign(Object.create(
|
|
13435
|
+
var makePrimitive2 = (tag, parse) => Object.assign(Object.create(Proto9), {
|
|
12661
13436
|
_tag: tag,
|
|
12662
13437
|
parse
|
|
12663
13438
|
});
|
|
@@ -12785,7 +13560,7 @@ var eraseLines = (rows) => {
|
|
|
12785
13560
|
};
|
|
12786
13561
|
|
|
12787
13562
|
// node_modules/effect/dist/cli/Prompt.js
|
|
12788
|
-
var
|
|
13563
|
+
var TypeId32 = "~effect/cli/Prompt";
|
|
12789
13564
|
var defaultTheme = {
|
|
12790
13565
|
prefix: "?",
|
|
12791
13566
|
arrowUp: "\u2191",
|
|
@@ -12822,7 +13597,7 @@ var makeTheme = (options) => ({
|
|
|
12822
13597
|
var Theme = /* @__PURE__ */ Reference("effect/cli/Prompt/Theme", {
|
|
12823
13598
|
defaultValue: makeTheme
|
|
12824
13599
|
});
|
|
12825
|
-
var getTheme = (options) =>
|
|
13600
|
+
var getTheme = (options) => map6(Theme, (theme) => ({
|
|
12826
13601
|
...theme,
|
|
12827
13602
|
...options.theme
|
|
12828
13603
|
}));
|
|
@@ -12968,8 +13743,8 @@ var Int2 = (options) => {
|
|
|
12968
13743
|
clear: handleNumberClear(opts)
|
|
12969
13744
|
});
|
|
12970
13745
|
};
|
|
12971
|
-
var
|
|
12972
|
-
var Password = (options) => basePrompt(options, "password").pipe(
|
|
13746
|
+
var map9 = /* @__PURE__ */ dual(2, (self, f) => flatMap5(self, (a) => succeed9(f(a))));
|
|
13747
|
+
var Password = (options) => basePrompt(options, "password").pipe(map9(make17));
|
|
12973
13748
|
var run3 = /* @__PURE__ */ fnUntraced2(function* (self) {
|
|
12974
13749
|
const terminal = yield* Terminal;
|
|
12975
13750
|
const input = yield* cached2(terminal.readInput);
|
|
@@ -13031,7 +13806,7 @@ var proto = {
|
|
|
13031
13806
|
return run3(this);
|
|
13032
13807
|
}
|
|
13033
13808
|
}),
|
|
13034
|
-
[
|
|
13809
|
+
[TypeId32]: {
|
|
13035
13810
|
_Output: (_) => _
|
|
13036
13811
|
}
|
|
13037
13812
|
};
|
|
@@ -13060,11 +13835,11 @@ var runLoop = /* @__PURE__ */ fnUntraced2(function* (loop, terminal, input) {
|
|
|
13060
13835
|
yield* orDie2(terminal.display(clear + msg));
|
|
13061
13836
|
clear = "";
|
|
13062
13837
|
if (loop.events) {
|
|
13063
|
-
const takeInput = take2(input).pipe(
|
|
13838
|
+
const takeInput = take2(input).pipe(map6((input) => ({
|
|
13064
13839
|
_tag: "Input",
|
|
13065
13840
|
input
|
|
13066
13841
|
})));
|
|
13067
|
-
const result = yield* raceFirst2(takeInput, take2(loop.events).pipe(
|
|
13842
|
+
const result = yield* raceFirst2(takeInput, take2(loop.events).pipe(map6((value) => ({
|
|
13068
13843
|
_tag: "Event",
|
|
13069
13844
|
value
|
|
13070
13845
|
}))));
|
|
@@ -13104,7 +13879,7 @@ var eraseText = (text, columns) => {
|
|
|
13104
13879
|
};
|
|
13105
13880
|
var lines = (prompt, columns) => {
|
|
13106
13881
|
const lines = prompt.split(NEWLINE_REGEXP);
|
|
13107
|
-
return columns === 0 ? lines.length : pipe(
|
|
13882
|
+
return columns === 0 ? lines.length : pipe(map3(lines, (line) => Math.ceil(line.length / columns)), reduce(0, (left, right) => left + right));
|
|
13108
13883
|
};
|
|
13109
13884
|
var clearOutputWithError = (outputText, columns, errorText) => {
|
|
13110
13885
|
if (errorText !== undefined && errorText.length > 0) {
|
|
@@ -13205,7 +13980,7 @@ var renderDateError = (state, pointer, theme) => {
|
|
|
13205
13980
|
const errorLines = state.error.value.split(NEWLINE_REGEXP);
|
|
13206
13981
|
if (isReadonlyArrayNonEmpty(errorLines)) {
|
|
13207
13982
|
const prefix = annotateSymbol(theme, pointer, theme.errorColor);
|
|
13208
|
-
const lines =
|
|
13983
|
+
const lines = map3(errorLines, (str) => annotateErrorLine(theme, str));
|
|
13209
13984
|
return cursorSavePosition + `
|
|
13210
13985
|
` + separateSymbol(prefix, lines.join(`
|
|
13211
13986
|
`)) + cursorRestorePosition;
|
|
@@ -13648,7 +14423,7 @@ var renderPrompt = (confirm, message, leadingSymbol, trailingSymbol, theme, opti
|
|
|
13648
14423
|
return match3(message.split(NEWLINE_REGEXP), {
|
|
13649
14424
|
onEmpty: () => renderLine(""),
|
|
13650
14425
|
onNonEmpty: (promptLines) => {
|
|
13651
|
-
const lines = options?.plain === true ? promptLines :
|
|
14426
|
+
const lines = options?.plain === true ? promptLines : map3(promptLines, (line) => annotate2(theme.colors, line, bold));
|
|
13652
14427
|
return renderLine(lines.join(`
|
|
13653
14428
|
`));
|
|
13654
14429
|
}
|
|
@@ -13695,7 +14470,7 @@ var renderNumberError = (state, pointer, theme, renderOptions) => {
|
|
|
13695
14470
|
`));
|
|
13696
14471
|
}
|
|
13697
14472
|
const prefix = annotateSymbol(theme, pointer, theme.errorColor);
|
|
13698
|
-
const lines =
|
|
14473
|
+
const lines = map3(errorLines, (str) => annotateErrorLine(theme, str));
|
|
13699
14474
|
return cursorSavePosition + `
|
|
13700
14475
|
` + separateSymbol(prefix, lines.join(`
|
|
13701
14476
|
`)) + cursorRestorePosition;
|
|
@@ -14124,7 +14899,7 @@ var renderTextError = (nextState, pointer, theme, renderOptions) => {
|
|
|
14124
14899
|
`));
|
|
14125
14900
|
}
|
|
14126
14901
|
const prefix = annotateSymbol(theme, pointer, theme.errorColor);
|
|
14127
|
-
const lines =
|
|
14902
|
+
const lines = map3(errorLines, (str) => annotateErrorLine(theme, str));
|
|
14128
14903
|
return cursorSavePosition + `
|
|
14129
14904
|
` + separateSymbol(prefix, lines.join(`
|
|
14130
14905
|
`)) + cursorRestorePosition;
|
|
@@ -14473,18 +15248,18 @@ var fromProcess = () => {
|
|
|
14473
15248
|
};
|
|
14474
15249
|
|
|
14475
15250
|
// node_modules/effect/dist/cli/Param.js
|
|
14476
|
-
var
|
|
15251
|
+
var TypeId33 = "~effect/cli/Param";
|
|
14477
15252
|
var argumentKind = "argument";
|
|
14478
15253
|
var flagKind = "flag";
|
|
14479
|
-
var
|
|
14480
|
-
[
|
|
15254
|
+
var Proto10 = {
|
|
15255
|
+
[TypeId33]: {
|
|
14481
15256
|
_A: identity
|
|
14482
15257
|
},
|
|
14483
15258
|
pipe() {
|
|
14484
15259
|
return pipeArguments(this, arguments);
|
|
14485
15260
|
}
|
|
14486
15261
|
};
|
|
14487
|
-
var isParam = (u) => hasProperty(u,
|
|
15262
|
+
var isParam = (u) => hasProperty(u, TypeId33);
|
|
14488
15263
|
var isFlagParam = (single) => single.kind === "flag";
|
|
14489
15264
|
var makeSingle2 = (params) => {
|
|
14490
15265
|
const parse = (args) => params.kind === argumentKind ? parsePositional(params.name, params.primitiveType, args) : parseFlag(params.name, params.primitiveType, args);
|
|
@@ -14495,7 +15270,7 @@ var makeSingle2 = (params) => {
|
|
|
14495
15270
|
aliases: params.aliases ?? [],
|
|
14496
15271
|
hidden: params.hidden ?? false,
|
|
14497
15272
|
parse
|
|
14498
|
-
},
|
|
15273
|
+
}, Proto10);
|
|
14499
15274
|
};
|
|
14500
15275
|
var String9 = (kind, name) => makeSingle2({
|
|
14501
15276
|
name,
|
|
@@ -14525,9 +15300,9 @@ var withDescription = /* @__PURE__ */ dual(2, (self, description) => {
|
|
|
14525
15300
|
description: some2(description)
|
|
14526
15301
|
}));
|
|
14527
15302
|
});
|
|
14528
|
-
var
|
|
14529
|
-
const parse = (args) =>
|
|
14530
|
-
return Object.assign(Object.create(
|
|
15303
|
+
var map10 = /* @__PURE__ */ dual(2, (self, f) => {
|
|
15304
|
+
const parse = (args) => map6(self.parse(args), ([operands, value]) => [operands, f(value)]);
|
|
15305
|
+
return Object.assign(Object.create(Proto10), {
|
|
14531
15306
|
_tag: "Map",
|
|
14532
15307
|
kind: self.kind,
|
|
14533
15308
|
param: self,
|
|
@@ -14537,7 +15312,7 @@ var map9 = /* @__PURE__ */ dual(2, (self, f) => {
|
|
|
14537
15312
|
});
|
|
14538
15313
|
var transform3 = (self, f, alternatives = []) => {
|
|
14539
15314
|
const alternativeParsers = alternatives.map((alternative) => () => alternative().parse);
|
|
14540
|
-
return Object.assign(Object.create(
|
|
15315
|
+
return Object.assign(Object.create(Proto10), {
|
|
14541
15316
|
_tag: "Transform",
|
|
14542
15317
|
kind: self.kind,
|
|
14543
15318
|
param: self,
|
|
@@ -14546,13 +15321,13 @@ var transform3 = (self, f, alternatives = []) => {
|
|
|
14546
15321
|
parse: f(self.parse, alternativeParsers)
|
|
14547
15322
|
});
|
|
14548
15323
|
};
|
|
14549
|
-
var mapEffect2 = /* @__PURE__ */ dual(2, (self, f) => transform3(self, (parse) => (args) => flatMap3(parse(args), ([leftover, a]) => f(a).pipe(
|
|
15324
|
+
var mapEffect2 = /* @__PURE__ */ dual(2, (self, f) => transform3(self, (parse) => (args) => flatMap3(parse(args), ([leftover, a]) => f(a).pipe(map6((b) => [leftover, b])))));
|
|
14550
15325
|
var optional3 = (param) => {
|
|
14551
|
-
const parse = (args) => param.parse(args).pipe(
|
|
15326
|
+
const parse = (args) => param.parse(args).pipe(map6(([leftover, value]) => [leftover, some2(value)]), catchTags2({
|
|
14552
15327
|
MissingOption: () => succeed6([args.arguments, none2()]),
|
|
14553
15328
|
MissingArgument: () => succeed6([args.arguments, none2()])
|
|
14554
15329
|
}));
|
|
14555
|
-
return Object.assign(Object.create(
|
|
15330
|
+
return Object.assign(Object.create(Proto10), {
|
|
14556
15331
|
_tag: "Optional",
|
|
14557
15332
|
kind: param.kind,
|
|
14558
15333
|
param,
|
|
@@ -14561,7 +15336,7 @@ var optional3 = (param) => {
|
|
|
14561
15336
|
};
|
|
14562
15337
|
var withDefault4 = /* @__PURE__ */ dual(2, (self, defaultValue) => {
|
|
14563
15338
|
if (!isEffect2(defaultValue)) {
|
|
14564
|
-
return
|
|
15339
|
+
return map10(optional3(self), getOrElse(() => defaultValue));
|
|
14565
15340
|
}
|
|
14566
15341
|
return mapEffect2(optional3(self), match({
|
|
14567
15342
|
onNone: () => defaultValue,
|
|
@@ -14577,7 +15352,7 @@ var variadic = (self, options) => {
|
|
|
14577
15352
|
return parseOptionVariadic(self, single, args, options);
|
|
14578
15353
|
}
|
|
14579
15354
|
};
|
|
14580
|
-
return Object.assign(Object.create(
|
|
15355
|
+
return Object.assign(Object.create(Proto10), {
|
|
14581
15356
|
_tag: "Variadic",
|
|
14582
15357
|
kind: self.kind,
|
|
14583
15358
|
param: self,
|
|
@@ -14708,7 +15483,7 @@ var matchParam = (param, patterns) => {
|
|
|
14708
15483
|
var transformSingle = (param, f) => {
|
|
14709
15484
|
return matchParam(param, {
|
|
14710
15485
|
Single: (single) => f(single),
|
|
14711
|
-
Map: (mapped) =>
|
|
15486
|
+
Map: (mapped) => map10(transformSingle(mapped.param, f), mapped.f),
|
|
14712
15487
|
Transform: (mapped) => transform3(transformSingle(mapped.param, f), mapped.f, mapped.alternatives.map((alternative) => () => transformSingle(alternative(), f))),
|
|
14713
15488
|
Optional: (p) => optional3(transformSingle(p.param, f)),
|
|
14714
15489
|
Variadic: (p) => variadic(transformSingle(p.param, f), {
|
|
@@ -15072,9 +15847,9 @@ var reconstructTree = (tree, results) => {
|
|
|
15072
15847
|
};
|
|
15073
15848
|
|
|
15074
15849
|
// node_modules/effect/dist/cli/internal/command.js
|
|
15075
|
-
var
|
|
15850
|
+
var TypeId34 = "~effect/cli/Command";
|
|
15076
15851
|
var toImpl = (self) => self;
|
|
15077
|
-
var
|
|
15852
|
+
var Proto11 = {
|
|
15078
15853
|
.../* @__PURE__ */ Prototype2({
|
|
15079
15854
|
label: "Command",
|
|
15080
15855
|
evaluate() {
|
|
@@ -15085,7 +15860,7 @@ var Proto8 = {
|
|
|
15085
15860
|
var makeCommand = (options) => {
|
|
15086
15861
|
const config = options.config;
|
|
15087
15862
|
const contextConfig = options.contextConfig ?? emptyConfig;
|
|
15088
|
-
const service = options.service ?? Service(`${
|
|
15863
|
+
const service = options.service ?? Service(`${TypeId34}/${options.name}`);
|
|
15089
15864
|
const annotations = options.annotations ?? empty();
|
|
15090
15865
|
const globalFlags = options.globalFlags ?? [];
|
|
15091
15866
|
const subcommands = options.subcommands ?? [];
|
|
@@ -15139,7 +15914,7 @@ var makeCommand = (options) => {
|
|
|
15139
15914
|
continue;
|
|
15140
15915
|
subcommandDocs.push({
|
|
15141
15916
|
group: group.group,
|
|
15142
|
-
commands:
|
|
15917
|
+
commands: map3(visible, (subcommand) => ({
|
|
15143
15918
|
name: subcommand.name,
|
|
15144
15919
|
alias: subcommand.alias,
|
|
15145
15920
|
shortDescription: subcommand.shortDescription,
|
|
@@ -15164,8 +15939,8 @@ var makeCommand = (options) => {
|
|
|
15164
15939
|
}
|
|
15165
15940
|
};
|
|
15166
15941
|
};
|
|
15167
|
-
return Object.assign(Object.create(
|
|
15168
|
-
[
|
|
15942
|
+
return Object.assign(Object.create(Proto11), {
|
|
15943
|
+
[TypeId34]: TypeId34,
|
|
15169
15944
|
name: options.name,
|
|
15170
15945
|
examples: resolveExamples([options.name]),
|
|
15171
15946
|
resolveExamples,
|
|
@@ -17344,7 +18119,7 @@ var promptSingle = (single) => {
|
|
|
17344
18119
|
const message = renderParamMessage(single);
|
|
17345
18120
|
switch (single.primitiveType._tag) {
|
|
17346
18121
|
case "Boolean":
|
|
17347
|
-
return
|
|
18122
|
+
return map6(run3(Confirm({
|
|
17348
18123
|
message,
|
|
17349
18124
|
label: {
|
|
17350
18125
|
confirm: "true",
|
|
@@ -17357,7 +18132,7 @@ var promptSingle = (single) => {
|
|
|
17357
18132
|
})), (value) => commandLineArg(String(value)));
|
|
17358
18133
|
case "Choice": {
|
|
17359
18134
|
const choices = getChoiceKeys(single.primitiveType) ?? [];
|
|
17360
|
-
return
|
|
18135
|
+
return map6(run3(Select({
|
|
17361
18136
|
message,
|
|
17362
18137
|
choices: choices.map((choice) => ({
|
|
17363
18138
|
title: choice,
|
|
@@ -17366,23 +18141,23 @@ var promptSingle = (single) => {
|
|
|
17366
18141
|
})), commandLineArg);
|
|
17367
18142
|
}
|
|
17368
18143
|
case "Date":
|
|
17369
|
-
return
|
|
18144
|
+
return map6(run3(Date4({
|
|
17370
18145
|
message
|
|
17371
18146
|
})), (date) => commandLineArg(date.toISOString()));
|
|
17372
18147
|
case "Finite":
|
|
17373
|
-
return
|
|
18148
|
+
return map6(run3(Number7({
|
|
17374
18149
|
message
|
|
17375
18150
|
})), (value) => commandLineArg(String(value)));
|
|
17376
18151
|
case "Int":
|
|
17377
|
-
return
|
|
18152
|
+
return map6(run3(Int2({
|
|
17378
18153
|
message
|
|
17379
18154
|
})), (value) => commandLineArg(String(value)));
|
|
17380
18155
|
case "Redacted":
|
|
17381
|
-
return
|
|
18156
|
+
return map6(run3(Password({
|
|
17382
18157
|
message
|
|
17383
18158
|
})), (value) => commandLineArg(value2(value), "<redacted>"));
|
|
17384
18159
|
default:
|
|
17385
|
-
return
|
|
18160
|
+
return map6(run3(String8({
|
|
17386
18161
|
message
|
|
17387
18162
|
})), commandLineArg);
|
|
17388
18163
|
}
|
|
@@ -17443,8 +18218,8 @@ var wrapCommand = (commandLine) => {
|
|
|
17443
18218
|
var formatShellArg = (arg) => /^[A-Za-z0-9_./:@%+=,-]+$/.test(arg) ? arg : `'${arg.replaceAll("'", `'"'"'`)}'`;
|
|
17444
18219
|
|
|
17445
18220
|
// node_modules/effect/dist/cli/Command.js
|
|
17446
|
-
var isCommand = (u) => hasProperty(u,
|
|
17447
|
-
var
|
|
18221
|
+
var isCommand = (u) => hasProperty(u, TypeId34);
|
|
18222
|
+
var make30 = (name, config, handler) => {
|
|
17448
18223
|
const parsedConfig = parseConfig(config ?? {});
|
|
17449
18224
|
return makeCommand({
|
|
17450
18225
|
name,
|
|
@@ -17727,7 +18502,7 @@ var runWith2 = (command, config) => {
|
|
|
17727
18502
|
}
|
|
17728
18503
|
const services = match(logLevel, {
|
|
17729
18504
|
onNone: () => empty(),
|
|
17730
|
-
onSome: (level) =>
|
|
18505
|
+
onSome: (level) => make3(MinimumLogLevel2, level)
|
|
17731
18506
|
});
|
|
17732
18507
|
yield* provideContext2(program, services);
|
|
17733
18508
|
}, catchFilter2((error) => isCliError(error) && error._tag === "ShowHelp" ? succeed2(error) : fail2(error), (error) => andThen2(showHelp(command, error, config.renderErrors !== false), fail7(error))), catchFilter2((error) => {
|
|
@@ -17744,39 +18519,911 @@ var runWith2 = (command, config) => {
|
|
|
17744
18519
|
}) => andThen2(showUserError(error, userMessage), fail7(error))), catchFilter2((e) => isQuitError(e) ? succeed2(e) : fail2(e), (_) => interrupt2));
|
|
17745
18520
|
};
|
|
17746
18521
|
// package.json
|
|
17747
|
-
var version = "0.0.
|
|
17748
|
-
//
|
|
17749
|
-
var
|
|
17750
|
-
|
|
17751
|
-
|
|
17752
|
-
|
|
17753
|
-
|
|
17754
|
-
|
|
17755
|
-
|
|
18522
|
+
var version = "0.0.3";
|
|
18523
|
+
// node_modules/effect/dist/http/HttpBody.js
|
|
18524
|
+
var TypeId35 = "~effect/http/HttpBody";
|
|
18525
|
+
var HttpBodyErrorTypeId = "~effect/http/HttpBody/HttpBodyError";
|
|
18526
|
+
|
|
18527
|
+
class HttpBodyError extends (/* @__PURE__ */ TaggedError2("HttpBodyError")) {
|
|
18528
|
+
[HttpBodyErrorTypeId] = HttpBodyErrorTypeId;
|
|
18529
|
+
}
|
|
18530
|
+
class Proto12 {
|
|
18531
|
+
[TypeId35];
|
|
18532
|
+
constructor() {
|
|
18533
|
+
this[TypeId35] = TypeId35;
|
|
18534
|
+
}
|
|
18535
|
+
[NodeInspectSymbol]() {
|
|
18536
|
+
return this.toJSON();
|
|
18537
|
+
}
|
|
18538
|
+
toString() {
|
|
18539
|
+
return format(this, {
|
|
18540
|
+
ignoreToString: true
|
|
17756
18541
|
});
|
|
17757
18542
|
}
|
|
17758
|
-
|
|
17759
|
-
|
|
17760
|
-
|
|
17761
|
-
|
|
17762
|
-
|
|
17763
|
-
|
|
17764
|
-
|
|
17765
|
-
|
|
18543
|
+
}
|
|
18544
|
+
|
|
18545
|
+
class Empty2 extends Proto12 {
|
|
18546
|
+
_tag = "Empty";
|
|
18547
|
+
toJSON() {
|
|
18548
|
+
return {
|
|
18549
|
+
_id: "effect/HttpBody",
|
|
18550
|
+
_tag: "Empty"
|
|
18551
|
+
};
|
|
18552
|
+
}
|
|
18553
|
+
}
|
|
18554
|
+
var empty7 = /* @__PURE__ */ new Empty2;
|
|
18555
|
+
class Uint8Array3 extends Proto12 {
|
|
18556
|
+
_tag = "Uint8Array";
|
|
18557
|
+
contentType;
|
|
18558
|
+
contentLength;
|
|
18559
|
+
text;
|
|
18560
|
+
_body;
|
|
18561
|
+
constructor(body, contentType, contentLength, text) {
|
|
18562
|
+
super();
|
|
18563
|
+
this._body = body;
|
|
18564
|
+
this.text = text;
|
|
18565
|
+
this.contentType = contentType;
|
|
18566
|
+
this.contentLength = contentLength;
|
|
18567
|
+
}
|
|
18568
|
+
get body() {
|
|
18569
|
+
return this._body ??= encodeText(this.text);
|
|
18570
|
+
}
|
|
18571
|
+
toJSON() {
|
|
18572
|
+
const toString = this.contentType.startsWith("text/") || this.contentType.endsWith("json");
|
|
18573
|
+
return {
|
|
18574
|
+
_id: "effect/HttpBody",
|
|
18575
|
+
_tag: "Uint8Array",
|
|
18576
|
+
body: toString ? new TextDecoder().decode(this.body) : `Uint8Array(${this.body.length})`,
|
|
18577
|
+
contentType: this.contentType,
|
|
18578
|
+
contentLength: this.contentLength
|
|
18579
|
+
};
|
|
18580
|
+
}
|
|
18581
|
+
}
|
|
18582
|
+
var encoder2 = /* @__PURE__ */ new TextEncoder;
|
|
18583
|
+
var buffer2 = globalThis.Buffer;
|
|
18584
|
+
var encodeText = buffer2 !== undefined ? (body) => buffer2.from(body, "utf8") : (body) => encoder2.encode(body);
|
|
18585
|
+
var text = (body, contentType) => {
|
|
18586
|
+
if (typeof body !== "string") {
|
|
18587
|
+
body = body === undefined ? "" : String(body);
|
|
18588
|
+
}
|
|
18589
|
+
if (buffer2 !== undefined) {
|
|
18590
|
+
return new Uint8Array3(undefined, contentType ?? "text/plain", buffer2.byteLength(body, "utf8"), body);
|
|
18591
|
+
}
|
|
18592
|
+
const bytes = encoder2.encode(body);
|
|
18593
|
+
return new Uint8Array3(bytes, contentType ?? "text/plain", bytes.length, body);
|
|
18594
|
+
};
|
|
18595
|
+
var json = (body, contentType) => try_3({
|
|
18596
|
+
try: () => text(JSON.stringify(body), contentType ?? "application/json"),
|
|
18597
|
+
catch: (cause) => new HttpBodyError({
|
|
18598
|
+
reason: {
|
|
18599
|
+
_tag: "JsonError"
|
|
18600
|
+
},
|
|
18601
|
+
cause
|
|
18602
|
+
})
|
|
18603
|
+
});
|
|
18604
|
+
|
|
18605
|
+
// node_modules/effect/dist/http/HttpClientError.js
|
|
18606
|
+
var TypeId36 = "~effect/http/HttpClientError";
|
|
18607
|
+
class HttpClientError extends (/* @__PURE__ */ TaggedError2("HttpClientError")) {
|
|
18608
|
+
constructor(props) {
|
|
18609
|
+
if ("cause" in props.reason) {
|
|
18610
|
+
super({
|
|
18611
|
+
...props,
|
|
18612
|
+
cause: props.reason.cause
|
|
18613
|
+
});
|
|
18614
|
+
} else {
|
|
18615
|
+
super(props);
|
|
18616
|
+
}
|
|
18617
|
+
}
|
|
18618
|
+
[TypeId36] = TypeId36;
|
|
18619
|
+
get request() {
|
|
18620
|
+
return this.reason.request;
|
|
18621
|
+
}
|
|
18622
|
+
get response() {
|
|
18623
|
+
return "response" in this.reason ? this.reason.response : undefined;
|
|
18624
|
+
}
|
|
18625
|
+
get message() {
|
|
18626
|
+
return this.reason.message;
|
|
18627
|
+
}
|
|
18628
|
+
}
|
|
18629
|
+
var formatReason = (tag) => tag.endsWith("Error") ? tag.slice(0, -5) : tag;
|
|
18630
|
+
var formatMessage = (reason, description, info) => description ? `${reason}: ${description} (${info})` : `${reason} error (${info})`;
|
|
18631
|
+
var formatMethodAndUrl = (request) => `${request.method} ${redactUrl(request.url)}`;
|
|
18632
|
+
var reasonToJSON = (reason, json) => ({
|
|
18633
|
+
...json,
|
|
18634
|
+
request: {
|
|
18635
|
+
_id: "HttpClientRequest",
|
|
18636
|
+
method: reason.request.method,
|
|
18637
|
+
url: redactUrl(reason.request.url)
|
|
18638
|
+
},
|
|
18639
|
+
..."response" in reason ? {
|
|
18640
|
+
response: {
|
|
18641
|
+
_id: "HttpClientResponse",
|
|
18642
|
+
status: reason.response.status
|
|
18643
|
+
}
|
|
18644
|
+
} : undefined
|
|
18645
|
+
});
|
|
18646
|
+
|
|
18647
|
+
class TransportError extends (/* @__PURE__ */ TaggedError2("TransportError")) {
|
|
18648
|
+
get methodAndUrl() {
|
|
18649
|
+
return formatMethodAndUrl(this.request);
|
|
18650
|
+
}
|
|
18651
|
+
get message() {
|
|
18652
|
+
return formatMessage(formatReason(this._tag), this.description, this.methodAndUrl);
|
|
18653
|
+
}
|
|
18654
|
+
toJSON() {
|
|
18655
|
+
return reasonToJSON(this, super.toJSON());
|
|
18656
|
+
}
|
|
18657
|
+
}
|
|
18658
|
+
|
|
18659
|
+
class EncodeError extends (/* @__PURE__ */ TaggedError2("EncodeError")) {
|
|
18660
|
+
get methodAndUrl() {
|
|
18661
|
+
return formatMethodAndUrl(this.request);
|
|
18662
|
+
}
|
|
18663
|
+
get message() {
|
|
18664
|
+
return formatMessage(formatReason(this._tag), this.description, this.methodAndUrl);
|
|
18665
|
+
}
|
|
18666
|
+
toJSON() {
|
|
18667
|
+
return reasonToJSON(this, super.toJSON());
|
|
18668
|
+
}
|
|
18669
|
+
}
|
|
18670
|
+
|
|
18671
|
+
class InvalidUrlError extends (/* @__PURE__ */ TaggedError2("InvalidUrlError")) {
|
|
18672
|
+
get methodAndUrl() {
|
|
18673
|
+
return formatMethodAndUrl(this.request);
|
|
18674
|
+
}
|
|
18675
|
+
get message() {
|
|
18676
|
+
return formatMessage(formatReason(this._tag), this.description, this.methodAndUrl);
|
|
18677
|
+
}
|
|
18678
|
+
toJSON() {
|
|
18679
|
+
return reasonToJSON(this, super.toJSON());
|
|
18680
|
+
}
|
|
18681
|
+
}
|
|
18682
|
+
|
|
18683
|
+
class StatusCodeError extends (/* @__PURE__ */ TaggedError2("StatusCodeError")) {
|
|
18684
|
+
get methodAndUrl() {
|
|
18685
|
+
return formatMethodAndUrl(this.request);
|
|
18686
|
+
}
|
|
18687
|
+
get message() {
|
|
18688
|
+
const info = `${this.response.status} ${this.methodAndUrl}`;
|
|
18689
|
+
return formatMessage(formatReason(this._tag), this.description, info);
|
|
18690
|
+
}
|
|
18691
|
+
toJSON() {
|
|
18692
|
+
return reasonToJSON(this, super.toJSON());
|
|
18693
|
+
}
|
|
18694
|
+
}
|
|
18695
|
+
|
|
18696
|
+
class DecodeError extends (/* @__PURE__ */ TaggedError2("DecodeError")) {
|
|
18697
|
+
get methodAndUrl() {
|
|
18698
|
+
return formatMethodAndUrl(this.request);
|
|
18699
|
+
}
|
|
18700
|
+
get message() {
|
|
18701
|
+
const info = `${this.response.status} ${this.methodAndUrl}`;
|
|
18702
|
+
return formatMessage(formatReason(this._tag), this.description, info);
|
|
18703
|
+
}
|
|
18704
|
+
toJSON() {
|
|
18705
|
+
return reasonToJSON(this, super.toJSON());
|
|
18706
|
+
}
|
|
18707
|
+
}
|
|
18708
|
+
|
|
18709
|
+
class EmptyBodyError extends (/* @__PURE__ */ TaggedError2("EmptyBodyError")) {
|
|
18710
|
+
get methodAndUrl() {
|
|
18711
|
+
return formatMethodAndUrl(this.request);
|
|
18712
|
+
}
|
|
18713
|
+
get message() {
|
|
18714
|
+
const info = `${this.response.status} ${this.methodAndUrl}`;
|
|
18715
|
+
return formatMessage(formatReason(this._tag), this.description, info);
|
|
18716
|
+
}
|
|
18717
|
+
toJSON() {
|
|
18718
|
+
return reasonToJSON(this, super.toJSON());
|
|
18719
|
+
}
|
|
18720
|
+
}
|
|
18721
|
+
|
|
18722
|
+
// node_modules/effect/dist/http/HttpMethod.js
|
|
18723
|
+
var allShort = [["GET", "get"], ["POST", "post"], ["PUT", "put"], ["DELETE", "del"], ["PATCH", "patch"], ["HEAD", "head"], ["OPTIONS", "options"], ["TRACE", "trace"], ["QUERY", "query"]];
|
|
18724
|
+
|
|
18725
|
+
// node_modules/effect/dist/http/internal/httpBody.js
|
|
18726
|
+
var updateHeaders = (headers, body) => {
|
|
18727
|
+
if (body._tag === "Empty" || body._tag === "FormData") {
|
|
18728
|
+
return remove3(remove3(headers, "content-type"), "content-length");
|
|
18729
|
+
}
|
|
18730
|
+
headers = body.contentType === undefined ? remove3(headers, "content-type") : set2(headers, "content-type", body.contentType);
|
|
18731
|
+
return updateContentLength(headers, body);
|
|
18732
|
+
};
|
|
18733
|
+
var updateContentLength = (headers, body) => {
|
|
18734
|
+
const contentLength = body._tag === "Empty" || body._tag === "FormData" ? undefined : body.contentLength;
|
|
18735
|
+
return contentLength === undefined ? remove3(headers, "content-length") : set2(headers, "content-length", contentLength.toString());
|
|
18736
|
+
};
|
|
18737
|
+
|
|
18738
|
+
// node_modules/effect/dist/http/Url.js
|
|
18739
|
+
class UrlError extends (/* @__PURE__ */ TaggedError2("UrlError")) {
|
|
18740
|
+
}
|
|
18741
|
+
var make31 = (url, params, hash) => try_({
|
|
18742
|
+
try: () => {
|
|
18743
|
+
const urlInstance = new URL(url, baseUrl());
|
|
18744
|
+
for (let i = 0;i < params.params.length; i++) {
|
|
18745
|
+
const [key, value] = params.params[i];
|
|
18746
|
+
if (value !== undefined) {
|
|
18747
|
+
urlInstance.searchParams.append(key, unwrap6(value));
|
|
18748
|
+
}
|
|
18749
|
+
}
|
|
18750
|
+
if (hash !== undefined) {
|
|
18751
|
+
urlInstance.hash = hash;
|
|
18752
|
+
}
|
|
18753
|
+
return urlInstance;
|
|
18754
|
+
},
|
|
18755
|
+
catch: (cause) => new UrlError({
|
|
18756
|
+
cause
|
|
18757
|
+
})
|
|
18758
|
+
});
|
|
18759
|
+
var baseUrl = () => {
|
|
18760
|
+
if ("location" in globalThis && globalThis.location !== undefined && globalThis.location.origin !== undefined && globalThis.location.pathname !== undefined) {
|
|
18761
|
+
const base = location.origin + location.pathname;
|
|
18762
|
+
try {
|
|
18763
|
+
return new URL(base).href;
|
|
18764
|
+
} catch {
|
|
18765
|
+
return;
|
|
18766
|
+
}
|
|
18767
|
+
}
|
|
18768
|
+
return;
|
|
18769
|
+
};
|
|
18770
|
+
|
|
18771
|
+
// node_modules/effect/dist/http/HttpClientRequest.js
|
|
18772
|
+
var TypeId37 = "~effect/http/HttpClientRequest";
|
|
18773
|
+
var Proto13 = {
|
|
18774
|
+
[TypeId37]: TypeId37,
|
|
18775
|
+
...BaseProto,
|
|
18776
|
+
toJSON() {
|
|
18777
|
+
return {
|
|
18778
|
+
_id: "HttpClientRequest",
|
|
18779
|
+
method: this.method,
|
|
18780
|
+
url: redactUrl(this.url),
|
|
18781
|
+
urlParams: this.urlParams,
|
|
18782
|
+
hash: this.hash,
|
|
18783
|
+
headers: redact(this.headers),
|
|
18784
|
+
body: this.body.toJSON()
|
|
18785
|
+
};
|
|
18786
|
+
},
|
|
18787
|
+
pipe() {
|
|
18788
|
+
return pipeArguments(this, arguments);
|
|
18789
|
+
}
|
|
18790
|
+
};
|
|
18791
|
+
function makeWith(method, url, urlParams, hash, headers, body) {
|
|
18792
|
+
const self = Object.create(Proto13);
|
|
18793
|
+
self.method = method;
|
|
18794
|
+
self.url = url;
|
|
18795
|
+
self.urlParams = urlParams;
|
|
18796
|
+
self.hash = hash;
|
|
18797
|
+
self.headers = headers;
|
|
18798
|
+
self.body = body;
|
|
18799
|
+
return self;
|
|
18800
|
+
}
|
|
18801
|
+
var empty8 = /* @__PURE__ */ makeWith("GET", "", empty6, /* @__PURE__ */ none2(), empty5, empty7);
|
|
18802
|
+
var make32 = (method) => (url, options) => modify(empty8, {
|
|
18803
|
+
method,
|
|
18804
|
+
url,
|
|
18805
|
+
...options ?? undefined
|
|
18806
|
+
});
|
|
18807
|
+
var post = /* @__PURE__ */ make32("POST");
|
|
18808
|
+
var modify = /* @__PURE__ */ dual(2, (self, options) => {
|
|
18809
|
+
let result = self;
|
|
18810
|
+
if (options.method) {
|
|
18811
|
+
result = setMethod(result, options.method);
|
|
18812
|
+
}
|
|
18813
|
+
if (options.url) {
|
|
18814
|
+
result = setUrl(result, options.url);
|
|
18815
|
+
}
|
|
18816
|
+
if (options.headers) {
|
|
18817
|
+
result = setHeaders(result, options.headers);
|
|
18818
|
+
}
|
|
18819
|
+
if (options.urlParams) {
|
|
18820
|
+
result = setUrlParams(result, options.urlParams);
|
|
18821
|
+
}
|
|
18822
|
+
if (options.hash) {
|
|
18823
|
+
result = setHash(result, options.hash);
|
|
18824
|
+
}
|
|
18825
|
+
if (options.body) {
|
|
18826
|
+
result = setBody(result, options.body);
|
|
18827
|
+
}
|
|
18828
|
+
if (options.accept) {
|
|
18829
|
+
result = accept(result, options.accept);
|
|
18830
|
+
}
|
|
18831
|
+
if (options.acceptJson) {
|
|
18832
|
+
result = acceptJson(result);
|
|
18833
|
+
}
|
|
18834
|
+
return result;
|
|
18835
|
+
});
|
|
18836
|
+
var setMethod = /* @__PURE__ */ dual(2, (self, method) => makeWith(method, self.url, self.urlParams, self.hash, self.headers, self.body));
|
|
18837
|
+
var setHeader = /* @__PURE__ */ dual(3, (self, key, value) => makeWith(self.method, self.url, self.urlParams, self.hash, set2(self.headers, key, value), self.body));
|
|
18838
|
+
var setHeaders = /* @__PURE__ */ dual(2, (self, input) => makeWith(self.method, self.url, self.urlParams, self.hash, setAll(self.headers, input), self.body));
|
|
18839
|
+
var accept = /* @__PURE__ */ dual(2, (self, mediaType) => setHeader(self, "Accept", mediaType));
|
|
18840
|
+
var acceptJson = /* @__PURE__ */ accept("application/json");
|
|
18841
|
+
var setUrl = /* @__PURE__ */ dual(2, (self, url) => {
|
|
18842
|
+
if (typeof url === "string") {
|
|
18843
|
+
return makeWith(self.method, url, self.urlParams, self.hash, self.headers, self.body);
|
|
18844
|
+
}
|
|
18845
|
+
const clone = new URL(url.toString());
|
|
18846
|
+
const urlParams = fromInput2(clone.searchParams);
|
|
18847
|
+
const hash = fromNullishOr(clone.hash === "" ? undefined : clone.hash.slice(1));
|
|
18848
|
+
clone.search = "";
|
|
18849
|
+
clone.hash = "";
|
|
18850
|
+
return makeWith(self.method, clone.toString(), urlParams, hash, self.headers, self.body);
|
|
18851
|
+
});
|
|
18852
|
+
var setUrlParams = /* @__PURE__ */ dual(2, (self, input) => makeWith(self.method, self.url, setAll2(self.urlParams, input), self.hash, self.headers, self.body));
|
|
18853
|
+
var setHash = /* @__PURE__ */ dual(2, (self, hash) => makeWith(self.method, self.url, self.urlParams, some2(hash), self.headers, self.body));
|
|
18854
|
+
var setBody = /* @__PURE__ */ dual(2, (self, body) => {
|
|
18855
|
+
return makeWith(self.method, self.url, self.urlParams, self.hash, updateHeaders(self.headers, body), body);
|
|
18856
|
+
});
|
|
18857
|
+
var bodyJson = /* @__PURE__ */ dual(2, (self, body) => map6(json(body), (body) => setBody(self, body)));
|
|
18858
|
+
function toUrl(self) {
|
|
18859
|
+
const r = make31(self.url, self.urlParams, getOrUndefined(self.hash));
|
|
18860
|
+
if (isSuccess2(r)) {
|
|
18861
|
+
return some2(r.success);
|
|
18862
|
+
}
|
|
18863
|
+
return none2();
|
|
18864
|
+
}
|
|
18865
|
+
|
|
18866
|
+
// node_modules/effect/dist/http/HttpIncomingMessage.js
|
|
18867
|
+
var TypeId38 = "~effect/http/HttpIncomingMessage";
|
|
18868
|
+
var inspect = (self, that) => {
|
|
18869
|
+
return {
|
|
18870
|
+
...that,
|
|
18871
|
+
headers: redact(self.headers),
|
|
18872
|
+
remoteAddress: self.remoteAddress
|
|
18873
|
+
};
|
|
18874
|
+
};
|
|
18875
|
+
|
|
18876
|
+
// node_modules/effect/dist/http/internal/webResponse.js
|
|
18877
|
+
var WebSourceSymbol = "~effect/http/HttpClientResponse/WebSource";
|
|
18878
|
+
var getWebSource = (self) => self[WebSourceSymbol]?.();
|
|
18879
|
+
|
|
18880
|
+
// node_modules/effect/dist/http/HttpClientResponse.js
|
|
18881
|
+
var TypeId39 = "~effect/http/HttpClientResponse";
|
|
18882
|
+
var fromWeb = (request, source) => new WebHttpClientResponse(request, source);
|
|
18883
|
+
var filterStatusOk = (self) => self.status >= 200 && self.status < 300 ? succeed6(self) : fail7(new HttpClientError({
|
|
18884
|
+
reason: new StatusCodeError({
|
|
18885
|
+
response: self,
|
|
18886
|
+
request: self.request,
|
|
18887
|
+
description: "non 2xx status code"
|
|
18888
|
+
})
|
|
17766
18889
|
}));
|
|
17767
18890
|
|
|
17768
|
-
|
|
17769
|
-
|
|
17770
|
-
|
|
17771
|
-
|
|
17772
|
-
|
|
17773
|
-
|
|
17774
|
-
|
|
17775
|
-
|
|
17776
|
-
|
|
18891
|
+
class WebHttpClientResponse extends Class2 {
|
|
18892
|
+
[TypeId38];
|
|
18893
|
+
[TypeId39];
|
|
18894
|
+
request;
|
|
18895
|
+
source;
|
|
18896
|
+
constructor(request, source) {
|
|
18897
|
+
super();
|
|
18898
|
+
this.request = request;
|
|
18899
|
+
this.source = source;
|
|
18900
|
+
this[TypeId38] = TypeId38;
|
|
18901
|
+
this[TypeId39] = TypeId39;
|
|
18902
|
+
}
|
|
18903
|
+
toJSON() {
|
|
18904
|
+
return inspect(this, {
|
|
18905
|
+
_id: "HttpClientResponse",
|
|
18906
|
+
request: this.request.toJSON(),
|
|
18907
|
+
status: this.status
|
|
18908
|
+
});
|
|
18909
|
+
}
|
|
18910
|
+
get status() {
|
|
18911
|
+
return this.source.status;
|
|
18912
|
+
}
|
|
18913
|
+
get url() {
|
|
18914
|
+
if (this.source.url)
|
|
18915
|
+
return this.source.url.split("#")[0];
|
|
18916
|
+
const url = toUrl(this.request);
|
|
18917
|
+
if (isNone2(url))
|
|
18918
|
+
return "";
|
|
18919
|
+
url.value.hash = "";
|
|
18920
|
+
return url.value.href;
|
|
18921
|
+
}
|
|
18922
|
+
get headers() {
|
|
18923
|
+
return fromInput(this.source.headers);
|
|
18924
|
+
}
|
|
18925
|
+
cachedCookies;
|
|
18926
|
+
get cookies() {
|
|
18927
|
+
if (this.cachedCookies) {
|
|
18928
|
+
return this.cachedCookies;
|
|
18929
|
+
}
|
|
18930
|
+
return this.cachedCookies = fromSetCookie(this.source.headers.getSetCookie?.() ?? []);
|
|
18931
|
+
}
|
|
18932
|
+
get remoteAddress() {
|
|
18933
|
+
return none2();
|
|
18934
|
+
}
|
|
18935
|
+
[WebSourceSymbol]() {
|
|
18936
|
+
return this.source;
|
|
18937
|
+
}
|
|
18938
|
+
get stream() {
|
|
18939
|
+
return this.source.body ? fromReadableStream2({
|
|
18940
|
+
evaluate: () => this.source.body,
|
|
18941
|
+
onError: (cause) => new HttpClientError({
|
|
18942
|
+
reason: new DecodeError({
|
|
18943
|
+
request: this.request,
|
|
18944
|
+
response: this,
|
|
18945
|
+
cause
|
|
18946
|
+
})
|
|
18947
|
+
})
|
|
18948
|
+
}) : fail9(new HttpClientError({
|
|
18949
|
+
reason: new EmptyBodyError({
|
|
18950
|
+
request: this.request,
|
|
18951
|
+
response: this,
|
|
18952
|
+
description: "can not create stream from empty body"
|
|
18953
|
+
})
|
|
18954
|
+
}));
|
|
18955
|
+
}
|
|
18956
|
+
get json() {
|
|
18957
|
+
return flatMap3(this.text, (text) => try_3({
|
|
18958
|
+
try: () => text === "" ? null : JSON.parse(text),
|
|
18959
|
+
catch: (cause) => new HttpClientError({
|
|
18960
|
+
reason: new DecodeError({
|
|
18961
|
+
request: this.request,
|
|
18962
|
+
response: this,
|
|
18963
|
+
cause
|
|
18964
|
+
})
|
|
18965
|
+
})
|
|
18966
|
+
}));
|
|
18967
|
+
}
|
|
18968
|
+
textBody;
|
|
18969
|
+
get text() {
|
|
18970
|
+
return this.textBody ??= map6(this.arrayBuffer, (_) => new TextDecoder().decode(_));
|
|
18971
|
+
}
|
|
18972
|
+
get urlParamsBody() {
|
|
18973
|
+
return flatMap3(this.arrayBuffer, (bytes) => try_3({
|
|
18974
|
+
try: () => fromInput2(fromBody(bytes)),
|
|
18975
|
+
catch: (cause) => new HttpClientError({
|
|
18976
|
+
reason: new DecodeError({
|
|
18977
|
+
request: this.request,
|
|
18978
|
+
response: this,
|
|
18979
|
+
cause
|
|
18980
|
+
})
|
|
18981
|
+
})
|
|
18982
|
+
}));
|
|
18983
|
+
}
|
|
18984
|
+
formDataBody;
|
|
18985
|
+
get formData() {
|
|
18986
|
+
return this.formDataBody ??= tryPromise2({
|
|
18987
|
+
try: () => this.source.formData(),
|
|
18988
|
+
catch: (cause) => new HttpClientError({
|
|
18989
|
+
reason: new DecodeError({
|
|
18990
|
+
request: this.request,
|
|
18991
|
+
response: this,
|
|
18992
|
+
cause
|
|
18993
|
+
})
|
|
18994
|
+
})
|
|
18995
|
+
}).pipe(cached2, runSync2);
|
|
18996
|
+
}
|
|
18997
|
+
arrayBufferBody;
|
|
18998
|
+
get arrayBuffer() {
|
|
18999
|
+
if (this.arrayBufferBody) {
|
|
19000
|
+
return this.arrayBufferBody;
|
|
19001
|
+
}
|
|
19002
|
+
this.arrayBufferBody = tryPromise2({
|
|
19003
|
+
try: () => this.source.arrayBuffer(),
|
|
19004
|
+
catch: (cause) => new HttpClientError({
|
|
19005
|
+
reason: new DecodeError({
|
|
19006
|
+
request: this.request,
|
|
19007
|
+
response: this,
|
|
19008
|
+
cause
|
|
19009
|
+
})
|
|
19010
|
+
})
|
|
19011
|
+
}).pipe(cached2, runSync2);
|
|
19012
|
+
return this.arrayBufferBody;
|
|
19013
|
+
}
|
|
19014
|
+
get upgrade() {
|
|
19015
|
+
return fail7(new HttpClientError({
|
|
19016
|
+
reason: new StatusCodeError({
|
|
19017
|
+
request: this.request,
|
|
19018
|
+
response: this,
|
|
19019
|
+
description: "fetch cannot hand over the connection of an HTTP upgrade"
|
|
19020
|
+
})
|
|
19021
|
+
}));
|
|
19022
|
+
}
|
|
19023
|
+
pipe() {
|
|
19024
|
+
return pipeArguments(this, arguments);
|
|
19025
|
+
}
|
|
19026
|
+
}
|
|
19027
|
+
|
|
19028
|
+
// node_modules/effect/dist/http/HttpTraceContext.js
|
|
19029
|
+
var toHeaders = (span) => fromRecordUnsafe({
|
|
19030
|
+
b3: `${span.traceId}-${span.spanId}-${span.sampled ? "1" : "0"}${match(span.parent, {
|
|
19031
|
+
onNone: () => "",
|
|
19032
|
+
onSome: (parent) => `-${parent.spanId}`
|
|
19033
|
+
})}`,
|
|
19034
|
+
traceparent: `00-${span.traceId.padStart(32, "0")}-${span.spanId}-${span.sampled ? "01" : "00"}`
|
|
17777
19035
|
});
|
|
17778
|
-
var decrypt = (file) => dotenvx(["decrypt", "--stdout", "--no-armor", "--no-native", "-f", file], true);
|
|
17779
19036
|
|
|
19037
|
+
// node_modules/effect/dist/http/internal/tracing.js
|
|
19038
|
+
var defaultPorts = {
|
|
19039
|
+
"http:": 80,
|
|
19040
|
+
"https:": 443,
|
|
19041
|
+
"ws:": 80,
|
|
19042
|
+
"wss:": 443
|
|
19043
|
+
};
|
|
19044
|
+
var addUrlAttributes = (span, url, redactedNames) => {
|
|
19045
|
+
const query = redactUrl(url.search, redactedNames).slice(1);
|
|
19046
|
+
span.attribute("url.full", redactUrl(url.href, redactedNames));
|
|
19047
|
+
span.attribute("url.path", url.pathname);
|
|
19048
|
+
if (query !== "") {
|
|
19049
|
+
span.attribute("url.query", query);
|
|
19050
|
+
}
|
|
19051
|
+
span.attribute("url.scheme", url.protocol.slice(0, -1));
|
|
19052
|
+
if (url.hostname !== "") {
|
|
19053
|
+
span.attribute("server.address", url.hostname.startsWith("[") ? url.hostname.slice(1, -1) : url.hostname);
|
|
19054
|
+
const port = url.port === "" ? defaultPorts[url.protocol] : Number(url.port);
|
|
19055
|
+
if (port !== undefined) {
|
|
19056
|
+
span.attribute("server.port", port);
|
|
19057
|
+
}
|
|
19058
|
+
}
|
|
19059
|
+
};
|
|
19060
|
+
var redactedNames = (urlParams, redactedNames) => {
|
|
19061
|
+
const keys = urlParams.params.filter(([, value]) => typeof value !== "string").map(([key]) => key);
|
|
19062
|
+
return keys.length === 0 ? redactedNames : [...redactedNames, ...new URLSearchParams(keys.map((key) => [key, ""])).keys()];
|
|
19063
|
+
};
|
|
19064
|
+
var addHeaderAttributes = (span, phase, headers, filter, redactedNames) => {
|
|
19065
|
+
for (const name in headers) {
|
|
19066
|
+
if (!filter(name, phase))
|
|
19067
|
+
continue;
|
|
19068
|
+
span.attribute(`http.${phase}.header.${name}`, isRedactedName(name, redactedNames) ? "<redacted>" : headers[name]);
|
|
19069
|
+
}
|
|
19070
|
+
};
|
|
19071
|
+
|
|
19072
|
+
// node_modules/effect/dist/http/HttpClient.js
|
|
19073
|
+
var TypeId40 = "~effect/http/HttpClient";
|
|
19074
|
+
var HttpClient = /* @__PURE__ */ Service("effect/HttpClient");
|
|
19075
|
+
var transformResponse = /* @__PURE__ */ dual(2, (self, f) => makeWith2((request) => f(self.postprocess(request)), self.preprocess));
|
|
19076
|
+
var filterStatusOk2 = /* @__PURE__ */ transformResponse(/* @__PURE__ */ flatMap3(filterStatusOk));
|
|
19077
|
+
var makeWith2 = (postprocess, preprocess) => {
|
|
19078
|
+
const self = Object.create(Proto14);
|
|
19079
|
+
self.preprocess = preprocess;
|
|
19080
|
+
self.postprocess = postprocess;
|
|
19081
|
+
self.execute = function(request) {
|
|
19082
|
+
return postprocess(preprocess(request));
|
|
19083
|
+
};
|
|
19084
|
+
return self;
|
|
19085
|
+
};
|
|
19086
|
+
var Proto14 = {
|
|
19087
|
+
[TypeId40]: TypeId40,
|
|
19088
|
+
pipe() {
|
|
19089
|
+
return pipeArguments(this, arguments);
|
|
19090
|
+
},
|
|
19091
|
+
...BaseProto,
|
|
19092
|
+
toJSON() {
|
|
19093
|
+
return {
|
|
19094
|
+
_id: "effect/HttpClient"
|
|
19095
|
+
};
|
|
19096
|
+
},
|
|
19097
|
+
.../* @__PURE__ */ Object.fromEntries(/* @__PURE__ */ allShort.map(([fullMethod, method]) => [method, function(url, options) {
|
|
19098
|
+
return this.execute(make32(fullMethod)(url, options));
|
|
19099
|
+
}]))
|
|
19100
|
+
};
|
|
19101
|
+
var make33 = (f) => makeWith2((effect) => flatMap3(effect, (request) => withFiber2((fiber) => {
|
|
19102
|
+
const scopedController = scopedRequests.get(request);
|
|
19103
|
+
const controller = scopedController ?? new AbortController;
|
|
19104
|
+
const urlResult = make31(request.url, request.urlParams, getOrUndefined(request.hash));
|
|
19105
|
+
if (isFailure2(urlResult)) {
|
|
19106
|
+
return fail7(new HttpClientError({
|
|
19107
|
+
reason: new InvalidUrlError({
|
|
19108
|
+
request,
|
|
19109
|
+
cause: urlResult.failure
|
|
19110
|
+
})
|
|
19111
|
+
}));
|
|
19112
|
+
}
|
|
19113
|
+
const url = urlResult.success;
|
|
19114
|
+
const tracerDisabled = fiber.getRef(DisablePropagation) || fiber.getRef(TracerDisabledWhen)(request);
|
|
19115
|
+
if (tracerDisabled) {
|
|
19116
|
+
const effect = f(request, url, controller.signal, fiber);
|
|
19117
|
+
if (scopedController)
|
|
19118
|
+
return map6(effect, (response) => trackResponse(response, controller, true));
|
|
19119
|
+
return uninterruptibleMask2((restore) => matchCauseEffect2(restore(effect), {
|
|
19120
|
+
onSuccess(response) {
|
|
19121
|
+
return succeed6(trackResponse(response, controller, false));
|
|
19122
|
+
},
|
|
19123
|
+
onFailure(cause) {
|
|
19124
|
+
if (hasInterrupts2(cause)) {
|
|
19125
|
+
controller.abort();
|
|
19126
|
+
}
|
|
19127
|
+
return failCause3(cause);
|
|
19128
|
+
}
|
|
19129
|
+
}));
|
|
19130
|
+
}
|
|
19131
|
+
return useSpan2(fiber.getRef(SpanNameGenerator)(request), {
|
|
19132
|
+
kind: "client"
|
|
19133
|
+
}, (span) => {
|
|
19134
|
+
span.attribute("http.request.method", request.method);
|
|
19135
|
+
const redactedHeaderNames = fiber.getRef(CurrentRedactedNames);
|
|
19136
|
+
addUrlAttributes(span, url, redactedNames(request.urlParams, fiber.getRef(CurrentRedactedNames2)));
|
|
19137
|
+
const headerFilter = fiber.getRef(TracerHeaderFilter);
|
|
19138
|
+
addHeaderAttributes(span, "request", request.headers, headerFilter, redactedHeaderNames);
|
|
19139
|
+
request = fiber.getRef(TracerPropagationEnabled) ? setHeaders(request, toHeaders(span)) : request;
|
|
19140
|
+
return uninterruptibleMask2((restore) => restore(f(request, url, controller.signal, fiber)).pipe(withParentSpan2(span, {
|
|
19141
|
+
captureStackTrace: false
|
|
19142
|
+
}), matchCauseEffect2({
|
|
19143
|
+
onSuccess: (response) => {
|
|
19144
|
+
span.attribute("http.response.status_code", response.status);
|
|
19145
|
+
addHeaderAttributes(span, "response", response.headers, headerFilter, redactedHeaderNames);
|
|
19146
|
+
if (response.status >= 400 && response.status < 600) {
|
|
19147
|
+
span.attribute("error.type", String(response.status));
|
|
19148
|
+
endSpanWithStatusError(fiber, span, request, response);
|
|
19149
|
+
}
|
|
19150
|
+
return succeed6(trackResponse(response, controller, scopedController !== undefined));
|
|
19151
|
+
},
|
|
19152
|
+
onFailure(cause) {
|
|
19153
|
+
if (!scopedController && hasInterrupts2(cause)) {
|
|
19154
|
+
controller.abort();
|
|
19155
|
+
}
|
|
19156
|
+
return failCause3(cause);
|
|
19157
|
+
}
|
|
19158
|
+
})));
|
|
19159
|
+
});
|
|
19160
|
+
})), succeed6);
|
|
19161
|
+
var endSpanWithStatusError = (fiber, span, request, response) => {
|
|
19162
|
+
const stackTraceLimit = getStackTraceLimit();
|
|
19163
|
+
setStackTraceLimit(0);
|
|
19164
|
+
let exit;
|
|
19165
|
+
try {
|
|
19166
|
+
exit = fail5(new HttpClientError({
|
|
19167
|
+
reason: new StatusCodeError({
|
|
19168
|
+
request,
|
|
19169
|
+
response
|
|
19170
|
+
})
|
|
19171
|
+
}));
|
|
19172
|
+
} finally {
|
|
19173
|
+
setStackTraceLimit(stackTraceLimit);
|
|
19174
|
+
}
|
|
19175
|
+
span.end(fiber.getRef(TracerTimingEnabled2) ? fiber.getRef(Clock).currentTimeNanosUnsafe() : BigInt(0), exit);
|
|
19176
|
+
};
|
|
19177
|
+
var TracerDisabledWhen = /* @__PURE__ */ Reference("effect/http/HttpClient/TracerDisabledWhen", {
|
|
19178
|
+
defaultValue: () => constFalse
|
|
19179
|
+
});
|
|
19180
|
+
var TracerHeaderFilter = /* @__PURE__ */ Reference("effect/http/HttpClient/TracerHeaderFilter", {
|
|
19181
|
+
defaultValue: () => constFalse
|
|
19182
|
+
});
|
|
19183
|
+
var TracerPropagationEnabled = /* @__PURE__ */ Reference("effect/http/HttpClient/TracerPropagationEnabled", {
|
|
19184
|
+
defaultValue: constTrue
|
|
19185
|
+
});
|
|
19186
|
+
var SpanNameGenerator = /* @__PURE__ */ Reference("effect/http/HttpClient/SpanNameGenerator", {
|
|
19187
|
+
defaultValue: () => (request) => request.method
|
|
19188
|
+
});
|
|
19189
|
+
var layerMergedContext = (effect2) => effect(HttpClient)(contextWith2((context) => map6(effect2, (client) => transformResponse(client, updateContext2((input) => merge(context, input))))));
|
|
19190
|
+
var responseRegistry = /* @__PURE__ */ (() => {
|
|
19191
|
+
if ("FinalizationRegistry" in globalThis && globalThis.FinalizationRegistry) {
|
|
19192
|
+
const registry = /* @__PURE__ */ new FinalizationRegistry((controller) => {
|
|
19193
|
+
try {
|
|
19194
|
+
controller.abort();
|
|
19195
|
+
} catch {}
|
|
19196
|
+
});
|
|
19197
|
+
return {
|
|
19198
|
+
register(response, controller) {
|
|
19199
|
+
registry.register(response, controller, response);
|
|
19200
|
+
},
|
|
19201
|
+
unregister(response) {
|
|
19202
|
+
registry.unregister(response);
|
|
19203
|
+
}
|
|
19204
|
+
};
|
|
19205
|
+
}
|
|
19206
|
+
const timers = /* @__PURE__ */ new WeakMap;
|
|
19207
|
+
return {
|
|
19208
|
+
register(response, controller) {
|
|
19209
|
+
timers.set(response, setTimeout(() => controller.abort(), 5000));
|
|
19210
|
+
},
|
|
19211
|
+
unregister(response) {
|
|
19212
|
+
const timer = timers.get(response);
|
|
19213
|
+
if (timer === undefined)
|
|
19214
|
+
return;
|
|
19215
|
+
clearTimeout(timer);
|
|
19216
|
+
timers.delete(response);
|
|
19217
|
+
}
|
|
19218
|
+
};
|
|
19219
|
+
})();
|
|
19220
|
+
var scopedRequests = /* @__PURE__ */ new WeakMap;
|
|
19221
|
+
var responseControllers = /* @__PURE__ */ new WeakMap;
|
|
19222
|
+
var trackResponse = (response, controller, scoped) => {
|
|
19223
|
+
if (!scoped) {
|
|
19224
|
+
responseRegistry.register(response, controller);
|
|
19225
|
+
response = new InterruptibleResponse(response, controller);
|
|
19226
|
+
}
|
|
19227
|
+
responseControllers.set(response, controller);
|
|
19228
|
+
return response;
|
|
19229
|
+
};
|
|
19230
|
+
|
|
19231
|
+
class InterruptibleResponse {
|
|
19232
|
+
original;
|
|
19233
|
+
controller;
|
|
19234
|
+
constructor(original, controller) {
|
|
19235
|
+
this.original = original;
|
|
19236
|
+
this.controller = controller;
|
|
19237
|
+
}
|
|
19238
|
+
[TypeId39] = TypeId39;
|
|
19239
|
+
[TypeId38] = TypeId38;
|
|
19240
|
+
applyInterrupt(effect) {
|
|
19241
|
+
return suspend2(() => {
|
|
19242
|
+
responseRegistry.unregister(this.original);
|
|
19243
|
+
return onInterrupt2(effect, () => sync2(() => {
|
|
19244
|
+
this.controller.abort();
|
|
19245
|
+
}));
|
|
19246
|
+
});
|
|
19247
|
+
}
|
|
19248
|
+
get request() {
|
|
19249
|
+
return this.original.request;
|
|
19250
|
+
}
|
|
19251
|
+
get url() {
|
|
19252
|
+
return this.original.url;
|
|
19253
|
+
}
|
|
19254
|
+
get status() {
|
|
19255
|
+
return this.original.status;
|
|
19256
|
+
}
|
|
19257
|
+
get headers() {
|
|
19258
|
+
return this.original.headers;
|
|
19259
|
+
}
|
|
19260
|
+
get cookies() {
|
|
19261
|
+
return this.original.cookies;
|
|
19262
|
+
}
|
|
19263
|
+
get remoteAddress() {
|
|
19264
|
+
return this.original.remoteAddress;
|
|
19265
|
+
}
|
|
19266
|
+
get formData() {
|
|
19267
|
+
return this.applyInterrupt(this.original.formData);
|
|
19268
|
+
}
|
|
19269
|
+
get text() {
|
|
19270
|
+
return this.applyInterrupt(this.original.text);
|
|
19271
|
+
}
|
|
19272
|
+
get json() {
|
|
19273
|
+
return this.applyInterrupt(this.original.json);
|
|
19274
|
+
}
|
|
19275
|
+
get urlParamsBody() {
|
|
19276
|
+
return this.applyInterrupt(this.original.urlParamsBody);
|
|
19277
|
+
}
|
|
19278
|
+
get arrayBuffer() {
|
|
19279
|
+
return this.applyInterrupt(this.original.arrayBuffer);
|
|
19280
|
+
}
|
|
19281
|
+
get upgrade() {
|
|
19282
|
+
return this.applyInterrupt(this.original.upgrade);
|
|
19283
|
+
}
|
|
19284
|
+
[WebSourceSymbol]() {
|
|
19285
|
+
const source = getWebSource(this.original);
|
|
19286
|
+
if (source !== undefined)
|
|
19287
|
+
responseRegistry.unregister(this.original);
|
|
19288
|
+
return source;
|
|
19289
|
+
}
|
|
19290
|
+
get stream() {
|
|
19291
|
+
return suspend4(() => {
|
|
19292
|
+
responseRegistry.unregister(this.original);
|
|
19293
|
+
return ensuring4(this.original.stream, sync2(() => {
|
|
19294
|
+
this.controller.abort();
|
|
19295
|
+
}));
|
|
19296
|
+
});
|
|
19297
|
+
}
|
|
19298
|
+
toJSON() {
|
|
19299
|
+
return this.original.toJSON();
|
|
19300
|
+
}
|
|
19301
|
+
[NodeInspectSymbol]() {
|
|
19302
|
+
return this.original[NodeInspectSymbol]();
|
|
19303
|
+
}
|
|
19304
|
+
pipe() {
|
|
19305
|
+
return pipeArguments(this, arguments);
|
|
19306
|
+
}
|
|
19307
|
+
}
|
|
19308
|
+
|
|
19309
|
+
// node_modules/effect/dist/http/FetchHttpClient.js
|
|
19310
|
+
var Fetch = /* @__PURE__ */ Reference("effect/http/FetchHttpClient/Fetch", {
|
|
19311
|
+
defaultValue: () => globalThis.fetch
|
|
19312
|
+
});
|
|
19313
|
+
var StreamBodyFallback = /* @__PURE__ */ Reference("effect/http/FetchHttpClient/StreamBodyFallback", {
|
|
19314
|
+
defaultValue: () => "error"
|
|
19315
|
+
});
|
|
19316
|
+
|
|
19317
|
+
class RequestInit extends (/* @__PURE__ */ Service()("effect/http/FetchHttpClient/RequestInit")) {
|
|
19318
|
+
}
|
|
19319
|
+
var supportsStreamBody;
|
|
19320
|
+
var detectStreamBodySupport = () => {
|
|
19321
|
+
try {
|
|
19322
|
+
let duplexAccessed = false;
|
|
19323
|
+
const body = new ReadableStream;
|
|
19324
|
+
const request = new Request("https://example.com", {
|
|
19325
|
+
method: "POST",
|
|
19326
|
+
body,
|
|
19327
|
+
get duplex() {
|
|
19328
|
+
duplexAccessed = true;
|
|
19329
|
+
return "half";
|
|
19330
|
+
}
|
|
19331
|
+
});
|
|
19332
|
+
return (duplexAccessed || request.body === body) && !request.headers.has("Content-Type");
|
|
19333
|
+
} catch {
|
|
19334
|
+
return false;
|
|
19335
|
+
}
|
|
19336
|
+
};
|
|
19337
|
+
var fetch = /* @__PURE__ */ make33((request, url, signal, fiber) => {
|
|
19338
|
+
if (request.headers.upgrade !== undefined) {
|
|
19339
|
+
return fail7(new HttpClientError({
|
|
19340
|
+
reason: new TransportError({
|
|
19341
|
+
request,
|
|
19342
|
+
description: "fetch cannot send an HTTP upgrade request"
|
|
19343
|
+
})
|
|
19344
|
+
}));
|
|
19345
|
+
}
|
|
19346
|
+
const fetch = fiber.getRef(Fetch);
|
|
19347
|
+
const options = getOrUndefined2(fiber.context, RequestInit) ?? {};
|
|
19348
|
+
let headers = options.headers ? merge4(fromInput(options.headers), request.headers) : request.headers;
|
|
19349
|
+
if (headers["content-length"]) {
|
|
19350
|
+
headers = remove3(headers, "content-length");
|
|
19351
|
+
}
|
|
19352
|
+
let uploadController;
|
|
19353
|
+
const stopUpload = sync2(() => uploadController?.abort());
|
|
19354
|
+
const send = (body) => map6(tryPromise2({
|
|
19355
|
+
try: () => fetch(url, {
|
|
19356
|
+
...options,
|
|
19357
|
+
method: request.method,
|
|
19358
|
+
headers,
|
|
19359
|
+
body,
|
|
19360
|
+
duplex: typeof ReadableStream !== "undefined" && body instanceof ReadableStream ? "half" : undefined,
|
|
19361
|
+
signal: uploadController ? AbortSignal.any([signal, uploadController.signal]) : signal
|
|
19362
|
+
}),
|
|
19363
|
+
catch: (cause) => new HttpClientError({
|
|
19364
|
+
reason: new TransportError({
|
|
19365
|
+
request,
|
|
19366
|
+
cause
|
|
19367
|
+
})
|
|
19368
|
+
})
|
|
19369
|
+
}), (response) => {
|
|
19370
|
+
const original = fromWeb(request, response);
|
|
19371
|
+
if (!uploadController)
|
|
19372
|
+
return original;
|
|
19373
|
+
if (response.body === null)
|
|
19374
|
+
uploadController.abort();
|
|
19375
|
+
return Object.create(original, {
|
|
19376
|
+
...Object.fromEntries(["arrayBuffer", "text", "json", "formData", "urlParamsBody"].map((key) => [key, {
|
|
19377
|
+
get: () => ensuring2(original[key], stopUpload)
|
|
19378
|
+
}])),
|
|
19379
|
+
stream: {
|
|
19380
|
+
get: () => ensuring4(original.stream, stopUpload)
|
|
19381
|
+
}
|
|
19382
|
+
});
|
|
19383
|
+
}).pipe(onError2(() => stopUpload));
|
|
19384
|
+
switch (request.body._tag) {
|
|
19385
|
+
case "Raw":
|
|
19386
|
+
case "Uint8Array":
|
|
19387
|
+
return send(request.body.body);
|
|
19388
|
+
case "FormData":
|
|
19389
|
+
return send(request.body.formData);
|
|
19390
|
+
case "Stream": {
|
|
19391
|
+
supportsStreamBody ??= detectStreamBodySupport();
|
|
19392
|
+
if (supportsStreamBody) {
|
|
19393
|
+
uploadController = new AbortController;
|
|
19394
|
+
const uploadSignal = AbortSignal.any([signal, uploadController.signal]);
|
|
19395
|
+
const stopped = callback2((resume) => {
|
|
19396
|
+
const onAbort = () => resume(interrupt2);
|
|
19397
|
+
if (uploadSignal.aborted) {
|
|
19398
|
+
onAbort();
|
|
19399
|
+
return;
|
|
19400
|
+
}
|
|
19401
|
+
uploadSignal.addEventListener("abort", onAbort, {
|
|
19402
|
+
once: true
|
|
19403
|
+
});
|
|
19404
|
+
return sync2(() => uploadSignal.removeEventListener("abort", onAbort));
|
|
19405
|
+
});
|
|
19406
|
+
return flatMap3(toReadableStreamEffect(interruptWhen2(request.body.stream, stopped)), send);
|
|
19407
|
+
}
|
|
19408
|
+
if (fiber.getRef(StreamBodyFallback) === "error") {
|
|
19409
|
+
return fail7(new HttpClientError({
|
|
19410
|
+
reason: new EncodeError({
|
|
19411
|
+
request,
|
|
19412
|
+
description: "Streaming request bodies are not supported in this runtime"
|
|
19413
|
+
})
|
|
19414
|
+
}));
|
|
19415
|
+
}
|
|
19416
|
+
return mkArrayBuffer(request.body.stream).pipe(mapError2((cause) => new HttpClientError({
|
|
19417
|
+
reason: new EncodeError({
|
|
19418
|
+
request,
|
|
19419
|
+
cause
|
|
19420
|
+
})
|
|
19421
|
+
})), flatMap3(send));
|
|
19422
|
+
}
|
|
19423
|
+
}
|
|
19424
|
+
return send(undefined);
|
|
19425
|
+
});
|
|
19426
|
+
var layer11 = /* @__PURE__ */ layerMergedContext(/* @__PURE__ */ succeed6(fetch));
|
|
17780
19427
|
// src/environment.ts
|
|
17781
19428
|
import { getSync } from "@dotenvx/dotenvx";
|
|
17782
19429
|
var Environment = Literals(["development", "preview", "production", "ci"]);
|
|
@@ -17789,7 +19436,7 @@ var options = {
|
|
|
17789
19436
|
strict: true
|
|
17790
19437
|
};
|
|
17791
19438
|
var read2 = fn2("Environment.read")(function* read(file) {
|
|
17792
|
-
return yield*
|
|
19439
|
+
return yield* try_3({
|
|
17793
19440
|
catch: () => new UserError({
|
|
17794
19441
|
cause: `Cannot load ${file}; check the file and its DOTENV_PRIVATE_KEY.`
|
|
17795
19442
|
}),
|
|
@@ -17826,12 +19473,51 @@ var load = fn2("Environment.load")(function* load() {
|
|
|
17826
19473
|
var exports = fn2("Environment.exports")(function* exports() {
|
|
17827
19474
|
const { values } = yield* load();
|
|
17828
19475
|
const variables = yield* decodeEffect2(ShellEnvironment, { onExcessProperty: "error" })(values).pipe(mapError2(() => new UserError({ cause: "Environment contains an invalid shell variable name." })));
|
|
17829
|
-
const lines = yield* forEach2(toEntries(variables), ([key, value]) => fromResult2(quote(`${key}=${value}`, { format: "posix" })).pipe(
|
|
19476
|
+
const lines = yield* forEach2(toEntries(variables), ([key, value]) => fromResult2(quote(`${key}=${value}`, { format: "posix" })).pipe(map6((assignment) => `export ${assignment}`)));
|
|
17830
19477
|
return join(lines, `
|
|
17831
19478
|
`);
|
|
17832
19479
|
});
|
|
17833
19480
|
|
|
19481
|
+
// src/process.ts
|
|
19482
|
+
var run6 = fn2("Process.run")(function* run(command) {
|
|
19483
|
+
const child = yield* command;
|
|
19484
|
+
const output = yield* child.stdout.pipe(decodeText2(), mkString);
|
|
19485
|
+
const code = yield* child.exitCode;
|
|
19486
|
+
if (code !== 0) {
|
|
19487
|
+
return yield* new UserError({
|
|
19488
|
+
cause: `${command.command} exited with status ${code}.`
|
|
19489
|
+
});
|
|
19490
|
+
}
|
|
19491
|
+
return output;
|
|
19492
|
+
}, scoped2);
|
|
19493
|
+
var convex = (args, env, input) => run6(make18("bunx", ["--no-install", "convex", ...args], {
|
|
19494
|
+
env,
|
|
19495
|
+
extendEnv: true,
|
|
19496
|
+
stderr: "inherit",
|
|
19497
|
+
stdin: input === undefined ? "inherit" : make13(new TextEncoder().encode(input)),
|
|
19498
|
+
stdout: "inherit"
|
|
19499
|
+
}));
|
|
19500
|
+
|
|
17834
19501
|
// src/deploy.ts
|
|
19502
|
+
var convexManagedEnvironmentNames = [
|
|
19503
|
+
"CONVEX_DEPLOY_KEY",
|
|
19504
|
+
"CONVEX_DEPLOYMENT_TOKEN",
|
|
19505
|
+
"CONVEX_DEPLOYMENT",
|
|
19506
|
+
"CONVEX_SELF_HOSTED_URL",
|
|
19507
|
+
"CONVEX_SELF_HOSTED_ADMIN_KEY",
|
|
19508
|
+
"CONVEX_URL",
|
|
19509
|
+
"PUBLIC_CONVEX_URL",
|
|
19510
|
+
"NEXT_PUBLIC_CONVEX_URL",
|
|
19511
|
+
"VITE_CONVEX_URL",
|
|
19512
|
+
"REACT_APP_CONVEX_URL",
|
|
19513
|
+
"EXPO_PUBLIC_CONVEX_URL",
|
|
19514
|
+
"CONVEX_SITE_URL",
|
|
19515
|
+
"PUBLIC_CONVEX_SITE_URL",
|
|
19516
|
+
"NEXT_PUBLIC_CONVEX_SITE_URL",
|
|
19517
|
+
"VITE_CONVEX_SITE_URL",
|
|
19518
|
+
"REACT_APP_CONVEX_SITE_URL",
|
|
19519
|
+
"EXPO_PUBLIC_CONVEX_SITE_URL"
|
|
19520
|
+
];
|
|
17835
19521
|
var deploy = fn2("Deploy.run")(function* deploy(build) {
|
|
17836
19522
|
const environment = yield* load();
|
|
17837
19523
|
const { target, values, file } = environment;
|
|
@@ -17845,7 +19531,8 @@ var deploy = fn2("Deploy.run")(function* deploy(build) {
|
|
|
17845
19531
|
return yield* new UserError({ cause: "Preview deployment requires a branch name." });
|
|
17846
19532
|
}
|
|
17847
19533
|
const prefix = target === "preview" ? "preview:" : "prod:";
|
|
17848
|
-
|
|
19534
|
+
const deployKey = values["CONVEX_DEPLOY_KEY"] ?? "";
|
|
19535
|
+
if (!deployKey.startsWith(prefix)) {
|
|
17849
19536
|
return yield* new UserError({
|
|
17850
19537
|
cause: "Encrypted project file must contain a Convex deploy key matching VERCEL_ENV."
|
|
17851
19538
|
});
|
|
@@ -17854,9 +19541,17 @@ var deploy = fn2("Deploy.run")(function* deploy(build) {
|
|
|
17854
19541
|
if (build) {
|
|
17855
19542
|
const cloud = yield* NonEmptyString2("NEXT_PUBLIC_CONVEX_URL");
|
|
17856
19543
|
const site = yield* NonEmptyString2("NEXT_PUBLIC_CONVEX_SITE_URL");
|
|
17857
|
-
const
|
|
17858
|
-
|
|
17859
|
-
|
|
19544
|
+
const changes = map3(filter(toEntries(values), ([name]) => !contains(name)(convexManagedEnvironmentNames)), ([name, value]) => ({ name, value }));
|
|
19545
|
+
if (changes.length > 0) {
|
|
19546
|
+
yield* gen2(function* syncEnvironmentVariables() {
|
|
19547
|
+
const client = yield* HttpClient;
|
|
19548
|
+
const request = yield* bodyJson(setHeader(post(`${cloud}/api/v1/update_environment_variables`), "Authorization", `Convex ${deployKey}`), { changes });
|
|
19549
|
+
yield* filterStatusOk2(client).execute(request).pipe(asVoid2);
|
|
19550
|
+
}).pipe(provide3(layer11), mapError2(() => new UserError({
|
|
19551
|
+
cause: "Could not synchronize Convex environment variables."
|
|
19552
|
+
})));
|
|
19553
|
+
}
|
|
19554
|
+
return yield* run6(make18("bun", ["run", "build"], {
|
|
17860
19555
|
env: { ...values, NEXT_PUBLIC_CONVEX_SITE_URL: site, NEXT_PUBLIC_CONVEX_URL: cloud },
|
|
17861
19556
|
extendEnv: true,
|
|
17862
19557
|
stderr: "inherit",
|
|
@@ -17873,10 +19568,22 @@ var deploy = fn2("Deploy.run")(function* deploy(build) {
|
|
|
17873
19568
|
], values).pipe(asVoid2);
|
|
17874
19569
|
});
|
|
17875
19570
|
|
|
19571
|
+
// src/dotenv.ts
|
|
19572
|
+
var dotenvx = fn2("Dotenvx.run")(function* dotenvx(args, capture) {
|
|
19573
|
+
const path = yield* Path;
|
|
19574
|
+
const bin = yield* path.fromFileUrl(new URL("src/cli/dotenvx.js", import.meta.resolve("@dotenvx/dotenvx/package.json")));
|
|
19575
|
+
return yield* run6(make18("bun", [bin, ...args], {
|
|
19576
|
+
stderr: capture ? "ignore" : "inherit",
|
|
19577
|
+
stdin: "inherit",
|
|
19578
|
+
stdout: capture ? "pipe" : "inherit"
|
|
19579
|
+
}));
|
|
19580
|
+
});
|
|
19581
|
+
var decrypt = (file) => dotenvx(["decrypt", "--stdout", "--no-armor", "--no-native", "-f", file], true);
|
|
19582
|
+
|
|
17876
19583
|
// src/run.ts
|
|
17877
19584
|
var run7 = fn2("Run.command")(function* run(command, args) {
|
|
17878
19585
|
const { values } = yield* load();
|
|
17879
|
-
const child = yield*
|
|
19586
|
+
const child = yield* make18(command, args, {
|
|
17880
19587
|
env: { ...values, ...process.env },
|
|
17881
19588
|
extendEnv: true,
|
|
17882
19589
|
stderr: "inherit",
|
|
@@ -17939,14 +19646,14 @@ var setup = fn2("Setup.run")(function* setup() {
|
|
|
17939
19646
|
});
|
|
17940
19647
|
|
|
17941
19648
|
// src/index.ts
|
|
17942
|
-
var program =
|
|
17943
|
-
|
|
17944
|
-
|
|
19649
|
+
var program = make30("affect").pipe(withDescription3("Environment and deployment commands for Affect applications."), withSubcommands([
|
|
19650
|
+
make30("env", {}, () => exports().pipe(flatMap3(log))).pipe(withDescription3("Print shell exports for the selected encrypted environment.")),
|
|
19651
|
+
make30("run", {
|
|
17945
19652
|
command: String10("command"),
|
|
17946
19653
|
params: String10("args").pipe(variadic2())
|
|
17947
19654
|
}, ({ command, params }) => run7(command, params)).pipe(withDescription3("Run a command with the selected encrypted environment.")),
|
|
17948
|
-
|
|
17949
|
-
|
|
17950
|
-
|
|
19655
|
+
make30("dotenvx", { args: String10("args").pipe(variadic2()) }, ({ args }) => dotenvx(args, false)).pipe(withDescription3("Run the bundled dotenvx CLI; pass its flags after --.")),
|
|
19656
|
+
make30("setup", {}, setup).pipe(withDescription3("Initialize or retry an anonymous local Convex backend.")),
|
|
19657
|
+
make30("deploy", { build: Boolean6("build").pipe(withDefault5(false)) }, ({ build }) => deploy(build)).pipe(withDescription3("Deploy the selected Vercel preview or production environment."))
|
|
17951
19658
|
]), run5({ version }), provide3(layer10), provideService2(LogToStderr2, true));
|
|
17952
19659
|
runMain2(program);
|