@deslop/portfolio 0.1.1254 → 0.1.1256
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/server.js +770 -289
- package/package.json +2 -2
package/dist/server.js
CHANGED
|
@@ -3151,7 +3151,7 @@ const Prototype = (options) => makePrimitiveProto({
|
|
|
3151
3151
|
* @category constructors
|
|
3152
3152
|
* @since 2.0.0
|
|
3153
3153
|
*/
|
|
3154
|
-
const make$
|
|
3154
|
+
const make$73 = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
|
|
3155
3155
|
const isStrictEquivalent = (x, y) => x === y;
|
|
3156
3156
|
/**
|
|
3157
3157
|
* Creates an equivalence relation that uses strict equality (`===`) to compare values.
|
|
@@ -3261,7 +3261,7 @@ const strictEqual = () => isStrictEquivalent;
|
|
|
3261
3261
|
* @since 4.0.0
|
|
3262
3262
|
*/
|
|
3263
3263
|
function Tuple$1(elements) {
|
|
3264
|
-
return make$
|
|
3264
|
+
return make$73((self, that) => {
|
|
3265
3265
|
if (self.length !== that.length) return false;
|
|
3266
3266
|
for (let i = 0; i < self.length; i++) if (!elements[i](self[i], that[i])) return false;
|
|
3267
3267
|
return true;
|
|
@@ -3271,7 +3271,7 @@ function Tuple$1(elements) {
|
|
|
3271
3271
|
* @since 4.0.0
|
|
3272
3272
|
*/
|
|
3273
3273
|
function Array_(item) {
|
|
3274
|
-
return make$
|
|
3274
|
+
return make$73((self, that) => {
|
|
3275
3275
|
if (self.length !== that.length) return false;
|
|
3276
3276
|
for (let i = 0; i < self.length; i++) if (!item(self[i], that[i])) return false;
|
|
3277
3277
|
return true;
|
|
@@ -3472,7 +3472,7 @@ const getSuccess$1 = (self) => isFailure$2(self) ? none$1 : some$2(self.success)
|
|
|
3472
3472
|
* @category constructors
|
|
3473
3473
|
* @since 2.0.0
|
|
3474
3474
|
*/
|
|
3475
|
-
function make$
|
|
3475
|
+
function make$72(compare) {
|
|
3476
3476
|
return (self, that) => self === that ? 0 : compare(self, that);
|
|
3477
3477
|
}
|
|
3478
3478
|
/**
|
|
@@ -3503,7 +3503,7 @@ function make$71(compare) {
|
|
|
3503
3503
|
* @category instances
|
|
3504
3504
|
* @since 4.0.0
|
|
3505
3505
|
*/
|
|
3506
|
-
const String$10 = /*#__PURE__*/ make$
|
|
3506
|
+
const String$10 = /*#__PURE__*/ make$72((self, that) => self < that ? -1 : 1);
|
|
3507
3507
|
/**
|
|
3508
3508
|
* Order instance for numbers that compares them numerically.
|
|
3509
3509
|
*
|
|
@@ -3536,7 +3536,7 @@ const String$10 = /*#__PURE__*/ make$71((self, that) => self < that ? -1 : 1);
|
|
|
3536
3536
|
* @category instances
|
|
3537
3537
|
* @since 4.0.0
|
|
3538
3538
|
*/
|
|
3539
|
-
const Number$6 = /*#__PURE__*/ make$
|
|
3539
|
+
const Number$6 = /*#__PURE__*/ make$72((self, that) => {
|
|
3540
3540
|
if (globalThis.Number.isNaN(self) && globalThis.Number.isNaN(that)) return 0;
|
|
3541
3541
|
if (globalThis.Number.isNaN(self)) return -1;
|
|
3542
3542
|
if (globalThis.Number.isNaN(that)) return 1;
|
|
@@ -3575,7 +3575,7 @@ const Number$6 = /*#__PURE__*/ make$71((self, that) => {
|
|
|
3575
3575
|
* @category mapping
|
|
3576
3576
|
* @since 2.0.0
|
|
3577
3577
|
*/
|
|
3578
|
-
const mapInput = /*#__PURE__*/ dual(2, (self, f) => make$
|
|
3578
|
+
const mapInput = /*#__PURE__*/ dual(2, (self, f) => make$72((b1, b2) => self(f(b1), f(b2))));
|
|
3579
3579
|
/**
|
|
3580
3580
|
* Checks whether one value is strictly less than another according to the given order.
|
|
3581
3581
|
*
|
|
@@ -3977,7 +3977,7 @@ const isSome = isSome$1;
|
|
|
3977
3977
|
* @category pattern matching
|
|
3978
3978
|
* @since 2.0.0
|
|
3979
3979
|
*/
|
|
3980
|
-
const match$
|
|
3980
|
+
const match$8 = /*#__PURE__*/ dual(2, (self, { onNone, onSome }) => isNone(self) ? onNone() : onSome(self.value));
|
|
3981
3981
|
/**
|
|
3982
3982
|
* Extracts the value from a `Some`, or evaluates a fallback thunk on `None`.
|
|
3983
3983
|
*
|
|
@@ -4494,7 +4494,7 @@ const ServiceProto = {
|
|
|
4494
4494
|
.../*#__PURE__*/ Prototype({
|
|
4495
4495
|
label: "Service",
|
|
4496
4496
|
evaluate(fiber) {
|
|
4497
|
-
return exitSucceed(get$
|
|
4497
|
+
return exitSucceed(get$7(fiber.context, this));
|
|
4498
4498
|
}
|
|
4499
4499
|
}),
|
|
4500
4500
|
toJSON() {
|
|
@@ -4507,13 +4507,13 @@ const ServiceProto = {
|
|
|
4507
4507
|
return self;
|
|
4508
4508
|
},
|
|
4509
4509
|
context(self) {
|
|
4510
|
-
return make$
|
|
4510
|
+
return make$71(this, self);
|
|
4511
4511
|
},
|
|
4512
4512
|
use(f) {
|
|
4513
|
-
return withFiber$1((fiber) => f(get$
|
|
4513
|
+
return withFiber$1((fiber) => f(get$7(fiber.context, this)));
|
|
4514
4514
|
},
|
|
4515
4515
|
useSync(f) {
|
|
4516
|
-
return withFiber$1((fiber) => exitSucceed(f(get$
|
|
4516
|
+
return withFiber$1((fiber) => exitSucceed(f(get$7(fiber.context, this))));
|
|
4517
4517
|
}
|
|
4518
4518
|
};
|
|
4519
4519
|
const cacheKeys = /*#__PURE__*/ new Set();
|
|
@@ -4730,7 +4730,7 @@ const emptyContext = /*#__PURE__*/ makeUnsafe$9(/*#__PURE__*/ new Map());
|
|
|
4730
4730
|
* @category constructors
|
|
4731
4731
|
* @since 2.0.0
|
|
4732
4732
|
*/
|
|
4733
|
-
const make$
|
|
4733
|
+
const make$71 = (key, service) => makeUnsafe$9(/* @__PURE__ */ new Map([[key.key, service]]));
|
|
4734
4734
|
/**
|
|
4735
4735
|
* Adds a service to a given `Context`.
|
|
4736
4736
|
*
|
|
@@ -4892,7 +4892,7 @@ const getUnsafe$2 = /*#__PURE__*/ dual(2, (self, service) => {
|
|
|
4892
4892
|
* @category getters
|
|
4893
4893
|
* @since 2.0.0
|
|
4894
4894
|
*/
|
|
4895
|
-
const get$
|
|
4895
|
+
const get$7 = getUnsafe$2;
|
|
4896
4896
|
const defaultValueCacheKey = "~effect/Context/defaultValue";
|
|
4897
4897
|
const getDefaultValue = (ref) => {
|
|
4898
4898
|
if (defaultValueCacheKey in ref) return ref[defaultValueCacheKey];
|
|
@@ -5384,7 +5384,7 @@ const map$10 = /*#__PURE__*/ dual(2, (self, f) => isSuccess$1(self) ? succeed$10
|
|
|
5384
5384
|
* @category pattern matching
|
|
5385
5385
|
* @since 2.0.0
|
|
5386
5386
|
*/
|
|
5387
|
-
const match$
|
|
5387
|
+
const match$7 = /*#__PURE__*/ dual(2, (self, { onFailure, onSuccess }) => isFailure$1(self) ? onFailure(self.failure) : onSuccess(self.success));
|
|
5388
5388
|
/**
|
|
5389
5389
|
* Extracts the success value or throws the raw failure value `E`.
|
|
5390
5390
|
*
|
|
@@ -5542,7 +5542,7 @@ const all$3 = (input) => {
|
|
|
5542
5542
|
* @category instances
|
|
5543
5543
|
* @since 4.0.0
|
|
5544
5544
|
*/
|
|
5545
|
-
const makeEquivalence$
|
|
5545
|
+
const makeEquivalence$4 = Tuple$1;
|
|
5546
5546
|
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Iterable.js
|
|
5547
5547
|
/**
|
|
5548
5548
|
* Gets the first element of an `Iterable` without returning an `Option`.
|
|
@@ -5761,7 +5761,7 @@ const has$3 = /*#__PURE__*/ dual(2, (self, key) => Object.hasOwn(self, key));
|
|
|
5761
5761
|
* @category getters
|
|
5762
5762
|
* @since 2.0.0
|
|
5763
5763
|
*/
|
|
5764
|
-
const get$
|
|
5764
|
+
const get$6 = /*#__PURE__*/ dual(2, (self, key) => Object.hasOwn(self, key) ? some$1(self[key]) : none());
|
|
5765
5765
|
/**
|
|
5766
5766
|
* Removes a key from a record.
|
|
5767
5767
|
*
|
|
@@ -5909,7 +5909,7 @@ const isSubrecordBy = (equivalence) => dual(2, (self, that) => {
|
|
|
5909
5909
|
* @category instances
|
|
5910
5910
|
* @since 4.0.0
|
|
5911
5911
|
*/
|
|
5912
|
-
const makeEquivalence$
|
|
5912
|
+
const makeEquivalence$3 = (equivalence) => {
|
|
5913
5913
|
const is = isSubrecordBy(equivalence);
|
|
5914
5914
|
return (self, that) => is(self, that) && is(that, self);
|
|
5915
5915
|
};
|
|
@@ -6042,7 +6042,7 @@ const ensure = (self) => Array$2.isArray(self) ? self : [self];
|
|
|
6042
6042
|
* @category pattern matching
|
|
6043
6043
|
* @since 2.0.0
|
|
6044
6044
|
*/
|
|
6045
|
-
const match$
|
|
6045
|
+
const match$6 = /*#__PURE__*/ dual(2, (self, { onEmpty, onNonEmpty }) => isReadonlyArrayNonEmpty(self) ? onNonEmpty(self) : onEmpty());
|
|
6046
6046
|
/**
|
|
6047
6047
|
* Adds a single element to the end of an iterable, returning a `NonEmptyArray`.
|
|
6048
6048
|
*
|
|
@@ -6762,7 +6762,7 @@ const some = /*#__PURE__*/ dual(2, (self, predicate) => self.some(predicate));
|
|
|
6762
6762
|
* @category instances
|
|
6763
6763
|
* @since 4.0.0
|
|
6764
6764
|
*/
|
|
6765
|
-
const makeEquivalence$
|
|
6765
|
+
const makeEquivalence$2 = Array_;
|
|
6766
6766
|
/**
|
|
6767
6767
|
* Joins string elements with a separator.
|
|
6768
6768
|
*
|
|
@@ -6798,7 +6798,7 @@ const bigintNanosPerDay = /*#__PURE__*/ BigInt(864e11);
|
|
|
6798
6798
|
const bigintNanosPerWeek = /*#__PURE__*/ BigInt(6048e11);
|
|
6799
6799
|
const roundTiesAwayFromZero = (input) => BigInt(Math.sign(input) * Math.round(Math.abs(input)));
|
|
6800
6800
|
const roundMillisToNanos = (millis) => Number.isInteger(millis) ? BigInt(millis) * bigint1e6 : roundTiesAwayFromZero(millis * 1e6);
|
|
6801
|
-
const fromNanosNumber = (nanos) => make$
|
|
6801
|
+
const fromNanosNumber = (nanos) => make$70(Number.isFinite(nanos) ? roundTiesAwayFromZero(nanos) : nanos);
|
|
6802
6802
|
const nanosToUnit = (nanos, divisor) => {
|
|
6803
6803
|
const value = Number(nanos);
|
|
6804
6804
|
if (Number.isFinite(value)) return value / divisor;
|
|
@@ -6821,9 +6821,9 @@ const divideTiesAwayFromZero = (numerator, denominator) => {
|
|
|
6821
6821
|
};
|
|
6822
6822
|
const fromMillisString = (input, scale) => {
|
|
6823
6823
|
const millis = Number(input) * scale;
|
|
6824
|
-
if (!Number.isFinite(millis)) return make$
|
|
6824
|
+
if (!Number.isFinite(millis)) return make$70(millis);
|
|
6825
6825
|
const nanos = parseNanos(input, BigInt(scale) * bigint1e6);
|
|
6826
|
-
return make$
|
|
6826
|
+
return make$70(Number.isInteger(millis) && BigInt(millis) * bigint1e6 === nanos ? millis : nanos);
|
|
6827
6827
|
};
|
|
6828
6828
|
const DURATION_REGEXP = /^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/;
|
|
6829
6829
|
/**
|
|
@@ -6890,7 +6890,7 @@ const fromInputUnsafe$1 = (input) => {
|
|
|
6890
6890
|
if (input[0] === -Infinity || input[1] === -Infinity) return negativeInfinity;
|
|
6891
6891
|
if (input[0] === Infinity || input[1] === Infinity) return infinity;
|
|
6892
6892
|
const nanos = input[0] * 1e9 + input[1];
|
|
6893
|
-
return Number.isFinite(nanos) && Number.isInteger(input[0]) && Number.isInteger(input[1]) ? make$
|
|
6893
|
+
return Number.isFinite(nanos) && Number.isInteger(input[0]) && Number.isInteger(input[1]) ? make$70(BigInt(input[0]) * bigint1e9 + BigInt(input[1])) : fromNanosNumber(nanos);
|
|
6894
6894
|
}
|
|
6895
6895
|
const obj = input;
|
|
6896
6896
|
let millis = 0;
|
|
@@ -6901,13 +6901,13 @@ const fromInputUnsafe$1 = (input) => {
|
|
|
6901
6901
|
if (obj.seconds) millis += obj.seconds * 1e3;
|
|
6902
6902
|
if (obj.milliseconds) millis += obj.milliseconds;
|
|
6903
6903
|
if (!obj.microseconds && !obj.nanoseconds) {
|
|
6904
|
-
if (!Number.isFinite(millis)) return make$
|
|
6904
|
+
if (!Number.isFinite(millis)) return make$70(millis);
|
|
6905
6905
|
const exact = sumObjectNanos(obj);
|
|
6906
|
-
return exact === void 0 || BigInt(millis) * bigint1e6 === exact ? make$
|
|
6906
|
+
return exact === void 0 || BigInt(millis) * bigint1e6 === exact ? make$70(millis) : make$70(exact);
|
|
6907
6907
|
}
|
|
6908
6908
|
const nanos = millis * 1e6 + (obj.microseconds ?? 0) * 1e3 + (obj.nanoseconds ?? 0);
|
|
6909
6909
|
const exact = Number.isFinite(nanos) ? sumObjectNanos(obj) : void 0;
|
|
6910
|
-
return exact === void 0 ? fromNanosNumber(nanos) : make$
|
|
6910
|
+
return exact === void 0 ? fromNanosNumber(nanos) : make$70(exact);
|
|
6911
6911
|
}
|
|
6912
6912
|
}
|
|
6913
6913
|
return invalid$3(input);
|
|
@@ -6984,7 +6984,7 @@ const DurationProto = {
|
|
|
6984
6984
|
return pipeArguments(this, arguments);
|
|
6985
6985
|
}
|
|
6986
6986
|
};
|
|
6987
|
-
const make$
|
|
6987
|
+
const make$70 = (input) => {
|
|
6988
6988
|
const duration = Object.create(DurationProto);
|
|
6989
6989
|
if (typeof input === "number") {
|
|
6990
6990
|
if (isNaN(input) || input === 0 || Object.is(input, -0)) duration.value = zeroDurationValue;
|
|
@@ -7107,8 +7107,8 @@ const abs = (self) => {
|
|
|
7107
7107
|
switch (self.value._tag) {
|
|
7108
7108
|
case "Infinity":
|
|
7109
7109
|
case "NegativeInfinity": return infinity;
|
|
7110
|
-
case "Millis": return self.value.millis < 0 ? make$
|
|
7111
|
-
case "Nanos": return self.value.nanos < bigint0$3 ? make$
|
|
7110
|
+
case "Millis": return self.value.millis < 0 ? make$70(-self.value.millis) : self;
|
|
7111
|
+
case "Nanos": return self.value.nanos < bigint0$3 ? make$70(-self.value.nanos) : self;
|
|
7112
7112
|
}
|
|
7113
7113
|
};
|
|
7114
7114
|
/**
|
|
@@ -7126,7 +7126,7 @@ const abs = (self) => {
|
|
|
7126
7126
|
* @category constructors
|
|
7127
7127
|
* @since 2.0.0
|
|
7128
7128
|
*/
|
|
7129
|
-
const zero$2 = /*#__PURE__*/ make$
|
|
7129
|
+
const zero$2 = /*#__PURE__*/ make$70(0);
|
|
7130
7130
|
/**
|
|
7131
7131
|
* A Duration representing infinite time.
|
|
7132
7132
|
*
|
|
@@ -7142,7 +7142,7 @@ const zero$2 = /*#__PURE__*/ make$69(0);
|
|
|
7142
7142
|
* @category constructors
|
|
7143
7143
|
* @since 2.0.0
|
|
7144
7144
|
*/
|
|
7145
|
-
const infinity = /*#__PURE__*/ make$
|
|
7145
|
+
const infinity = /*#__PURE__*/ make$70(Infinity);
|
|
7146
7146
|
/**
|
|
7147
7147
|
* A Duration representing negative infinite time.
|
|
7148
7148
|
*
|
|
@@ -7158,7 +7158,7 @@ const infinity = /*#__PURE__*/ make$69(Infinity);
|
|
|
7158
7158
|
* @category constructors
|
|
7159
7159
|
* @since 4.0.0
|
|
7160
7160
|
*/
|
|
7161
|
-
const negativeInfinity = /*#__PURE__*/ make$
|
|
7161
|
+
const negativeInfinity = /*#__PURE__*/ make$70(-Infinity);
|
|
7162
7162
|
/**
|
|
7163
7163
|
* Creates a Duration from nanoseconds.
|
|
7164
7164
|
*
|
|
@@ -7174,7 +7174,7 @@ const negativeInfinity = /*#__PURE__*/ make$69(-Infinity);
|
|
|
7174
7174
|
* @category constructors
|
|
7175
7175
|
* @since 2.0.0
|
|
7176
7176
|
*/
|
|
7177
|
-
const nanos = (nanos) => make$
|
|
7177
|
+
const nanos = (nanos) => make$70(nanos);
|
|
7178
7178
|
/**
|
|
7179
7179
|
* Creates a Duration from milliseconds.
|
|
7180
7180
|
*
|
|
@@ -7190,7 +7190,7 @@ const nanos = (nanos) => make$69(nanos);
|
|
|
7190
7190
|
* @category constructors
|
|
7191
7191
|
* @since 2.0.0
|
|
7192
7192
|
*/
|
|
7193
|
-
const millis = (millis) => make$
|
|
7193
|
+
const millis = (millis) => make$70(millis);
|
|
7194
7194
|
/**
|
|
7195
7195
|
* Creates a Duration from seconds.
|
|
7196
7196
|
*
|
|
@@ -7206,7 +7206,7 @@ const millis = (millis) => make$69(millis);
|
|
|
7206
7206
|
* @category constructors
|
|
7207
7207
|
* @since 2.0.0
|
|
7208
7208
|
*/
|
|
7209
|
-
const seconds = (seconds) => make$
|
|
7209
|
+
const seconds = (seconds) => make$70(seconds * 1e3);
|
|
7210
7210
|
/**
|
|
7211
7211
|
* Converts a Duration to milliseconds.
|
|
7212
7212
|
*
|
|
@@ -7223,7 +7223,7 @@ const seconds = (seconds) => make$69(seconds * 1e3);
|
|
|
7223
7223
|
* @category getters
|
|
7224
7224
|
* @since 2.0.0
|
|
7225
7225
|
*/
|
|
7226
|
-
const toMillis = (self) => match$
|
|
7226
|
+
const toMillis = (self) => match$5(fromInputUnsafe$1(self), {
|
|
7227
7227
|
onMillis: identity,
|
|
7228
7228
|
onNanos: (nanos) => nanosToUnit(nanos, 1e6),
|
|
7229
7229
|
onInfinity: () => Infinity,
|
|
@@ -7245,7 +7245,7 @@ const toMillis = (self) => match$4(fromInputUnsafe$1(self), {
|
|
|
7245
7245
|
* @category getters
|
|
7246
7246
|
* @since 2.0.0
|
|
7247
7247
|
*/
|
|
7248
|
-
const toSeconds = (self) => match$
|
|
7248
|
+
const toSeconds = (self) => match$5(fromInputUnsafe$1(self), {
|
|
7249
7249
|
onMillis: (millis) => millis / 1e3,
|
|
7250
7250
|
onNanos: (nanos) => nanosToUnit(nanos, 1e9),
|
|
7251
7251
|
onInfinity: () => Infinity,
|
|
@@ -7317,7 +7317,7 @@ const toNanosUnsafe = (input) => {
|
|
|
7317
7317
|
* @category pattern matching
|
|
7318
7318
|
* @since 2.0.0
|
|
7319
7319
|
*/
|
|
7320
|
-
const match$
|
|
7320
|
+
const match$5 = /*#__PURE__*/ dual(2, (self, options) => {
|
|
7321
7321
|
switch (self.value._tag) {
|
|
7322
7322
|
case "Millis": return options.onMillis(self.value.millis);
|
|
7323
7323
|
case "Nanos": return options.onNanos(self.value.nanos);
|
|
@@ -7373,7 +7373,7 @@ const matchPair = /*#__PURE__*/ dual(3, (self, that, options) => {
|
|
|
7373
7373
|
* @category instances
|
|
7374
7374
|
* @since 2.0.0
|
|
7375
7375
|
*/
|
|
7376
|
-
const Order$3 = /*#__PURE__*/ make$
|
|
7376
|
+
const Order$3 = /*#__PURE__*/ make$72((self, that) => matchPair(self, that, {
|
|
7377
7377
|
onMillis: (self, that) => self < that ? -1 : self > that ? 1 : 0,
|
|
7378
7378
|
onNanos: (self, that) => self < that ? -1 : self > that ? 1 : 0,
|
|
7379
7379
|
onInfinity: (self, that) => {
|
|
@@ -7446,8 +7446,8 @@ const max = /*#__PURE__*/ max$1(Order$3);
|
|
|
7446
7446
|
* @since 2.0.0
|
|
7447
7447
|
*/
|
|
7448
7448
|
const sum = /*#__PURE__*/ dual(2, (self, that) => matchPair(self, that, {
|
|
7449
|
-
onMillis: (self, that) => make$
|
|
7450
|
-
onNanos: (self, that) => make$
|
|
7449
|
+
onMillis: (self, that) => make$70(self + that),
|
|
7450
|
+
onNanos: (self, that) => make$70(self + that),
|
|
7451
7451
|
onInfinity: (self, that) => {
|
|
7452
7452
|
const s = self.value._tag;
|
|
7453
7453
|
const t = that.value._tag;
|
|
@@ -8291,7 +8291,7 @@ var ParentSpan = class extends (/*#__PURE__*/ Service$1()(ParentSpanKey, { fiber
|
|
|
8291
8291
|
* @category constructors
|
|
8292
8292
|
* @since 2.0.0
|
|
8293
8293
|
*/
|
|
8294
|
-
const make$
|
|
8294
|
+
const make$69 = (options) => options;
|
|
8295
8295
|
/**
|
|
8296
8296
|
* Creates an `ExternalSpan` from trace and span identifiers, defaulting
|
|
8297
8297
|
* `sampled` to `true` and annotations to an empty context when they are not
|
|
@@ -8471,7 +8471,7 @@ const Tracer = /*#__PURE__*/ Reference(TracerKey, {
|
|
|
8471
8471
|
* @category references
|
|
8472
8472
|
* @since 4.0.0
|
|
8473
8473
|
*/
|
|
8474
|
-
const nativeTracer = /*#__PURE__*/ make$
|
|
8474
|
+
const nativeTracer = /*#__PURE__*/ make$69({ span: (options) => new NativeSpan(options) });
|
|
8475
8475
|
/**
|
|
8476
8476
|
* Default in-memory `Span` implementation used by the native tracer. It
|
|
8477
8477
|
* generates span and trace identifiers, stores attributes, events, and links,
|
|
@@ -8887,7 +8887,7 @@ var FiberImpl = class {
|
|
|
8887
8887
|
return this._dispatcher ??= this.cache.scheduler.makeDispatcher();
|
|
8888
8888
|
}
|
|
8889
8889
|
getRef(ref) {
|
|
8890
|
-
return get$
|
|
8890
|
+
return get$7(this.context, ref);
|
|
8891
8891
|
}
|
|
8892
8892
|
addObserver(cb) {
|
|
8893
8893
|
if (this._exit) {
|
|
@@ -8906,7 +8906,7 @@ var FiberImpl = class {
|
|
|
8906
8906
|
interruptUnsafe(fiberId, annotations) {
|
|
8907
8907
|
if (this._exit) return;
|
|
8908
8908
|
let cause = causeInterrupt(fiberId);
|
|
8909
|
-
if (this.cache.stackFrame) cause = causeAnnotate(cause, make$
|
|
8909
|
+
if (this.cache.stackFrame) cause = causeAnnotate(cause, make$71(StackTraceKey, this.cache.stackFrame));
|
|
8910
8910
|
if (annotations) cause = causeAnnotate(cause, annotations);
|
|
8911
8911
|
this._interruptedCause = this._interruptedCause ? causeAddInterrupts(this._interruptedCause, cause) : cause;
|
|
8912
8912
|
if (this.interruptible) {
|
|
@@ -9055,17 +9055,17 @@ var FiberImpl = class {
|
|
|
9055
9055
|
const makeFiberContextCache = (context) => {
|
|
9056
9056
|
const currentTracer = getOrUndefinedUnsafe(context, TracerKey);
|
|
9057
9057
|
return {
|
|
9058
|
-
scheduler: get$
|
|
9058
|
+
scheduler: get$7(context, Scheduler),
|
|
9059
9059
|
tracer: currentTracer,
|
|
9060
9060
|
tracerContext: currentTracer ? currentTracer["context"] : void 0,
|
|
9061
|
-
tracerEnabled: get$
|
|
9061
|
+
tracerEnabled: get$7(context, TracerEnabled),
|
|
9062
9062
|
span: getOrUndefinedUnsafe(context, ParentSpanKey),
|
|
9063
|
-
logLevel: get$
|
|
9064
|
-
minimumLogLevel: get$
|
|
9065
|
-
stackFrame: get$
|
|
9063
|
+
logLevel: get$7(context, CurrentLogLevel),
|
|
9064
|
+
minimumLogLevel: get$7(context, MinimumLogLevel$1),
|
|
9065
|
+
stackFrame: get$7(context, CurrentStackFrame),
|
|
9066
9066
|
runtimeMetrics: getOrUndefinedUnsafe(context, FiberRuntimeMetricsKey),
|
|
9067
|
-
maxOpsBeforeYield: get$
|
|
9068
|
-
preventYield: get$
|
|
9067
|
+
maxOpsBeforeYield: get$7(context, MaxOpsBeforeYield),
|
|
9068
|
+
preventYield: get$7(context, PreventSchedulerYield)
|
|
9069
9069
|
};
|
|
9070
9070
|
};
|
|
9071
9071
|
const deferredInterruptCont = {
|
|
@@ -9174,7 +9174,7 @@ const suspend$3 = /*#__PURE__*/ makePrimitive$1({
|
|
|
9174
9174
|
}
|
|
9175
9175
|
});
|
|
9176
9176
|
/** @internal */
|
|
9177
|
-
const fromResult$1 = /*#__PURE__*/ match$
|
|
9177
|
+
const fromResult$1 = /*#__PURE__*/ match$7({
|
|
9178
9178
|
onFailure: fail$11,
|
|
9179
9179
|
onSuccess: succeed$9
|
|
9180
9180
|
});
|
|
@@ -9476,7 +9476,7 @@ const tapEffectCont = function(value) {
|
|
|
9476
9476
|
return new ContImpl(this.payload, succeedPayload, value);
|
|
9477
9477
|
};
|
|
9478
9478
|
/** @internal */
|
|
9479
|
-
const asSome = (self) => map$7(self, some$1);
|
|
9479
|
+
const asSome$1 = (self) => map$7(self, some$1);
|
|
9480
9480
|
/** @internal */
|
|
9481
9481
|
const andThen$1 = /*#__PURE__*/ dual(2, (self, f) => new ContImpl(self, isEffect$1(f) ? returnPayload : andThenCont, f));
|
|
9482
9482
|
/** @internal */
|
|
@@ -9653,7 +9653,7 @@ const provideServiceImpl = (self, service, implementation) => updateContext$1(se
|
|
|
9653
9653
|
/** @internal */
|
|
9654
9654
|
const zipWith$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[1]), (self, that, f, options) => options?.concurrent ? map$7(all$2([self, that], { concurrency: 2 }), ([a, a2]) => f(a, a2)) : flatMap$4(self, (a) => map$7(that, (a2) => f(a, a2))));
|
|
9655
9655
|
/** @internal */
|
|
9656
|
-
const when$1 = /*#__PURE__*/ dual(2, (self, condition) => flatMap$4(condition, (pass) => pass ? asSome(self) : succeedNone$1));
|
|
9656
|
+
const when$1 = /*#__PURE__*/ dual(2, (self, condition) => flatMap$4(condition, (pass) => pass ? asSome$1(self) : succeedNone$1));
|
|
9657
9657
|
/** @internal */
|
|
9658
9658
|
const forever$2 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, options) => whileLoop$1({
|
|
9659
9659
|
while: constTrue,
|
|
@@ -9768,7 +9768,7 @@ const ignoreCause$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, o
|
|
|
9768
9768
|
});
|
|
9769
9769
|
});
|
|
9770
9770
|
/** @internal */
|
|
9771
|
-
const option$2 = (self) => match$
|
|
9771
|
+
const option$2 = (self) => match$4(self, {
|
|
9772
9772
|
onFailure: none,
|
|
9773
9773
|
onSuccess: some$1
|
|
9774
9774
|
});
|
|
@@ -9822,7 +9822,7 @@ const matchEffect$2 = /*#__PURE__*/ dual(2, (self, options) => matchCauseEffect$
|
|
|
9822
9822
|
onSuccess: options.onSuccess
|
|
9823
9823
|
}));
|
|
9824
9824
|
/** @internal */
|
|
9825
|
-
const match$
|
|
9825
|
+
const match$4 = /*#__PURE__*/ dual(2, (self, options) => new MatchImpl(self, options));
|
|
9826
9826
|
/** @internal */
|
|
9827
9827
|
const matchEager = /*#__PURE__*/ dual(2, (self, options) => {
|
|
9828
9828
|
if (effectIsExit(self)) {
|
|
@@ -9831,7 +9831,7 @@ const matchEager = /*#__PURE__*/ dual(2, (self, options) => {
|
|
|
9831
9831
|
if (isFailure$1(error)) return exitFailCause(error.failure);
|
|
9832
9832
|
return exitSucceed(options.onFailure(error.success));
|
|
9833
9833
|
}
|
|
9834
|
-
return match$
|
|
9834
|
+
return match$4(self, options);
|
|
9835
9835
|
});
|
|
9836
9836
|
/** @internal */
|
|
9837
9837
|
const exit$1 = (self) => effectIsExit(self) ? exitSucceed(self) : exitPrimitive(self);
|
|
@@ -9863,7 +9863,7 @@ const timeout$2 = /*#__PURE__*/ dual(2, (self, duration) => {
|
|
|
9863
9863
|
});
|
|
9864
9864
|
});
|
|
9865
9865
|
/** @internal */
|
|
9866
|
-
const timeoutOption$1 = /*#__PURE__*/ dual(2, (self, duration) => raceFirst$1(asSome(self), as$1(sleep$1(duration), none())));
|
|
9866
|
+
const timeoutOption$1 = /*#__PURE__*/ dual(2, (self, duration) => raceFirst$1(asSome$1(self), as$1(sleep$1(duration), none())));
|
|
9867
9867
|
/** @internal */
|
|
9868
9868
|
const ScopeTypeId = "~effect/Scope";
|
|
9869
9869
|
/** @internal */
|
|
@@ -10557,11 +10557,11 @@ const NoopSpanProto = {
|
|
|
10557
10557
|
const noopSpan = (options) => Object.assign(Object.create(NoopSpanProto), options);
|
|
10558
10558
|
const filterDisablePropagation = (span) => {
|
|
10559
10559
|
if (!span) return none();
|
|
10560
|
-
return get$
|
|
10560
|
+
return get$7(span.annotations, DisablePropagation) ? span._tag === "Span" ? filterDisablePropagation(getOrUndefined$1(span.parent)) : none() : some$1(span);
|
|
10561
10561
|
};
|
|
10562
10562
|
/** @internal */
|
|
10563
10563
|
const makeSpanUnsafe = (fiber, name, options) => {
|
|
10564
|
-
const disablePropagation = !fiber.cache.tracerEnabled || options?.annotations && get$
|
|
10564
|
+
const disablePropagation = !fiber.cache.tracerEnabled || options?.annotations && get$7(options.annotations, DisablePropagation);
|
|
10565
10565
|
const parent = options?.parent !== void 0 ? some$1(options.parent) : options?.root ? none() : filterDisablePropagation(fiber.cache.span);
|
|
10566
10566
|
let span;
|
|
10567
10567
|
if (disablePropagation) span = noopSpan({
|
|
@@ -11994,7 +11994,7 @@ const makeUnsafe$8 = () => new DeferredImpl();
|
|
|
11994
11994
|
* @category constructors
|
|
11995
11995
|
* @since 2.0.0
|
|
11996
11996
|
*/
|
|
11997
|
-
const make$
|
|
11997
|
+
const make$68 = () => sync$2(() => makeUnsafe$8());
|
|
11998
11998
|
const _await = (self) => callback$2((resume) => {
|
|
11999
11999
|
if (self.effect) return resume(self.effect);
|
|
12000
12000
|
self.resumes ??= [];
|
|
@@ -12601,7 +12601,7 @@ const Scope = scopeTag;
|
|
|
12601
12601
|
* @category constructors
|
|
12602
12602
|
* @since 2.0.0
|
|
12603
12603
|
*/
|
|
12604
|
-
const make$
|
|
12604
|
+
const make$67 = scopeMake;
|
|
12605
12605
|
/**
|
|
12606
12606
|
* Creates a new `Scope` synchronously without wrapping it in an `Effect`.
|
|
12607
12607
|
* This is useful when you need a scope immediately but should be used with caution
|
|
@@ -13250,8 +13250,8 @@ const buildWithScope = /*#__PURE__*/ dual(2, (self, scope) => withFiber$1((fiber
|
|
|
13250
13250
|
* @since 2.0.0
|
|
13251
13251
|
*/
|
|
13252
13252
|
const succeed$6 = function() {
|
|
13253
|
-
if (arguments.length === 1) return (resource) => succeedContext(make$
|
|
13254
|
-
return succeedContext(make$
|
|
13253
|
+
if (arguments.length === 1) return (resource) => succeedContext(make$71(arguments[0], resource));
|
|
13254
|
+
return succeedContext(make$71(arguments[0], arguments[1]));
|
|
13255
13255
|
};
|
|
13256
13256
|
/**
|
|
13257
13257
|
* Constructs a layer that provides all services in an already available
|
|
@@ -13363,8 +13363,8 @@ const empty$8 = /*#__PURE__*/ succeedContext(/*#__PURE__*/ empty$12());
|
|
|
13363
13363
|
* @since 2.0.0
|
|
13364
13364
|
*/
|
|
13365
13365
|
const sync$1 = function() {
|
|
13366
|
-
if (arguments.length === 1) return (evaluate) => syncContext(() => make$
|
|
13367
|
-
return syncContext(() => make$
|
|
13366
|
+
if (arguments.length === 1) return (evaluate) => syncContext(() => make$71(arguments[0], evaluate()));
|
|
13367
|
+
return syncContext(() => make$71(arguments[0], arguments[1]()));
|
|
13368
13368
|
};
|
|
13369
13369
|
/**
|
|
13370
13370
|
* Constructs a layer lazily that provides all services in a `Context`.
|
|
@@ -13448,7 +13448,7 @@ const effect = function() {
|
|
|
13448
13448
|
if (arguments.length === 1) return (effect) => effectImpl(arguments[0], effect);
|
|
13449
13449
|
return effectImpl(arguments[0], arguments[1]);
|
|
13450
13450
|
};
|
|
13451
|
-
const effectImpl = (service, effect) => effectContext(map$7(effect, (value) => make$
|
|
13451
|
+
const effectImpl = (service, effect) => effectContext(map$7(effect, (value) => make$71(service, value)));
|
|
13452
13452
|
/**
|
|
13453
13453
|
* Constructs a layer from an effect that produces all services in a `Context`.
|
|
13454
13454
|
*
|
|
@@ -13556,7 +13556,7 @@ const unwrapKey = /*#__PURE__*/ Service$1("effect/Layer/unwrap");
|
|
|
13556
13556
|
* @category converting
|
|
13557
13557
|
* @since 4.0.0
|
|
13558
13558
|
*/
|
|
13559
|
-
const unwrap$7 = (self) => flatMap$3(effect(unwrapKey)(self), get$
|
|
13559
|
+
const unwrap$7 = (self) => flatMap$3(effect(unwrapKey)(self), get$7(unwrapKey));
|
|
13560
13560
|
const mergeAllEffect = (layers, memoMap, scope) => {
|
|
13561
13561
|
const parentScope = forkUnsafe(scope, "parallel");
|
|
13562
13562
|
return forEach$2(layers, (layer) => layer.build(memoMap, forkUnsafe(parentScope, "sequential")), { concurrency: layers.length }).pipe(map$7((context) => mergeAll$2(...context)));
|
|
@@ -14761,7 +14761,7 @@ const endsWith = (searchString, position) => (self) => self.endsWith(searchStrin
|
|
|
14761
14761
|
* @category searching
|
|
14762
14762
|
* @since 2.0.0
|
|
14763
14763
|
*/
|
|
14764
|
-
const match$
|
|
14764
|
+
const match$3 = (regExp) => (self) => fromNullOr(self.match(regExp));
|
|
14765
14765
|
/**
|
|
14766
14766
|
* Replaces all occurrences of a substring or pattern in a string.
|
|
14767
14767
|
*
|
|
@@ -16717,6 +16717,24 @@ const map$5 = map$7;
|
|
|
16717
16717
|
*/
|
|
16718
16718
|
const as = as$1;
|
|
16719
16719
|
/**
|
|
16720
|
+
* Maps the success value of an `Effect` to `Some`, preserving failures.
|
|
16721
|
+
*
|
|
16722
|
+
* **Example** (Wrapping success in Option.some)
|
|
16723
|
+
*
|
|
16724
|
+
* ```ts import.meta.vitest
|
|
16725
|
+
* import { Effect, Option } from "effect"
|
|
16726
|
+
*
|
|
16727
|
+
* const program = Effect.asSome(Effect.succeed(42))
|
|
16728
|
+
*
|
|
16729
|
+
* Effect.runSync(program) // => Option.some(42)
|
|
16730
|
+
* ```
|
|
16731
|
+
*
|
|
16732
|
+
* @stability stable
|
|
16733
|
+
* @category mapping
|
|
16734
|
+
* @since 2.0.0
|
|
16735
|
+
*/
|
|
16736
|
+
const asSome = asSome$1;
|
|
16737
|
+
/**
|
|
16720
16738
|
* Maps the success value of an `Effect` to `void`, preserving failures.
|
|
16721
16739
|
*
|
|
16722
16740
|
* **Example** (Discarding success values)
|
|
@@ -17765,7 +17783,7 @@ const when = when$1;
|
|
|
17765
17783
|
* @category pattern matching
|
|
17766
17784
|
* @since 2.0.0
|
|
17767
17785
|
*/
|
|
17768
|
-
const match$
|
|
17786
|
+
const match$2 = match$4;
|
|
17769
17787
|
/**
|
|
17770
17788
|
* Handles success or failure eagerly with effectful handlers when the effect is already resolved.
|
|
17771
17789
|
*
|
|
@@ -20382,7 +20400,7 @@ const Empty$2 = /*#__PURE__*/ Symbol.for("effect/MutableList/Empty");
|
|
|
20382
20400
|
* @category constructors
|
|
20383
20401
|
* @since 2.0.0
|
|
20384
20402
|
*/
|
|
20385
|
-
const make$
|
|
20403
|
+
const make$65 = () => ({
|
|
20386
20404
|
head: void 0,
|
|
20387
20405
|
tail: void 0,
|
|
20388
20406
|
length: 0
|
|
@@ -20827,12 +20845,12 @@ const QueueProto = {
|
|
|
20827
20845
|
* @category constructors
|
|
20828
20846
|
* @since 4.0.0
|
|
20829
20847
|
*/
|
|
20830
|
-
const make$
|
|
20848
|
+
const make$64 = (options) => withFiber$1((fiber) => {
|
|
20831
20849
|
const self = Object.create(QueueProto);
|
|
20832
20850
|
self.dispatcher = fiber.currentDispatcher;
|
|
20833
20851
|
self.capacity = options?.capacity ?? Number.POSITIVE_INFINITY;
|
|
20834
20852
|
self.strategy = options?.strategy ?? "suspend";
|
|
20835
|
-
self.messages = make$
|
|
20853
|
+
self.messages = make$65();
|
|
20836
20854
|
self.scheduleRunning = false;
|
|
20837
20855
|
self.state = {
|
|
20838
20856
|
_tag: "Open",
|
|
@@ -20873,7 +20891,7 @@ const make$63 = (options) => withFiber$1((fiber) => {
|
|
|
20873
20891
|
* @category constructors
|
|
20874
20892
|
* @since 2.0.0
|
|
20875
20893
|
*/
|
|
20876
|
-
const bounded = (capacity) => make$
|
|
20894
|
+
const bounded = (capacity) => make$64({ capacity });
|
|
20877
20895
|
/**
|
|
20878
20896
|
* Creates a bounded queue with sliding strategy. When the queue reaches capacity,
|
|
20879
20897
|
* new elements are added and the oldest elements are dropped.
|
|
@@ -20910,7 +20928,7 @@ const bounded = (capacity) => make$63({ capacity });
|
|
|
20910
20928
|
* @category constructors
|
|
20911
20929
|
* @since 2.0.0
|
|
20912
20930
|
*/
|
|
20913
|
-
const sliding = (capacity) => make$
|
|
20931
|
+
const sliding = (capacity) => make$64({
|
|
20914
20932
|
capacity,
|
|
20915
20933
|
strategy: "sliding"
|
|
20916
20934
|
});
|
|
@@ -22042,7 +22060,7 @@ const makeUuid = (bytes, randomBytes, format) => {
|
|
|
22042
22060
|
* @category constructors
|
|
22043
22061
|
* @since 4.0.0
|
|
22044
22062
|
*/
|
|
22045
|
-
const make$
|
|
22063
|
+
const make$63 = (randomBytes) => {
|
|
22046
22064
|
const randomBytesChecked = (size) => {
|
|
22047
22065
|
checkSize(size);
|
|
22048
22066
|
return randomBytes(size);
|
|
@@ -22088,7 +22106,7 @@ const fillRandom = (crypto, size) => {
|
|
|
22088
22106
|
* @category layers
|
|
22089
22107
|
* @since 4.0.0
|
|
22090
22108
|
*/
|
|
22091
|
-
const layerWebCrypto$7 = /*#__PURE__*/ effect(SecureRandom, /*#__PURE__*/ WebCrypto.use((crypto) => succeed$5(make$
|
|
22109
|
+
const layerWebCrypto$7 = /*#__PURE__*/ effect(SecureRandom, /*#__PURE__*/ WebCrypto.use((crypto) => succeed$5(make$63((size) => fillRandom(crypto, size)))));
|
|
22092
22110
|
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Semaphore.js
|
|
22093
22111
|
/**
|
|
22094
22112
|
* Creates a `Semaphore` synchronously with the specified total
|
|
@@ -22221,7 +22239,7 @@ var SemaphoreImpl = class {
|
|
|
22221
22239
|
return (self) => uninterruptibleMask$1((restore) => {
|
|
22222
22240
|
if (this.free < n) return succeedNone$1;
|
|
22223
22241
|
this.taken += n;
|
|
22224
|
-
return onExitPrimitive$1(restore(asSome(self)), () => {
|
|
22242
|
+
return onExitPrimitive$1(restore(asSome$1(self)), () => {
|
|
22225
22243
|
this.releaseUnsafe(getCurrentFiber(), n);
|
|
22226
22244
|
}, true);
|
|
22227
22245
|
});
|
|
@@ -22262,7 +22280,7 @@ var SemaphoreImpl = class {
|
|
|
22262
22280
|
* @category constructors
|
|
22263
22281
|
* @since 4.0.0
|
|
22264
22282
|
*/
|
|
22265
|
-
const make$
|
|
22283
|
+
const make$62 = (permits) => sync$2(() => new SemaphoreImpl(permits));
|
|
22266
22284
|
/**
|
|
22267
22285
|
* Runs an effect with a single permit and releases the permit when the effect
|
|
22268
22286
|
* completes.
|
|
@@ -22382,7 +22400,7 @@ const isBigDecimal = (u) => hasProperty(u, TypeId$52);
|
|
|
22382
22400
|
* @category constructors
|
|
22383
22401
|
* @since 2.0.0
|
|
22384
22402
|
*/
|
|
22385
|
-
const make$
|
|
22403
|
+
const make$61 = (value, scale) => {
|
|
22386
22404
|
if (!Number.isSafeInteger(scale)) throw new RangeError(`Scale must be a safe integer, got ${scale}`);
|
|
22387
22405
|
const o = Object.create(BigDecimalProto);
|
|
22388
22406
|
o.value = value;
|
|
@@ -22390,7 +22408,7 @@ const make$60 = (value, scale) => {
|
|
|
22390
22408
|
return o;
|
|
22391
22409
|
};
|
|
22392
22410
|
const makeNormalized = (value, scale) => {
|
|
22393
|
-
const o = make$
|
|
22411
|
+
const o = make$61(value, scale);
|
|
22394
22412
|
o.normalized = o;
|
|
22395
22413
|
return o;
|
|
22396
22414
|
};
|
|
@@ -22824,7 +22842,7 @@ const binaryUnits = [
|
|
|
22824
22842
|
const allUnits = [...decimalUnits, .../*#__PURE__*/ binaryUnits.slice(1)];
|
|
22825
22843
|
const unitsByName = /*#__PURE__*/ new Map(/*#__PURE__*/ allUnits.flatMap((unit) => unit.names.map((name) => [name, unit])));
|
|
22826
22844
|
const unitsBySymbol = /*#__PURE__*/ new Map(/*#__PURE__*/ allUnits.map((unit) => [unit.symbol, unit]));
|
|
22827
|
-
const make$
|
|
22845
|
+
const make$60 = (value) => value;
|
|
22828
22846
|
/**
|
|
22829
22847
|
* The byte size containing zero bytes.
|
|
22830
22848
|
*
|
|
@@ -22832,13 +22850,13 @@ const make$59 = (value) => value;
|
|
|
22832
22850
|
* @category constants
|
|
22833
22851
|
* @since 4.0.0
|
|
22834
22852
|
*/
|
|
22835
|
-
const zero = /*#__PURE__*/ make$
|
|
22853
|
+
const zero = /*#__PURE__*/ make$60(bigint0);
|
|
22836
22854
|
const invalid$2 = (message) => {
|
|
22837
22855
|
throw new Error(`Invalid ByteSize: ${message}`);
|
|
22838
22856
|
};
|
|
22839
22857
|
const fromNumber = (input) => {
|
|
22840
22858
|
if (!Number.isSafeInteger(input) || input < 0) return invalid$2(`expected a non-negative safe integer, received ${input}`);
|
|
22841
|
-
return make$
|
|
22859
|
+
return make$60(BigInt(input));
|
|
22842
22860
|
};
|
|
22843
22861
|
const maxSafeInteger = /*#__PURE__*/ BigInt(Number.MAX_SAFE_INTEGER);
|
|
22844
22862
|
const scaleDecimal = (quantity, factor) => {
|
|
@@ -22854,14 +22872,14 @@ const scaleDecimal = (quantity, factor) => {
|
|
|
22854
22872
|
const fromQuantity = (quantity, unit) => {
|
|
22855
22873
|
if (typeof quantity === "bigint") {
|
|
22856
22874
|
if (quantity < bigint0) return invalid$2(`expected a non-negative quantity, received ${quantity}`);
|
|
22857
|
-
return make$
|
|
22875
|
+
return make$60(quantity * unit.factor);
|
|
22858
22876
|
}
|
|
22859
22877
|
if (binaryUnits.includes(unit)) {
|
|
22860
22878
|
const value = quantity * Number(unit.factor);
|
|
22861
|
-
if (Number.isSafeInteger(value) && value >= 0) return make$
|
|
22879
|
+
if (Number.isSafeInteger(value) && value >= 0) return make$60(BigInt(value));
|
|
22862
22880
|
} else {
|
|
22863
22881
|
const value = scaleDecimal(String(quantity), unit.factor);
|
|
22864
|
-
if (value !== void 0 && value <= maxSafeInteger) return make$
|
|
22882
|
+
if (value !== void 0 && value <= maxSafeInteger) return make$60(value);
|
|
22865
22883
|
}
|
|
22866
22884
|
return invalid$2(`expected an exact non-negative safe-integer byte result, received ${quantity} ${unit.symbol}`);
|
|
22867
22885
|
};
|
|
@@ -22887,7 +22905,7 @@ const fromStringUnsafe = (input) => {
|
|
|
22887
22905
|
if (unit === void 0) return invalid$2(`unsupported unit ${JSON.stringify(match[2])}`);
|
|
22888
22906
|
const value = scaleDecimal(match[1], unit.factor);
|
|
22889
22907
|
if (value === void 0) return invalid$2(`${JSON.stringify(input)} does not represent an integral number of bytes`);
|
|
22890
|
-
return make$
|
|
22908
|
+
return make$60(value);
|
|
22891
22909
|
};
|
|
22892
22910
|
/**
|
|
22893
22911
|
* Decodes a trusted input into a byte size and throws for invalid input.
|
|
@@ -22900,7 +22918,7 @@ const fromInputUnsafe = (input) => {
|
|
|
22900
22918
|
switch (typeof input) {
|
|
22901
22919
|
case "bigint":
|
|
22902
22920
|
if (input < bigint0) return invalid$2(`expected a non-negative bigint, received ${input}`);
|
|
22903
|
-
return make$
|
|
22921
|
+
return make$60(input);
|
|
22904
22922
|
case "number": return fromNumber(input);
|
|
22905
22923
|
case "string": return fromStringUnsafe(input);
|
|
22906
22924
|
}
|
|
@@ -22960,14 +22978,14 @@ const emptyArray = [];
|
|
|
22960
22978
|
* @category instances
|
|
22961
22979
|
* @since 4.0.0
|
|
22962
22980
|
*/
|
|
22963
|
-
const makeEquivalence = (isEquivalent) => make$
|
|
22981
|
+
const makeEquivalence$1 = (isEquivalent) => make$73((self, that) => {
|
|
22964
22982
|
if (self.length !== that.length) return false;
|
|
22965
22983
|
const as = toReadonlyArray(self);
|
|
22966
22984
|
const bs = toReadonlyArray(that);
|
|
22967
22985
|
for (let i = 0; i < as.length; i++) if (!isEquivalent(as[i], bs[i])) return false;
|
|
22968
22986
|
return true;
|
|
22969
22987
|
});
|
|
22970
|
-
const _equivalence = /*#__PURE__*/ makeEquivalence(equals$1);
|
|
22988
|
+
const _equivalence = /*#__PURE__*/ makeEquivalence$1(equals$1);
|
|
22971
22989
|
const ChunkProto = {
|
|
22972
22990
|
[TypeId$51]: { _A: (_) => _ },
|
|
22973
22991
|
toString() {
|
|
@@ -24134,7 +24152,7 @@ const redactedProto = (typeId, label) => ({
|
|
|
24134
24152
|
* Builds a key. Keys compare by reference: comparing key bytes is not constant
|
|
24135
24153
|
* time, and structural equality would let secret keys act as `HashMap` keys.
|
|
24136
24154
|
*/
|
|
24137
|
-
const make$
|
|
24155
|
+
const make$59 = (proto, algorithm, material) => byReferenceUnsafe(Object.create(proto, {
|
|
24138
24156
|
algorithm: {
|
|
24139
24157
|
value: algorithm,
|
|
24140
24158
|
enumerable: true
|
|
@@ -24142,7 +24160,7 @@ const make$58 = (proto, algorithm, material) => byReferenceUnsafe(Object.create(
|
|
|
24142
24160
|
[MaterialId]: { value: material }
|
|
24143
24161
|
}));
|
|
24144
24162
|
/** @internal */
|
|
24145
|
-
const makeBytes = (proto, algorithm, bytes) => make$
|
|
24163
|
+
const makeBytes = (proto, algorithm, bytes) => make$59(proto, algorithm, {
|
|
24146
24164
|
_tag: "Bytes",
|
|
24147
24165
|
bytes
|
|
24148
24166
|
});
|
|
@@ -24205,7 +24223,7 @@ const importedAlgorithm = (algorithm, cryptoKey) => {
|
|
|
24205
24223
|
*/
|
|
24206
24224
|
const fromCryptoKey$3 = (module, method, proto, algorithm, cryptoKey, expected) => suspend$2(() => {
|
|
24207
24225
|
const problem = checkCryptoKey(cryptoKey, expected);
|
|
24208
|
-
return problem === void 0 ? succeed$5(make$
|
|
24226
|
+
return problem === void 0 ? succeed$5(make$59(proto, importedAlgorithm(algorithm, cryptoKey), {
|
|
24209
24227
|
_tag: "CryptoKey",
|
|
24210
24228
|
cryptoKey
|
|
24211
24229
|
})) : invalidKey(module, method, problem);
|
|
@@ -26621,7 +26639,7 @@ const isRedacted = (u) => hasProperty(u, TypeId$45);
|
|
|
26621
26639
|
* @category constructors
|
|
26622
26640
|
* @since 3.3.0
|
|
26623
26641
|
*/
|
|
26624
|
-
const make$
|
|
26642
|
+
const make$57 = (value, options) => {
|
|
26625
26643
|
const self = Object.create(Proto$17);
|
|
26626
26644
|
if (options?.label) self.label = options.label;
|
|
26627
26645
|
redactedRegistry.set(self, value);
|
|
@@ -26667,6 +26685,36 @@ const Proto$17 = {
|
|
|
26667
26685
|
* @since 3.3.0
|
|
26668
26686
|
*/
|
|
26669
26687
|
const value = value$1;
|
|
26688
|
+
/**
|
|
26689
|
+
* Generates an equivalence relation for `Redacted<A>` values based on an
|
|
26690
|
+
* equivalence relation for the underlying values `A`. This function is useful
|
|
26691
|
+
* for comparing `Redacted` instances without exposing their contents.
|
|
26692
|
+
*
|
|
26693
|
+
* **When to use**
|
|
26694
|
+
*
|
|
26695
|
+
* Use when you need to compare wrapped secrets through an approved equality
|
|
26696
|
+
* rule without exposing the underlying values at each comparison site.
|
|
26697
|
+
*
|
|
26698
|
+
* **Example** (Comparing redacted values)
|
|
26699
|
+
*
|
|
26700
|
+
* ```ts import.meta.vitest
|
|
26701
|
+
* import { Equivalence, Redacted } from "effect"
|
|
26702
|
+
*
|
|
26703
|
+
* const API_KEY1 = Redacted.make("1234567890")
|
|
26704
|
+
* const API_KEY2 = Redacted.make("1-34567890")
|
|
26705
|
+
* const API_KEY3 = Redacted.make("1234567890")
|
|
26706
|
+
*
|
|
26707
|
+
* const equivalence = Redacted.makeEquivalence(Equivalence.strictEqual<string>())
|
|
26708
|
+
*
|
|
26709
|
+
* equivalence(API_KEY1, API_KEY2) // => false
|
|
26710
|
+
* equivalence(API_KEY1, API_KEY3) // => true
|
|
26711
|
+
* ```
|
|
26712
|
+
*
|
|
26713
|
+
* @stability stable
|
|
26714
|
+
* @category instances
|
|
26715
|
+
* @since 4.0.0
|
|
26716
|
+
*/
|
|
26717
|
+
const makeEquivalence = (isEquivalent) => make$73((x, y) => isEquivalent(value(x), value(y)));
|
|
26670
26718
|
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/Headers.js
|
|
26671
26719
|
/**
|
|
26672
26720
|
* Models HTTP headers for the unstable HTTP client and server modules.
|
|
@@ -26695,7 +26743,7 @@ const TypeId$44 = /*#__PURE__*/ Symbol.for("~effect/http/Headers");
|
|
|
26695
26743
|
const Proto$16 = /*#__PURE__*/ Object.defineProperties(/*#__PURE__*/ Object.create(null), {
|
|
26696
26744
|
[TypeId$44]: { value: TypeId$44 },
|
|
26697
26745
|
[symbolRedactable]: { value(context) {
|
|
26698
|
-
return redact$1(this, get$
|
|
26746
|
+
return redact$1(this, get$7(context, CurrentRedactedNames$1));
|
|
26699
26747
|
} },
|
|
26700
26748
|
toJSON: { value() {
|
|
26701
26749
|
return redact$2(this);
|
|
@@ -26709,7 +26757,7 @@ const Proto$16 = /*#__PURE__*/ Object.defineProperties(/*#__PURE__*/ Object.crea
|
|
|
26709
26757
|
toString: { value: BaseProto.toString },
|
|
26710
26758
|
[NodeInspectSymbol]: { value: BaseProto[NodeInspectSymbol] }
|
|
26711
26759
|
});
|
|
26712
|
-
const make$
|
|
26760
|
+
const make$56 = (input) => Object.assign(Object.create(Proto$16), input);
|
|
26713
26761
|
/**
|
|
26714
26762
|
* Provides an `Equivalence` instance that compares `Headers` by header names
|
|
26715
26763
|
* and string values.
|
|
@@ -26718,7 +26766,7 @@ const make$55 = (input) => Object.assign(Object.create(Proto$16), input);
|
|
|
26718
26766
|
* @category instances
|
|
26719
26767
|
* @since 4.0.0
|
|
26720
26768
|
*/
|
|
26721
|
-
const Equivalence$2 = /*#__PURE__*/ makeEquivalence$
|
|
26769
|
+
const Equivalence$2 = /*#__PURE__*/ makeEquivalence$3(/*#__PURE__*/ strictEqual());
|
|
26722
26770
|
/**
|
|
26723
26771
|
* An empty `Headers` collection.
|
|
26724
26772
|
*
|
|
@@ -26773,7 +26821,7 @@ const fromRecordUnsafe = (input) => Object.setPrototypeOf(input, Proto$16);
|
|
|
26773
26821
|
* @category combinators
|
|
26774
26822
|
* @since 4.0.0
|
|
26775
26823
|
*/
|
|
26776
|
-
const get$
|
|
26824
|
+
const get$4 = /*#__PURE__*/ dual(2, (self, key) => fromUndefinedOr(self[key.toLowerCase()]));
|
|
26777
26825
|
/**
|
|
26778
26826
|
* Returns a new `Headers` collection with the given header set.
|
|
26779
26827
|
*
|
|
@@ -26785,8 +26833,8 @@ const get$3 = /*#__PURE__*/ dual(2, (self, key) => fromUndefinedOr(self[key.toLo
|
|
|
26785
26833
|
* @category combinators
|
|
26786
26834
|
* @since 4.0.0
|
|
26787
26835
|
*/
|
|
26788
|
-
const set$
|
|
26789
|
-
const out = make$
|
|
26836
|
+
const set$2 = /*#__PURE__*/ dual(3, (self, key, value) => {
|
|
26837
|
+
const out = make$56(self);
|
|
26790
26838
|
out[key.toLowerCase()] = value;
|
|
26791
26839
|
return out;
|
|
26792
26840
|
});
|
|
@@ -26801,7 +26849,7 @@ const set$1 = /*#__PURE__*/ dual(3, (self, key, value) => {
|
|
|
26801
26849
|
* @category combinators
|
|
26802
26850
|
* @since 4.0.0
|
|
26803
26851
|
*/
|
|
26804
|
-
const setAll$1 = /*#__PURE__*/ dual(2, (self, headers) => make$
|
|
26852
|
+
const setAll$1 = /*#__PURE__*/ dual(2, (self, headers) => make$56({
|
|
26805
26853
|
...self,
|
|
26806
26854
|
...fromInput$1(headers)
|
|
26807
26855
|
}));
|
|
@@ -26817,7 +26865,7 @@ const setAll$1 = /*#__PURE__*/ dual(2, (self, headers) => make$55({
|
|
|
26817
26865
|
* @since 4.0.0
|
|
26818
26866
|
*/
|
|
26819
26867
|
const merge$2 = /*#__PURE__*/ dual(2, (self, headers) => {
|
|
26820
|
-
const out = make$
|
|
26868
|
+
const out = make$56(self);
|
|
26821
26869
|
Object.assign(out, headers);
|
|
26822
26870
|
return out;
|
|
26823
26871
|
});
|
|
@@ -26833,7 +26881,7 @@ const merge$2 = /*#__PURE__*/ dual(2, (self, headers) => {
|
|
|
26833
26881
|
* @since 4.0.0
|
|
26834
26882
|
*/
|
|
26835
26883
|
const remove$1 = /*#__PURE__*/ dual(2, (self, key) => {
|
|
26836
|
-
const out = make$
|
|
26884
|
+
const out = make$56(self);
|
|
26837
26885
|
delete out[key.toLowerCase()];
|
|
26838
26886
|
return out;
|
|
26839
26887
|
});
|
|
@@ -26853,8 +26901,8 @@ const redact$1 = /*#__PURE__*/ dual(2, (self, key) => {
|
|
|
26853
26901
|
const modify = (key) => {
|
|
26854
26902
|
if (typeof key === "string") {
|
|
26855
26903
|
const k = key.toLowerCase();
|
|
26856
|
-
if (k in self) out[k] = make$
|
|
26857
|
-
} else for (const name in self) if (name.search(key) !== -1) out[name] = make$
|
|
26904
|
+
if (k in self) out[k] = make$57(self[k]);
|
|
26905
|
+
} else for (const name in self) if (name.search(key) !== -1) out[name] = make$57(self[name]);
|
|
26858
26906
|
};
|
|
26859
26907
|
if (Array.isArray(key)) for (let i = 0; i < key.length; i++) modify(key[i]);
|
|
26860
26908
|
else modify(key);
|
|
@@ -27130,7 +27178,7 @@ const Proto$15 = {
|
|
|
27130
27178
|
[symbolRedactable](context) {
|
|
27131
27179
|
return {
|
|
27132
27180
|
_id: "UrlParams",
|
|
27133
|
-
params: Object.fromEntries(redact(this, get$
|
|
27181
|
+
params: Object.fromEntries(redact(this, get$7(context, CurrentRedactedNames)))
|
|
27134
27182
|
};
|
|
27135
27183
|
},
|
|
27136
27184
|
toJSON() {
|
|
@@ -27154,7 +27202,7 @@ const Proto$15 = {
|
|
|
27154
27202
|
* @category constructors
|
|
27155
27203
|
* @since 4.0.0
|
|
27156
27204
|
*/
|
|
27157
|
-
const make$
|
|
27205
|
+
const make$55 = (params) => {
|
|
27158
27206
|
const self = Object.create(Proto$15);
|
|
27159
27207
|
self.params = params;
|
|
27160
27208
|
return self;
|
|
@@ -27180,7 +27228,7 @@ const fromInput = (input) => {
|
|
|
27180
27228
|
const [keys, value] = parsed[i];
|
|
27181
27229
|
out.push([`${keys[0]}[${keys.slice(1).join("][")}]`, value]);
|
|
27182
27230
|
} else out.push(parsed[i]);
|
|
27183
|
-
return make$
|
|
27231
|
+
return make$55(out);
|
|
27184
27232
|
};
|
|
27185
27233
|
const fromInputNested = (input) => {
|
|
27186
27234
|
const entries = typeof input[Symbol.iterator] === "function" ? fromIterable$2(input) : Object.entries(input);
|
|
@@ -27206,8 +27254,8 @@ const coerce = (value) => isRedacted(value) ? value : String(value);
|
|
|
27206
27254
|
* @category instances
|
|
27207
27255
|
* @since 4.0.0
|
|
27208
27256
|
*/
|
|
27209
|
-
const Equivalence$1 = /*#__PURE__*/ make$
|
|
27210
|
-
const arrayEquivalence = /*#__PURE__*/ makeEquivalence$
|
|
27257
|
+
const Equivalence$1 = /*#__PURE__*/ make$73((a, b) => arrayEquivalence(a.params, b.params));
|
|
27258
|
+
const arrayEquivalence = /*#__PURE__*/ makeEquivalence$2(/*#__PURE__*/ makeEquivalence$4([/*#__PURE__*/ strictEqual(), /*#__PURE__*/ asEquivalence()]));
|
|
27211
27259
|
/**
|
|
27212
27260
|
* An empty `UrlParams` value.
|
|
27213
27261
|
*
|
|
@@ -27215,7 +27263,7 @@ const arrayEquivalence = /*#__PURE__*/ makeEquivalence$1(/*#__PURE__*/ makeEquiv
|
|
|
27215
27263
|
* @category constructors
|
|
27216
27264
|
* @since 4.0.0
|
|
27217
27265
|
*/
|
|
27218
|
-
const empty$5 = /*#__PURE__*/ make$
|
|
27266
|
+
const empty$5 = /*#__PURE__*/ make$55([]);
|
|
27219
27267
|
/**
|
|
27220
27268
|
* Sets multiple query parameters from input.
|
|
27221
27269
|
*
|
|
@@ -27236,7 +27284,7 @@ const setAll = /*#__PURE__*/ dual(2, (self, input) => {
|
|
|
27236
27284
|
if (keys.has(self.params[i][0])) continue;
|
|
27237
27285
|
params.push(self.params[i]);
|
|
27238
27286
|
}
|
|
27239
|
-
return make$
|
|
27287
|
+
return make$55(params);
|
|
27240
27288
|
});
|
|
27241
27289
|
/**
|
|
27242
27290
|
* Returns the parameter pairs with selected values wrapped in `Redacted`.
|
|
@@ -27252,7 +27300,7 @@ const setAll = /*#__PURE__*/ dual(2, (self, input) => {
|
|
|
27252
27300
|
*/
|
|
27253
27301
|
const redact = /*#__PURE__*/ dual(2, (self, key) => {
|
|
27254
27302
|
const patterns = Array.isArray(key) ? key : [key];
|
|
27255
|
-
return self.params.map(([name, value]) => [name, typeof value === "string" && isRedactedName(name, patterns) ? make$
|
|
27303
|
+
return self.params.map(([name, value]) => [name, typeof value === "string" && isRedactedName(name, patterns) ? make$57(value) : value]);
|
|
27256
27304
|
});
|
|
27257
27305
|
/**
|
|
27258
27306
|
* Checks whether a parameter name matches one of the redaction patterns.
|
|
@@ -27331,7 +27379,7 @@ const decodeQueryKey = (key) => {
|
|
|
27331
27379
|
return key;
|
|
27332
27380
|
}
|
|
27333
27381
|
};
|
|
27334
|
-
const currentRedactedNames = () => get$
|
|
27382
|
+
const currentRedactedNames = () => get$7(globalThis["~effect/Fiber/currentFiber"]?.context ?? empty$12(), CurrentRedactedNames);
|
|
27335
27383
|
/**
|
|
27336
27384
|
* Query parameter names or patterns to redact in inspection, spans and errors.
|
|
27337
27385
|
*
|
|
@@ -27641,6 +27689,24 @@ function makeCompositeAtKey(compositeAst, pointerKey, pointerIssue, compositeInp
|
|
|
27641
27689
|
return new Composite(compositeAst, [new Pointer([pointerKey], pointerIssue)], compositeInput, parseOptions);
|
|
27642
27690
|
}
|
|
27643
27691
|
/**
|
|
27692
|
+
* Constructs a schema issue for a forbidden parsing operation.
|
|
27693
|
+
*
|
|
27694
|
+
* @stability stable
|
|
27695
|
+
* @category constructors
|
|
27696
|
+
* @since 4.0.0
|
|
27697
|
+
*/
|
|
27698
|
+
const Forbidden = class extends IssueNodeImpl {
|
|
27699
|
+
_tag = "Forbidden";
|
|
27700
|
+
/**
|
|
27701
|
+
* The metadata for the issue.
|
|
27702
|
+
*/
|
|
27703
|
+
annotations;
|
|
27704
|
+
constructor(annotations, input, options) {
|
|
27705
|
+
super(input, options);
|
|
27706
|
+
this.annotations = annotations;
|
|
27707
|
+
}
|
|
27708
|
+
};
|
|
27709
|
+
/**
|
|
27644
27710
|
* Constructs a schema issue for a value that matches no union member.
|
|
27645
27711
|
*
|
|
27646
27712
|
* @stability stable
|
|
@@ -27968,6 +28034,84 @@ const compose = /*#__PURE__*/ dual(2, (self, other) => {
|
|
|
27968
28034
|
case "TransformOptionalEffect": return composeOptionalEffect(self, other);
|
|
27969
28035
|
}
|
|
27970
28036
|
});
|
|
28037
|
+
/**
|
|
28038
|
+
* Creates a getter that always fails with the given issue.
|
|
28039
|
+
*
|
|
28040
|
+
* **When to use**
|
|
28041
|
+
*
|
|
28042
|
+
* Use when you need a schema getter that unconditionally rejects input.
|
|
28043
|
+
* - Building custom validation getters that produce specific error types.
|
|
28044
|
+
*
|
|
28045
|
+
* **Details**
|
|
28046
|
+
*
|
|
28047
|
+
* - Always fails with the `Issue` returned by `f`.
|
|
28048
|
+
* - The failure function receives the original `Option<E>` input and the
|
|
28049
|
+
* effective `ParseOptions` for error context.
|
|
28050
|
+
*
|
|
28051
|
+
* **Example** (Defining an always-failing getter)
|
|
28052
|
+
*
|
|
28053
|
+
* ```ts import.meta.vitest
|
|
28054
|
+
* import { Effect, Option, SchemaGetter, SchemaIssue } from "effect"
|
|
28055
|
+
*
|
|
28056
|
+
* const rejectAll = SchemaGetter.fail<string, string>(
|
|
28057
|
+
* () => new SchemaIssue.InvalidValue({ message: "not allowed" })
|
|
28058
|
+
* )
|
|
28059
|
+
* const issue = await Effect.runPromise(
|
|
28060
|
+
* Effect.flip(SchemaGetter.run(rejectAll, Option.some("x"), {}))
|
|
28061
|
+
* )
|
|
28062
|
+
* issue._tag // => "InvalidValue"
|
|
28063
|
+
* ```
|
|
28064
|
+
*
|
|
28065
|
+
* @see {@link forbidden} for a convenience helper for `Forbidden` issues
|
|
28066
|
+
* @see {@link checkEffect} to fail conditionally based on input value
|
|
28067
|
+
*
|
|
28068
|
+
* @stability stable
|
|
28069
|
+
* @category constructors
|
|
28070
|
+
* @since 4.0.0
|
|
28071
|
+
*/
|
|
28072
|
+
function fail$3(f) {
|
|
28073
|
+
return transformOptionalEffect((oe, options) => fail$7(f(oe, options)));
|
|
28074
|
+
}
|
|
28075
|
+
/**
|
|
28076
|
+
* Creates a getter that always fails with a `Forbidden` issue.
|
|
28077
|
+
*
|
|
28078
|
+
* **When to use**
|
|
28079
|
+
*
|
|
28080
|
+
* Use when you need a schema getter to disallow a field or direction
|
|
28081
|
+
* (encode/decode) entirely.
|
|
28082
|
+
* - You want a clear "forbidden" error message in schema validation output.
|
|
28083
|
+
*
|
|
28084
|
+
* **Details**
|
|
28085
|
+
*
|
|
28086
|
+
* - Always fails with `SchemaIssue.Forbidden`.
|
|
28087
|
+
* - The message function receives the `Option<E>` input for context.
|
|
28088
|
+
*
|
|
28089
|
+
* **Example** (Forbidding a decode direction)
|
|
28090
|
+
*
|
|
28091
|
+
* ```ts import.meta.vitest
|
|
28092
|
+
* import { Effect, Option, SchemaGetter } from "effect"
|
|
28093
|
+
*
|
|
28094
|
+
* const noEncode = SchemaGetter.forbidden<string, number>(
|
|
28095
|
+
* () => "encoding is not supported"
|
|
28096
|
+
* )
|
|
28097
|
+
* const issue = await Effect.runPromise(
|
|
28098
|
+
* Effect.flip(SchemaGetter.run(noEncode, Option.some(1), {}))
|
|
28099
|
+
* )
|
|
28100
|
+
* issue._tag // => "Forbidden"
|
|
28101
|
+
* ```
|
|
28102
|
+
*
|
|
28103
|
+
* @see {@link fail} to fail with a custom issue type
|
|
28104
|
+
*
|
|
28105
|
+
* @stability stable
|
|
28106
|
+
* @category constructors
|
|
28107
|
+
* @since 4.0.0
|
|
28108
|
+
*/
|
|
28109
|
+
function forbidden(message) {
|
|
28110
|
+
return fail$3((oe, options) => {
|
|
28111
|
+
const annotations = { message: message(oe) };
|
|
28112
|
+
return isSome(oe) ? new Forbidden(annotations, oe.value, options) : new Forbidden(annotations);
|
|
28113
|
+
});
|
|
28114
|
+
}
|
|
27971
28115
|
const passthrough_$1 = /*#__PURE__*/ makeGetter({ _tag: "Passthrough" });
|
|
27972
28116
|
function passthrough$1() {
|
|
27973
28117
|
return passthrough_$1;
|
|
@@ -31291,7 +31435,7 @@ function makeOption(schema) {
|
|
|
31291
31435
|
* @category constructors
|
|
31292
31436
|
* @since 4.0.0
|
|
31293
31437
|
*/
|
|
31294
|
-
function make$
|
|
31438
|
+
function make$54(schema) {
|
|
31295
31439
|
return makeConstructorSync(toType$1(schema.ast));
|
|
31296
31440
|
}
|
|
31297
31441
|
/**
|
|
@@ -31523,7 +31667,7 @@ const RebuildOptions = /*#__PURE__*/ Symbol();
|
|
|
31523
31667
|
const SchemaProto = {
|
|
31524
31668
|
[TypeId$39]: TypeId$39,
|
|
31525
31669
|
get make() {
|
|
31526
|
-
const value = make$
|
|
31670
|
+
const value = make$54(this);
|
|
31527
31671
|
Object.defineProperty(this, "make", {
|
|
31528
31672
|
value,
|
|
31529
31673
|
enumerable: true
|
|
@@ -31559,11 +31703,11 @@ const SchemaProto = {
|
|
|
31559
31703
|
return this.rebuild(appendChecks(this.ast, checks));
|
|
31560
31704
|
},
|
|
31561
31705
|
rebuild(ast) {
|
|
31562
|
-
return make$
|
|
31706
|
+
return make$53(ast, this[RebuildOptions]);
|
|
31563
31707
|
}
|
|
31564
31708
|
};
|
|
31565
31709
|
/** @internal */
|
|
31566
|
-
function make$
|
|
31710
|
+
function make$53(ast, options) {
|
|
31567
31711
|
function Schema() {}
|
|
31568
31712
|
const self = Object.setPrototypeOf(Schema, SchemaProto);
|
|
31569
31713
|
if (options && (Object.hasOwn(options, "name") || Object.hasOwn(options, "length") || Object.hasOwn(options, "__proto__"))) Object.defineProperties(self, Object.getOwnPropertyDescriptors({ ...options }));
|
|
@@ -31575,7 +31719,7 @@ function make$52(ast, options) {
|
|
|
31575
31719
|
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/toCodec.js
|
|
31576
31720
|
/** @internal */
|
|
31577
31721
|
function toCodecJson$1(schema) {
|
|
31578
|
-
return make$
|
|
31722
|
+
return make$53(toCodecJsonAST(schema.ast), { schema });
|
|
31579
31723
|
}
|
|
31580
31724
|
/** @internal */
|
|
31581
31725
|
const toCodecJsonAST = /*#__PURE__*/ makeCodecDerivation(toCodecJsonASTStep);
|
|
@@ -31619,7 +31763,7 @@ function toCodecJsonASTStep(ast, recur) {
|
|
|
31619
31763
|
case "Declaration": {
|
|
31620
31764
|
const getLink = ast.annotations?.toCodecJson ?? ast.annotations?.toCodec;
|
|
31621
31765
|
if (!isFunction(getLink)) return replaceEncoding(ast, [unknownToJson]);
|
|
31622
|
-
const link = getLink(ast.typeParameters.map((tp) => make$
|
|
31766
|
+
const link = getLink(ast.typeParameters.map((tp) => make$53(toEncoded(tp))));
|
|
31623
31767
|
return link === void 0 ? ast : replaceEncoding(ast, [mapLink(link, recur)]);
|
|
31624
31768
|
}
|
|
31625
31769
|
case "Unknown": return replaceEncoding(ast, [unknownToJson]);
|
|
@@ -31646,7 +31790,7 @@ function toCodecJsonASTStep(ast, recur) {
|
|
|
31646
31790
|
}
|
|
31647
31791
|
/** @internal */
|
|
31648
31792
|
function toCodecStringTree$1(schema) {
|
|
31649
|
-
return make$
|
|
31793
|
+
return make$53(toCodecStringTreeAST(schema.ast), { schema });
|
|
31650
31794
|
}
|
|
31651
31795
|
const toStringTreeReorder = /*#__PURE__*/ makeReorder((ast) => {
|
|
31652
31796
|
switch (ast._tag) {
|
|
@@ -31662,7 +31806,7 @@ const toStringTreeReorder = /*#__PURE__*/ makeReorder((ast) => {
|
|
|
31662
31806
|
function toCodecStringTreeASTStep(ast, recur, onMissingAnnotation) {
|
|
31663
31807
|
switch (ast._tag) {
|
|
31664
31808
|
case "Declaration": {
|
|
31665
|
-
const typeParameters = ast.typeParameters.map((tp) => make$
|
|
31809
|
+
const typeParameters = ast.typeParameters.map((tp) => make$53(recur(toEncoded(tp))));
|
|
31666
31810
|
const getStringTreeLink = ast.annotations?.toCodecStringTree;
|
|
31667
31811
|
if (isFunction(getStringTreeLink)) {
|
|
31668
31812
|
const link = getStringTreeLink(typeParameters);
|
|
@@ -31894,7 +32038,7 @@ const concat$2 = (chunks) => {
|
|
|
31894
32038
|
* @category instances
|
|
31895
32039
|
* @since 4.0.6
|
|
31896
32040
|
*/
|
|
31897
|
-
const Order = /*#__PURE__*/ make$
|
|
32041
|
+
const Order = /*#__PURE__*/ make$72((self, that) => {
|
|
31898
32042
|
const length = Math.min(self.length, that.length);
|
|
31899
32043
|
for (let i = 0; i < length; i++) if (self[i] !== that[i]) return self[i] < that[i] ? -1 : 1;
|
|
31900
32044
|
return self.length < that.length ? -1 : self.length > that.length ? 1 : 0;
|
|
@@ -32495,7 +32639,7 @@ const TypeId$36 = TypeId$39;
|
|
|
32495
32639
|
*/
|
|
32496
32640
|
function declareConstructor() {
|
|
32497
32641
|
return (typeParameters, run, annotations) => {
|
|
32498
|
-
return make$
|
|
32642
|
+
return make$52(new Declaration(typeParameters.map(getAST), (typeParameters) => run(typeParameters.map((ast) => make$52(ast))), annotations));
|
|
32499
32643
|
};
|
|
32500
32644
|
}
|
|
32501
32645
|
/**
|
|
@@ -32846,6 +32990,29 @@ function encodeUnknownEffect(schema, options) {
|
|
|
32846
32990
|
};
|
|
32847
32991
|
}
|
|
32848
32992
|
/**
|
|
32993
|
+
* Encodes a typed input (the schema's `Type`) against a schema, returning an
|
|
32994
|
+
* `Effect` that succeeds with the encoded value or fails with a
|
|
32995
|
+
* {@link SchemaError}.
|
|
32996
|
+
*
|
|
32997
|
+
* **When to use**
|
|
32998
|
+
*
|
|
32999
|
+
* Use when you need to encode input already typed as the schema's `Type` in
|
|
33000
|
+
* an `Effect` whose failure channel is `SchemaError`.
|
|
33001
|
+
*
|
|
33002
|
+
* **Details**
|
|
33003
|
+
*
|
|
33004
|
+
* For `unknown` input use {@link encodeUnknownEffect}.
|
|
33005
|
+
* Options may be provided either when creating the encoder or when applying it;
|
|
33006
|
+
* application options override creation options.
|
|
33007
|
+
*
|
|
33008
|
+
* @see {@link SchemaParser.encodeEffect} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
33009
|
+
*
|
|
33010
|
+
* @stability stable
|
|
33011
|
+
* @category encoding
|
|
33012
|
+
* @since 4.0.0
|
|
33013
|
+
*/
|
|
33014
|
+
const encodeEffect = encodeUnknownEffect;
|
|
33015
|
+
/**
|
|
32849
33016
|
* Encodes an `unknown` input against a schema synchronously, throwing a
|
|
32850
33017
|
* {@link SchemaError} for schema mismatches.
|
|
32851
33018
|
*
|
|
@@ -32922,7 +33089,7 @@ const encodeSync = encodeUnknownSync$1;
|
|
|
32922
33089
|
* @category constructors
|
|
32923
33090
|
* @since 3.10.0
|
|
32924
33091
|
*/
|
|
32925
|
-
const make$
|
|
33092
|
+
const make$52 = make$53;
|
|
32926
33093
|
/**
|
|
32927
33094
|
* Checks whether a value is a `Schema`.
|
|
32928
33095
|
*
|
|
@@ -32956,7 +33123,7 @@ function isSchema(u) {
|
|
|
32956
33123
|
* @category combinators
|
|
32957
33124
|
* @since 4.0.0
|
|
32958
33125
|
*/
|
|
32959
|
-
const optionalKey = /*#__PURE__*/ lambda((schema) => make$
|
|
33126
|
+
const optionalKey = /*#__PURE__*/ lambda((schema) => make$52(optionalKey$1(schema.ast), { schema }));
|
|
32960
33127
|
/**
|
|
32961
33128
|
* Marks a struct field as optional, allowing the key to be absent or
|
|
32962
33129
|
* `undefined`.
|
|
@@ -32989,7 +33156,7 @@ const optionalKey = /*#__PURE__*/ lambda((schema) => make$51(optionalKey$1(schem
|
|
|
32989
33156
|
*/
|
|
32990
33157
|
const optional$2 = /*#__PURE__*/ lambda((self) => {
|
|
32991
33158
|
const schema = UndefinedOr(self);
|
|
32992
|
-
return make$
|
|
33159
|
+
return make$52(optional$3(self.ast), { schema });
|
|
32993
33160
|
});
|
|
32994
33161
|
/**
|
|
32995
33162
|
* Extracts the type-side schema: sets `Encoded` to equal the decoded `Type`,
|
|
@@ -32999,7 +33166,7 @@ const optional$2 = /*#__PURE__*/ lambda((self) => {
|
|
|
32999
33166
|
* @category transforming
|
|
33000
33167
|
* @since 4.0.0
|
|
33001
33168
|
*/
|
|
33002
|
-
const toType = /*#__PURE__*/ lambda((schema) => make$
|
|
33169
|
+
const toType = /*#__PURE__*/ lambda((schema) => make$52(toType$1(schema.ast), { schema }));
|
|
33003
33170
|
/**
|
|
33004
33171
|
* Creates a schema for a single literal value (string, number, bigint, boolean, or null).
|
|
33005
33172
|
*
|
|
@@ -33021,7 +33188,7 @@ const toType = /*#__PURE__*/ lambda((schema) => make$51(toType$1(schema.ast), {
|
|
|
33021
33188
|
* @since 3.10.0
|
|
33022
33189
|
*/
|
|
33023
33190
|
function Literal(literal) {
|
|
33024
|
-
const out = make$
|
|
33191
|
+
const out = make$52(new Literal$1(literal), {
|
|
33025
33192
|
literal,
|
|
33026
33193
|
transform(to) {
|
|
33027
33194
|
return out.pipe(decodeTo(Literal(to), {
|
|
@@ -33039,7 +33206,7 @@ function Literal(literal) {
|
|
|
33039
33206
|
* @category schemas
|
|
33040
33207
|
* @since 3.10.0
|
|
33041
33208
|
*/
|
|
33042
|
-
const Never = /*#__PURE__*/ make$
|
|
33209
|
+
const Never = /*#__PURE__*/ make$52(never$2);
|
|
33043
33210
|
/**
|
|
33044
33211
|
* Schema for the `any` type. Accepts any value without validation.
|
|
33045
33212
|
*
|
|
@@ -33048,7 +33215,7 @@ const Never = /*#__PURE__*/ make$51(never$2);
|
|
|
33048
33215
|
* @category schemas
|
|
33049
33216
|
* @since 3.10.0
|
|
33050
33217
|
*/
|
|
33051
|
-
const Any = /*#__PURE__*/ make$
|
|
33218
|
+
const Any = /*#__PURE__*/ make$52(any);
|
|
33052
33219
|
/**
|
|
33053
33220
|
* Schema for the `unknown` type. Accepts any value without validation.
|
|
33054
33221
|
*
|
|
@@ -33062,7 +33229,7 @@ const Any = /*#__PURE__*/ make$51(any);
|
|
|
33062
33229
|
* @category schemas
|
|
33063
33230
|
* @since 3.10.0
|
|
33064
33231
|
*/
|
|
33065
|
-
const Unknown = /*#__PURE__*/ make$
|
|
33232
|
+
const Unknown = /*#__PURE__*/ make$52(unknown);
|
|
33066
33233
|
/**
|
|
33067
33234
|
* Schema for the `undefined` literal. Validates that the input is strictly `undefined`.
|
|
33068
33235
|
*
|
|
@@ -33071,7 +33238,7 @@ const Unknown = /*#__PURE__*/ make$51(unknown);
|
|
|
33071
33238
|
* @category schemas
|
|
33072
33239
|
* @since 3.10.0
|
|
33073
33240
|
*/
|
|
33074
|
-
const Undefined = /*#__PURE__*/ make$
|
|
33241
|
+
const Undefined = /*#__PURE__*/ make$52(undefined_);
|
|
33075
33242
|
/**
|
|
33076
33243
|
* Schema for `string` values. Validates that the input is `typeof` `"string"`.
|
|
33077
33244
|
*
|
|
@@ -33079,7 +33246,7 @@ const Undefined = /*#__PURE__*/ make$51(undefined_);
|
|
|
33079
33246
|
* @category schemas
|
|
33080
33247
|
* @since 4.0.0
|
|
33081
33248
|
*/
|
|
33082
|
-
const String$6 = /*#__PURE__*/ make$
|
|
33249
|
+
const String$6 = /*#__PURE__*/ make$52(string);
|
|
33083
33250
|
/**
|
|
33084
33251
|
* Schema for `number` values, including `NaN`, `Infinity`, and `-Infinity`.
|
|
33085
33252
|
*
|
|
@@ -33095,7 +33262,7 @@ const String$6 = /*#__PURE__*/ make$51(string);
|
|
|
33095
33262
|
* @category schemas
|
|
33096
33263
|
* @since 4.0.0
|
|
33097
33264
|
*/
|
|
33098
|
-
const Number$2 = /*#__PURE__*/ make$
|
|
33265
|
+
const Number$2 = /*#__PURE__*/ make$52(number);
|
|
33099
33266
|
/**
|
|
33100
33267
|
* Schema for `boolean` values. Validates that the input is `typeof` `"boolean"`.
|
|
33101
33268
|
*
|
|
@@ -33109,7 +33276,7 @@ const Number$2 = /*#__PURE__*/ make$51(number);
|
|
|
33109
33276
|
* @category schemas
|
|
33110
33277
|
* @since 4.0.0
|
|
33111
33278
|
*/
|
|
33112
|
-
const Boolean$5 = /*#__PURE__*/ make$
|
|
33279
|
+
const Boolean$5 = /*#__PURE__*/ make$52(boolean);
|
|
33113
33280
|
/**
|
|
33114
33281
|
* Schema for a TypeScript `void` return value.
|
|
33115
33282
|
*
|
|
@@ -33130,9 +33297,9 @@ const Boolean$5 = /*#__PURE__*/ make$51(boolean);
|
|
|
33130
33297
|
* @category schemas
|
|
33131
33298
|
* @since 3.10.0
|
|
33132
33299
|
*/
|
|
33133
|
-
const Void = /*#__PURE__*/ make$
|
|
33300
|
+
const Void = /*#__PURE__*/ make$52(void_);
|
|
33134
33301
|
function makeStruct(ast, fields) {
|
|
33135
|
-
return make$
|
|
33302
|
+
return make$52(ast, {
|
|
33136
33303
|
fields,
|
|
33137
33304
|
mapFields(f, options) {
|
|
33138
33305
|
const fields = f(this.fields);
|
|
@@ -33225,13 +33392,13 @@ function Struct(fields) {
|
|
|
33225
33392
|
* @since 3.10.0
|
|
33226
33393
|
*/
|
|
33227
33394
|
function Record$1(key, value) {
|
|
33228
|
-
return make$
|
|
33395
|
+
return make$52(record$3(key.ast, value.ast), {
|
|
33229
33396
|
key,
|
|
33230
33397
|
value
|
|
33231
33398
|
});
|
|
33232
33399
|
}
|
|
33233
33400
|
function makeTuple(ast, elements) {
|
|
33234
|
-
return make$
|
|
33401
|
+
return make$52(ast, {
|
|
33235
33402
|
elements,
|
|
33236
33403
|
mapElements(f, options) {
|
|
33237
33404
|
const elements = f(this.elements);
|
|
@@ -33263,7 +33430,7 @@ function Tuple(elements) {
|
|
|
33263
33430
|
* @category constructors
|
|
33264
33431
|
* @since 4.0.0
|
|
33265
33432
|
*/
|
|
33266
|
-
const ArraySchema = /*#__PURE__*/ lambda((schema) => make$
|
|
33433
|
+
const ArraySchema = /*#__PURE__*/ lambda((schema) => make$52(new Arrays(false, [], [schema.ast]), { value: schema }));
|
|
33267
33434
|
/**
|
|
33268
33435
|
* Defines a non-empty `ReadonlyArray` schema — at least one element required.
|
|
33269
33436
|
* Type is `readonly [T, ...T[]]`.
|
|
@@ -33282,9 +33449,9 @@ const ArraySchema = /*#__PURE__*/ lambda((schema) => make$51(new Arrays(false, [
|
|
|
33282
33449
|
* @category constructors
|
|
33283
33450
|
* @since 3.10.0
|
|
33284
33451
|
*/
|
|
33285
|
-
const NonEmptyArray = /*#__PURE__*/ lambda((schema) => make$
|
|
33452
|
+
const NonEmptyArray = /*#__PURE__*/ lambda((schema) => make$52(new Arrays(false, [schema.ast], [schema.ast]), { value: schema }));
|
|
33286
33453
|
function makeUnion(ast, members) {
|
|
33287
|
-
return make$
|
|
33454
|
+
return make$52(ast, {
|
|
33288
33455
|
members,
|
|
33289
33456
|
mapMembers(f, options) {
|
|
33290
33457
|
const members = f(this.members);
|
|
@@ -33339,7 +33506,7 @@ function Union(members, options) {
|
|
|
33339
33506
|
*/
|
|
33340
33507
|
function Literals(literals) {
|
|
33341
33508
|
const members = literals.map(Literal);
|
|
33342
|
-
return make$
|
|
33509
|
+
return make$52(union$1(members, void 0, void 0), {
|
|
33343
33510
|
literals,
|
|
33344
33511
|
members,
|
|
33345
33512
|
mapMembers(f) {
|
|
@@ -33386,7 +33553,7 @@ function check(...checks) {
|
|
|
33386
33553
|
}
|
|
33387
33554
|
function decodeTo(to, transformation) {
|
|
33388
33555
|
return (from) => {
|
|
33389
|
-
return make$
|
|
33556
|
+
return make$52(decodeTo$1(from.ast, to.ast, transformation ? makeTransformation$1(transformation) : passthrough()), {
|
|
33390
33557
|
from,
|
|
33391
33558
|
to
|
|
33392
33559
|
});
|
|
@@ -33441,7 +33608,7 @@ const BooleanLiterals = /*#__PURE__*/ Literals([...TrueLiterals.literals, ...Fal
|
|
|
33441
33608
|
* @since 3.10.0
|
|
33442
33609
|
*/
|
|
33443
33610
|
function withConstructorDefault(defaultValue) {
|
|
33444
|
-
return (schema) => make$
|
|
33611
|
+
return (schema) => make$52(withConstructorDefault$1(schema.ast, defaultValue), { schema });
|
|
33445
33612
|
}
|
|
33446
33613
|
/**
|
|
33447
33614
|
* Combines a {@link Literal} schema with {@link withConstructorDefault}, making it ideal
|
|
@@ -33659,7 +33826,7 @@ function TaggedUnion(casesByTag) {
|
|
|
33659
33826
|
}
|
|
33660
33827
|
const union = Union(members);
|
|
33661
33828
|
const { tag, guards, isAnyOf, match, matchOrElse } = toTaggedUnion("_tag")(union);
|
|
33662
|
-
return make$
|
|
33829
|
+
return make$52(union.ast, {
|
|
33663
33830
|
tag,
|
|
33664
33831
|
cases,
|
|
33665
33832
|
isAnyOf,
|
|
@@ -33799,7 +33966,7 @@ function isPattern(regExp, annotations) {
|
|
|
33799
33966
|
* @category schemas
|
|
33800
33967
|
* @since 3.10.0
|
|
33801
33968
|
*/
|
|
33802
|
-
const Finite = /*#__PURE__*/ make$
|
|
33969
|
+
const Finite = /*#__PURE__*/ make$52(finite);
|
|
33803
33970
|
/**
|
|
33804
33971
|
* Creates an inclusive or exclusive range check for any ordered type from an
|
|
33805
33972
|
* `Order.Order` instance.
|
|
@@ -34268,7 +34435,7 @@ function CauseReason(error, defect) {
|
|
|
34268
34435
|
}
|
|
34269
34436
|
}))
|
|
34270
34437
|
});
|
|
34271
|
-
return make$
|
|
34438
|
+
return make$52(schema.ast, {
|
|
34272
34439
|
error,
|
|
34273
34440
|
defect
|
|
34274
34441
|
});
|
|
@@ -34321,7 +34488,7 @@ function Cause(error, defect) {
|
|
|
34321
34488
|
encode: ({ reasons: failures }) => failures
|
|
34322
34489
|
}))
|
|
34323
34490
|
});
|
|
34324
|
-
return make$
|
|
34491
|
+
return make$52(schema.ast, {
|
|
34325
34492
|
error,
|
|
34326
34493
|
defect
|
|
34327
34494
|
});
|
|
@@ -34387,12 +34554,90 @@ function Exit(value, error, defect) {
|
|
|
34387
34554
|
}
|
|
34388
34555
|
}))
|
|
34389
34556
|
});
|
|
34390
|
-
return make$
|
|
34557
|
+
return make$52(schema.ast, {
|
|
34391
34558
|
value,
|
|
34392
34559
|
error,
|
|
34393
34560
|
defect
|
|
34394
34561
|
});
|
|
34395
34562
|
}
|
|
34563
|
+
/**
|
|
34564
|
+
* Schema for `Redacted` values, which hide their contents from inspection.
|
|
34565
|
+
*
|
|
34566
|
+
* **Details**
|
|
34567
|
+
*
|
|
34568
|
+
* Options:
|
|
34569
|
+
*
|
|
34570
|
+
* - `label`: When provided, the schema will behave as follows:
|
|
34571
|
+
* - Values will be validated against the label in addition to the wrapped schema
|
|
34572
|
+
* - The default JSON serializer will deserialize into a `Redacted` instance with the label
|
|
34573
|
+
* - The arbitrary generator will produce a `Redacted` instance with the label
|
|
34574
|
+
* - The formatter will return the label
|
|
34575
|
+
* - `disallowJsonEncode`: When set to `true`, when attempting to encode a `Redacted` instance
|
|
34576
|
+
* into JSON, it will fail with an error. This is useful when the wrapped schema is
|
|
34577
|
+
* sensitive and should not be exposed in JSON.
|
|
34578
|
+
*
|
|
34579
|
+
* @see {@link RedactedFromValue} for decoding raw values and wrapping them in `Redacted`.
|
|
34580
|
+
* @stability stable
|
|
34581
|
+
* @category schemas
|
|
34582
|
+
* @since 3.10.0
|
|
34583
|
+
*/
|
|
34584
|
+
function Redacted(value$7, options) {
|
|
34585
|
+
const label = typeof options?.label === "string" ? options.label : void 0;
|
|
34586
|
+
const disallowJsonEncode = options?.disallowJsonEncode === true;
|
|
34587
|
+
const normalizedOptions = label !== void 0 ? disallowJsonEncode ? {
|
|
34588
|
+
label,
|
|
34589
|
+
disallowJsonEncode: true
|
|
34590
|
+
} : { label } : disallowJsonEncode ? { disallowJsonEncode: true } : void 0;
|
|
34591
|
+
const decodeLabel = label !== void 0 ? decodeUnknownEffect$1(Literal(label)) : void 0;
|
|
34592
|
+
const schema = declareConstructor()([value$7], ([value$9]) => (input, ast, poptions) => {
|
|
34593
|
+
if (isRedacted(input)) {
|
|
34594
|
+
const label = decodeLabel !== void 0 ? mapErrorEager(decodeLabel(input.label, poptions), (issue) => new Pointer(["label"], issue)) : void_$1;
|
|
34595
|
+
return flatMapEager(label, () => mapBothEager(decodeUnknownEffect$1(value$9)(value(input), poptions), {
|
|
34596
|
+
onSuccess: (value) => make$57(value, { label: input.label }),
|
|
34597
|
+
onFailure: () => {
|
|
34598
|
+
return new Composite(ast, [new Pointer(["value"], new InvalidValue$1(void 0, input, poptions))], input, poptions);
|
|
34599
|
+
}
|
|
34600
|
+
}));
|
|
34601
|
+
}
|
|
34602
|
+
return fail$7(new InvalidType(ast, input, poptions));
|
|
34603
|
+
}, {
|
|
34604
|
+
representation: {
|
|
34605
|
+
id: "effect/schema/Redacted",
|
|
34606
|
+
payload: normalizedOptions ?? null
|
|
34607
|
+
},
|
|
34608
|
+
toCode: ({ typeParameters }) => ({
|
|
34609
|
+
runtime: normalizedOptions !== void 0 ? `Schema.Redacted(${typeParameters[0].runtime}, ${format$2(normalizedOptions)})` : `Schema.Redacted(${typeParameters[0].runtime})`,
|
|
34610
|
+
Type: `Redacted.Redacted<${typeParameters[0].Type}>`,
|
|
34611
|
+
importDeclarations: [`import * as Redacted from "effect/Redacted"`]
|
|
34612
|
+
}),
|
|
34613
|
+
expected: "Redacted",
|
|
34614
|
+
toCodecJson: ([value$6]) => link$1()(value$6, {
|
|
34615
|
+
decode: transform$3((e) => make$57(e, { label })),
|
|
34616
|
+
encode: disallowJsonEncode ? forbidden((oe) => "Cannot serialize Redacted" + (isSome(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : transform$3(value)
|
|
34617
|
+
}),
|
|
34618
|
+
toEquivalence: ([value]) => makeEquivalence(value)
|
|
34619
|
+
});
|
|
34620
|
+
return make$52(schema.ast, { value: value$7 });
|
|
34621
|
+
}
|
|
34622
|
+
/**
|
|
34623
|
+
* Decodes a value and wraps it in `Redacted<A>`. Unlike {@link Redacted} which
|
|
34624
|
+
* expects the input to already be a `Redacted` instance, this schema decodes
|
|
34625
|
+
* the raw value and wraps it.
|
|
34626
|
+
*
|
|
34627
|
+
* @see {@link Redacted} for schemas whose input is already a `Redacted` value.
|
|
34628
|
+
* @stability stable
|
|
34629
|
+
* @category schemas
|
|
34630
|
+
* @since 4.0.0
|
|
34631
|
+
*/
|
|
34632
|
+
function RedactedFromValue(value$8, options) {
|
|
34633
|
+
return decodeTo(Redacted(toType(value$8), {
|
|
34634
|
+
label: options?.label,
|
|
34635
|
+
disallowJsonEncode: options?.disallowEncode
|
|
34636
|
+
}), {
|
|
34637
|
+
decode: transform$3((t) => make$57(t, { label: options?.label })),
|
|
34638
|
+
encode: options?.disallowEncode ? forbidden((oe) => "Cannot encode Redacted" + (isSome(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : transform$3(value)
|
|
34639
|
+
})(value$8);
|
|
34640
|
+
}
|
|
34396
34641
|
const immerable = /*#__PURE__*/ globalThis.Symbol.for("immer-draftable");
|
|
34397
34642
|
const payloadToken = {};
|
|
34398
34643
|
function makeClass(Inherited, identifier, struct$1, annotations, proto) {
|
|
@@ -34488,7 +34733,7 @@ function getClassSchemaFactory(from, identifier, annotations) {
|
|
|
34488
34733
|
const ClassTypeId = getClassTypeId(identifier);
|
|
34489
34734
|
const isClassValue = (input) => input instanceof self || hasProperty(input, ClassTypeId);
|
|
34490
34735
|
const transformation = getClassTransformation(self);
|
|
34491
|
-
return memo = decodeTo(make$
|
|
34736
|
+
return memo = decodeTo(make$52(new Declaration([from.ast], () => (input, ast, options) => {
|
|
34492
34737
|
return isClassValue(input) ? succeed$5(input) : fail$7(new InvalidType(ast, input, options));
|
|
34493
34738
|
}, {
|
|
34494
34739
|
identifier,
|
|
@@ -34721,7 +34966,7 @@ const toCodecStringTree = toCodecStringTree$1;
|
|
|
34721
34966
|
* @category schemas
|
|
34722
34967
|
* @since 4.0.0
|
|
34723
34968
|
*/
|
|
34724
|
-
const Json = /*#__PURE__*/ make$
|
|
34969
|
+
const Json = /*#__PURE__*/ make$52(/*#__PURE__*/ annotate$1(Json$1, { toCode: () => ({
|
|
34725
34970
|
runtime: "Schema.Json",
|
|
34726
34971
|
Type: "Schema.Json"
|
|
34727
34972
|
}) }));
|
|
@@ -34761,7 +35006,7 @@ globalThis.Boolean;
|
|
|
34761
35006
|
* @category pattern matching
|
|
34762
35007
|
* @since 2.0.0
|
|
34763
35008
|
*/
|
|
34764
|
-
const match = /*#__PURE__*/ dual(2, (value, options) => value ? options.onTrue() : options.onFalse());
|
|
35009
|
+
const match$1 = /*#__PURE__*/ dual(2, (value, options) => value ? options.onTrue() : options.onFalse());
|
|
34765
35010
|
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Brand.js
|
|
34766
35011
|
/**
|
|
34767
35012
|
* Returns a `Constructor` that **does not apply any runtime checks** and just
|
|
@@ -34857,7 +35102,7 @@ const makeUnsafe$3 = makeLatchUnsafe;
|
|
|
34857
35102
|
* @category constructors
|
|
34858
35103
|
* @since 4.0.0
|
|
34859
35104
|
*/
|
|
34860
|
-
const make$
|
|
35105
|
+
const make$51 = makeLatch;
|
|
34861
35106
|
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/MutableRef.js
|
|
34862
35107
|
const TypeId$35 = "~effect/MutableRef";
|
|
34863
35108
|
const MutableRefProto = {
|
|
@@ -34903,7 +35148,7 @@ const MutableRefProto = {
|
|
|
34903
35148
|
* @category constructors
|
|
34904
35149
|
* @since 2.0.0
|
|
34905
35150
|
*/
|
|
34906
|
-
const make$
|
|
35151
|
+
const make$50 = (value) => {
|
|
34907
35152
|
const ref = Object.create(MutableRefProto);
|
|
34908
35153
|
ref.current = value;
|
|
34909
35154
|
return ref;
|
|
@@ -34959,7 +35204,7 @@ const make$49 = (value) => {
|
|
|
34959
35204
|
* @category mutations
|
|
34960
35205
|
* @since 2.0.0
|
|
34961
35206
|
*/
|
|
34962
|
-
const set = /*#__PURE__*/ dual(2, (self, value) => {
|
|
35207
|
+
const set$1 = /*#__PURE__*/ dual(2, (self, value) => {
|
|
34963
35208
|
self.current = value;
|
|
34964
35209
|
return self;
|
|
34965
35210
|
});
|
|
@@ -35008,7 +35253,7 @@ const SubscriptionTypeId = "~effect/PubSub/Subscription";
|
|
|
35008
35253
|
* @category constructors
|
|
35009
35254
|
* @since 4.0.0
|
|
35010
35255
|
*/
|
|
35011
|
-
const make$
|
|
35256
|
+
const make$49 = (options) => sync(() => makePubSubUnsafe(options.atomicPubSub(), /* @__PURE__ */ new Map(), makeUnsafe$7(), makeUnsafe$3(false), make$50(false), options.strategy(), make$50(none())));
|
|
35012
35257
|
/**
|
|
35013
35258
|
* Creates an unbounded `PubSub`.
|
|
35014
35259
|
*
|
|
@@ -35039,7 +35284,7 @@ const make$48 = (options) => sync(() => makePubSubUnsafe(options.atomicPubSub(),
|
|
|
35039
35284
|
* @category constructors
|
|
35040
35285
|
* @since 2.0.0
|
|
35041
35286
|
*/
|
|
35042
|
-
const unbounded = (options) => make$
|
|
35287
|
+
const unbounded = (options) => make$49({
|
|
35043
35288
|
atomicPubSub: () => makeAtomicUnbounded(options),
|
|
35044
35289
|
strategy: () => new DroppingStrategy()
|
|
35045
35290
|
});
|
|
@@ -35105,7 +35350,7 @@ const makeAtomicUnbounded = (options) => {
|
|
|
35105
35350
|
* @since 2.0.0
|
|
35106
35351
|
*/
|
|
35107
35352
|
const shutdown = (self) => uninterruptible(withFiber((fiber) => {
|
|
35108
|
-
set(self.shutdownFlag, true);
|
|
35353
|
+
set$1(self.shutdownFlag, true);
|
|
35109
35354
|
return close(self.scope, interrupt$2(fiber.id)).pipe(andThen(self.strategy.shutdown), when(self.shutdownHook.open), asVoid);
|
|
35110
35355
|
}));
|
|
35111
35356
|
/**
|
|
@@ -35255,13 +35500,13 @@ const publishUnsafe = /*#__PURE__*/ dual(2, (self, value) => {
|
|
|
35255
35500
|
* @since 2.0.0
|
|
35256
35501
|
*/
|
|
35257
35502
|
const subscribe = (self) => uninterruptible(contextWith((services) => {
|
|
35258
|
-
const localScope = get$
|
|
35503
|
+
const localScope = get$7(services, Scope);
|
|
35259
35504
|
const scope = forkUnsafe(self.scope);
|
|
35260
35505
|
const subscription = makeSubscriptionUnsafe(self.pubsub, self.subscribers, self.strategy, self.ended);
|
|
35261
35506
|
return addFinalizer$1(scope, unsubscribe(subscription)).pipe(andThen(addFinalizerExit(localScope, (exit) => close(scope, exit))), as(subscription));
|
|
35262
35507
|
}));
|
|
35263
35508
|
const unsubscribe = (self) => uninterruptible(withFiber((state) => {
|
|
35264
|
-
set(self.shutdownFlag, true);
|
|
35509
|
+
set$1(self.shutdownFlag, true);
|
|
35265
35510
|
return forEach$1(takeAll$2(self.pollers), (d) => interruptWith(d, state.id), {
|
|
35266
35511
|
discard: true,
|
|
35267
35512
|
concurrency: "unbounded"
|
|
@@ -35389,7 +35634,7 @@ const removeSubscribers = (subscribers, subscription, pollers) => {
|
|
|
35389
35634
|
set.delete(pollers);
|
|
35390
35635
|
if (set.size === 0) subscribers.delete(subscription);
|
|
35391
35636
|
};
|
|
35392
|
-
const makeSubscriptionUnsafe = (pubsub, subscribers, strategy, ended) => new SubscriptionImpl(pubsub, subscribers, pubsub.subscribe(), make$
|
|
35637
|
+
const makeSubscriptionUnsafe = (pubsub, subscribers, strategy, ended) => new SubscriptionImpl(pubsub, subscribers, pubsub.subscribe(), make$65(), makeUnsafe$3(false), make$50(false), strategy, pubsub.replayWindow(), ended);
|
|
35393
35638
|
var UnboundedPubSub = class {
|
|
35394
35639
|
publisherHead = {
|
|
35395
35640
|
value: AbsentValue,
|
|
@@ -35961,7 +36206,7 @@ const fromTransformBracket = (f) => fromTransform$1(fnUntraced(function* (upstre
|
|
|
35961
36206
|
* @since 4.0.0
|
|
35962
36207
|
*/
|
|
35963
36208
|
const toTransform = (channel) => channel.transform;
|
|
35964
|
-
const asyncQueue = (scope, f, options) => make$
|
|
36209
|
+
const asyncQueue = (scope, f, options) => make$64({
|
|
35965
36210
|
capacity: options?.bufferSize,
|
|
35966
36211
|
strategy: options?.strategy
|
|
35967
36212
|
}).pipe(tap$1((queue) => addFinalizer$1(scope, shutdown$1(queue))), tap$1((queue) => provide$3(f(queue), scope).pipe(catchCause$1((cause) => failCause$1(queue, cause)), forkIn(scope, { startImmediately: true }))));
|
|
@@ -36520,7 +36765,7 @@ const fromReadableStream$1 = (options) => fromTransform$1((_, scope) => readable
|
|
|
36520
36765
|
}));
|
|
36521
36766
|
const readableStreamToPullUnsafe = (options) => {
|
|
36522
36767
|
const reader = options.readable.getReader();
|
|
36523
|
-
const exit = options.exit ?? make$
|
|
36768
|
+
const exit = options.exit ?? make$50(void 0);
|
|
36524
36769
|
const pull = suspend$2(() => {
|
|
36525
36770
|
if (exit.current) return exit.current;
|
|
36526
36771
|
return matchCauseEffect(tryPromise({
|
|
@@ -36895,7 +37140,7 @@ const orDie$1 = (self) => catch_(self, die$1);
|
|
|
36895
37140
|
const mergeAll = /*#__PURE__*/ dual(2, (channels, { bufferSize = 16, concurrency, switch: switch_ = false }) => fromTransformBracket(fnUntraced(function* (upstream, scope, forkedScope) {
|
|
36896
37141
|
const concurrencyN = concurrency === "unbounded" ? Number.MAX_SAFE_INTEGER : Math.max(1, concurrency);
|
|
36897
37142
|
const semaphore = switch_ ? void 0 : makeUnsafe$5(concurrencyN);
|
|
36898
|
-
const doneLatch = yield* make$
|
|
37143
|
+
const doneLatch = yield* make$51(true);
|
|
36899
37144
|
const fibers = /* @__PURE__ */ new Map();
|
|
36900
37145
|
const queue = yield* bounded(bufferSize);
|
|
36901
37146
|
yield* addFinalizer$1(forkedScope, shutdown$1(queue));
|
|
@@ -37266,7 +37511,7 @@ const unwrap$5 = (channel) => fromTransform$1((upstream, scope) => {
|
|
|
37266
37511
|
*/
|
|
37267
37512
|
const bufferArray = /*#__PURE__*/ dual(2, (self, options) => fromTransform$1(fnUntraced(function* (upstream, scope) {
|
|
37268
37513
|
const pull = yield* toTransform(self)(upstream, scope);
|
|
37269
|
-
const queue = yield* make$
|
|
37514
|
+
const queue = yield* make$64({
|
|
37270
37515
|
capacity: options.capacity === "unbounded" ? void 0 : options.capacity,
|
|
37271
37516
|
strategy: options.capacity === "unbounded" ? void 0 : options.strategy
|
|
37272
37517
|
});
|
|
@@ -37995,7 +38240,7 @@ const isNotLink = (error) => isIgnorable(error) || error.reason._tag === "Unknow
|
|
|
37995
38240
|
const DIRECTORY_CONCURRENCY = 16;
|
|
37996
38241
|
const byName = /*#__PURE__*/ mapInput(String$10, (entry) => entry.name);
|
|
37997
38242
|
/** @internal */
|
|
37998
|
-
const make$
|
|
38243
|
+
const make$48 = (fs) => (pattern, options) => walk(fs, compile([pattern], options?.dot ?? false), options);
|
|
37999
38244
|
const walk = /*#__PURE__*/ fnUntraced(function* (fs, compiled, options) {
|
|
38000
38245
|
if (compiled.initial.size === 0) return [];
|
|
38001
38246
|
const root = options?.root ?? "";
|
|
@@ -38487,9 +38732,9 @@ var RcRefImpl = class {
|
|
|
38487
38732
|
}
|
|
38488
38733
|
};
|
|
38489
38734
|
/** @internal */
|
|
38490
|
-
const make$
|
|
38735
|
+
const make$47 = (options) => withFiber((fiber) => {
|
|
38491
38736
|
const context = fiber.context;
|
|
38492
|
-
const scope = get$
|
|
38737
|
+
const scope = get$7(context, Scope);
|
|
38493
38738
|
const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive !== void 0 ? fromInputUnsafe$1(options.idleTimeToLive) : void 0);
|
|
38494
38739
|
return as(addFinalizerExit(scope, () => {
|
|
38495
38740
|
const state = ref.state;
|
|
@@ -38552,7 +38797,7 @@ const awaitAcquiring = (self, acquiring, restore) => onExit$1(restore(join$1(acq
|
|
|
38552
38797
|
return interrupt(acquiring.fiber);
|
|
38553
38798
|
});
|
|
38554
38799
|
/** @internal */
|
|
38555
|
-
const get$
|
|
38800
|
+
const get$3 = (self_) => {
|
|
38556
38801
|
const self = self_;
|
|
38557
38802
|
return uninterruptibleMask((restore) => flatMap$2(scope, (scope) => flatMap$2(getState(self, restore), (state) => as(addFinalizerExit(scope, () => release(self, state)), state.value))));
|
|
38558
38803
|
};
|
|
@@ -38626,7 +38871,7 @@ const release = (self, state) => {
|
|
|
38626
38871
|
* @category constructors
|
|
38627
38872
|
* @since 3.5.0
|
|
38628
38873
|
*/
|
|
38629
|
-
const make$
|
|
38874
|
+
const make$46 = make$47;
|
|
38630
38875
|
/**
|
|
38631
38876
|
* Gets the value from an `RcRef`, acquiring it first if needed.
|
|
38632
38877
|
*
|
|
@@ -38672,7 +38917,7 @@ const make$45 = make$46;
|
|
|
38672
38917
|
* @category combinators
|
|
38673
38918
|
* @since 3.5.0
|
|
38674
38919
|
*/
|
|
38675
|
-
const get$
|
|
38920
|
+
const get$2 = get$3;
|
|
38676
38921
|
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Stream.js
|
|
38677
38922
|
/**
|
|
38678
38923
|
* Describes effectful sources that emit values over time.
|
|
@@ -38924,7 +39169,7 @@ const succeed$2 = (value) => fromChannel(succeed$3(of(value)));
|
|
|
38924
39169
|
* @category constructors
|
|
38925
39170
|
* @since 2.0.0
|
|
38926
39171
|
*/
|
|
38927
|
-
const make$
|
|
39172
|
+
const make$45 = (...values) => fromArray(values);
|
|
38928
39173
|
/**
|
|
38929
39174
|
* Creates a lazily constructed stream.
|
|
38930
39175
|
*
|
|
@@ -40108,10 +40353,10 @@ const FileSystem = /*#__PURE__*/ Service$1("effect/FileSystem");
|
|
|
40108
40353
|
* @category constructors
|
|
40109
40354
|
* @since 4.0.0
|
|
40110
40355
|
*/
|
|
40111
|
-
const make$
|
|
40356
|
+
const make$44 = (impl) => FileSystem.of({
|
|
40112
40357
|
...impl,
|
|
40113
40358
|
[TypeId$27]: TypeId$27,
|
|
40114
|
-
glob: make$
|
|
40359
|
+
glob: make$48(impl),
|
|
40115
40360
|
exists: (path) => pipe(impl.access(path), as(true), catchTag("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed$5(false) : fail$7(e))),
|
|
40116
40361
|
readFileString: (path, encoding) => flatMap$2(impl.readFile(path), (_) => try_({
|
|
40117
40362
|
try: () => new TextDecoder(encoding).decode(_),
|
|
@@ -40133,7 +40378,7 @@ const make$43 = (impl) => FileSystem.of({
|
|
|
40133
40378
|
return fromPull(succeed$5(flatMap$2(suspend$2(() => {
|
|
40134
40379
|
if (bytesToRead !== void 0 && bytesToRead <= totalBytesRead) return done$2();
|
|
40135
40380
|
return bytesToRead !== void 0 && bytesToRead - totalBytesRead < chunkSize ? file.readAlloc(Number(bytesToRead - totalBytesRead)) : readChunk;
|
|
40136
|
-
}), match$
|
|
40381
|
+
}), match$8({
|
|
40137
40382
|
onNone: () => done$2(),
|
|
40138
40383
|
onSome: (buf) => {
|
|
40139
40384
|
totalBytesRead += BigInt(buf.length);
|
|
@@ -40330,7 +40575,7 @@ const Path$1 = /*#__PURE__*/ Service$1("effect/Path");
|
|
|
40330
40575
|
* @category constructors
|
|
40331
40576
|
* @since 4.0.0
|
|
40332
40577
|
*/
|
|
40333
|
-
const make$
|
|
40578
|
+
const make$43 = (impl) => Path$1.of({
|
|
40334
40579
|
...impl,
|
|
40335
40580
|
[TypeId$26]: TypeId$26,
|
|
40336
40581
|
resolveWithin(root, input) {
|
|
@@ -40566,7 +40811,7 @@ function makeOrElse(first, second) {
|
|
|
40566
40811
|
* @category constructors
|
|
40567
40812
|
* @since 4.0.0
|
|
40568
40813
|
*/
|
|
40569
|
-
function make$
|
|
40814
|
+
function make$42(get) {
|
|
40570
40815
|
return makeSource(get, identityPath);
|
|
40571
40816
|
}
|
|
40572
40817
|
/**
|
|
@@ -40669,7 +40914,7 @@ const orElse = /*#__PURE__*/ dual(2, (self, that) => makeOrElse(self, that));
|
|
|
40669
40914
|
*/
|
|
40670
40915
|
function fromUnknown(root, options) {
|
|
40671
40916
|
const preserveEmptyStrings = options?.preserveEmptyStrings === true;
|
|
40672
|
-
return make$
|
|
40917
|
+
return make$42((path) => succeed$5(nodeAtJson(root, path, preserveEmptyStrings)));
|
|
40673
40918
|
}
|
|
40674
40919
|
function nodeAtJson(root, path, preserveEmptyStrings) {
|
|
40675
40920
|
let cur = root;
|
|
@@ -40737,7 +40982,7 @@ function emptyStringAsMissing(value, preserveEmptyStrings) {
|
|
|
40737
40982
|
function fromEnvRecord(env, options) {
|
|
40738
40983
|
const preserveEmptyStrings = options?.preserveEmptyStrings === true;
|
|
40739
40984
|
const trie = buildEnvTrie(env);
|
|
40740
|
-
return make$
|
|
40985
|
+
return make$42((path) => succeed$5(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
|
|
40741
40986
|
}
|
|
40742
40987
|
/**
|
|
40743
40988
|
* Creates a `ConfigProvider` backed by environment variables.
|
|
@@ -40911,7 +41156,7 @@ const Proto$13 = {
|
|
|
40911
41156
|
return { _id: "Config" };
|
|
40912
41157
|
}
|
|
40913
41158
|
};
|
|
40914
|
-
function make$
|
|
41159
|
+
function make$41(evaluator) {
|
|
40915
41160
|
const self = Object.create(Proto$13);
|
|
40916
41161
|
self.evaluator = evaluator;
|
|
40917
41162
|
self.parse = (provider) => flatMapEager(evaluator(provider, []), fromResult);
|
|
@@ -40946,7 +41191,7 @@ const evaluateAt = (self, provider, pathPrefix) => self.evaluator(provider, path
|
|
|
40946
41191
|
* @since 2.0.0
|
|
40947
41192
|
*/
|
|
40948
41193
|
const map$2 = /*#__PURE__*/ dual(2, (self, f) => {
|
|
40949
|
-
return make$
|
|
41194
|
+
return make$41((provider, pathPrefix) => map$5(evaluateAt(self, provider, pathPrefix), map$10(f)));
|
|
40950
41195
|
});
|
|
40951
41196
|
/**
|
|
40952
41197
|
* Combines multiple configs into a single config that parses all of them.
|
|
@@ -40993,7 +41238,7 @@ const map$2 = /*#__PURE__*/ dual(2, (self, f) => {
|
|
|
40993
41238
|
*/
|
|
40994
41239
|
function all(arg) {
|
|
40995
41240
|
const configs = globalThis.Array.isArray(arg) ? arg : Symbol.iterator in arg ? [...arg] : arg;
|
|
40996
|
-
return make$
|
|
41241
|
+
return make$41((provider, pathPrefix) => globalThis.Array.isArray(configs) ? mapEager(all$1(configs.map((config) => evaluateAt(config, provider, pathPrefix))), all$3) : mapEager(all$1(map$9(configs, (config) => evaluateAt(config, provider, pathPrefix))), all$3));
|
|
40997
41242
|
}
|
|
40998
41243
|
/**
|
|
40999
41244
|
* Provides a fallback value when the config is absent.
|
|
@@ -41032,7 +41277,7 @@ function all(arg) {
|
|
|
41032
41277
|
* @since 2.0.0
|
|
41033
41278
|
*/
|
|
41034
41279
|
const withDefault$2 = /*#__PURE__*/ dual(2, (self, defaultValue) => {
|
|
41035
|
-
return make$
|
|
41280
|
+
return make$41((provider, pathPrefix) => mapEager(evaluateAt(self, provider, pathPrefix), (resolution) => isFailure$1(resolution) ? succeed$10(defaultValue) : resolution));
|
|
41036
41281
|
});
|
|
41037
41282
|
/**
|
|
41038
41283
|
* Makes a config optional: returns `Some(value)` on success and `None` when the
|
|
@@ -41273,9 +41518,9 @@ const toConfigCursorAST = /*#__PURE__*/ memoize((root) => {
|
|
|
41273
41518
|
function schema$1(codec, path) {
|
|
41274
41519
|
const codecStringTree = toCodecStringTree(codec);
|
|
41275
41520
|
const encodedAst = toEncoded(codecStringTree.ast);
|
|
41276
|
-
const decodeCursor = decodeUnknownEffect$1(make$
|
|
41521
|
+
const decodeCursor = decodeUnknownEffect$1(make$52(toConfigCursorAST(codecStringTree.ast)));
|
|
41277
41522
|
const localPath = typeof path === "string" ? [path] : path ?? [];
|
|
41278
|
-
return make$
|
|
41523
|
+
return make$41((provider, pathPrefix) => {
|
|
41279
41524
|
const fullPath = [...pathPrefix, ...localPath];
|
|
41280
41525
|
return loadCursor(provider, fullPath).pipe(flatMapEager((cursor) => decodeCursor(cursor).pipe(mapEager(succeed$10), catchEager((issue) => {
|
|
41281
41526
|
const error = new ConfigError(new SchemaError(fullPath.length > 0 ? new Pointer(fullPath, issue) : issue));
|
|
@@ -41314,7 +41559,7 @@ const isPath = (u) => isString$2(u) || globalThis.Array.isArray(u);
|
|
|
41314
41559
|
* @since 2.0.0
|
|
41315
41560
|
*/
|
|
41316
41561
|
function succeed$1(value) {
|
|
41317
|
-
return make$
|
|
41562
|
+
return make$41(() => succeed$5(succeed$10(value)));
|
|
41318
41563
|
}
|
|
41319
41564
|
/**
|
|
41320
41565
|
* Creates a config for a single string value.
|
|
@@ -41675,7 +41920,7 @@ const makeUnsafe$2 = (backing, deferred) => {
|
|
|
41675
41920
|
* @category constructors
|
|
41676
41921
|
* @since 2.0.0
|
|
41677
41922
|
*/
|
|
41678
|
-
const make$
|
|
41923
|
+
const make$40 = () => acquireRelease(sync(() => makeUnsafe$2(/* @__PURE__ */ new Set(), makeUnsafe$8())), (set) => suspend$2(() => {
|
|
41679
41924
|
const state = set.state;
|
|
41680
41925
|
if (state._tag === "Closed") return void_$1;
|
|
41681
41926
|
set.state = { _tag: "Closed" };
|
|
@@ -41967,7 +42212,7 @@ const LogToStderr = LogToStderr$1;
|
|
|
41967
42212
|
* @category constructors
|
|
41968
42213
|
* @since 2.0.0
|
|
41969
42214
|
*/
|
|
41970
|
-
const make$
|
|
42215
|
+
const make$39 = loggerMake;
|
|
41971
42216
|
/**
|
|
41972
42217
|
* Creates a `Layer` which will overwrite the current set of loggers with the
|
|
41973
42218
|
* specified array of `loggers`.
|
|
@@ -42055,10 +42300,100 @@ const RefProto = {
|
|
|
42055
42300
|
*/
|
|
42056
42301
|
const makeUnsafe$1 = (value) => {
|
|
42057
42302
|
const self = Object.create(RefProto);
|
|
42058
|
-
self.ref = make$
|
|
42303
|
+
self.ref = make$50(value);
|
|
42059
42304
|
return self;
|
|
42060
42305
|
};
|
|
42061
42306
|
/**
|
|
42307
|
+
* Creates a new Ref with the specified initial value.
|
|
42308
|
+
*
|
|
42309
|
+
* **When to use**
|
|
42310
|
+
*
|
|
42311
|
+
* Use to create a `Ref` for shared mutable state inside an Effect program.
|
|
42312
|
+
*
|
|
42313
|
+
* **Example** (Creating a ref)
|
|
42314
|
+
*
|
|
42315
|
+
* ```ts import.meta.vitest
|
|
42316
|
+
* import { Effect, Ref } from "effect"
|
|
42317
|
+
*
|
|
42318
|
+
* const program = Effect.gen(function*() {
|
|
42319
|
+
* const ref = yield* Ref.make(42)
|
|
42320
|
+
* return yield* Ref.get(ref)
|
|
42321
|
+
* })
|
|
42322
|
+
*
|
|
42323
|
+
* await Effect.runPromise(program) // => 42
|
|
42324
|
+
* ```
|
|
42325
|
+
*
|
|
42326
|
+
* @see {@link makeUnsafe} for synchronous construction outside Effect code
|
|
42327
|
+
*
|
|
42328
|
+
* @stability stable
|
|
42329
|
+
* @category constructors
|
|
42330
|
+
* @since 2.0.0
|
|
42331
|
+
*/
|
|
42332
|
+
const make$38 = (value) => sync(() => makeUnsafe$1(value));
|
|
42333
|
+
/**
|
|
42334
|
+
* Gets the current value of the Ref.
|
|
42335
|
+
*
|
|
42336
|
+
* **When to use**
|
|
42337
|
+
*
|
|
42338
|
+
* Use to read the current `Ref` value without changing it.
|
|
42339
|
+
*
|
|
42340
|
+
* **Example** (Getting the current value)
|
|
42341
|
+
*
|
|
42342
|
+
* ```ts import.meta.vitest
|
|
42343
|
+
* import { Effect, Ref } from "effect"
|
|
42344
|
+
*
|
|
42345
|
+
* const program = Effect.gen(function*() {
|
|
42346
|
+
* const ref = yield* Ref.make(42)
|
|
42347
|
+
* return yield* Ref.get(ref)
|
|
42348
|
+
* })
|
|
42349
|
+
*
|
|
42350
|
+
* await Effect.runPromise(program) // => 42
|
|
42351
|
+
* ```
|
|
42352
|
+
*
|
|
42353
|
+
* @see {@link set} for replacing the current value
|
|
42354
|
+
*
|
|
42355
|
+
* @stability stable
|
|
42356
|
+
* @category getters
|
|
42357
|
+
* @since 2.0.0
|
|
42358
|
+
*/
|
|
42359
|
+
const get$1 = (self) => sync(() => self.ref.current);
|
|
42360
|
+
/**
|
|
42361
|
+
* Sets the value of the Ref to the specified value.
|
|
42362
|
+
*
|
|
42363
|
+
* **When to use**
|
|
42364
|
+
*
|
|
42365
|
+
* Use to replace the current `Ref` value with a known value.
|
|
42366
|
+
*
|
|
42367
|
+
* **Example** (Setting a value)
|
|
42368
|
+
*
|
|
42369
|
+
* ```ts import.meta.vitest
|
|
42370
|
+
* import { Effect, Ref } from "effect"
|
|
42371
|
+
*
|
|
42372
|
+
* const program = Effect.gen(function*() {
|
|
42373
|
+
* const ref = yield* Ref.make(0)
|
|
42374
|
+
* yield* Ref.set(ref, 42)
|
|
42375
|
+
* return yield* Ref.get(ref)
|
|
42376
|
+
* })
|
|
42377
|
+
*
|
|
42378
|
+
* const program2 = Effect.gen(function*() {
|
|
42379
|
+
* const ref = yield* Ref.make(0)
|
|
42380
|
+
* yield* Ref.set(ref, 100)
|
|
42381
|
+
* return yield* Ref.get(ref)
|
|
42382
|
+
* })
|
|
42383
|
+
*
|
|
42384
|
+
* await Effect.runPromise(program) // => 42
|
|
42385
|
+
* await Effect.runPromise(program2) // => 100
|
|
42386
|
+
* ```
|
|
42387
|
+
*
|
|
42388
|
+
* @see {@link getAndSet} for setting while returning the previous value
|
|
42389
|
+
* @see {@link setAndGet} for setting while returning the new value
|
|
42390
|
+
*
|
|
42391
|
+
* @stability stable
|
|
42392
|
+
* @category mutations
|
|
42393
|
+
* @since 2.0.0
|
|
42394
|
+
*/
|
|
42395
|
+
const set = /*#__PURE__*/ dual(2, (self, value) => sync(() => set$1(self.ref, value)));
|
|
42396
|
+
/**
|
|
42062
42397
|
* Modifies the value of the Ref atomically using the given function.
|
|
42063
42398
|
*
|
|
42064
42399
|
* **When to use**
|
|
@@ -42143,6 +42478,24 @@ const modify$2 = /*#__PURE__*/ dual(2, (self, f) => sync(() => {
|
|
|
42143
42478
|
* @since 2.0.0
|
|
42144
42479
|
*/
|
|
42145
42480
|
const updateAndGet$1 = /*#__PURE__*/ dual(2, (self, f) => sync(() => self.ref.current = f(self.ref.current)));
|
|
42481
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/UndefinedOr.js
|
|
42482
|
+
/**
|
|
42483
|
+
* Pattern matches on an `A | undefined` value, running `onDefined` when the
|
|
42484
|
+
* value is present or evaluating `onUndefined` when the value is `undefined`.
|
|
42485
|
+
*
|
|
42486
|
+
* **When to use**
|
|
42487
|
+
*
|
|
42488
|
+
* Use when you need to turn an `A | undefined` into a non-optional result by
|
|
42489
|
+
* handling both the defined and undefined branches in one expression.
|
|
42490
|
+
*
|
|
42491
|
+
* @see {@link map} for transforming defined values while preserving `undefined`
|
|
42492
|
+
* @see {@link getOrThrowWith} for throwing when the value is `undefined` instead of returning a fallback branch
|
|
42493
|
+
*
|
|
42494
|
+
* @stability stable
|
|
42495
|
+
* @category pattern matching
|
|
42496
|
+
* @since 4.0.0
|
|
42497
|
+
*/
|
|
42498
|
+
const match = /*#__PURE__*/ dual(2, (self, { onDefined, onUndefined }) => self === void 0 ? onUndefined() : onDefined(self));
|
|
42146
42499
|
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/persistence/KeyValueStore.js
|
|
42147
42500
|
/**
|
|
42148
42501
|
* Provides effectful key/value storage for persistence backends.
|
|
@@ -42311,6 +42664,41 @@ const decodeFileKey = (file) => {
|
|
|
42311
42664
|
return;
|
|
42312
42665
|
}
|
|
42313
42666
|
};
|
|
42667
|
+
const SchemaStoreTypeId = "~effect/persistence/KeyValueStore/SchemaStore";
|
|
42668
|
+
/**
|
|
42669
|
+
* Adapts a `KeyValueStore` into a `SchemaStore` using the schema's JSON codec.
|
|
42670
|
+
*
|
|
42671
|
+
* @stability unstable
|
|
42672
|
+
* @category converting
|
|
42673
|
+
* @since 4.0.0
|
|
42674
|
+
*/
|
|
42675
|
+
const toSchemaStore = (self, schema) => {
|
|
42676
|
+
const jsonSchema = fromJsonString(toCodecJson(schema));
|
|
42677
|
+
const decode = decodeEffect(jsonSchema);
|
|
42678
|
+
const encode = encodeEffect(jsonSchema);
|
|
42679
|
+
const get = (key) => flatMap$2(self.get(key), match({
|
|
42680
|
+
onUndefined: () => succeedNone,
|
|
42681
|
+
onDefined: (value) => asSome(decode(value))
|
|
42682
|
+
}));
|
|
42683
|
+
const set = (key, value) => flatMap$2(encode(value), (json) => self.set(key, json));
|
|
42684
|
+
const modify = (key, f) => flatMap$2(get(key), (o) => {
|
|
42685
|
+
if (isNone(o)) return succeedNone;
|
|
42686
|
+
const newValue = f(o.value);
|
|
42687
|
+
return as(set(key, newValue), some$1(newValue));
|
|
42688
|
+
});
|
|
42689
|
+
return {
|
|
42690
|
+
[SchemaStoreTypeId]: SchemaStoreTypeId,
|
|
42691
|
+
get,
|
|
42692
|
+
set,
|
|
42693
|
+
modify,
|
|
42694
|
+
remove: self.remove,
|
|
42695
|
+
clear: self.clear,
|
|
42696
|
+
size: self.size,
|
|
42697
|
+
keys: self.keys,
|
|
42698
|
+
has: self.has,
|
|
42699
|
+
isEmpty: self.isEmpty
|
|
42700
|
+
};
|
|
42701
|
+
};
|
|
42314
42702
|
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/SynchronizedRef.js
|
|
42315
42703
|
/**
|
|
42316
42704
|
* Stores mutable state whose updates run one at a time.
|
|
@@ -43271,7 +43659,7 @@ const parseTemplate$1 = (texts, values) => {
|
|
|
43271
43659
|
const endWord = () => {
|
|
43272
43660
|
if (word.length === 0) return;
|
|
43273
43661
|
const value = word.map(unwrap$1).join("");
|
|
43274
|
-
words.push(word.length === 1 && isRedacted(word[0]) ? word[0] : word.some(isRedacted) ? make$
|
|
43662
|
+
words.push(word.length === 1 && isRedacted(word[0]) ? word[0] : word.some(isRedacted) ? make$57(value) : value);
|
|
43275
43663
|
word = [];
|
|
43276
43664
|
plain = true;
|
|
43277
43665
|
braceDepth = 0;
|
|
@@ -43735,7 +44123,7 @@ const fromReadableChannel = (options) => fromTransform$1((_, scope) => readableT
|
|
|
43735
44123
|
*/
|
|
43736
44124
|
const fromDuplex$1 = (options) => fromTransform$1((upstream, scope) => {
|
|
43737
44125
|
const duplex = options.evaluate();
|
|
43738
|
-
const exit = make$
|
|
44126
|
+
const exit = make$50(void 0);
|
|
43739
44127
|
const latch = makeUnsafe$3(false);
|
|
43740
44128
|
return pullIntoWritable({
|
|
43741
44129
|
pull: upstream,
|
|
@@ -43846,7 +44234,7 @@ const readableToPullUnsafe = (options) => {
|
|
|
43846
44234
|
const readable = options.readable;
|
|
43847
44235
|
const chunkSize = options.chunkSize ?? 4096;
|
|
43848
44236
|
const closeOnDone = options.closeOnDone ?? true;
|
|
43849
|
-
const exit = options.exit ?? make$
|
|
44237
|
+
const exit = options.exit ?? make$50(void 0);
|
|
43850
44238
|
const latch = options.latch ?? makeUnsafe$3(false);
|
|
43851
44239
|
function onReadable() {
|
|
43852
44240
|
latch.openUnsafe();
|
|
@@ -44975,7 +45363,7 @@ const compressBody$1 = (body, algorithm, options) => {
|
|
|
44975
45363
|
*/
|
|
44976
45364
|
const updateHeaders = (headers, body) => {
|
|
44977
45365
|
if (body._tag === "Empty" || body._tag === "FormData") return remove$1(remove$1(headers, "content-type"), "content-length");
|
|
44978
|
-
headers = body.contentType === void 0 ? remove$1(headers, "content-type") : set$
|
|
45366
|
+
headers = body.contentType === void 0 ? remove$1(headers, "content-type") : set$2(headers, "content-type", body.contentType);
|
|
44979
45367
|
return updateContentLength(headers, body);
|
|
44980
45368
|
};
|
|
44981
45369
|
/**
|
|
@@ -44983,7 +45371,7 @@ const updateHeaders = (headers, body) => {
|
|
|
44983
45371
|
*/
|
|
44984
45372
|
const updateContentLength = (headers, body) => {
|
|
44985
45373
|
const contentLength = body._tag === "Empty" || body._tag === "FormData" ? void 0 : body.contentLength;
|
|
44986
|
-
return contentLength === void 0 ? remove$1(headers, "content-length") : set$
|
|
45374
|
+
return contentLength === void 0 ? remove$1(headers, "content-length") : set$2(headers, "content-length", contentLength.toString());
|
|
44987
45375
|
};
|
|
44988
45376
|
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/Url.js
|
|
44989
45377
|
/**
|
|
@@ -45190,7 +45578,7 @@ const setMethod = /*#__PURE__*/ dual(2, (self, method) => makeWith$1(method, sel
|
|
|
45190
45578
|
* @category combinators
|
|
45191
45579
|
* @since 4.0.0
|
|
45192
45580
|
*/
|
|
45193
|
-
const setHeader$1 = /*#__PURE__*/ dual(3, (self, key, value) => makeWith$1(self.method, self.url, self.urlParams, self.hash, set$
|
|
45581
|
+
const setHeader$1 = /*#__PURE__*/ dual(3, (self, key, value) => makeWith$1(self.method, self.url, self.urlParams, self.hash, set$2(self.headers, key, value), self.body));
|
|
45194
45582
|
/**
|
|
45195
45583
|
* Sets multiple request headers from an input collection, replacing existing values with matching names.
|
|
45196
45584
|
*
|
|
@@ -45290,9 +45678,17 @@ const setBody$1 = /*#__PURE__*/ dual(2, (self, body) => {
|
|
|
45290
45678
|
*/
|
|
45291
45679
|
const compressBody = /*#__PURE__*/ dual((args) => isHttpClientRequest(args[0]), (self, algorithm, options) => {
|
|
45292
45680
|
if (self.headers["content-encoding"] !== void 0) return succeed$5(self);
|
|
45293
|
-
return map$5(compressBody$1(self.body, algorithm, options), (body) => body === self.body ? self : makeWith$1(self.method, self.url, self.urlParams, self.hash, set$
|
|
45681
|
+
return map$5(compressBody$1(self.body, algorithm, options), (body) => body === self.body ? self : makeWith$1(self.method, self.url, self.urlParams, self.hash, set$2(updateContentLength(self.headers, body), "content-encoding", algorithm), body));
|
|
45294
45682
|
});
|
|
45295
45683
|
/**
|
|
45684
|
+
* Encodes a value as a JSON request body and sets it on the request, failing with `HttpBodyError` if encoding fails.
|
|
45685
|
+
*
|
|
45686
|
+
* @stability unstable
|
|
45687
|
+
* @category combinators
|
|
45688
|
+
* @since 4.0.0
|
|
45689
|
+
*/
|
|
45690
|
+
const bodyJson = /*#__PURE__*/ dual(2, (self, body) => map$5(json$1(body), (body) => setBody$1(self, body)));
|
|
45691
|
+
/**
|
|
45296
45692
|
* Sets a JSON request body using unsafe JSON encoding.
|
|
45297
45693
|
*
|
|
45298
45694
|
* **When to use**
|
|
@@ -45559,7 +45955,7 @@ var WebHttpClientResponse = class extends Class$2 {
|
|
|
45559
45955
|
* @since 4.0.0
|
|
45560
45956
|
*/
|
|
45561
45957
|
const toHeaders = (span) => fromRecordUnsafe({
|
|
45562
|
-
b3: `${span.traceId}-${span.spanId}-${span.sampled ? "1" : "0"}${match$
|
|
45958
|
+
b3: `${span.traceId}-${span.spanId}-${span.sampled ? "1" : "0"}${match$8(span.parent, {
|
|
45563
45959
|
onNone: () => "",
|
|
45564
45960
|
onSome: (parent) => `-${parent.spanId}`
|
|
45565
45961
|
})}`,
|
|
@@ -45847,6 +46243,14 @@ const endSpanWithStatusError = (fiber, span, request, response) => {
|
|
|
45847
46243
|
span.end(fiber.getRef(TracerTimingEnabled) ? fiber.getRef(Clock).currentTimeNanosUnsafe() : BigInt(0), exit);
|
|
45848
46244
|
};
|
|
45849
46245
|
/**
|
|
46246
|
+
* Appends an effectful transformation of the request object before sending it.
|
|
46247
|
+
*
|
|
46248
|
+
* @stability unstable
|
|
46249
|
+
* @category mapping
|
|
46250
|
+
* @since 4.0.0
|
|
46251
|
+
*/
|
|
46252
|
+
const mapRequestEffect = /*#__PURE__*/ dual(2, (self, f) => makeWith(self.postprocess, (request) => flatMap$2(self.preprocess(request), f)));
|
|
46253
|
+
/**
|
|
45850
46254
|
* Retries common transient errors, such as rate limiting, timeouts or network issues.
|
|
45851
46255
|
*
|
|
45852
46256
|
* **When to use**
|
|
@@ -46945,7 +47349,7 @@ const toString = (self) => {
|
|
|
46945
47349
|
*/
|
|
46946
47350
|
var Generator = class extends (/*#__PURE__*/ Service$1()("effect/http/Etag/Generator")) {};
|
|
46947
47351
|
const fromFileInfo = (info) => {
|
|
46948
|
-
const mtime = match$
|
|
47352
|
+
const mtime = match$8(info.mtime, {
|
|
46949
47353
|
onNone: () => "0",
|
|
46950
47354
|
onSome: (mtime) => mtime.getTime().toString(16)
|
|
46951
47355
|
});
|
|
@@ -47208,7 +47612,7 @@ const stream$1 = (body, options) => {
|
|
|
47208
47612
|
* @category combinators
|
|
47209
47613
|
* @since 4.0.0
|
|
47210
47614
|
*/
|
|
47211
|
-
const setHeader = /*#__PURE__*/ dual(3, (self, key, value) => makeResponse(self, set$
|
|
47615
|
+
const setHeader = /*#__PURE__*/ dual(3, (self, key, value) => makeResponse(self, set$2(self.headers, key, value)));
|
|
47212
47616
|
/**
|
|
47213
47617
|
* Returns a response with the specified header removed.
|
|
47214
47618
|
*
|
|
@@ -47903,7 +48307,7 @@ const make$25 = /*#__PURE__*/ fnUntraced(function* (impl) {
|
|
|
47903
48307
|
const limit = bytesToRead === void 0 ? void 0 : offset + contentLength;
|
|
47904
48308
|
const start = yield* fileResponseNumber(offset, "offset");
|
|
47905
48309
|
const end = limit === void 0 ? void 0 : yield* fileResponseNumber(limit, "end");
|
|
47906
|
-
const headers = set$
|
|
48310
|
+
const headers = set$2(optionHeaders(options), "etag", toString(etag));
|
|
47907
48311
|
if (isSome(info.mtime)) headers["last-modified"] = info.mtime.value.toUTCString();
|
|
47908
48312
|
return impl.fileResponse(path, options?.status ?? 200, options?.statusText, headers, start, end, contentLength);
|
|
47909
48313
|
}),
|
|
@@ -47920,7 +48324,7 @@ const make$25 = /*#__PURE__*/ fnUntraced(function* (impl) {
|
|
|
47920
48324
|
});
|
|
47921
48325
|
const optionHeaders = (options) => {
|
|
47922
48326
|
const headers = options?.headers ? fromInput$1(options.headers) : empty$6;
|
|
47923
|
-
return options?.contentType ? set$
|
|
48327
|
+
return options?.contentType ? set$2(headers, "content-type", options.contentType) : headers;
|
|
47924
48328
|
};
|
|
47925
48329
|
const fileResponseSize = (input, field) => {
|
|
47926
48330
|
const size = fromInput$2(input);
|
|
@@ -49457,7 +49861,7 @@ const isMultipartError = (u) => hasProperty(u, MultipartErrorTypeId);
|
|
|
49457
49861
|
* @since 4.0.0
|
|
49458
49862
|
*/
|
|
49459
49863
|
const makeConfig = (headers) => withFiber((fiber) => {
|
|
49460
|
-
const mimeTypes = get$
|
|
49864
|
+
const mimeTypes = get$7(fiber.context, FieldMimeTypes);
|
|
49461
49865
|
return succeed$5({
|
|
49462
49866
|
headers,
|
|
49463
49867
|
maxParts: fiber.getRef(MaxParts),
|
|
@@ -50408,7 +50812,7 @@ const prefixPath = /*#__PURE__*/ dual(2, (self, prefix) => {
|
|
|
50408
50812
|
const prefixRoute = /*#__PURE__*/ dual(2, (self, prefix) => makeRoute({
|
|
50409
50813
|
...self,
|
|
50410
50814
|
path: prefixPath(self.path, prefix),
|
|
50411
|
-
prefix: match$
|
|
50815
|
+
prefix: match$8(self.prefix, {
|
|
50412
50816
|
onNone: () => removeTrailingSlash(prefix),
|
|
50413
50817
|
onSome: (existingPrefix) => prefixPath(existingPrefix, prefix)
|
|
50414
50818
|
})
|
|
@@ -50485,7 +50889,7 @@ var MiddlewareImpl = class MiddlewareImpl {
|
|
|
50485
50889
|
const stack = [getOrUndefinedUnsafe(context$3, fnContextKey)];
|
|
50486
50890
|
if (this.dependencies) {
|
|
50487
50891
|
const memoMap = yield* CurrentMemoMap;
|
|
50488
|
-
const scope = get$
|
|
50892
|
+
const scope = get$7(context$3, Scope);
|
|
50489
50893
|
const depsContext = yield* buildWithMemoMap(this.dependencies, memoMap, scope);
|
|
50490
50894
|
stack.push(...getMiddleware(depsContext));
|
|
50491
50895
|
}
|
|
@@ -50540,9 +50944,9 @@ const serve = (appLayer, options) => {
|
|
|
50540
50944
|
const layerWithRouter = provideMerge(appLayer, options?.routerConfig ? provide$2(layer$17, succeed$6(RouterConfig)(options.routerConfig)) : layer$17);
|
|
50541
50945
|
return contextWith((context) => {
|
|
50542
50946
|
const memoMap = CurrentMemoMap.forkOrCreate(context);
|
|
50543
|
-
return buildWithMemoMap(layerWithRouter, memoMap, get$
|
|
50947
|
+
return buildWithMemoMap(layerWithRouter, memoMap, get$7(context, Scope));
|
|
50544
50948
|
}).pipe(map$5((context) => {
|
|
50545
|
-
const handler = get$
|
|
50949
|
+
const handler = get$7(context, HttpRouter).asHttpEffect();
|
|
50546
50950
|
return merge$3(middleware ? serve$1(handler, middleware) : serve$1(handler), succeedContext(context));
|
|
50547
50951
|
}), unwrap$7, options?.disableListenLog ? identity : withLogAddress);
|
|
50548
50952
|
};
|
|
@@ -50658,7 +51062,7 @@ const schema = /*#__PURE__*/ declare(isStream);
|
|
|
50658
51062
|
* @since 4.0.0
|
|
50659
51063
|
*/
|
|
50660
51064
|
function Stream(success, error) {
|
|
50661
|
-
return make$
|
|
51065
|
+
return make$52(schema.ast, {
|
|
50662
51066
|
[StreamSchemaTypeId]: StreamSchemaTypeId,
|
|
50663
51067
|
success,
|
|
50664
51068
|
error
|
|
@@ -52204,7 +52608,7 @@ function toBinaryASTStep(ast) {
|
|
|
52204
52608
|
const getJson = ast.annotations?.toCodecJson;
|
|
52205
52609
|
const getCodec = ast.annotations?.toCodec;
|
|
52206
52610
|
if (!isFunction(getJson) && !isFunction(getCodec)) return ast;
|
|
52207
|
-
const typeParameters = ast.typeParameters.map((tp) => make$
|
|
52611
|
+
const typeParameters = ast.typeParameters.map((tp) => make$52(toEncoded(tp)));
|
|
52208
52612
|
const link = (isFunction(getJson) ? getJson(typeParameters) : void 0) ?? (isFunction(getCodec) ? getCodec(typeParameters) : void 0);
|
|
52209
52613
|
return link === void 0 ? ast : replaceEncoding(ast, [mapLink(link, toBinaryAST)]);
|
|
52210
52614
|
}
|
|
@@ -54640,7 +55044,7 @@ function decodeValueUnchecked(layout, r) {
|
|
|
54640
55044
|
const value = r.zigzag();
|
|
54641
55045
|
const scale = r.zigzag();
|
|
54642
55046
|
if (scale > MAX_SAFE_BIGINT || -scale > MAX_SAFE_BIGINT) invalid("safe integer length", void 0, r.options);
|
|
54643
|
-
return make$
|
|
55047
|
+
return make$61(value, Number(scale));
|
|
54644
55048
|
}
|
|
54645
55049
|
case "json": {
|
|
54646
55050
|
const text = r.readUtf8(r.end - r.pos);
|
|
@@ -54755,7 +55159,7 @@ function compileMode(layout, fingerprint) {
|
|
|
54755
55159
|
return fingerprint === true ? fingerprintModeMemo(layout) : defaultMode;
|
|
54756
55160
|
}
|
|
54757
55161
|
const compileTargetFromAst = /*#__PURE__*/ memoize((ast) => {
|
|
54758
|
-
const raw = make$
|
|
55162
|
+
const raw = make$52(toBinaryAST(ast));
|
|
54759
55163
|
const { exact, exitSuccess, layout, recursive } = compileLayout(raw.ast);
|
|
54760
55164
|
return {
|
|
54761
55165
|
target: recursive ? withCycleGuard(raw) : raw,
|
|
@@ -54774,10 +55178,10 @@ function takeTrusted(trusted, input) {
|
|
|
54774
55178
|
return true;
|
|
54775
55179
|
}
|
|
54776
55180
|
function bypassPass(target, decodeAccept, encodeAccept) {
|
|
54777
|
-
const type = make$
|
|
55181
|
+
const type = make$52(toType$1(target.ast));
|
|
54778
55182
|
const parse = decodeUnknownEffect$1(type);
|
|
54779
55183
|
const run = (accept) => () => (input, _ast, options) => accept(input, options) ? sameExit : parse(input, options);
|
|
54780
|
-
return make$
|
|
55184
|
+
return make$52(new Declaration([type.ast], run(decodeAccept), { identifier: "binary value" }, void 0, void 0, void 0, void 0, run(encodeAccept)));
|
|
54781
55185
|
}
|
|
54782
55186
|
function reportsExcess(_input, options) {
|
|
54783
55187
|
return options.onExcessProperty !== "error";
|
|
@@ -54798,7 +55202,7 @@ function passThrough(target) {
|
|
|
54798
55202
|
return bypassPass(target, reportsExcess, reportsExcess);
|
|
54799
55203
|
}
|
|
54800
55204
|
function withCycleGuard(target) {
|
|
54801
|
-
const type = make$
|
|
55205
|
+
const type = make$52(toType$1(target.ast));
|
|
54802
55206
|
const decoded = /* @__PURE__ */ new WeakSet();
|
|
54803
55207
|
return decodeTo(declareConstructor()([type], ([type]) => (input, ast, options) => {
|
|
54804
55208
|
if (isObjectOrArray(input) && decoded.delete(input)) return succeed$5(input);
|
|
@@ -54966,9 +55370,9 @@ const makeNoSerialization = /*#__PURE__*/ fnUntraced(function* (group, options)
|
|
|
54966
55370
|
const concurrency = options.concurrency ?? "unbounded";
|
|
54967
55371
|
const disableFatalDefects = options.disableFatalDefects ?? false;
|
|
54968
55372
|
const services = yield* context();
|
|
54969
|
-
const scope = get$
|
|
55373
|
+
const scope = get$7(services, Scope);
|
|
54970
55374
|
const trackFiber = runIn(forkUnsafe(scope, "parallel"));
|
|
54971
|
-
const concurrencySemaphore = concurrency === "unbounded" ? void 0 : yield* make$
|
|
55375
|
+
const concurrencySemaphore = concurrency === "unbounded" ? void 0 : yield* make$62(concurrency);
|
|
54972
55376
|
const clients = /* @__PURE__ */ new Map();
|
|
54973
55377
|
let isShutdown = false;
|
|
54974
55378
|
const shutdownLatch = makeUnsafe$3(false);
|
|
@@ -55207,7 +55611,7 @@ const rpcCodecs = (codecFor, rpc) => {
|
|
|
55207
55611
|
let codecs = shared ? sharedRpcCodecs.get(rpc) : void 0;
|
|
55208
55612
|
if (codecs === void 0) {
|
|
55209
55613
|
const streamSchemas = getStreamSchemas(rpc.successSchema);
|
|
55210
|
-
const parseOptions = get$
|
|
55614
|
+
const parseOptions = get$7(rpc.annotations, ParseOptions);
|
|
55211
55615
|
codecs = {
|
|
55212
55616
|
decode: decodeUnknownEffect(codecFor(rpc.payloadSchema), parseOptions),
|
|
55213
55617
|
encodeChunk: encodeUnknownEffect(codecFor(NonEmptyArray(isSome(streamSchemas) ? streamSchemas.value.success : Any)), parseOptions),
|
|
@@ -55271,7 +55675,7 @@ const make$15 = /*#__PURE__*/ fnUntraced(function* (group, options) {
|
|
|
55271
55675
|
const { codecFor, disconnects, end, run, send, supportsAck, supportsSpanPropagation, supportsTransferables } = yield* Protocol;
|
|
55272
55676
|
const { encodeDefectUnsafe, encodeUnknownRequestExit } = defectCodecs(codecFor);
|
|
55273
55677
|
const services = yield* context();
|
|
55274
|
-
const scope = yield* make$
|
|
55678
|
+
const scope = yield* make$67();
|
|
55275
55679
|
const server = yield* makeNoSerialization(group, {
|
|
55276
55680
|
...options,
|
|
55277
55681
|
disableClientAcks: !supportsAck,
|
|
@@ -55332,7 +55736,7 @@ const make$15 = /*#__PURE__*/ fnUntraced(function* (group, options) {
|
|
|
55332
55736
|
const exitSchema$1 = exitSchema(rpc);
|
|
55333
55737
|
discardSchemas = {
|
|
55334
55738
|
...schemas,
|
|
55335
|
-
encodeExit: encodeUnknownEffect(codecFor(Exit(Void, exitSchema$1.error, exitSchema$1.defect)), get$
|
|
55739
|
+
encodeExit: encodeUnknownEffect(codecFor(Exit(Void, exitSchema$1.error, exitSchema$1.defect)), get$7(rpc.annotations, ParseOptions))
|
|
55336
55740
|
};
|
|
55337
55741
|
discardSchemasCache.set(rpc, discardSchemas);
|
|
55338
55742
|
}
|
|
@@ -55547,7 +55951,7 @@ const makeProtocolWithHttpEffect = /*#__PURE__*/ fnUntraced(function* (options =
|
|
|
55547
55951
|
const { encodeDefectUnsafe } = defectCodecs(serialization.codecFor);
|
|
55548
55952
|
const includesFraming = serialization.includesFraming;
|
|
55549
55953
|
const isBinary = !serialization.contentType.includes("json");
|
|
55550
|
-
const disconnects = yield* make$
|
|
55954
|
+
const disconnects = yield* make$64();
|
|
55551
55955
|
let writeRequest;
|
|
55552
55956
|
let clientId = 0;
|
|
55553
55957
|
const clients = /* @__PURE__ */ new Map();
|
|
@@ -55560,7 +55964,7 @@ const makeProtocolWithHttpEffect = /*#__PURE__*/ fnUntraced(function* (options =
|
|
|
55560
55964
|
const requestHeaders = Object.entries(request.headers);
|
|
55561
55965
|
const data = yield* orDie$2(isBinary ? map$5(request.arrayBuffer, (buf) => new Uint8Array(buf)) : request.text);
|
|
55562
55966
|
const id = clientId++;
|
|
55563
|
-
const queue = yield* make$
|
|
55967
|
+
const queue = yield* make$64({ capacity: includesFraming && options.streamBufferSize !== "unbounded" ? options.streamBufferSize ?? 16 : void 0 });
|
|
55564
55968
|
const parser = serialization.makeUnsafe();
|
|
55565
55969
|
const requestIds = [];
|
|
55566
55970
|
const offer$1 = (data) => typeof data === "string" ? offer(queue, encoder.encode(data)) : offer(queue, data);
|
|
@@ -55665,7 +56069,7 @@ const layerProtocolHttp = (options) => {
|
|
|
55665
56069
|
const makeSocketProtocol = /*#__PURE__*/ gen(function* () {
|
|
55666
56070
|
const serialization = yield* RpcSerialization;
|
|
55667
56071
|
const { encodeDefectUnsafe } = defectCodecs(serialization.codecFor);
|
|
55668
|
-
const disconnects = yield* make$
|
|
56072
|
+
const disconnects = yield* make$64();
|
|
55669
56073
|
let clientId = 0;
|
|
55670
56074
|
const clients = /* @__PURE__ */ new Map();
|
|
55671
56075
|
const clientIds = /* @__PURE__ */ new Set();
|
|
@@ -55845,7 +56249,7 @@ const RpcGroupProto = {
|
|
|
55845
56249
|
});
|
|
55846
56250
|
},
|
|
55847
56251
|
annotateRpcs(service, value) {
|
|
55848
|
-
return this.annotateRpcsMerge(make$
|
|
56252
|
+
return this.annotateRpcsMerge(make$71(service, value));
|
|
55849
56253
|
},
|
|
55850
56254
|
annotateMerge(context) {
|
|
55851
56255
|
return makeProto({
|
|
@@ -60404,7 +60808,7 @@ const writeFile = (path, data, options) => callback$1((resume, signal) => {
|
|
|
60404
60808
|
resume(fail$7(handleBadArgument("writeFile")(err)));
|
|
60405
60809
|
}
|
|
60406
60810
|
});
|
|
60407
|
-
const makeFileSystem = /*#__PURE__*/ map$5(/*#__PURE__*/ serviceOption(WatchBackend), (backend) => make$
|
|
60811
|
+
const makeFileSystem = /*#__PURE__*/ map$5(/*#__PURE__*/ serviceOption(WatchBackend), (backend) => make$44({
|
|
60408
60812
|
access,
|
|
60409
60813
|
chmod,
|
|
60410
60814
|
chown,
|
|
@@ -61372,7 +61776,7 @@ const fileUrlOps = (windows) => ({
|
|
|
61372
61776
|
* @category layers
|
|
61373
61777
|
* @since 4.0.0
|
|
61374
61778
|
*/
|
|
61375
|
-
const layer$9 = /* @__PURE__ */ succeed$6(Path$1)(/*#__PURE__*/ make$
|
|
61779
|
+
const layer$9 = /* @__PURE__ */ succeed$6(Path$1)(/*#__PURE__*/ make$43({
|
|
61376
61780
|
...Path,
|
|
61377
61781
|
.../*#__PURE__*/ fileUrlOps(void 0)
|
|
61378
61782
|
}));
|
|
@@ -61443,7 +61847,7 @@ const layer$7 = /* @__PURE__ */ succeed$6(Stdio, /*#__PURE__*/ make$35({
|
|
|
61443
61847
|
const layer$6 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit) {
|
|
61444
61848
|
const stdin = process.stdin;
|
|
61445
61849
|
const stdout = process.stdout;
|
|
61446
|
-
const lines = yield* make$
|
|
61850
|
+
const lines = yield* make$64();
|
|
61447
61851
|
let inputEnded = stdin.readableEnded;
|
|
61448
61852
|
let readlineActive = false;
|
|
61449
61853
|
const onStdinEnd = () => {
|
|
@@ -61452,7 +61856,7 @@ const layer$6 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
|
|
|
61452
61856
|
};
|
|
61453
61857
|
stdin.once("end", onStdinEnd);
|
|
61454
61858
|
yield* addFinalizer(() => sync(() => stdin.off("end", onStdinEnd)));
|
|
61455
|
-
const rlRef = yield* make$
|
|
61859
|
+
const rlRef = yield* make$46({
|
|
61456
61860
|
acquire: acquireRelease(sync(() => {
|
|
61457
61861
|
const rl = readline.createInterface({
|
|
61458
61862
|
input: stdin,
|
|
@@ -61484,7 +61888,7 @@ const layer$6 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
|
|
|
61484
61888
|
const setRawMode = (enabled) => sync(() => {
|
|
61485
61889
|
if (stdin.isTTY) stdin.setRawMode(enabled);
|
|
61486
61890
|
});
|
|
61487
|
-
const rawModeRef = yield* make$
|
|
61891
|
+
const rawModeRef = yield* make$46({
|
|
61488
61892
|
acquire: acquireRelease(setRawMode(true), () => setRawMode(false)),
|
|
61489
61893
|
idleTimeToLive: "10 millis"
|
|
61490
61894
|
});
|
|
@@ -61505,7 +61909,7 @@ const layer$6 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
|
|
|
61505
61909
|
return queue;
|
|
61506
61910
|
});
|
|
61507
61911
|
const readInput = gen(function* () {
|
|
61508
|
-
const queue = yield* make$
|
|
61912
|
+
const queue = yield* make$64();
|
|
61509
61913
|
const handleKeypress = (s, k) => {
|
|
61510
61914
|
const userInput = {
|
|
61511
61915
|
input: fromUndefinedOr(s),
|
|
@@ -61532,14 +61936,14 @@ const layer$6 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
|
|
|
61532
61936
|
stdin.on("keypress", handleKeypress);
|
|
61533
61937
|
if (inputEnded) handleEnd();
|
|
61534
61938
|
else {
|
|
61535
|
-
yield* get$
|
|
61536
|
-
yield* get$
|
|
61939
|
+
yield* get$2(rlRef);
|
|
61940
|
+
yield* get$2(rawModeRef);
|
|
61537
61941
|
stdin.once("end", handleEnd);
|
|
61538
61942
|
}
|
|
61539
61943
|
return queue;
|
|
61540
61944
|
});
|
|
61541
|
-
const readLine = suspend$2(() => poll(lines).pipe(flatMap$2(match$
|
|
61542
|
-
onNone: () => scoped(andThen(get$
|
|
61945
|
+
const readLine = suspend$2(() => poll(lines).pipe(flatMap$2(match$8({
|
|
61946
|
+
onNone: () => scoped(andThen(get$2(rlRef), take$1(lines))),
|
|
61543
61947
|
onSome: succeed$5
|
|
61544
61948
|
})), mapError$2(() => new QuitError({}))));
|
|
61545
61949
|
const display = (prompt) => uninterruptible(callback$1((resume) => {
|
|
@@ -63632,7 +64036,7 @@ const map$1 = /*#__PURE__*/ dual(2, (self, f) => flatMap(self, (a) => succeed(f(
|
|
|
63632
64036
|
* @category constructors
|
|
63633
64037
|
* @since 4.0.0
|
|
63634
64038
|
*/
|
|
63635
|
-
const Password = (options) => basePrompt(options, "password").pipe(map$1(make$
|
|
64039
|
+
const Password = (options) => basePrompt(options, "password").pipe(map$1(make$57));
|
|
63636
64040
|
/**
|
|
63637
64041
|
* Runs a prompt by reading terminal input and rendering prompt frames until the
|
|
63638
64042
|
* prompt submits a value.
|
|
@@ -63858,7 +64262,7 @@ const handleDateClear = (options) => {
|
|
|
63858
64262
|
const resetCurrentLine = eraseLine + "\x1B[G";
|
|
63859
64263
|
const parts = reduce(state.dateParts, "", (doc, part) => doc + part.toString());
|
|
63860
64264
|
const promptText = renderPrompt(parts, options.message, figures.prefix, figures.pointerSmall, figures, { plain: true });
|
|
63861
|
-
const errorText = isSome(state.error) ? match$
|
|
64265
|
+
const errorText = isSome(state.error) ? match$6(state.error.value.split(NEWLINE_REGEXP), {
|
|
63862
64266
|
onEmpty: () => "",
|
|
63863
64267
|
onNonEmpty: (errorLines) => separateSymbol(figures.pointerSmall, errorLines.join("\n"))
|
|
63864
64268
|
}) : "";
|
|
@@ -63936,7 +64340,7 @@ const processDateCursorRight = (state) => {
|
|
|
63936
64340
|
};
|
|
63937
64341
|
const processDateNext = (state) => {
|
|
63938
64342
|
const next = state.dateParts[state.cursor].nextPart();
|
|
63939
|
-
const cursor = match$
|
|
64343
|
+
const cursor = match$8(next, {
|
|
63940
64344
|
onNone: () => state.dateParts.findIndex((part) => !part.isToken()),
|
|
63941
64345
|
onSome: (next) => state.dateParts.indexOf(next)
|
|
63942
64346
|
});
|
|
@@ -64025,7 +64429,7 @@ const handleDateProcess = (options) => {
|
|
|
64025
64429
|
case "down": return succeed$5(processDown(state));
|
|
64026
64430
|
case "tab": return succeed$5(processDateNext(state));
|
|
64027
64431
|
case "enter":
|
|
64028
|
-
case "return": return match$
|
|
64432
|
+
case "return": return match$2(options.validate(state.value), {
|
|
64029
64433
|
onFailure: (error) => Action$1.NextFrame({ state: {
|
|
64030
64434
|
...state,
|
|
64031
64435
|
error: some$1(error)
|
|
@@ -64279,7 +64683,7 @@ const renderPrompt = (confirm, message, leadingSymbol, trailingSymbol, theme, op
|
|
|
64279
64683
|
else if (trailingSymbol.length > 0) output += " ";
|
|
64280
64684
|
return output;
|
|
64281
64685
|
};
|
|
64282
|
-
return match$
|
|
64686
|
+
return match$6(message.split(NEWLINE_REGEXP), {
|
|
64283
64687
|
onEmpty: () => renderLine(""),
|
|
64284
64688
|
onNonEmpty: (promptLines) => {
|
|
64285
64689
|
const lines = options?.plain === true ? promptLines : map$8(promptLines, (line) => annotate(theme.colors, line, bold));
|
|
@@ -64311,7 +64715,7 @@ const renderNumberInput = (state, submitted, theme, renderOptions) => {
|
|
|
64311
64715
|
return annotate(theme.colors, value, annotation);
|
|
64312
64716
|
};
|
|
64313
64717
|
const renderNumberError = (state, pointer, theme, renderOptions) => {
|
|
64314
|
-
if (isSome(state.error)) return match$
|
|
64718
|
+
if (isSome(state.error)) return match$6(state.error.value.split(NEWLINE_REGEXP), {
|
|
64315
64719
|
onEmpty: () => "",
|
|
64316
64720
|
onNonEmpty: (errorLines) => {
|
|
64317
64721
|
if (renderOptions?.plain === true) return separateSymbol(pointer, errorLines.join("\n"));
|
|
@@ -64416,7 +64820,7 @@ const handleProcessInteger = (options) => {
|
|
|
64416
64820
|
...state,
|
|
64417
64821
|
error: some$1("Must provide an integer value")
|
|
64418
64822
|
} }));
|
|
64419
|
-
else return match$
|
|
64823
|
+
else return match$2(options.validate(parsed), {
|
|
64420
64824
|
onFailure: (error) => Action$1.NextFrame({ state: {
|
|
64421
64825
|
...state,
|
|
64422
64826
|
error: some$1(error)
|
|
@@ -64461,7 +64865,7 @@ const handleProcessFloat = (options) => {
|
|
|
64461
64865
|
...state,
|
|
64462
64866
|
error: some$1("Must provide a floating point value")
|
|
64463
64867
|
} }));
|
|
64464
|
-
else return flatMap$2(sync(() => round(parsed, options.precision)), (rounded) => match$
|
|
64868
|
+
else return flatMap$2(sync(() => round(parsed, options.precision)), (rounded) => match$2(options.validate(rounded), {
|
|
64465
64869
|
onFailure: (error) => Action$1.NextFrame({ state: {
|
|
64466
64870
|
...state,
|
|
64467
64871
|
error: some$1(error)
|
|
@@ -64588,7 +64992,7 @@ const renderTextInput = (nextState, options, theme, submitted, renderOptions) =>
|
|
|
64588
64992
|
}
|
|
64589
64993
|
};
|
|
64590
64994
|
const renderTextError = (nextState, pointer, theme, renderOptions) => {
|
|
64591
|
-
if (isSome(nextState.error)) return match$
|
|
64995
|
+
if (isSome(nextState.error)) return match$6(nextState.error.value.split(NEWLINE_REGEXP), {
|
|
64592
64996
|
onEmpty: () => "",
|
|
64593
64997
|
onNonEmpty: (errorLines) => {
|
|
64594
64998
|
if (renderOptions?.plain === true) return separateSymbol(pointer, errorLines.join("\n"));
|
|
@@ -64712,7 +65116,7 @@ const handleTextProcess = (options) => {
|
|
|
64712
65116
|
case "enter":
|
|
64713
65117
|
case "return": {
|
|
64714
65118
|
const value = state.value;
|
|
64715
|
-
return match$
|
|
65119
|
+
return match$2(options.validate(value), {
|
|
64716
65120
|
onFailure: (error) => Action$1.NextFrame({ state: {
|
|
64717
65121
|
...state,
|
|
64718
65122
|
value,
|
|
@@ -65275,7 +65679,7 @@ const optional$1 = (param) => {
|
|
|
65275
65679
|
*/
|
|
65276
65680
|
const withDefault$1 = /*#__PURE__*/ dual(2, (self, defaultValue) => {
|
|
65277
65681
|
if (!isEffect(defaultValue)) return map(optional$1(self), getOrElse(() => defaultValue));
|
|
65278
|
-
return mapEffect(optional$1(self), match$
|
|
65682
|
+
return mapEffect(optional$1(self), match$8({
|
|
65279
65683
|
onNone: () => defaultValue,
|
|
65280
65684
|
onSome: succeed$5
|
|
65281
65685
|
}));
|
|
@@ -65312,7 +65716,7 @@ const withFallbackConfig$1 = /*#__PURE__*/ dual(2, (self, config) => {
|
|
|
65312
65716
|
expected: configError.message,
|
|
65313
65717
|
kind: error._tag === "MissingOption" ? "flag" : "argument"
|
|
65314
65718
|
});
|
|
65315
|
-
const runConfig = (error, args) => option(config).pipe(mapError$2((configError) => toInvalidValue(error, configError)), flatMap$2(match$
|
|
65719
|
+
const runConfig = (error, args) => option(config).pipe(mapError$2((configError) => toInvalidValue(error, configError)), flatMap$2(match$8({
|
|
65316
65720
|
onNone: () => fail$7(error),
|
|
65317
65721
|
onSome: (value) => succeed$5([args.arguments, value])
|
|
65318
65722
|
})));
|
|
@@ -65656,7 +66060,7 @@ const Formatter = /*#__PURE__*/ Reference("effect/cli/CliOutput", { defaultValue
|
|
|
65656
66060
|
*/
|
|
65657
66061
|
const defaultPresenter = { present: /*#__PURE__*/ fnUntraced(function* (event) {
|
|
65658
66062
|
const context$2 = yield* context();
|
|
65659
|
-
const formatter = getOrUndefined(context$2, Formatter) ?? defaultFormatter({ colors: get$
|
|
66063
|
+
const formatter = getOrUndefined(context$2, Formatter) ?? defaultFormatter({ colors: get$7(context$2, TerminalCapabilities).canColor });
|
|
65660
66064
|
switch (event._tag) {
|
|
65661
66065
|
case "Help": return yield* log(formatter.formatHelpDoc(event.helpDoc));
|
|
65662
66066
|
case "InvalidInvocation":
|
|
@@ -66271,7 +66675,7 @@ const toFlagDoc = (single, metadata) => {
|
|
|
66271
66675
|
const appendChoiceKeys = (description, choiceKeys) => {
|
|
66272
66676
|
if (choiceKeys === void 0 || choiceKeys.length === 0) return description;
|
|
66273
66677
|
const choiceSuffix = `(choices: ${choiceKeys.join(", ")})`;
|
|
66274
|
-
return match$
|
|
66678
|
+
return match$8(description, {
|
|
66275
66679
|
onNone: () => some$1(choiceSuffix),
|
|
66276
66680
|
onSome: (value) => some$1(`${value} ${choiceSuffix}`)
|
|
66277
66681
|
});
|
|
@@ -68051,7 +68455,7 @@ const defaults = { builtIns: BuiltIns };
|
|
|
68051
68455
|
*
|
|
68052
68456
|
* @internal
|
|
68053
68457
|
*/
|
|
68054
|
-
const resolveFormatter = /*#__PURE__*/ contextWith((context) => succeed$5(getOrUndefined(context, Formatter) ?? defaultFormatter({ colors: get$
|
|
68458
|
+
const resolveFormatter = /*#__PURE__*/ contextWith((context) => succeed$5(getOrUndefined(context, Formatter) ?? defaultFormatter({ colors: get$7(context, TerminalCapabilities).canColor })));
|
|
68055
68459
|
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/internal/lexer.js
|
|
68056
68460
|
/**
|
|
68057
68461
|
* @internal
|
|
@@ -68181,7 +68585,7 @@ const suggest = (input, candidates) => {
|
|
|
68181
68585
|
/**
|
|
68182
68586
|
* @internal
|
|
68183
68587
|
*/
|
|
68184
|
-
const getCommandPath = (parsedInput) => match$
|
|
68588
|
+
const getCommandPath = (parsedInput) => match$8(parsedInput.subcommand, {
|
|
68185
68589
|
onNone: () => [],
|
|
68186
68590
|
onSome: (subcommand) => [subcommand.name, ...getCommandPath(subcommand.parsedInput)]
|
|
68187
68591
|
});
|
|
@@ -69518,9 +69922,9 @@ const runWith = (command, config) => {
|
|
|
69518
69922
|
const [, value] = yield* flag.flag.parse(emptyArgs).pipe(toShowHelp);
|
|
69519
69923
|
program = provideService(program, flag, value);
|
|
69520
69924
|
}
|
|
69521
|
-
const services = match$
|
|
69925
|
+
const services = match$8(logLevel, {
|
|
69522
69926
|
onNone: () => empty$12(),
|
|
69523
|
-
onSome: (level) => make$
|
|
69927
|
+
onSome: (level) => make$71(MinimumLogLevel, level)
|
|
69524
69928
|
});
|
|
69525
69929
|
yield* provideContext$2(program, services);
|
|
69526
69930
|
}, catchFilter((error) => isCliError(error) && error._tag === "ShowHelp" ? succeed$10(error) : fail$12(error), (error) => andThen(showHelp(command, error, config.renderErrors !== false), fail$7(error))), catchFilter((error) => {
|
|
@@ -70088,17 +70492,17 @@ const layerFlusher = /*#__PURE__*/ sync$1(Flusher, () => {
|
|
|
70088
70492
|
*/
|
|
70089
70493
|
const make$6 = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
70090
70494
|
const services = yield* context();
|
|
70091
|
-
const clock = get$
|
|
70092
|
-
const scope = get$
|
|
70495
|
+
const clock = get$7(services, Clock);
|
|
70496
|
+
const scope = get$7(services, Scope);
|
|
70093
70497
|
const exportInterval = max(fromInputUnsafe$1(options.exportInterval), zero$2);
|
|
70094
|
-
const client = get$
|
|
70498
|
+
const client = get$7(services, HttpClient).pipe(tap((response) => ignore$1(response.arrayBuffer)), tapError((error) => error.response ? ignore$1(error.response.arrayBuffer) : void_$1), filterStatusOk, transformResponse(provideService(TracerPropagationEnabled, false)), retryTransient({
|
|
70095
70499
|
schedule: policy,
|
|
70096
70500
|
times: 3
|
|
70097
70501
|
}));
|
|
70098
70502
|
const exporterUserAgent = `OTel-OTLP-Exporter-JavaScript-Effect-${options.label}/${getCurrentVersion()}`;
|
|
70099
70503
|
const userHeaders = fromInput$1(options.headers);
|
|
70100
70504
|
const userAgent = userHeaders["user-agent"];
|
|
70101
|
-
const headers = set$
|
|
70505
|
+
const headers = set$2(userHeaders, "user-agent", userAgent ? `${userAgent} ${exporterUserAgent}` : exporterUserAgent);
|
|
70102
70506
|
const request = post(options.url, { headers });
|
|
70103
70507
|
const exportsEmpty = options.maxBatchSize === "disabled" && options.exportEmpty === true;
|
|
70104
70508
|
let buffer = [];
|
|
@@ -70125,15 +70529,15 @@ const make$6 = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
|
70125
70529
|
package: "@effect/opentelemetry",
|
|
70126
70530
|
module: options.label
|
|
70127
70531
|
}));
|
|
70128
|
-
const exportFibers = yield* make$
|
|
70532
|
+
const exportFibers = yield* make$40();
|
|
70129
70533
|
const runExportFork = yield* runtime(exportFibers)();
|
|
70130
70534
|
yield* addFinalizer$1(scope, suspend$2(() => {
|
|
70131
70535
|
if (disabledUntil !== void 0) return void_$1;
|
|
70132
70536
|
runExportFork(runExport);
|
|
70133
70537
|
return awaitEmpty(exportFibers);
|
|
70134
70538
|
}).pipe(ignore$1, interruptible, timeoutOption(options.shutdownTimeout)));
|
|
70135
|
-
const armed = yield* make$
|
|
70136
|
-
const wake = yield* make$
|
|
70539
|
+
const armed = yield* make$51(exportsEmpty);
|
|
70540
|
+
const wake = yield* make$51();
|
|
70137
70541
|
const disarmIfEmpty = sync(() => {
|
|
70138
70542
|
if (exportsEmpty || buffer.length > 0 || !armed.closeUnsafe()) return;
|
|
70139
70543
|
wake.openUnsafe();
|
|
@@ -70380,7 +70784,7 @@ const make$4 = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
|
70380
70784
|
excludeLogSpans: options.excludeLogSpans ?? false,
|
|
70381
70785
|
clock: yield* Clock
|
|
70382
70786
|
};
|
|
70383
|
-
return make$
|
|
70787
|
+
return make$39((options) => {
|
|
70384
70788
|
exporter.push(makeLogRecord(options, opts));
|
|
70385
70789
|
});
|
|
70386
70790
|
});
|
|
@@ -70505,7 +70909,7 @@ const layer = /*#__PURE__*/ flow(/* @__PURE__ */ fnUntraced(function* (options)
|
|
|
70505
70909
|
if (!span.sampled) return;
|
|
70506
70910
|
exporter.push(makeOtlpSpan(span));
|
|
70507
70911
|
}
|
|
70508
|
-
return make$
|
|
70912
|
+
return make$69({
|
|
70509
70913
|
span(options) {
|
|
70510
70914
|
return new SpanImpl(options, exportFn);
|
|
70511
70915
|
},
|
|
@@ -70730,6 +71134,71 @@ function failureOptions(error, status) {
|
|
|
70730
71134
|
}
|
|
70731
71135
|
var CurrentUser = class extends Service$1()("@deslop/runtime/auth/lib/utils/CurrentUser") {};
|
|
70732
71136
|
var RpcAuth = class extends Service()("@deslop/runtime/auth/lib/utils/RpcAuth", { error: AuthError }) {};
|
|
71137
|
+
Literals([
|
|
71138
|
+
"anthropic",
|
|
71139
|
+
"openrouter",
|
|
71140
|
+
"opencode-zen",
|
|
71141
|
+
"opencode-go"
|
|
71142
|
+
]);
|
|
71143
|
+
// ../../packages/runtime/src/ai/service.ts
|
|
71144
|
+
var AiUnavailable = class extends TaggedError()("AiUnavailable", { message: String$6 }) {};
|
|
71145
|
+
fromJsonString(Struct({ error: Struct({ message: String$6 }) }));
|
|
71146
|
+
var AiGateway = class AiGateway extends Service$1()("@deslop/runtime/ai/service/AiGateway") {
|
|
71147
|
+
static layer = effect(this, gen(function* () {
|
|
71148
|
+
const gateway = yield* option(String$5("GATEWAY_URL"));
|
|
71149
|
+
const local = yield* localAuth;
|
|
71150
|
+
const app = yield* String$5("APP_URL");
|
|
71151
|
+
const client = yield* HttpClient;
|
|
71152
|
+
const store = toSchemaStore(yield* KeyValueStore, Record$1(String$6, RedactedFromValue(String$6)));
|
|
71153
|
+
const grants = yield* make$38(getOrElse(yield* store.get("ai-gateway-grants"), () => ({})));
|
|
71154
|
+
const lock = yield* make$62(1);
|
|
71155
|
+
return AiGateway.of({
|
|
71156
|
+
apiUrl: (provider) => match$8(gateway, {
|
|
71157
|
+
onNone: () => fail$7(AiUnavailable.make({ message: "Start the app with --gateway" })),
|
|
71158
|
+
onSome: (url) => succeed$5(`${url}/ai/${provider}${match$1(provider === "openrouter", {
|
|
71159
|
+
onFalse: () => "",
|
|
71160
|
+
onTrue: () => "/v1"
|
|
71161
|
+
})}`)
|
|
71162
|
+
}),
|
|
71163
|
+
authorize: (userId) => (http) => pipe(mapRequestEffect(http, (request) => gen(function* () {
|
|
71164
|
+
if (local) return request;
|
|
71165
|
+
const token = (yield* get$1(grants))[userId];
|
|
71166
|
+
if (token === void 0) return yield* new HttpClientError({ reason: new TransportError({
|
|
71167
|
+
description: "AI access is unavailable; sign in again to enroll with Gateway",
|
|
71168
|
+
request
|
|
71169
|
+
}) });
|
|
71170
|
+
return setHeader$1(request, "authorization", `Bearer ${value(token)}`);
|
|
71171
|
+
})), tap((response) => pipe(gen(function* () {
|
|
71172
|
+
if (local || response.headers["x-gateway-grant-refused"] === void 0 || !exists(gateway, (url) => startsWith(`${url}/ai/`)(response.request.url))) return;
|
|
71173
|
+
const current = yield* get$1(grants);
|
|
71174
|
+
const token = current[userId];
|
|
71175
|
+
if (token === void 0 || response.request.headers["authorization"] !== `Bearer ${value(token)}`) return;
|
|
71176
|
+
const next = remove$3(current, userId);
|
|
71177
|
+
yield* pipe(store.set("ai-gateway-grants", next), ignore$1({
|
|
71178
|
+
log: "Warn",
|
|
71179
|
+
message: "The rejected AI grant could not be removed from storage"
|
|
71180
|
+
}));
|
|
71181
|
+
yield* set(grants, next);
|
|
71182
|
+
}), withPermit(lock)))),
|
|
71183
|
+
enroll: fnUntraced(function* (userId, headers) {
|
|
71184
|
+
return yield* pipe(gen(function* () {
|
|
71185
|
+
if (local || isNone(gateway) || (yield* get$1(grants))[userId] !== void 0) return;
|
|
71186
|
+
const response = yield* client.execute(yield* bodyJson(post(`${getOrElse(gateway, () => "")}/ai/grants`, { headers: match$1(headers["authorization"] !== void 0, {
|
|
71187
|
+
onFalse: () => ({ cookie: headers["cookie"] ?? "" }),
|
|
71188
|
+
onTrue: () => ({ authorization: headers["authorization"] })
|
|
71189
|
+
}) }), { app }));
|
|
71190
|
+
const result = yield* schemaBodyJson(Struct({ token: String$6 }))(response);
|
|
71191
|
+
const next = {
|
|
71192
|
+
...yield* get$1(grants),
|
|
71193
|
+
[userId]: make$57(result.token)
|
|
71194
|
+
};
|
|
71195
|
+
yield* store.set("ai-gateway-grants", next);
|
|
71196
|
+
yield* set(grants, next);
|
|
71197
|
+
}), withPermit(lock), timeout$1("10 seconds"), catch_$1(() => logWarning("AI Gateway enrollment failed")));
|
|
71198
|
+
})
|
|
71199
|
+
});
|
|
71200
|
+
}));
|
|
71201
|
+
};
|
|
70733
71202
|
// ../../packages/runtime/src/auth/service.ts
|
|
70734
71203
|
function rejected(message) {
|
|
70735
71204
|
return mapError$2((cause) => {
|
|
@@ -70748,12 +71217,18 @@ function rejected(message) {
|
|
|
70748
71217
|
function developer() {
|
|
70749
71218
|
return succeed$5(DEVELOPER);
|
|
70750
71219
|
}
|
|
71220
|
+
function enrolled(user, headers) {
|
|
71221
|
+
return gen(function* () {
|
|
71222
|
+
const gateway = getOrUndefined(yield* context(), AiGateway);
|
|
71223
|
+
if (gateway !== void 0) yield* gateway.enroll(user.id, headers);
|
|
71224
|
+
});
|
|
71225
|
+
}
|
|
70751
71226
|
const unavailable = text("The authorization service is temporarily unavailable; retry later", {
|
|
70752
71227
|
headers: { "retry-after": "5" },
|
|
70753
71228
|
status: 503
|
|
70754
71229
|
});
|
|
70755
71230
|
var Auth = class Auth extends Service$1()("@deslop/runtime/auth/service/Auth") {
|
|
70756
|
-
static makeContext = (auth) => pipe(make$
|
|
71231
|
+
static makeContext = (auth) => pipe(make$71(Auth, auth), add$1(RpcAuth, RpcAuth.of((effect, request) => pipe(auth.user(request.headers), tap$1((user) => enrolled(user, request.headers)), tap$1(() => {
|
|
70757
71232
|
if (isStreamSchema(request.rpc.successSchema)) return annotateCurrentSpan("rpc.stream", true);
|
|
70758
71233
|
return void_$1;
|
|
70759
71234
|
}), flatMap$2((user) => raceFirst(provideService(effect, CurrentUser, user), pipe(delay(auth.user(request.headers), "5 minutes"), retry({ while: (error) => error.error === "temporarily_unavailable" }), forever)))))));
|
|
@@ -70774,7 +71249,7 @@ var Auth = class Auth extends Service$1()("@deslop/runtime/auth/service/Auth") {
|
|
|
70774
71249
|
return Auth.makeContext(Auth.of({
|
|
70775
71250
|
access,
|
|
70776
71251
|
user: fn("Auth.user")(function* (headers) {
|
|
70777
|
-
if (isSome(get$
|
|
71252
|
+
if (isSome(get$4(headers, "authorization"))) return yield* access(headers, canonical);
|
|
70778
71253
|
return yield* pipe(client.get(new URL(SESSION_PATH, issuer).href, { headers: { cookie: headers["cookie"] ?? "" } }), flatMap$2(schemaBodyJson(User)), timeout$1("10 seconds"));
|
|
70779
71254
|
}, rejected("Sign in first"))
|
|
70780
71255
|
}));
|
|
@@ -70788,13 +71263,14 @@ middleware()(gen(function* () {
|
|
|
70788
71263
|
if (user.failure.error === "temporarily_unavailable") return unavailable;
|
|
70789
71264
|
return text("Sign in first", { status: 401 });
|
|
70790
71265
|
}
|
|
71266
|
+
yield* enrolled(user.success, (yield* HttpServerRequest).headers);
|
|
70791
71267
|
return yield* provideService(app, CurrentUser, user.success);
|
|
70792
71268
|
});
|
|
70793
71269
|
}));
|
|
70794
71270
|
// ../../packages/runtime/src/server.ts
|
|
70795
71271
|
const LOOPBACK = /^(?:localhost|\d{1,3}(?:\.\d{1,3}){3}|\[[\da-f:.]+\])$/iu;
|
|
70796
71272
|
const OTLP = ["/v1/traces", "/v1/logs"];
|
|
70797
|
-
const packageRoot = match(endsWith(".ts")(import.meta.url), {
|
|
71273
|
+
const packageRoot = match$1(endsWith(".ts")(import.meta.url), {
|
|
70798
71274
|
onFalse: () => fileURLToPath(new URL("..", import.meta.url)),
|
|
70799
71275
|
onTrue: cwd
|
|
70800
71276
|
});
|
|
@@ -70812,7 +71288,7 @@ const checkoutRoot = fnUntraced(function* (directory) {
|
|
|
70812
71288
|
const dataDirectory = gen(function* () {
|
|
70813
71289
|
const path = yield* Path$1;
|
|
70814
71290
|
const name = yield* appName;
|
|
70815
|
-
const directory = yield* match$
|
|
71291
|
+
const directory = yield* match$8(yield* checkoutRoot(packageRoot), {
|
|
70816
71292
|
onNone: () => map$5(String$5("HOME"), (home) => path.join(home, ".deslop", name)),
|
|
70817
71293
|
onSome: (root) => succeed$5(path.join(root, ".deslop", name))
|
|
70818
71294
|
});
|
|
@@ -70848,7 +71324,7 @@ const guard = make$19((app) => gen(function* () {
|
|
|
70848
71324
|
const origin = fromNullishOr(request.headers["origin"]);
|
|
70849
71325
|
if (yield* localAuth) {
|
|
70850
71326
|
const canonical = new URL(yield* String$5("APP_URL")).hostname;
|
|
70851
|
-
if (!exists(liftThrowable(() => new URL(`http://${host}`))(), (url) => url.hostname === canonical || isSome(match$
|
|
71327
|
+
if (!exists(liftThrowable(() => new URL(`http://${host}`))(), (url) => url.hostname === canonical || isSome(match$3(LOOPBACK)(url.hostname)))) return empty({ status: 403 });
|
|
70852
71328
|
}
|
|
70853
71329
|
if (exists(origin, (value) => !exists(liftThrowable(() => new URL(value).host)(), (originHost) => originHost === host)) && request.headers["sec-fetch-site"] !== "same-origin" && !contains(OTLP, headNonEmpty(split$1(request.url, "?")))) return empty({ status: 403 });
|
|
70854
71330
|
return yield* app;
|
|
@@ -70858,7 +71334,7 @@ function layerKeyValueStore(directory) {
|
|
|
70858
71334
|
const base = yield* KeyValueStore;
|
|
70859
71335
|
const fs = yield* FileSystem;
|
|
70860
71336
|
const path = yield* Path$1;
|
|
70861
|
-
const writes = yield* make$
|
|
71337
|
+
const writes = yield* make$62(1);
|
|
70862
71338
|
return make$37({
|
|
70863
71339
|
...omit(base, [
|
|
70864
71340
|
"set",
|
|
@@ -70885,7 +71361,7 @@ function layerKeyValueStore(directory) {
|
|
|
70885
71361
|
});
|
|
70886
71362
|
})), provide$2(layerFileSystem(directory)));
|
|
70887
71363
|
}
|
|
70888
|
-
unwrap$7(map$5(dataDirectory, layerKeyValueStore));
|
|
71364
|
+
const layerDataStore = unwrap$7(map$5(dataDirectory, layerKeyValueStore));
|
|
70889
71365
|
const layerProtocol = mergeAll$1(layerSchemaBinary(), succeed$6(MaxBodySize)(mebibytes(10)), effect(TracerDisabledWhen, map$5(TracerDisabledWhen, (previous) => (request) => {
|
|
70890
71366
|
const path = headNonEmpty(split$1(request.url, "?"));
|
|
70891
71367
|
return previous(request) || path === "/api/rpc" && toLowerCase(request.headers["upgrade"] ?? "") === "websocket" || startsWith("/assets/")(path) || contains([
|
|
@@ -70897,7 +71373,7 @@ const layerProtocol = mergeAll$1(layerSchemaBinary(), succeed$6(MaxBodySize)(meb
|
|
|
70897
71373
|
})));
|
|
70898
71374
|
const layerTelemetry = unwrap$7(gen(function* () {
|
|
70899
71375
|
const metadata = yield* packageMetadata;
|
|
70900
|
-
return match$
|
|
71376
|
+
return match$8(yield* option(String$5("OTEL_URL")), {
|
|
70901
71377
|
onNone: () => empty$8,
|
|
70902
71378
|
onSome: (url) => layerOtlp(`${metadata.name}-server`, url, "server", metadata.version)
|
|
70903
71379
|
});
|
|
@@ -70911,9 +71387,9 @@ const layerRoutes = use((router) => gen(function* () {
|
|
|
70911
71387
|
const toIssuer = fnUntraced(function* (search) {
|
|
70912
71388
|
const request = yield* HttpServerRequest;
|
|
70913
71389
|
const next = filter$3(liftThrowable(() => new URL(new URL(request.url, canonical).searchParams.get("next") ?? canonical, canonical))(), (url) => url.origin === canonical);
|
|
70914
|
-
return match$
|
|
71390
|
+
return match$8(issuer, {
|
|
70915
71391
|
onNone: () => text("Sign-in is not configured for this app", { status: 503 }),
|
|
70916
|
-
onSome: (origin) => match$
|
|
71392
|
+
onSome: (origin) => match$8(next, {
|
|
70917
71393
|
onNone: () => empty({ status: 400 }),
|
|
70918
71394
|
onSome: (url) => redirect(`${new URL("/", origin).href}?${new URLSearchParams({
|
|
70919
71395
|
...search,
|
|
@@ -70925,7 +71401,7 @@ const layerRoutes = use((router) => gen(function* () {
|
|
|
70925
71401
|
yield* router.add("GET", RUNTIME_PATH, gen(function* () {
|
|
70926
71402
|
const release = yield* metadata;
|
|
70927
71403
|
return yield* schemaJson(RuntimeConfig)({
|
|
70928
|
-
...match$
|
|
71404
|
+
...match$8(issuer, {
|
|
70929
71405
|
onNone: () => ({}),
|
|
70930
71406
|
onSome: (origin) => ({ auth: origin })
|
|
70931
71407
|
}),
|
|
@@ -70951,7 +71427,7 @@ const layerAnnounce = effectDiscard(gen(function* () {
|
|
|
70951
71427
|
schedule: spaced("1 minute"),
|
|
70952
71428
|
times: 60
|
|
70953
71429
|
}));
|
|
70954
|
-
yield* match$
|
|
71430
|
+
yield* match$8(yield* option(String$5("AUTH_URL")), {
|
|
70955
71431
|
onNone: () => void_$1,
|
|
70956
71432
|
onSome: fnUntraced(function* (issuer) {
|
|
70957
71433
|
yield* pipe(post(new URL(APPS_PATH, issuer).href), bodyJsonUnsafe({ origin }), client.execute, delay("2 seconds"), ignore$1({
|
|
@@ -71051,7 +71527,7 @@ const install = fnUntraced(function* (name, command, options) {
|
|
|
71051
71527
|
yield* fs.writeFileString(path.join(directory, unit), `[Unit]\nDescription=Deslop ${name}\nAfter=network-online.target\n\n[Service]\nType=simple\nEnvironment=NODE_ENV=production\nEnvironment=${systemdArgument(`PATH=${home}/.vite-plus/bin:/usr/local/bin:/usr/bin:/bin`)}\nEnvironmentFile=-${replaceAll("%", "%%")(`${home}/.deslop/${name}.env`)}\nExecStart=${join$2(map$8(command, systemdArgument), " ")}\nRestart=on-failure\nRestartSec=3\nUMask=0077\n\n[Install]\nWantedBy=default.target\n`, { mode: 384 });
|
|
71052
71528
|
yield* systemctl("daemon-reload");
|
|
71053
71529
|
yield* systemctl("enable", unit);
|
|
71054
|
-
yield* systemctl(match(options?.restart === false, {
|
|
71530
|
+
yield* systemctl(match$1(options?.restart === false, {
|
|
71055
71531
|
onFalse: () => "restart",
|
|
71056
71532
|
onTrue: () => "start"
|
|
71057
71533
|
}), unit);
|
|
@@ -71146,6 +71622,11 @@ const SETTINGS = {
|
|
|
71146
71622
|
flag: "auth",
|
|
71147
71623
|
schema: SecureOrigin
|
|
71148
71624
|
},
|
|
71625
|
+
GATEWAY_URL: {
|
|
71626
|
+
description: "Deslop Gateway origin for AI calls",
|
|
71627
|
+
flag: "gateway",
|
|
71628
|
+
schema: Origin
|
|
71629
|
+
},
|
|
71149
71630
|
HOST: {
|
|
71150
71631
|
description: `Listen address; defaults to ${DEFAULT_HOST}`,
|
|
71151
71632
|
flag: "host",
|
|
@@ -71174,19 +71655,19 @@ const provider = fnUntraced(function* (given, defaultPort) {
|
|
|
71174
71655
|
});
|
|
71175
71656
|
const layerPlatform = mergeAll$1(layer$4, layer$12, layer$15);
|
|
71176
71657
|
function server(app) {
|
|
71177
|
-
return pipe(serve(pipe(mergeAll$1(app.routes, layerRoutes, layerIcon(app.icon), layerWeb, layerAnnounce), provide$2(match$
|
|
71658
|
+
return pipe(serve(pipe(mergeAll$1(app.routes, layerRoutes, layerIcon(app.icon), layerWeb, layerAnnounce), provide$2(match$8(fromUndefinedOr(app.middleware), {
|
|
71178
71659
|
onNone: () => empty$8,
|
|
71179
71660
|
onSome: (middleware$1) => middleware()(middleware$1).layer
|
|
71180
|
-
})), provide$2(Auth.layer)), {
|
|
71661
|
+
})), provide$2(Auth.layer), provideMerge(pipe(AiGateway.layer, provide$2(layerDataStore)))), {
|
|
71181
71662
|
disableLogger: true,
|
|
71182
71663
|
middleware: guard
|
|
71183
|
-
}), provide$2(mergeAll$1(layerProtocol, match(app.telemetry === false, {
|
|
71664
|
+
}), provide$2(mergeAll$1(layerProtocol, match$1(app.telemetry === false, {
|
|
71184
71665
|
onFalse: () => layerTelemetry,
|
|
71185
71666
|
onTrue: () => empty$8
|
|
71186
71667
|
}))), provide$2(layerNodeHttpServer), provide$2(layerPlatform), launch);
|
|
71187
71668
|
}
|
|
71188
71669
|
function output(text) {
|
|
71189
|
-
return flatMap$2(Stdio, (stdio) => run$4(make$
|
|
71670
|
+
return flatMap$2(Stdio, (stdio) => run$4(make$45(text), stdio.stdout()));
|
|
71190
71671
|
}
|
|
71191
71672
|
function runApp(app) {
|
|
71192
71673
|
const program = gen(function* () {
|
|
@@ -76290,7 +76771,7 @@ var CompiledProcess = class {
|
|
|
76290
76771
|
return this.requestTermination(requested).pipe(flatMap$2((accepted) => accepted ? forkDetach(this.settleRequestedTermination()).pipe(asVoid) : void_$1));
|
|
76291
76772
|
}
|
|
76292
76773
|
sendAcknowledgedEffect(event) {
|
|
76293
|
-
return uninterruptibleMask((restore) => make$
|
|
76774
|
+
return uninterruptibleMask((restore) => make$68().pipe(flatMap$2((deferred) => this.offerEvent(event, void 0, void 0, deferred).pipe(andThen(restore(_await(deferred)))))));
|
|
76294
76775
|
}
|
|
76295
76776
|
offerEvent(event, source, causedBy, deferred) {
|
|
76296
76777
|
return suspend$2(() => {
|
|
@@ -76720,8 +77201,8 @@ const startGenericInternal = fnUntraced(function* (logic, options) {
|
|
|
76720
77201
|
let initialMicrosteps;
|
|
76721
77202
|
const mailbox = makeProcessMailbox();
|
|
76722
77203
|
const emissions = options.emissions ?? makeEmissionRuntime();
|
|
76723
|
-
const termination = yield* make$
|
|
76724
|
-
const done = yield* make$
|
|
77204
|
+
const termination = yield* make$68();
|
|
77205
|
+
const done = yield* make$68();
|
|
76725
77206
|
const awaitCompletion = _await(done).pipe(exit, asVoid);
|
|
76726
77207
|
let initializing = true;
|
|
76727
77208
|
let inFlightMessage;
|
|
@@ -76735,7 +77216,7 @@ const startGenericInternal = fnUntraced(function* (logic, options) {
|
|
|
76735
77216
|
};
|
|
76736
77217
|
return offerDirect(message, () => publishInspectedSent(inspector, subject, message));
|
|
76737
77218
|
});
|
|
76738
|
-
const sendAcknowledged = logic.execution?._tag !== "Compiled" ? void 0 : (event) => uninterruptibleMask((restore) => make$
|
|
77219
|
+
const sendAcknowledged = logic.execution?._tag !== "Compiled" ? void 0 : (event) => uninterruptibleMask((restore) => make$68().pipe(flatMap$2((deferred) => {
|
|
76739
77220
|
return (inspector === void 0 ? offerDirect({
|
|
76740
77221
|
[AcknowledgedMessageTypeId]: true,
|
|
76741
77222
|
event,
|
|
@@ -77125,7 +77606,7 @@ fnUntraced(function* (logic, strategy, options) {
|
|
|
77125
77606
|
const inspection = yield* make$2(sessionId);
|
|
77126
77607
|
runtime.inspection = inspection;
|
|
77127
77608
|
const emissions = makeEmissionRuntime();
|
|
77128
|
-
const started = yield* make$
|
|
77609
|
+
const started = yield* make$68();
|
|
77129
77610
|
const internalOptions = options === void 0 ? {
|
|
77130
77611
|
detached: true,
|
|
77131
77612
|
emissions,
|
|
@@ -78589,7 +79070,7 @@ var Presence = class Presence extends Service$1()("@deslop/portfolio/services/pr
|
|
|
78589
79070
|
...transition.state,
|
|
78590
79071
|
tabs: {
|
|
78591
79072
|
...transition.state.tabs,
|
|
78592
|
-
[transition.event.visitor.id]: getOrElse(get$
|
|
79073
|
+
[transition.event.visitor.id]: getOrElse(get$6(transition.state.tabs, transition.event.visitor.id), () => 0) + 1
|
|
78593
79074
|
},
|
|
78594
79075
|
visitors: upsertPortfolioVisitor(transition.state.visitors, transition.event.visitor)
|
|
78595
79076
|
}),
|
|
@@ -78598,7 +79079,7 @@ var Presence = class Presence extends Service$1()("@deslop/portfolio/services/pr
|
|
|
78598
79079
|
Left: {
|
|
78599
79080
|
branches: "left",
|
|
78600
79081
|
resolve: (transition) => {
|
|
78601
|
-
const open = getOrElse(get$
|
|
79082
|
+
const open = getOrElse(get$6(transition.state.tabs, transition.event.id), () => 1) - 1;
|
|
78602
79083
|
if (open > 0) return transition.select.open({ data: {
|
|
78603
79084
|
...transition.state,
|
|
78604
79085
|
tabs: {
|
|
@@ -78656,7 +79137,7 @@ var Presence = class Presence extends Service$1()("@deslop/portfolio/services/pr
|
|
|
78656
79137
|
_tag: "Left",
|
|
78657
79138
|
id: payload.id
|
|
78658
79139
|
}));
|
|
78659
|
-
return pipe(ref.changes, map$3((snapshot) => match$
|
|
79140
|
+
return pipe(ref.changes, map$3((snapshot) => match$8(room.root.get(snapshot.state, "Occupied"), {
|
|
78660
79141
|
onNone: () => [],
|
|
78661
79142
|
onSome: (occupied) => [...occupied.visitors, ...occupied.bots]
|
|
78662
79143
|
})), buffer$1({
|