@deslop/auth 0.1.1345 → 0.1.1354
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -11
- package/dist/client/assets/{(home)-BoeHqAri.js → (home)-Bg5mmCgh.js} +1 -1
- package/dist/client/assets/{app-bar-Dqbmtpqx.js → app-bar-DJqg9XnE.js} +2 -2
- package/dist/client/assets/auth-BQTBhqaL.js +1 -0
- package/dist/client/assets/{dropdown-menu-BIBLM6G7.js → dropdown-menu-isVYXx1s.js} +1 -1
- package/dist/client/assets/effect-C9oAGCsS.js +17 -0
- package/dist/client/assets/{format-Ch9ozqFi.js → format-Dj1kG1eh.js} +1 -1
- package/dist/client/assets/index-BRAEuyxI.js +3 -0
- package/dist/client/assets/{marks-ClLDFiwP.js → marks-Dk_i6_UU.js} +2 -2
- package/dist/client/assets/{people-D60arvMd.js → people-BWTlj1aV.js} +1 -1
- package/dist/client/assets/route-CCKrDM-O.js +1 -0
- package/dist/client/index.html +3 -3
- package/dist/server.js +1092 -1415
- package/package.json +2 -2
- package/dist/client/assets/auth-xe7mJnOp.js +0 -1
- package/dist/client/assets/effect-DkaNBwCo.js +0 -17
- package/dist/client/assets/index-ClQ9zIn3.js +0 -3
- package/dist/client/assets/route-8_VQneqe.js +0 -1
package/dist/server.js
CHANGED
|
@@ -3385,9 +3385,9 @@ function Array_(item) {
|
|
|
3385
3385
|
/**
|
|
3386
3386
|
* @since 2.0.0
|
|
3387
3387
|
*/
|
|
3388
|
-
const TypeId$
|
|
3388
|
+
const TypeId$74 = "~effect/Option";
|
|
3389
3389
|
const CommonProto$1 = {
|
|
3390
|
-
[TypeId$
|
|
3390
|
+
[TypeId$74]: { _A: (_) => _ },
|
|
3391
3391
|
...PipeInspectableProto,
|
|
3392
3392
|
[Symbol.iterator]() {
|
|
3393
3393
|
return new SingleShotGen(this);
|
|
@@ -3437,7 +3437,7 @@ const NoneProto = /*#__PURE__*/ Object.assign(/*#__PURE__*/ Object.create(Common
|
|
|
3437
3437
|
}
|
|
3438
3438
|
});
|
|
3439
3439
|
/** @internal */
|
|
3440
|
-
const isOption$1 = (input) => hasProperty(input, TypeId$
|
|
3440
|
+
const isOption$1 = (input) => hasProperty(input, TypeId$74);
|
|
3441
3441
|
/** @internal */
|
|
3442
3442
|
const isNone$1 = (fa) => fa._tag === "None";
|
|
3443
3443
|
/** @internal */
|
|
@@ -3452,9 +3452,9 @@ SomeImpl.prototype = SomeProto;
|
|
|
3452
3452
|
/** @internal */
|
|
3453
3453
|
const some$2 = (value) => new SomeImpl(value);
|
|
3454
3454
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/result.js
|
|
3455
|
-
const TypeId$
|
|
3455
|
+
const TypeId$73 = "~effect/Result";
|
|
3456
3456
|
const CommonProto = {
|
|
3457
|
-
[TypeId$
|
|
3457
|
+
[TypeId$73]: {
|
|
3458
3458
|
/* v8 ignore next 2 */
|
|
3459
3459
|
_A: (_) => _,
|
|
3460
3460
|
_E: (_) => _
|
|
@@ -3505,7 +3505,7 @@ const FailureProto = /*#__PURE__*/ Object.assign(/*#__PURE__*/ Object.create(Com
|
|
|
3505
3505
|
}
|
|
3506
3506
|
});
|
|
3507
3507
|
/** @internal */
|
|
3508
|
-
const isResult$1 = (input) => hasProperty(input, TypeId$
|
|
3508
|
+
const isResult$1 = (input) => hasProperty(input, TypeId$73);
|
|
3509
3509
|
/** @internal */
|
|
3510
3510
|
const isFailure$2 = (result) => result._tag === "Failure";
|
|
3511
3511
|
/** @internal */
|
|
@@ -3741,7 +3741,7 @@ const isLessThan$1 = (O) => dual(2, (self, that) => O(self, that) === -1);
|
|
|
3741
3741
|
* @category predicates
|
|
3742
3742
|
* @since 4.0.0
|
|
3743
3743
|
*/
|
|
3744
|
-
const isGreaterThan$
|
|
3744
|
+
const isGreaterThan$1 = (O) => dual(2, (self, that) => O(self, that) === 1);
|
|
3745
3745
|
/**
|
|
3746
3746
|
* Checks whether one value is less than or equal to another according to the given order.
|
|
3747
3747
|
*
|
|
@@ -4467,7 +4467,7 @@ const toArray = (self) => isNone(self) ? [] : [self.value];
|
|
|
4467
4467
|
* @category filtering
|
|
4468
4468
|
* @since 2.0.0
|
|
4469
4469
|
*/
|
|
4470
|
-
const filter$
|
|
4470
|
+
const filter$7 = /*#__PURE__*/ dual(2, (self, predicate) => isNone(self) ? none() : predicate(self.value) ? some$1(self.value) : none());
|
|
4471
4471
|
/**
|
|
4472
4472
|
* Lifts a `Predicate` or `Refinement` into the `Option` context: returns
|
|
4473
4473
|
* `Some(value)` when the predicate holds, `None` otherwise.
|
|
@@ -4642,10 +4642,10 @@ const ServiceProto = {
|
|
|
4642
4642
|
};
|
|
4643
4643
|
const cacheKeys = /*#__PURE__*/ new Set();
|
|
4644
4644
|
const ReferenceTypeId = "~effect/Context/Reference";
|
|
4645
|
-
const TypeId$
|
|
4645
|
+
const TypeId$72 = "~effect/Context";
|
|
4646
4646
|
const FlattenAfterBaseHits = 8;
|
|
4647
4647
|
const makeImpl$1 = (cacheRoot, base, overlay, depth, maxDepth) => {
|
|
4648
|
-
const self = Object.create(Proto$
|
|
4648
|
+
const self = Object.create(Proto$22);
|
|
4649
4649
|
self.cacheRoot = cacheRoot ?? self;
|
|
4650
4650
|
self.base = base;
|
|
4651
4651
|
self.overlay = overlay;
|
|
@@ -4736,12 +4736,12 @@ const makeUnsafe$9 = (mapUnsafe, options) => {
|
|
|
4736
4736
|
const maxDepth = options?.maxDepth;
|
|
4737
4737
|
return makeImpl$1(void 0, mapUnsafe, void 0, 0, Number.isInteger(maxDepth) && maxDepth >= 0 ? maxDepth : 8);
|
|
4738
4738
|
};
|
|
4739
|
-
const Proto$
|
|
4739
|
+
const Proto$22 = {
|
|
4740
4740
|
get mapUnsafe() {
|
|
4741
4741
|
return flatten$5(this);
|
|
4742
4742
|
},
|
|
4743
4743
|
...PipeInspectableProto,
|
|
4744
|
-
[TypeId$
|
|
4744
|
+
[TypeId$72]: { _Services: (_) => _ },
|
|
4745
4745
|
toJSON() {
|
|
4746
4746
|
return {
|
|
4747
4747
|
_id: "Context",
|
|
@@ -4797,7 +4797,7 @@ const hasSameCache = (self, that) => self.cacheRoot === that.cacheRoot;
|
|
|
4797
4797
|
* @category guards
|
|
4798
4798
|
* @since 2.0.0
|
|
4799
4799
|
*/
|
|
4800
|
-
const isContext = (u) => hasProperty(u, TypeId$
|
|
4800
|
+
const isContext = (u) => hasProperty(u, TypeId$72);
|
|
4801
4801
|
/**
|
|
4802
4802
|
* Checks whether the provided argument is a `Reference`.
|
|
4803
4803
|
*
|
|
@@ -4833,7 +4833,7 @@ const isReference = (u) => !!u[ReferenceTypeId];
|
|
|
4833
4833
|
* @category constructors
|
|
4834
4834
|
* @since 2.0.0
|
|
4835
4835
|
*/
|
|
4836
|
-
const empty$
|
|
4836
|
+
const empty$16 = () => emptyContext;
|
|
4837
4837
|
const emptyContext = /*#__PURE__*/ makeUnsafe$9(/*#__PURE__*/ new Map());
|
|
4838
4838
|
/**
|
|
4839
4839
|
* Creates a new `Context` with a single service associated to the key.
|
|
@@ -5065,7 +5065,7 @@ const serviceNotFoundError = (service) => {
|
|
|
5065
5065
|
* @category getters
|
|
5066
5066
|
* @since 2.0.0
|
|
5067
5067
|
*/
|
|
5068
|
-
const getOption = /*#__PURE__*/ dual(2, (self, service) => {
|
|
5068
|
+
const getOption$1 = /*#__PURE__*/ dual(2, (self, service) => {
|
|
5069
5069
|
const value = lookup(self, service.key);
|
|
5070
5070
|
if (value !== notFound$2) return some$1(value);
|
|
5071
5071
|
return isReference(service) ? some$1(getDefaultValue(service)) : none();
|
|
@@ -5241,7 +5241,7 @@ const omit$2 = (...keys) => (self) => withFlat(self, (map) => {
|
|
|
5241
5241
|
*/
|
|
5242
5242
|
const Reference = Service$1;
|
|
5243
5243
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Duration.js
|
|
5244
|
-
const TypeId$
|
|
5244
|
+
const TypeId$71 = "~effect/Duration";
|
|
5245
5245
|
const bigint0$3 = /*#__PURE__*/ BigInt(0);
|
|
5246
5246
|
const bigint1$2 = /*#__PURE__*/ BigInt(1);
|
|
5247
5247
|
const bigint2 = /*#__PURE__*/ BigInt(2);
|
|
@@ -5342,7 +5342,7 @@ const fromInputUnsafe$1 = (input) => {
|
|
|
5342
5342
|
}
|
|
5343
5343
|
case "object": {
|
|
5344
5344
|
if (input === null) break;
|
|
5345
|
-
if (TypeId$
|
|
5345
|
+
if (TypeId$71 in input) return input;
|
|
5346
5346
|
if (Array.isArray(input)) {
|
|
5347
5347
|
if (input.length !== 2 || !input.every(isNumber)) return invalid$3(input);
|
|
5348
5348
|
if (Number.isNaN(input[0]) || Number.isNaN(input[1])) return zero$2;
|
|
@@ -5413,7 +5413,7 @@ const zeroDurationValue = {
|
|
|
5413
5413
|
const infinityDurationValue = { _tag: "Infinity" };
|
|
5414
5414
|
const negativeInfinityDurationValue = { _tag: "NegativeInfinity" };
|
|
5415
5415
|
const DurationProto = {
|
|
5416
|
-
[TypeId$
|
|
5416
|
+
[TypeId$71]: TypeId$71,
|
|
5417
5417
|
[symbol$3]() {
|
|
5418
5418
|
switch (this.value._tag) {
|
|
5419
5419
|
case "Millis": return hash(roundMillisToNanos(this.value.millis));
|
|
@@ -5497,7 +5497,7 @@ const make$91 = (input) => {
|
|
|
5497
5497
|
* @category guards
|
|
5498
5498
|
* @since 2.0.0
|
|
5499
5499
|
*/
|
|
5500
|
-
const isDuration = (u) => hasProperty(u, TypeId$
|
|
5500
|
+
const isDuration = (u) => hasProperty(u, TypeId$71);
|
|
5501
5501
|
/**
|
|
5502
5502
|
* Checks whether a Duration is finite (not infinite).
|
|
5503
5503
|
*
|
|
@@ -5882,7 +5882,7 @@ const matchPair = /*#__PURE__*/ dual(3, (self, that, options) => {
|
|
|
5882
5882
|
* @category instances
|
|
5883
5883
|
* @since 2.0.0
|
|
5884
5884
|
*/
|
|
5885
|
-
const Order$
|
|
5885
|
+
const Order$4 = /*#__PURE__*/ make$93((self, that) => matchPair(self, that, {
|
|
5886
5886
|
onMillis: (self, that) => self < that ? -1 : self > that ? 1 : 0,
|
|
5887
5887
|
onNanos: (self, that) => self < that ? -1 : self > that ? 1 : 0,
|
|
5888
5888
|
onInfinity: (self, that) => {
|
|
@@ -5928,7 +5928,7 @@ const Equivalence$3 = (self, that) => matchPair(self, that, {
|
|
|
5928
5928
|
* @category ordering
|
|
5929
5929
|
* @since 2.0.0
|
|
5930
5930
|
*/
|
|
5931
|
-
const max = /*#__PURE__*/ max$1(Order$
|
|
5931
|
+
const max = /*#__PURE__*/ max$1(Order$4);
|
|
5932
5932
|
/**
|
|
5933
5933
|
* Adds two Durations together.
|
|
5934
5934
|
*
|
|
@@ -6671,7 +6671,7 @@ const constEmptyIterator = { next() {
|
|
|
6671
6671
|
* @category constructors
|
|
6672
6672
|
* @since 2.0.0
|
|
6673
6673
|
*/
|
|
6674
|
-
const empty$
|
|
6674
|
+
const empty$15 = () => constEmpty;
|
|
6675
6675
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Record.js
|
|
6676
6676
|
/**
|
|
6677
6677
|
* Creates a new, empty record.
|
|
@@ -6693,7 +6693,7 @@ const empty$16 = () => constEmpty;
|
|
|
6693
6693
|
* @category constructors
|
|
6694
6694
|
* @since 2.0.0
|
|
6695
6695
|
*/
|
|
6696
|
-
const empty$
|
|
6696
|
+
const empty$14 = () => ({});
|
|
6697
6697
|
/**
|
|
6698
6698
|
* Determines if a mutable record is empty.
|
|
6699
6699
|
*
|
|
@@ -6812,8 +6812,8 @@ const map$11 = /*#__PURE__*/ dual(2, (self, f) => {
|
|
|
6812
6812
|
* @category filtering
|
|
6813
6813
|
* @since 2.0.0
|
|
6814
6814
|
*/
|
|
6815
|
-
const filter$
|
|
6816
|
-
const out = empty$
|
|
6815
|
+
const filter$6 = /*#__PURE__*/ dual(2, (self, predicate) => {
|
|
6816
|
+
const out = empty$14();
|
|
6817
6817
|
for (const key of keys$1(self)) if (predicate(self[key], key)) assignProperty(out, key, self[key]);
|
|
6818
6818
|
return out;
|
|
6819
6819
|
});
|
|
@@ -6834,7 +6834,7 @@ const filter$8 = /*#__PURE__*/ dual(2, (self, predicate) => {
|
|
|
6834
6834
|
* @since 2.0.0
|
|
6835
6835
|
*/
|
|
6836
6836
|
const getSomes$1 = (self) => {
|
|
6837
|
-
const out = empty$
|
|
6837
|
+
const out = empty$14();
|
|
6838
6838
|
for (const key of keys$1(self)) {
|
|
6839
6839
|
const option = self[key];
|
|
6840
6840
|
if (isSome(option)) assignProperty(out, key, option.value);
|
|
@@ -6872,7 +6872,7 @@ const keys$1 = (self) => Object.keys(self);
|
|
|
6872
6872
|
* @category getters
|
|
6873
6873
|
* @since 2.0.0
|
|
6874
6874
|
*/
|
|
6875
|
-
const values
|
|
6875
|
+
const values = (self) => collect$1(self, (_, a) => a);
|
|
6876
6876
|
/**
|
|
6877
6877
|
* Adds a new key-value pair or update an existing key's value in a record.
|
|
6878
6878
|
*
|
|
@@ -7672,7 +7672,7 @@ const difference = /*#__PURE__*/ dual(2, (self, that) => {
|
|
|
7672
7672
|
* @category constructors
|
|
7673
7673
|
* @since 2.0.0
|
|
7674
7674
|
*/
|
|
7675
|
-
const empty$
|
|
7675
|
+
const empty$13 = () => [];
|
|
7676
7676
|
/**
|
|
7677
7677
|
* Wraps a single value in a `NonEmptyArray`.
|
|
7678
7678
|
*
|
|
@@ -7835,7 +7835,7 @@ const getSomes = (self) => {
|
|
|
7835
7835
|
* @category filtering
|
|
7836
7836
|
* @since 2.0.0
|
|
7837
7837
|
*/
|
|
7838
|
-
const filter$
|
|
7838
|
+
const filter$5 = /*#__PURE__*/ dual(2, (self, predicate) => {
|
|
7839
7839
|
const as = fromIterable$5(self);
|
|
7840
7840
|
const out = [];
|
|
7841
7841
|
for (let i = 0; i < as.length; i++) if (predicate(as[i], i)) out.push(as[i]);
|
|
@@ -7893,7 +7893,7 @@ const reduce = /*#__PURE__*/ dual(3, (self, b, f) => fromIterable$5(self).reduce
|
|
|
7893
7893
|
* @category converting
|
|
7894
7894
|
* @since 4.0.0
|
|
7895
7895
|
*/
|
|
7896
|
-
const fromNullishOr = (a) => a == null ? empty$
|
|
7896
|
+
const fromNullishOr = (a) => a == null ? empty$13() : [a];
|
|
7897
7897
|
/**
|
|
7898
7898
|
* Maps each element with a nullable-returning function, keeping only non-null /
|
|
7899
7899
|
* non-undefined results.
|
|
@@ -8786,7 +8786,7 @@ const externalSpan = (options) => ({
|
|
|
8786
8786
|
spanId: options.spanId,
|
|
8787
8787
|
traceId: options.traceId,
|
|
8788
8788
|
sampled: options.sampled ?? true,
|
|
8789
|
-
annotations: options.annotations ?? empty$
|
|
8789
|
+
annotations: options.annotations ?? empty$16()
|
|
8790
8790
|
});
|
|
8791
8791
|
/**
|
|
8792
8792
|
* Context reference for disabling trace propagation.
|
|
@@ -9413,7 +9413,7 @@ var FiberImpl = class {
|
|
|
9413
9413
|
}
|
|
9414
9414
|
this._stack.length = 0;
|
|
9415
9415
|
this._children = void 0;
|
|
9416
|
-
this.context = empty$
|
|
9416
|
+
this.context = empty$16();
|
|
9417
9417
|
const cache = this.cache;
|
|
9418
9418
|
if (cache.span !== void 0 || cache.stackFrame !== void 0) this.cache = {
|
|
9419
9419
|
...cache,
|
|
@@ -9617,7 +9617,7 @@ const fiberInterruptAs = /*#__PURE__*/ dual((args) => hasProperty(args[0], Fiber
|
|
|
9617
9617
|
/** @internal */
|
|
9618
9618
|
const fiberInterruptAll = (fibers) => withFiber$1((parent) => {
|
|
9619
9619
|
const annotations = fiberStackAnnotations(parent);
|
|
9620
|
-
let fiberArr = empty$
|
|
9620
|
+
let fiberArr = empty$13();
|
|
9621
9621
|
for (const fiber of fibers) {
|
|
9622
9622
|
fiber.interruptUnsafe(parent.id, annotations);
|
|
9623
9623
|
fiberArr.push(fiber);
|
|
@@ -9627,7 +9627,7 @@ const fiberInterruptAll = (fibers) => withFiber$1((parent) => {
|
|
|
9627
9627
|
/** @internal */
|
|
9628
9628
|
const fiberInterruptAllAs = /*#__PURE__*/ dual(2, (fibers, fiberId) => withFiber$1((parent) => {
|
|
9629
9629
|
const annotations = fiberStackAnnotations(parent);
|
|
9630
|
-
const fiberArr = empty$
|
|
9630
|
+
const fiberArr = empty$13();
|
|
9631
9631
|
for (const fiber of fibers) {
|
|
9632
9632
|
fiber.interruptUnsafe(fiberId, annotations);
|
|
9633
9633
|
fiberArr.push(fiber);
|
|
@@ -10111,7 +10111,7 @@ const exitAsVoidAll = (exits) => {
|
|
|
10111
10111
|
return failures.length === 0 ? exitVoid : exitFailCause(causeFromReasons(failures));
|
|
10112
10112
|
};
|
|
10113
10113
|
/** @internal */
|
|
10114
|
-
const serviceOption$1 = (service) => withFiber$1((fiber) => succeed$9(getOption(fiber.context, service)));
|
|
10114
|
+
const serviceOption$1 = (service) => withFiber$1((fiber) => succeed$9(getOption$1(fiber.context, service)));
|
|
10115
10115
|
/** @internal */
|
|
10116
10116
|
const updateContext$1 = /*#__PURE__*/ dual(2, (self, f) => withFiber$1((fiber) => {
|
|
10117
10117
|
const prevContext = fiber.context;
|
|
@@ -10196,7 +10196,7 @@ const tapCauseFilter = /*#__PURE__*/ dual(3, (self, filter, f) => catchCause$4(s
|
|
|
10196
10196
|
/** @internal */
|
|
10197
10197
|
const tapError$4 = /*#__PURE__*/ dual(2, (self, f) => tapCauseFilter(self, findError, (e) => f(e)));
|
|
10198
10198
|
/** @internal */
|
|
10199
|
-
const catchIf$
|
|
10199
|
+
const catchIf$3 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, predicate, f, orElse) => catchCause$4(self, (cause) => {
|
|
10200
10200
|
const error = findRecoverableError(cause);
|
|
10201
10201
|
if (isFailure$1(error)) return failCause$6(error.failure);
|
|
10202
10202
|
if (!predicate(error.success)) return orElse ? orElse(error.success) : failCause$6(cause);
|
|
@@ -10213,7 +10213,7 @@ const catchFilter$3 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, f
|
|
|
10213
10213
|
/** @internal */
|
|
10214
10214
|
const catchTag$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, k, f, orElse) => {
|
|
10215
10215
|
const pred = Array.isArray(k) ? (e) => hasProperty(e, "_tag") && k.includes(e._tag) : isTagged(k);
|
|
10216
|
-
return catchIf$
|
|
10216
|
+
return catchIf$3(self, pred, f, orElse);
|
|
10217
10217
|
});
|
|
10218
10218
|
/** @internal */
|
|
10219
10219
|
const catchTags$2 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, cases, orElse) => {
|
|
@@ -10224,7 +10224,7 @@ const catchTags$2 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, cas
|
|
|
10224
10224
|
}, (e) => cases[e["_tag"]](e), orElse);
|
|
10225
10225
|
});
|
|
10226
10226
|
/** @internal */
|
|
10227
|
-
const catchReason$3 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, errorTag, reasonTag, f, orElse) => catchIf$
|
|
10227
|
+
const catchReason$3 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, errorTag, reasonTag, f, orElse) => catchIf$3(self, (e) => isTagged(e, errorTag) && hasProperty(e, "reason") && (orElse !== void 0 || isTagged(e.reason, reasonTag)), (e) => {
|
|
10228
10228
|
const reason = e.reason;
|
|
10229
10229
|
if (isTagged(reason, reasonTag)) return f(reason, e);
|
|
10230
10230
|
return orElse ? orElse(reason, e) : fail$10(e);
|
|
@@ -10865,7 +10865,7 @@ const forEachConcurrent = /*#__PURE__*/ iterateConcurrentImpl({
|
|
|
10865
10865
|
/** @internal */
|
|
10866
10866
|
const filterOrElse = /*#__PURE__*/ dual(3, (self, predicate, orElse) => flatMap$5(self, (a) => predicate(a) ? succeed$9(a) : orElse(a)));
|
|
10867
10867
|
/** @internal */
|
|
10868
|
-
const filter$
|
|
10868
|
+
const filter$4 = /*#__PURE__*/ dual((args) => isIterable(args[0]) && !isEffect$1(args[0]), (elements, predicate, options) => map$9(forEach$2(elements, (a, i) => {
|
|
10869
10869
|
const result = predicate(a, i);
|
|
10870
10870
|
if (typeof result === "boolean") return succeed$9(result ? some$1(a) : none());
|
|
10871
10871
|
return map$9(result, (keep) => keep ? some$1(a) : none());
|
|
@@ -10934,7 +10934,7 @@ const fiberRunIn = /*#__PURE__*/ dual(2, (self, scope) => {
|
|
|
10934
10934
|
return self;
|
|
10935
10935
|
});
|
|
10936
10936
|
/** @internal */
|
|
10937
|
-
const runFork$1 = /*#__PURE__*/ runForkWith$1(/*#__PURE__*/ empty$
|
|
10937
|
+
const runFork$1 = /*#__PURE__*/ runForkWith$1(/*#__PURE__*/ empty$16());
|
|
10938
10938
|
/** @internal */
|
|
10939
10939
|
const runPromiseExitWith = (context) => {
|
|
10940
10940
|
const runFork = runForkWith$1(context);
|
|
@@ -10954,7 +10954,7 @@ const runPromiseWith = (context) => {
|
|
|
10954
10954
|
});
|
|
10955
10955
|
};
|
|
10956
10956
|
/** @internal */
|
|
10957
|
-
const runPromise$1 = /*#__PURE__*/ runPromiseWith(/*#__PURE__*/ empty$
|
|
10957
|
+
const runPromise$1 = /*#__PURE__*/ runPromiseWith(/*#__PURE__*/ empty$16());
|
|
10958
10958
|
/** @internal */
|
|
10959
10959
|
const runSyncExitWith = (context) => {
|
|
10960
10960
|
const runFork = runForkWith$1(context);
|
|
@@ -10967,7 +10967,7 @@ const runSyncExitWith = (context) => {
|
|
|
10967
10967
|
};
|
|
10968
10968
|
};
|
|
10969
10969
|
/** @internal */
|
|
10970
|
-
const runSyncExit$1 = /*#__PURE__*/ runSyncExitWith(/*#__PURE__*/ empty$
|
|
10970
|
+
const runSyncExit$1 = /*#__PURE__*/ runSyncExitWith(/*#__PURE__*/ empty$16());
|
|
10971
10971
|
/** @internal */
|
|
10972
10972
|
const runSyncWith = (context) => {
|
|
10973
10973
|
const runSyncExit = runSyncExitWith(context);
|
|
@@ -10978,7 +10978,7 @@ const runSyncWith = (context) => {
|
|
|
10978
10978
|
};
|
|
10979
10979
|
};
|
|
10980
10980
|
/** @internal */
|
|
10981
|
-
const runSync$2 = /*#__PURE__*/ runSyncWith(/*#__PURE__*/ empty$
|
|
10981
|
+
const runSync$2 = /*#__PURE__*/ runSyncWith(/*#__PURE__*/ empty$16());
|
|
10982
10982
|
const succeedTrue = /*#__PURE__*/ succeed$9(true);
|
|
10983
10983
|
const succeedFalse = /*#__PURE__*/ succeed$9(false);
|
|
10984
10984
|
var Latch = class {
|
|
@@ -11084,7 +11084,7 @@ const makeSpanUnsafe = (fiber, name, options) => {
|
|
|
11084
11084
|
if (disablePropagation) span = noopSpan({
|
|
11085
11085
|
name,
|
|
11086
11086
|
parent,
|
|
11087
|
-
annotations: add$2(options?.annotations ?? empty$
|
|
11087
|
+
annotations: add$2(options?.annotations ?? empty$16(), DisablePropagation, true)
|
|
11088
11088
|
});
|
|
11089
11089
|
else {
|
|
11090
11090
|
const tracer = fiber.cache.tracer ?? nativeTracer;
|
|
@@ -11097,7 +11097,7 @@ const makeSpanUnsafe = (fiber, name, options) => {
|
|
|
11097
11097
|
span = tracer.span({
|
|
11098
11098
|
name,
|
|
11099
11099
|
parent,
|
|
11100
|
-
annotations: options?.annotations ?? empty$
|
|
11100
|
+
annotations: options?.annotations ?? empty$16(),
|
|
11101
11101
|
links,
|
|
11102
11102
|
startTime: timingEnabled ? clock.currentTimeNanosUnsafe() : bigint0$2,
|
|
11103
11103
|
kind: options?.kind ?? "internal",
|
|
@@ -11316,7 +11316,7 @@ const logLevelToOrder = (level) => {
|
|
|
11316
11316
|
/** @internal */
|
|
11317
11317
|
const LogLevelOrder = /*#__PURE__*/ mapInput(Number$6, logLevelToOrder);
|
|
11318
11318
|
/** @internal */
|
|
11319
|
-
const isLogLevelGreaterThan = /*#__PURE__*/ isGreaterThan$
|
|
11319
|
+
const isLogLevelGreaterThan = /*#__PURE__*/ isGreaterThan$1(LogLevelOrder);
|
|
11320
11320
|
/** @internal */
|
|
11321
11321
|
const CurrentLoggers$1 = /*#__PURE__*/ Reference("effect/Logger/CurrentLoggers", { defaultValue: () => /* @__PURE__ */ new Set([defaultLogger, tracerLogger]) });
|
|
11322
11322
|
/** @internal */
|
|
@@ -11768,7 +11768,7 @@ const match$3 = exitMatch;
|
|
|
11768
11768
|
*/
|
|
11769
11769
|
const asVoidAll = exitAsVoidAll;
|
|
11770
11770
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Deferred.js
|
|
11771
|
-
const TypeId$
|
|
11771
|
+
const TypeId$70 = "~effect/Deferred";
|
|
11772
11772
|
/**
|
|
11773
11773
|
* Checks whether a value is a `Deferred`.
|
|
11774
11774
|
*
|
|
@@ -11781,9 +11781,9 @@ const TypeId$71 = "~effect/Deferred";
|
|
|
11781
11781
|
* @category guards
|
|
11782
11782
|
* @since 4.0.0
|
|
11783
11783
|
*/
|
|
11784
|
-
const isDeferred = (u) => hasProperty(u, TypeId$
|
|
11784
|
+
const isDeferred = (u) => hasProperty(u, TypeId$70);
|
|
11785
11785
|
const DeferredProto = {
|
|
11786
|
-
[TypeId$
|
|
11786
|
+
[TypeId$70]: {
|
|
11787
11787
|
_A: identity,
|
|
11788
11788
|
_E: identity
|
|
11789
11789
|
},
|
|
@@ -12759,7 +12759,7 @@ const closeUnsafe = scopeCloseUnsafe;
|
|
|
12759
12759
|
*/
|
|
12760
12760
|
const use$1 = scopeUse;
|
|
12761
12761
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Layer.js
|
|
12762
|
-
const TypeId$
|
|
12762
|
+
const TypeId$69 = "~effect/Layer";
|
|
12763
12763
|
const MemoMapTypeId = "~effect/Layer/MemoMap";
|
|
12764
12764
|
const makeMemoMapEntry = (memoMap, layer) => {
|
|
12765
12765
|
const entry = {
|
|
@@ -12781,7 +12781,7 @@ const memoMapObserve = (entry, scope) => {
|
|
|
12781
12781
|
return true;
|
|
12782
12782
|
};
|
|
12783
12783
|
const LayerProto = {
|
|
12784
|
-
[TypeId$
|
|
12784
|
+
[TypeId$69]: {
|
|
12785
12785
|
_ROut: identity,
|
|
12786
12786
|
_E: identity,
|
|
12787
12787
|
_RIn: identity
|
|
@@ -13236,7 +13236,7 @@ const succeedContext = (context) => fromBuildUnsafe(constant(succeed$9(context))
|
|
|
13236
13236
|
* @category constructors
|
|
13237
13237
|
* @since 2.0.0
|
|
13238
13238
|
*/
|
|
13239
|
-
const empty$
|
|
13239
|
+
const empty$12 = /*#__PURE__*/ succeedContext(/*#__PURE__*/ empty$16());
|
|
13240
13240
|
/**
|
|
13241
13241
|
* Constructs a layer lazily that provides a single service.
|
|
13242
13242
|
*
|
|
@@ -13429,7 +13429,7 @@ const effectContext = (effect) => fromBuildMemo((_, scope) => provide$3(effect,
|
|
|
13429
13429
|
* @category constructors
|
|
13430
13430
|
* @since 2.0.0
|
|
13431
13431
|
*/
|
|
13432
|
-
const effectDiscard = (effect) => effectContext(as$1(effect, empty$
|
|
13432
|
+
const effectDiscard = (effect) => effectContext(as$1(effect, empty$16()));
|
|
13433
13433
|
const unwrapKey = /*#__PURE__*/ Service$1("effect/Layer/unwrap");
|
|
13434
13434
|
/**
|
|
13435
13435
|
* Unwraps a `Layer` from an `Effect`, flattening the nested structure.
|
|
@@ -14933,11 +14933,11 @@ const currentTimeNanos = currentTimeNanos$1;
|
|
|
14933
14933
|
const monotonicTimeNanos = monotonicTimeNanos$1;
|
|
14934
14934
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/dateTime.js
|
|
14935
14935
|
/** @internal */
|
|
14936
|
-
const TypeId$
|
|
14936
|
+
const TypeId$68 = "~effect/DateTime";
|
|
14937
14937
|
/** @internal */
|
|
14938
14938
|
const TimeZoneTypeId = "~effect/DateTime/TimeZone";
|
|
14939
|
-
const Proto$
|
|
14940
|
-
[TypeId$
|
|
14939
|
+
const Proto$21 = {
|
|
14940
|
+
[TypeId$68]: TypeId$68,
|
|
14941
14941
|
pipe() {
|
|
14942
14942
|
return pipeArguments(this, arguments);
|
|
14943
14943
|
},
|
|
@@ -14949,7 +14949,7 @@ const Proto$22 = {
|
|
|
14949
14949
|
}
|
|
14950
14950
|
};
|
|
14951
14951
|
const ProtoUtc = {
|
|
14952
|
-
...Proto$
|
|
14952
|
+
...Proto$21,
|
|
14953
14953
|
_tag: "Utc",
|
|
14954
14954
|
[symbol$3]() {
|
|
14955
14955
|
return number$2(this.epochMilliseconds);
|
|
@@ -14962,7 +14962,7 @@ const ProtoUtc = {
|
|
|
14962
14962
|
}
|
|
14963
14963
|
};
|
|
14964
14964
|
const ProtoZoned = {
|
|
14965
|
-
...Proto$
|
|
14965
|
+
...Proto$21,
|
|
14966
14966
|
_tag: "Zoned",
|
|
14967
14967
|
[symbol$3]() {
|
|
14968
14968
|
return combine$2(number$2(this.epochMilliseconds))(hash(this.zone));
|
|
@@ -15064,7 +15064,7 @@ const makeZonedProto = (epochMillis, zone, partsUtc) => {
|
|
|
15064
15064
|
return self;
|
|
15065
15065
|
};
|
|
15066
15066
|
/** @internal */
|
|
15067
|
-
const isDateTime$1 = (u) => hasProperty(u, TypeId$
|
|
15067
|
+
const isDateTime$1 = (u) => hasProperty(u, TypeId$68);
|
|
15068
15068
|
const isDateTimeArgs = (args) => isDateTime$1(args[0]);
|
|
15069
15069
|
/** @internal */
|
|
15070
15070
|
const isTimeZone = (u) => hasProperty(u, TimeZoneTypeId);
|
|
@@ -15072,8 +15072,6 @@ const isTimeZone = (u) => hasProperty(u, TimeZoneTypeId);
|
|
|
15072
15072
|
const isUtc$1 = (self) => self._tag === "Utc";
|
|
15073
15073
|
/** @internal */
|
|
15074
15074
|
const isZoned = (self) => self._tag === "Zoned";
|
|
15075
|
-
/** @internal */
|
|
15076
|
-
const Order$4 = /*#__PURE__*/ make$93((self, that) => self.epochMilliseconds < that.epochMilliseconds ? -1 : self.epochMilliseconds > that.epochMilliseconds ? 1 : 0);
|
|
15077
15075
|
const makeUtc = (epochMillis) => {
|
|
15078
15076
|
const self = Object.create(ProtoUtc);
|
|
15079
15077
|
self.epochMilliseconds = epochMillis;
|
|
@@ -15195,8 +15193,6 @@ const zoneFromString = (zone) => {
|
|
|
15195
15193
|
return zoneMakeNamed(zone);
|
|
15196
15194
|
};
|
|
15197
15195
|
/** @internal */
|
|
15198
|
-
const isGreaterThan$2 = /*#__PURE__*/ isGreaterThan$3(Order$4);
|
|
15199
|
-
/** @internal */
|
|
15200
15196
|
const toDateUtc$1 = (self) => new Date(self.epochMilliseconds);
|
|
15201
15197
|
/** @internal */
|
|
15202
15198
|
const toDate = (self) => {
|
|
@@ -15317,8 +15313,6 @@ const mapEpochMillis = /*#__PURE__*/ dual(2, (self, f) => {
|
|
|
15317
15313
|
return self._tag === "Utc" ? makeUtc(millis) : makeZonedProto(millis, self.zone);
|
|
15318
15314
|
});
|
|
15319
15315
|
/** @internal */
|
|
15320
|
-
const addDuration$1 = /*#__PURE__*/ dual(2, (self, duration) => mapEpochMillis(self, (millis) => millis + toMillis(fromInputUnsafe$1(duration))));
|
|
15321
|
-
/** @internal */
|
|
15322
15316
|
const add$1 = /*#__PURE__*/ dual(2, (self, parts) => {
|
|
15323
15317
|
const shifted = mutateUtc(self, (date) => {
|
|
15324
15318
|
if (parts.milliseconds) date.setTime(date.getTime() + parts.milliseconds);
|
|
@@ -15915,7 +15909,7 @@ const matchEffect$1 = /*#__PURE__*/ dual(2, (self, options) => matchCauseEffect$
|
|
|
15915
15909
|
}
|
|
15916
15910
|
}));
|
|
15917
15911
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Schedule.js
|
|
15918
|
-
const TypeId$
|
|
15912
|
+
const TypeId$67 = "~effect/Schedule";
|
|
15919
15913
|
/**
|
|
15920
15914
|
* Context reference containing metadata for the currently running schedule step.
|
|
15921
15915
|
*
|
|
@@ -15941,7 +15935,7 @@ const CurrentMetadata = /*#__PURE__*/ Reference("effect/Schedule/CurrentMetadata
|
|
|
15941
15935
|
elapsedSincePrevious: 0
|
|
15942
15936
|
}) });
|
|
15943
15937
|
const ScheduleProto = {
|
|
15944
|
-
[TypeId$
|
|
15938
|
+
[TypeId$67]: {
|
|
15945
15939
|
_Out: identity,
|
|
15946
15940
|
_In: identity,
|
|
15947
15941
|
_Env: identity
|
|
@@ -15971,7 +15965,7 @@ const ScheduleProto = {
|
|
|
15971
15965
|
* @category guards
|
|
15972
15966
|
* @since 2.0.0
|
|
15973
15967
|
*/
|
|
15974
|
-
const isSchedule = (u) => hasProperty(u, TypeId$
|
|
15968
|
+
const isSchedule = (u) => hasProperty(u, TypeId$67);
|
|
15975
15969
|
/**
|
|
15976
15970
|
* Creates a Schedule from a step function that returns a Pull.
|
|
15977
15971
|
*
|
|
@@ -16352,9 +16346,9 @@ const buildFromOptions = (options) => {
|
|
|
16352
16346
|
return schedule;
|
|
16353
16347
|
};
|
|
16354
16348
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/MutableHashMap.js
|
|
16355
|
-
const TypeId$
|
|
16349
|
+
const TypeId$66 = "~effect/MutableHashMap";
|
|
16356
16350
|
const MutableHashMapProto = {
|
|
16357
|
-
[TypeId$
|
|
16351
|
+
[TypeId$66]: TypeId$66,
|
|
16358
16352
|
[Symbol.iterator]() {
|
|
16359
16353
|
return this.backing[Symbol.iterator]();
|
|
16360
16354
|
},
|
|
@@ -16406,7 +16400,7 @@ const MutableHashMapProto = {
|
|
|
16406
16400
|
* @category constructors
|
|
16407
16401
|
* @since 2.0.0
|
|
16408
16402
|
*/
|
|
16409
|
-
const empty$
|
|
16403
|
+
const empty$11 = () => {
|
|
16410
16404
|
const self = Object.create(MutableHashMapProto);
|
|
16411
16405
|
self.backing = /* @__PURE__ */ new Map();
|
|
16412
16406
|
self.buckets = /* @__PURE__ */ new Map();
|
|
@@ -16478,7 +16472,7 @@ const make$86 = (...entries) => fromIterable$4(entries);
|
|
|
16478
16472
|
* @since 2.0.0
|
|
16479
16473
|
*/
|
|
16480
16474
|
const fromIterable$4 = (entries) => {
|
|
16481
|
-
const self = empty$
|
|
16475
|
+
const self = empty$11();
|
|
16482
16476
|
for (const [key, value] of entries) set$4(self, key, value);
|
|
16483
16477
|
return self;
|
|
16484
16478
|
};
|
|
@@ -16636,7 +16630,7 @@ const getRefKey = (bucket, key) => {
|
|
|
16636
16630
|
* @category mutations
|
|
16637
16631
|
* @since 2.0.0
|
|
16638
16632
|
*/
|
|
16639
|
-
const remove$
|
|
16633
|
+
const remove$3 = /*#__PURE__*/ dual(2, (self, key_) => {
|
|
16640
16634
|
if (isSimpleKey(key_)) {
|
|
16641
16635
|
self.backing.delete(key_);
|
|
16642
16636
|
return self;
|
|
@@ -16731,7 +16725,7 @@ const clear$2 = (self) => {
|
|
|
16731
16725
|
* @category getters
|
|
16732
16726
|
* @since 2.0.0
|
|
16733
16727
|
*/
|
|
16734
|
-
const size$
|
|
16728
|
+
const size$2 = (self) => self.backing.size;
|
|
16735
16729
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Effect.js
|
|
16736
16730
|
/**
|
|
16737
16731
|
* Checks whether a value is an `Effect`.
|
|
@@ -18539,7 +18533,7 @@ const catchDefect = catchDefect$1;
|
|
|
18539
18533
|
* @category error handling
|
|
18540
18534
|
* @since 2.0.0
|
|
18541
18535
|
*/
|
|
18542
|
-
const catchIf = catchIf$
|
|
18536
|
+
const catchIf$2 = catchIf$3;
|
|
18543
18537
|
/**
|
|
18544
18538
|
* Recovers from specific errors using a `Filter`.
|
|
18545
18539
|
*
|
|
@@ -19223,7 +19217,7 @@ const raceFirst = raceFirst$1;
|
|
|
19223
19217
|
* @category collecting
|
|
19224
19218
|
* @since 2.0.0
|
|
19225
19219
|
*/
|
|
19226
|
-
const filter$
|
|
19220
|
+
const filter$3 = filter$4;
|
|
19227
19221
|
/**
|
|
19228
19222
|
* Filters an effect, failing with a custom error if the predicate fails.
|
|
19229
19223
|
*
|
|
@@ -22085,7 +22079,7 @@ const Order$2 = /*#__PURE__*/ make$93((self, that) => {
|
|
|
22085
22079
|
return self.length < that.length ? -1 : self.length > that.length ? 1 : 0;
|
|
22086
22080
|
});
|
|
22087
22081
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/net/NetAddress.js
|
|
22088
|
-
const TypeId$
|
|
22082
|
+
const TypeId$65 = "~effect/net/NetAddress";
|
|
22089
22083
|
const ipv4Value = (self) => self.value;
|
|
22090
22084
|
const ipv6Words = (self) => self;
|
|
22091
22085
|
/**
|
|
@@ -22103,7 +22097,7 @@ const ipv6Words = (self) => self;
|
|
|
22103
22097
|
* @since 4.0.0
|
|
22104
22098
|
*/
|
|
22105
22099
|
var NetAddressError = class extends (/*#__PURE__*/ TaggedError$1("NetAddressError")) {};
|
|
22106
|
-
const isAddress = (u) => hasProperty(u, TypeId$
|
|
22100
|
+
const isAddress = (u) => hasProperty(u, TypeId$65);
|
|
22107
22101
|
/**
|
|
22108
22102
|
* Returns `true` when a value is an IPv4 address.
|
|
22109
22103
|
*
|
|
@@ -22163,7 +22157,7 @@ const isUnixPathAddress = (u) => isAddress(u) && u._tag === "UnixPathAddress";
|
|
|
22163
22157
|
const Ipv4Proto = {
|
|
22164
22158
|
...BaseProto,
|
|
22165
22159
|
_tag: "Ipv4Address",
|
|
22166
|
-
[TypeId$
|
|
22160
|
+
[TypeId$65]: TypeId$65,
|
|
22167
22161
|
[symbol$2](that) {
|
|
22168
22162
|
return isIpv4Address(that) && ipv4Value(this) === ipv4Value(that);
|
|
22169
22163
|
},
|
|
@@ -22180,7 +22174,7 @@ const Ipv4Proto = {
|
|
|
22180
22174
|
const Ipv6Proto = {
|
|
22181
22175
|
...BaseProto,
|
|
22182
22176
|
_tag: "Ipv6Address",
|
|
22183
|
-
[TypeId$
|
|
22177
|
+
[TypeId$65]: TypeId$65,
|
|
22184
22178
|
[symbol$2](that) {
|
|
22185
22179
|
if (!isIpv6Address(that)) return false;
|
|
22186
22180
|
const self = ipv6Words(this);
|
|
@@ -22448,7 +22442,7 @@ function toCanonical(self) {
|
|
|
22448
22442
|
const InetV4Proto = {
|
|
22449
22443
|
...BaseProto,
|
|
22450
22444
|
_tag: "InetAddressV4",
|
|
22451
|
-
[TypeId$
|
|
22445
|
+
[TypeId$65]: TypeId$65,
|
|
22452
22446
|
[symbol$2](that) {
|
|
22453
22447
|
return isInetAddressV4(that) && this.port === that.port && equals$1(this.address, that.address);
|
|
22454
22448
|
},
|
|
@@ -22465,7 +22459,7 @@ const InetV4Proto = {
|
|
|
22465
22459
|
const InetV6Proto = {
|
|
22466
22460
|
...BaseProto,
|
|
22467
22461
|
_tag: "InetAddressV6",
|
|
22468
|
-
[TypeId$
|
|
22462
|
+
[TypeId$65]: TypeId$65,
|
|
22469
22463
|
[symbol$2](that) {
|
|
22470
22464
|
return isInetAddressV6(that) && this.port === that.port && this.scopeId === that.scopeId && equals$1(this.address, that.address);
|
|
22471
22465
|
},
|
|
@@ -22679,7 +22673,7 @@ const formatUrlUnsafe = (self, scheme = "http") => getOrThrow(formatUrl(self, sc
|
|
|
22679
22673
|
const UnixPathProto = {
|
|
22680
22674
|
...BaseProto,
|
|
22681
22675
|
_tag: "UnixPathAddress",
|
|
22682
|
-
[TypeId$
|
|
22676
|
+
[TypeId$65]: TypeId$65,
|
|
22683
22677
|
[symbol$2](that) {
|
|
22684
22678
|
return isUnixPathAddress(that) && this.path === that.path;
|
|
22685
22679
|
},
|
|
@@ -23754,7 +23748,7 @@ const walk = /*#__PURE__*/ fnUntraced(function* (fs, compiled, options) {
|
|
|
23754
23748
|
const isUnlisted = (value) => value === "." || value === ".." || isRoot(value);
|
|
23755
23749
|
const probe = (parent, name, named) => {
|
|
23756
23750
|
const path = toFsPath(join$2(parent, name));
|
|
23757
|
-
return fs.stat(path).pipe(map$7((info) => info.type), catchReason$2("PlatformError", "NotFound", () => fs.readLink(path).pipe(as("SymbolicLink"), catchIf(isNotLink, () => succeed$5(void 0)))), catchIf(named ? isMissing : isIgnorable, () => succeed$5(void 0)), map$7((type) => type === void 0 ? void 0 : {
|
|
23751
|
+
return fs.stat(path).pipe(map$7((info) => info.type), catchReason$2("PlatformError", "NotFound", () => fs.readLink(path).pipe(as("SymbolicLink"), catchIf$2(isNotLink, () => succeed$5(void 0)))), catchIf$2(named ? isMissing : isIgnorable, () => succeed$5(void 0)), map$7((type) => type === void 0 ? void 0 : {
|
|
23758
23752
|
name,
|
|
23759
23753
|
type
|
|
23760
23754
|
}));
|
|
@@ -23768,7 +23762,7 @@ const walk = /*#__PURE__*/ fnUntraced(function* (fs, compiled, options) {
|
|
|
23768
23762
|
else if (node._tag !== "End") listed = true;
|
|
23769
23763
|
}
|
|
23770
23764
|
const probed = listed ? [...literals].filter(isUnlisted) : [...literals];
|
|
23771
|
-
return zipWith(listed ? catchIf(fs.readDirectoryEntries(toFsPath(relative)), named ? isMissing : isIgnorable, () => succeed$5([])) : succeed$5([]), forEach$1(probed, (name) => probe(relative, name, named), { concurrency: 16 }), (listing, found) => ({
|
|
23765
|
+
return zipWith(listed ? catchIf$2(fs.readDirectoryEntries(toFsPath(relative)), named ? isMissing : isIgnorable, () => succeed$5([])) : succeed$5([]), forEach$1(probed, (name) => probe(relative, name, named), { concurrency: 16 }), (listing, found) => ({
|
|
23772
23766
|
entries: sort([...listing, ...found.filter(isNotUndefined)], byName),
|
|
23773
23767
|
named: named && !listed
|
|
23774
23768
|
}));
|
|
@@ -23793,10 +23787,10 @@ const walk = /*#__PURE__*/ fnUntraced(function* (fs, compiled, options) {
|
|
|
23793
23787
|
if (!descend && !needsDirectory(compiled, next) && !excludeNeedsDirectory) return child(false, false);
|
|
23794
23788
|
if (type !== "Unknown" && type !== "SymbolicLink") return child(type === "Directory", false);
|
|
23795
23789
|
const path = toFsPath(relative);
|
|
23796
|
-
return fs.stat(path).pipe(map$7((info) => info.type === "Directory"), catchIf(isIgnorable, () => succeed$5(false)), flatMap$3((isDirectory) => {
|
|
23790
|
+
return fs.stat(path).pipe(map$7((info) => info.type === "Directory"), catchIf$2(isIgnorable, () => succeed$5(false)), flatMap$3((isDirectory) => {
|
|
23797
23791
|
const resolved = child(isDirectory, type === "SymbolicLink");
|
|
23798
23792
|
if (type === "SymbolicLink" || resolved?.next === void 0 || result.globstar.size === 0) return succeed$5(resolved);
|
|
23799
|
-
return fs.readLink(path).pipe(as(child(isDirectory, true)), catchIf(isNotLink, () => succeed$5(resolved)));
|
|
23793
|
+
return fs.readLink(path).pipe(as(child(isDirectory, true)), catchIf$2(isNotLink, () => succeed$5(resolved)));
|
|
23800
23794
|
}));
|
|
23801
23795
|
};
|
|
23802
23796
|
let slots = DIRECTORY_CONCURRENCY;
|
|
@@ -23858,7 +23852,7 @@ const walk = /*#__PURE__*/ fnUntraced(function* (fs, compiled, options) {
|
|
|
23858
23852
|
* @stability unstable
|
|
23859
23853
|
* @since 4.0.0
|
|
23860
23854
|
*/
|
|
23861
|
-
const TypeId$
|
|
23855
|
+
const TypeId$63 = "~effect/PlatformError";
|
|
23862
23856
|
/**
|
|
23863
23857
|
* Error data for an invalid argument passed to a platform API.
|
|
23864
23858
|
*
|
|
@@ -23971,7 +23965,7 @@ var PlatformError = class extends (/*#__PURE__*/ TaggedError$1("PlatformError"))
|
|
|
23971
23965
|
*
|
|
23972
23966
|
* @since 4.0.0
|
|
23973
23967
|
*/
|
|
23974
|
-
[TypeId$
|
|
23968
|
+
[TypeId$63] = TypeId$63;
|
|
23975
23969
|
get message() {
|
|
23976
23970
|
return this.reason.message;
|
|
23977
23971
|
}
|
|
@@ -24003,7 +23997,7 @@ const systemError = (options) => new PlatformError(new SystemError(options));
|
|
|
24003
23997
|
*/
|
|
24004
23998
|
const badArgument = (options) => new PlatformError(new BadArgument(options));
|
|
24005
23999
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Chunk.js
|
|
24006
|
-
const TypeId$
|
|
24000
|
+
const TypeId$62 = "~effect/Chunk";
|
|
24007
24001
|
function copy$2(src, srcPos, dest, destPos, len) {
|
|
24008
24002
|
for (let i = srcPos; i < Math.min(src.length, srcPos + len); i++) dest[destPos + i - srcPos] = src[i];
|
|
24009
24003
|
return dest;
|
|
@@ -24040,7 +24034,7 @@ const makeEquivalence$1 = (isEquivalent) => make$94((self, that) => {
|
|
|
24040
24034
|
});
|
|
24041
24035
|
const _equivalence = /*#__PURE__*/ makeEquivalence$1(equals$1);
|
|
24042
24036
|
const ChunkProto = {
|
|
24043
|
-
[TypeId$
|
|
24037
|
+
[TypeId$62]: { _A: (_) => _ },
|
|
24044
24038
|
toString() {
|
|
24045
24039
|
return `Chunk(${format$4(toReadonlyArray(this))})`;
|
|
24046
24040
|
},
|
|
@@ -24126,7 +24120,7 @@ const makeChunk = (backing) => {
|
|
|
24126
24120
|
* @category guards
|
|
24127
24121
|
* @since 2.0.0
|
|
24128
24122
|
*/
|
|
24129
|
-
const isChunk = (u) => hasProperty(u, TypeId$
|
|
24123
|
+
const isChunk = (u) => hasProperty(u, TypeId$62);
|
|
24130
24124
|
const _empty = /*#__PURE__*/ makeChunk({ _tag: "IEmpty" });
|
|
24131
24125
|
const copyToArray = (self, array, initial) => {
|
|
24132
24126
|
switch (self.backing._tag) {
|
|
@@ -24260,9 +24254,9 @@ const makeUnsafe$5 = makeLatchUnsafe;
|
|
|
24260
24254
|
*/
|
|
24261
24255
|
const make$83 = makeLatch;
|
|
24262
24256
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/MutableRef.js
|
|
24263
|
-
const TypeId$
|
|
24257
|
+
const TypeId$61 = "~effect/MutableRef";
|
|
24264
24258
|
const MutableRefProto = {
|
|
24265
|
-
[TypeId$
|
|
24259
|
+
[TypeId$61]: TypeId$61,
|
|
24266
24260
|
...PipeInspectableProto,
|
|
24267
24261
|
toJSON() {
|
|
24268
24262
|
return {
|
|
@@ -24724,7 +24718,7 @@ const takeNVoid = (self, n) => {
|
|
|
24724
24718
|
* @category mutations
|
|
24725
24719
|
* @since 4.0.0
|
|
24726
24720
|
*/
|
|
24727
|
-
const takeAll$
|
|
24721
|
+
const takeAll$1 = (self) => takeN(self, self.length);
|
|
24728
24722
|
/**
|
|
24729
24723
|
* Takes a single element from the beginning of the MutableList.
|
|
24730
24724
|
* Returns the element if available, or the Empty symbol if the list is empty.
|
|
@@ -24781,7 +24775,7 @@ const take$2 = (self) => {
|
|
|
24781
24775
|
* @category mutations
|
|
24782
24776
|
* @since 4.0.0
|
|
24783
24777
|
*/
|
|
24784
|
-
const filter$
|
|
24778
|
+
const filter$2 = (self, f) => {
|
|
24785
24779
|
const array = [];
|
|
24786
24780
|
let chunk = self.head;
|
|
24787
24781
|
let index = 0;
|
|
@@ -24836,22 +24830,9 @@ const filter$4 = (self, f) => {
|
|
|
24836
24830
|
* @category mutations
|
|
24837
24831
|
* @since 4.0.0
|
|
24838
24832
|
*/
|
|
24839
|
-
const remove$
|
|
24833
|
+
const remove$2 = (self, value) => filter$2(self, (v) => v !== value);
|
|
24840
24834
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/PubSub.js
|
|
24841
|
-
|
|
24842
|
-
* Broadcasts values from publishers to many subscribers.
|
|
24843
|
-
*
|
|
24844
|
-
* Publishers add messages with `publish` or `publishAll`, and each active
|
|
24845
|
-
* `Subscription` receives its own copy of every accepted message. Unlike a
|
|
24846
|
-
* queue, subscribers do not compete for messages. This module includes bounded,
|
|
24847
|
-
* dropping, sliding, and unbounded hubs, optional replay buffers for late
|
|
24848
|
-
* subscribers, message-taking helpers, capacity and shutdown operations, a
|
|
24849
|
-
* type guard, and low-level types for custom hub strategies.
|
|
24850
|
-
*
|
|
24851
|
-
* @stability stable
|
|
24852
|
-
* @since 2.0.0
|
|
24853
|
-
*/
|
|
24854
|
-
const TypeId$61 = "~effect/PubSub";
|
|
24835
|
+
const TypeId$60 = "~effect/PubSub";
|
|
24855
24836
|
const SubscriptionTypeId = "~effect/PubSub/Subscription";
|
|
24856
24837
|
/**
|
|
24857
24838
|
* Creates a PubSub with a custom atomic implementation and strategy.
|
|
@@ -24994,49 +24975,6 @@ const publish = /*#__PURE__*/ dual(2, (self, value) => suspend$3(() => {
|
|
|
24994
24975
|
return self.strategy.handleSurplus(self.pubsub, self.subscribers, [value], self.shutdownFlag, self.ended);
|
|
24995
24976
|
}));
|
|
24996
24977
|
/**
|
|
24997
|
-
* Attempts to publish a message synchronously without applying the PubSub
|
|
24998
|
-
* strategy's effectful surplus handling.
|
|
24999
|
-
*
|
|
25000
|
-
* **When to use**
|
|
25001
|
-
*
|
|
25002
|
-
* Use when you need a non-blocking synchronous publish attempt where `false`
|
|
25003
|
-
* is an acceptable result when the message cannot be accepted immediately.
|
|
25004
|
-
*
|
|
25005
|
-
* **Details**
|
|
25006
|
-
*
|
|
25007
|
-
* Returns `false` if the `PubSub` is shut down or the message cannot be
|
|
25008
|
-
* accepted immediately, for example when a bounded PubSub is full. Prefer
|
|
25009
|
-
* `publish` when backpressure or sliding behavior should be honored.
|
|
25010
|
-
*
|
|
25011
|
-
* **Example** (Publishing without suspending)
|
|
25012
|
-
*
|
|
25013
|
-
* ```ts import.meta.vitest
|
|
25014
|
-
* import { Effect, PubSub } from "effect"
|
|
25015
|
-
*
|
|
25016
|
-
* const program = Effect.gen(function*() {
|
|
25017
|
-
* const pubsub = yield* PubSub.bounded<string>(2)
|
|
25018
|
-
* return PubSub.publishUnsafe(pubsub, "Hello")
|
|
25019
|
-
* })
|
|
25020
|
-
*
|
|
25021
|
-
* const actual = await Effect.runPromise(program)
|
|
25022
|
-
* actual // => true
|
|
25023
|
-
* ```
|
|
25024
|
-
*
|
|
25025
|
-
* @see {@link publish} for effectful publishing that honors the configured surplus strategy
|
|
25026
|
-
*
|
|
25027
|
-
* @stability stable
|
|
25028
|
-
* @category publishing
|
|
25029
|
-
* @since 4.0.0
|
|
25030
|
-
*/
|
|
25031
|
-
const publishUnsafe = /*#__PURE__*/ dual(2, (self, value) => {
|
|
25032
|
-
if (self.shutdownFlag.current || isSome(self.ended.current)) return false;
|
|
25033
|
-
if (self.pubsub.publish(value)) {
|
|
25034
|
-
self.strategy.completeSubscribersUnsafe(self.pubsub, self.subscribers);
|
|
25035
|
-
return true;
|
|
25036
|
-
}
|
|
25037
|
-
return false;
|
|
25038
|
-
});
|
|
25039
|
-
/**
|
|
25040
24978
|
* Subscribes to receive messages from the `PubSub`. The resulting subscription can
|
|
25041
24979
|
* be evaluated multiple times within the scope to take a message from the `PubSub`
|
|
25042
24980
|
* each time.
|
|
@@ -25096,7 +25034,7 @@ const subscribe = (self) => uninterruptible(contextWith((services) => {
|
|
|
25096
25034
|
}));
|
|
25097
25035
|
const unsubscribe = (self) => uninterruptible(withFiber((state) => {
|
|
25098
25036
|
set$3(self.shutdownFlag, true);
|
|
25099
|
-
return forEach$1(takeAll$
|
|
25037
|
+
return forEach$1(takeAll$1(self.pollers), (d) => interruptWith(d, state.id), {
|
|
25100
25038
|
discard: true,
|
|
25101
25039
|
concurrency: "unbounded"
|
|
25102
25040
|
}).pipe(tap$2(() => sync(() => {
|
|
@@ -25151,44 +25089,6 @@ const take$1 = (self) => suspend$3(() => {
|
|
|
25151
25089
|
return succeed$5(message);
|
|
25152
25090
|
}
|
|
25153
25091
|
});
|
|
25154
|
-
/**
|
|
25155
|
-
* Takes all available messages from the subscription, suspending if no items
|
|
25156
|
-
* are available.
|
|
25157
|
-
*
|
|
25158
|
-
* **Example** (Taking all available messages)
|
|
25159
|
-
*
|
|
25160
|
-
* ```ts import.meta.vitest
|
|
25161
|
-
* import { Effect, PubSub } from "effect"
|
|
25162
|
-
*
|
|
25163
|
-
* const program = Effect.scoped(Effect.gen(function*() {
|
|
25164
|
-
* const pubsub = yield* PubSub.bounded<string>(10)
|
|
25165
|
-
*
|
|
25166
|
-
* const subscription = yield* PubSub.subscribe(pubsub)
|
|
25167
|
-
*
|
|
25168
|
-
* // Publish multiple messages
|
|
25169
|
-
* yield* PubSub.publishAll(pubsub, ["msg1", "msg2", "msg3"])
|
|
25170
|
-
*
|
|
25171
|
-
* // Take all available messages at once
|
|
25172
|
-
* return yield* PubSub.takeAll(subscription)
|
|
25173
|
-
* }))
|
|
25174
|
-
*
|
|
25175
|
-
* const actual = await Effect.runPromise(program)
|
|
25176
|
-
* actual // => ["msg1", "msg2", "msg3"]
|
|
25177
|
-
* ```
|
|
25178
|
-
*
|
|
25179
|
-
* @stability stable
|
|
25180
|
-
* @category subscriptions
|
|
25181
|
-
* @since 4.0.0
|
|
25182
|
-
*/
|
|
25183
|
-
const takeAll$1 = (self) => suspend$3(function loop(value) {
|
|
25184
|
-
if (self.shutdownFlag.current) return interrupt$1;
|
|
25185
|
-
let as = self.pollers.length === 0 ? self.subscription.pollUpTo(Number.POSITIVE_INFINITY) : [];
|
|
25186
|
-
if (value) as = value.concat(as);
|
|
25187
|
-
self.strategy.onPubSubEmptySpaceUnsafe(self.pubsub, self.subscribers);
|
|
25188
|
-
if (self.replayWindow.remaining > 0) return succeed$5(self.replayWindow.takeAll().concat(as));
|
|
25189
|
-
else if (!isArrayNonEmpty(as)) return flatMap$3(pollForItem(self), (item) => loop([item]));
|
|
25190
|
-
return succeed$5(as);
|
|
25191
|
-
});
|
|
25192
25092
|
const pollForItem = (self) => callback$1((resume) => {
|
|
25193
25093
|
if (self.shutdownFlag.current) return resume(interrupt$1);
|
|
25194
25094
|
if (isSome(self.ended.current)) {
|
|
@@ -25210,7 +25110,7 @@ const pollForItem = (self) => callback$1((resume) => {
|
|
|
25210
25110
|
self.strategy.completePollersUnsafe(self.pubsub, self.subscribers, self.subscription, self.pollers);
|
|
25211
25111
|
if (deferred.effect) return resume(deferred.effect);
|
|
25212
25112
|
deferred.resumes = [resume];
|
|
25213
|
-
return sync(() => remove$
|
|
25113
|
+
return sync(() => remove$2(self.pollers, deferred));
|
|
25214
25114
|
});
|
|
25215
25115
|
const AbsentValue = /*#__PURE__*/ Symbol.for("effect/PubSub/AbsentValue");
|
|
25216
25116
|
const addSubscribers = (subscribers, subscription, pollers) => {
|
|
@@ -25397,7 +25297,7 @@ var SubscriptionImpl = class {
|
|
|
25397
25297
|
}
|
|
25398
25298
|
};
|
|
25399
25299
|
var PubSubImpl = class {
|
|
25400
|
-
[TypeId$
|
|
25300
|
+
[TypeId$60] = { _A: identity };
|
|
25401
25301
|
pubsub;
|
|
25402
25302
|
subscribers;
|
|
25403
25303
|
scope;
|
|
@@ -25626,7 +25526,7 @@ const emptyReplayWindow = {
|
|
|
25626
25526
|
* @stability stable
|
|
25627
25527
|
* @since 3.8.0
|
|
25628
25528
|
*/
|
|
25629
|
-
const TypeId$
|
|
25529
|
+
const TypeId$59 = "~effect/Queue";
|
|
25630
25530
|
const EnqueueTypeId = "~effect/Queue/Enqueue";
|
|
25631
25531
|
const DequeueTypeId = "~effect/Queue/Dequeue";
|
|
25632
25532
|
const variance$1 = {
|
|
@@ -25634,7 +25534,7 @@ const variance$1 = {
|
|
|
25634
25534
|
_E: identity
|
|
25635
25535
|
};
|
|
25636
25536
|
const QueueProto = {
|
|
25637
|
-
[TypeId$
|
|
25537
|
+
[TypeId$59]: variance$1,
|
|
25638
25538
|
[EnqueueTypeId]: variance$1,
|
|
25639
25539
|
[DequeueTypeId]: variance$1,
|
|
25640
25540
|
...PipeInspectableProto,
|
|
@@ -26326,7 +26226,7 @@ const takeAll = (self) => takeBetween(self, 1, Number.POSITIVE_INFINITY);
|
|
|
26326
26226
|
* @since 4.0.0
|
|
26327
26227
|
*/
|
|
26328
26228
|
const collect = (self) => suspend$4(() => {
|
|
26329
|
-
const out = empty$
|
|
26229
|
+
const out = empty$13();
|
|
26330
26230
|
return as$1(catchDone(whileLoop$1({
|
|
26331
26231
|
while: constTrue,
|
|
26332
26232
|
body: constant(takeAll(self)),
|
|
@@ -26864,6 +26764,28 @@ var SemaphoreImpl = class {
|
|
|
26864
26764
|
* @since 4.0.0
|
|
26865
26765
|
*/
|
|
26866
26766
|
const make$78 = (permits) => sync$2(() => new SemaphoreImpl(permits));
|
|
26767
|
+
/**
|
|
26768
|
+
* Runs an effect with a single permit and releases the permit when the effect
|
|
26769
|
+
* completes.
|
|
26770
|
+
*
|
|
26771
|
+
* **When to use**
|
|
26772
|
+
*
|
|
26773
|
+
* Use to guard an effect with exactly one semaphore permit while automatically
|
|
26774
|
+
* releasing that permit when the effect exits.
|
|
26775
|
+
*
|
|
26776
|
+
* @see {@link withPermits} for acquiring more than one permit
|
|
26777
|
+
* @see {@link withPermitsIfAvailable} for running only when permits are immediately available
|
|
26778
|
+
* @see {@link take} for manually acquiring permits
|
|
26779
|
+
* @see {@link release} for manually returning permits
|
|
26780
|
+
*
|
|
26781
|
+
* @stability stable
|
|
26782
|
+
* @category combinators
|
|
26783
|
+
* @since 4.0.0
|
|
26784
|
+
*/
|
|
26785
|
+
const withPermit = (self, effect) => {
|
|
26786
|
+
if (!effect) return self.withPermit;
|
|
26787
|
+
return self.withPermit(effect);
|
|
26788
|
+
};
|
|
26867
26789
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Channel.js
|
|
26868
26790
|
/**
|
|
26869
26791
|
* Provides low-level building blocks for streaming data through Effect.
|
|
@@ -26885,7 +26807,7 @@ const make$78 = (permits) => sync$2(() => new SemaphoreImpl(permits));
|
|
|
26885
26807
|
* @category type IDs
|
|
26886
26808
|
* @since 4.0.0
|
|
26887
26809
|
*/
|
|
26888
|
-
const TypeId$
|
|
26810
|
+
const TypeId$58 = "~effect/Channel";
|
|
26889
26811
|
/**
|
|
26890
26812
|
* Checks whether a value is a `Channel`.
|
|
26891
26813
|
*
|
|
@@ -26903,9 +26825,9 @@ const TypeId$59 = "~effect/Channel";
|
|
|
26903
26825
|
* @category guards
|
|
26904
26826
|
* @since 3.5.4
|
|
26905
26827
|
*/
|
|
26906
|
-
const isChannel = (u) => hasProperty(u, TypeId$
|
|
26828
|
+
const isChannel = (u) => hasProperty(u, TypeId$58);
|
|
26907
26829
|
const ChannelProto = {
|
|
26908
|
-
[TypeId$
|
|
26830
|
+
[TypeId$58]: {
|
|
26909
26831
|
_Env: identity,
|
|
26910
26832
|
_InErr: identity,
|
|
26911
26833
|
_InElem: identity,
|
|
@@ -27251,7 +27173,7 @@ const succeed$4 = (value) => fromEffect$1(succeed$5(value));
|
|
|
27251
27173
|
* @category constructors
|
|
27252
27174
|
* @since 4.0.0
|
|
27253
27175
|
*/
|
|
27254
|
-
const empty$
|
|
27176
|
+
const empty$10 = /*#__PURE__*/ fromPull$1(/*#__PURE__*/ succeed$5(/*#__PURE__*/ done()));
|
|
27255
27177
|
/**
|
|
27256
27178
|
* Constructs a channel that fails immediately with the specified error.
|
|
27257
27179
|
*
|
|
@@ -27368,258 +27290,6 @@ const fromEffectDrain = (effect) => fromPull$1(flatMap$3(effect, () => done()));
|
|
|
27368
27290
|
*/
|
|
27369
27291
|
const fromQueueArray = (queue) => fromPull$1(succeed$5(takeAll(queue)));
|
|
27370
27292
|
/**
|
|
27371
|
-
* Creates a channel from a PubSub subscription that outputs arrays of values.
|
|
27372
|
-
*
|
|
27373
|
-
* **Details**
|
|
27374
|
-
*
|
|
27375
|
-
* This constructor creates a channel that reads from a PubSub subscription and outputs
|
|
27376
|
-
* arrays of values in chunks. It's useful when you want to process multiple values at once
|
|
27377
|
-
* for better performance.
|
|
27378
|
-
*
|
|
27379
|
-
* **Example** (Batching subscription values)
|
|
27380
|
-
*
|
|
27381
|
-
* ```ts import.meta.vitest
|
|
27382
|
-
* import { Channel, Data, Effect, Option, PubSub } from "effect"
|
|
27383
|
-
*
|
|
27384
|
-
* class StreamError extends Data.TaggedError("StreamError")<{
|
|
27385
|
-
* readonly message: string
|
|
27386
|
-
* }> {}
|
|
27387
|
-
*
|
|
27388
|
-
* const program = Effect.gen(function*() {
|
|
27389
|
-
* const pubsub = yield* PubSub.bounded<number>(16)
|
|
27390
|
-
* const subscription = yield* PubSub.subscribe(pubsub)
|
|
27391
|
-
*
|
|
27392
|
-
* // Create a channel that reads arrays of values
|
|
27393
|
-
* const channel = Channel.fromSubscriptionArray(subscription)
|
|
27394
|
-
*
|
|
27395
|
-
* // Publish some values
|
|
27396
|
-
* yield* PubSub.publish(pubsub, 1)
|
|
27397
|
-
* yield* PubSub.publish(pubsub, 2)
|
|
27398
|
-
* yield* PubSub.publish(pubsub, 3)
|
|
27399
|
-
* yield* PubSub.publish(pubsub, 4)
|
|
27400
|
-
*
|
|
27401
|
-
* // The channel will output arrays like [1, 2, 3] and [4]
|
|
27402
|
-
* return channel
|
|
27403
|
-
* })
|
|
27404
|
-
* const result = Effect.scoped(Effect.flatMap(program, Channel.runHead))
|
|
27405
|
-
* await Effect.runPromise(result) // => Option.some([1, 2, 3, 4])
|
|
27406
|
-
* ```
|
|
27407
|
-
*
|
|
27408
|
-
* **Example** (Processing subscription values in batches)
|
|
27409
|
-
*
|
|
27410
|
-
* ```ts import.meta.vitest
|
|
27411
|
-
* import { Channel, Data, Effect, Option, PubSub } from "effect"
|
|
27412
|
-
*
|
|
27413
|
-
* class BatchProcessingError extends Data.TaggedError("BatchProcessingError")<{
|
|
27414
|
-
* readonly reason: string
|
|
27415
|
-
* }> {}
|
|
27416
|
-
*
|
|
27417
|
-
* const batchProcessor = Effect.gen(function*() {
|
|
27418
|
-
* const pubsub = yield* PubSub.bounded<string>(32)
|
|
27419
|
-
* const subscription = yield* PubSub.subscribe(pubsub)
|
|
27420
|
-
*
|
|
27421
|
-
* // Create a channel that processes items in batches
|
|
27422
|
-
* const batchChannel = Channel.fromSubscriptionArray(subscription)
|
|
27423
|
-
*
|
|
27424
|
-
* // Transform to process each batch
|
|
27425
|
-
* const processedChannel = Channel.map(batchChannel, (batch) =>
|
|
27426
|
-
* batch.map((item) => item.toUpperCase())
|
|
27427
|
-
* )
|
|
27428
|
-
*
|
|
27429
|
-
* yield* PubSub.publishAll(pubsub, ["one", "two"])
|
|
27430
|
-
* return processedChannel
|
|
27431
|
-
* })
|
|
27432
|
-
* const batch = Effect.scoped(Effect.flatMap(batchProcessor, Channel.runHead))
|
|
27433
|
-
* await Effect.runPromise(batch) // => Option.some(["ONE", "TWO"])
|
|
27434
|
-
* ```
|
|
27435
|
-
*
|
|
27436
|
-
* **Example** (Aggregating subscription metrics)
|
|
27437
|
-
*
|
|
27438
|
-
* ```ts import.meta.vitest
|
|
27439
|
-
* import { Channel, Effect, Option, PubSub } from "effect"
|
|
27440
|
-
*
|
|
27441
|
-
* const metricsAggregator = Effect.gen(function*() {
|
|
27442
|
-
* const metricsPubSub = yield* PubSub.bounded<
|
|
27443
|
-
* { timestamp: number; value: number }
|
|
27444
|
-
* >(100)
|
|
27445
|
-
* const subscription = yield* PubSub.subscribe(metricsPubSub)
|
|
27446
|
-
*
|
|
27447
|
-
* // Create a channel that collects metrics in chunks
|
|
27448
|
-
* const metricsChannel = Channel.fromSubscriptionArray(subscription)
|
|
27449
|
-
*
|
|
27450
|
-
* // Transform to calculate aggregate statistics
|
|
27451
|
-
* const aggregatedChannel = Channel.map(metricsChannel, (metrics) => {
|
|
27452
|
-
* const values = metrics.map((m) => m.value)
|
|
27453
|
-
* const sum = values.reduce((a, b) => a + b, 0)
|
|
27454
|
-
* const avg = sum / values.length
|
|
27455
|
-
* const min = Math.min(...values)
|
|
27456
|
-
* const max = Math.max(...values)
|
|
27457
|
-
*
|
|
27458
|
-
* return {
|
|
27459
|
-
* count: values.length,
|
|
27460
|
-
* sum,
|
|
27461
|
-
* average: avg,
|
|
27462
|
-
* min,
|
|
27463
|
-
* max,
|
|
27464
|
-
* firstTimestamp: Math.min(...metrics.map((m) => m.timestamp)),
|
|
27465
|
-
* lastTimestamp: Math.max(...metrics.map((m) => m.timestamp))
|
|
27466
|
-
* }
|
|
27467
|
-
* })
|
|
27468
|
-
*
|
|
27469
|
-
* yield* PubSub.publish(metricsPubSub, { timestamp: 1, value: 10 })
|
|
27470
|
-
* return aggregatedChannel
|
|
27471
|
-
* })
|
|
27472
|
-
* const metric = Effect.scoped(Effect.flatMap(metricsAggregator, Channel.runHead))
|
|
27473
|
-
* const result = await Effect.runPromise(metric)
|
|
27474
|
-
* Option.map(result, ({ count, sum, average, min, max }) => ({ count, sum, average, min, max })) // => Option.some({ count: 1, sum: 10, average: 10, min: 10, max: 10 })
|
|
27475
|
-
* ```
|
|
27476
|
-
*
|
|
27477
|
-
* @stability stable
|
|
27478
|
-
* @category constructors
|
|
27479
|
-
* @since 4.0.0
|
|
27480
|
-
*/
|
|
27481
|
-
const fromSubscriptionArray = (subscription) => fromPull$1(succeed$5(onInterrupt(takeAll$1(subscription), () => done())));
|
|
27482
|
-
/**
|
|
27483
|
-
* Creates a channel from a PubSub that outputs arrays of values.
|
|
27484
|
-
*
|
|
27485
|
-
* **Details**
|
|
27486
|
-
*
|
|
27487
|
-
* This constructor creates a channel that reads from a PubSub by automatically
|
|
27488
|
-
* subscribing to it and collecting values into arrays. The channel outputs
|
|
27489
|
-
* arrays of values in chunks, making it ideal for batch processing scenarios.
|
|
27490
|
-
*
|
|
27491
|
-
* **Example** (Batching PubSub values)
|
|
27492
|
-
*
|
|
27493
|
-
* ```ts import.meta.vitest
|
|
27494
|
-
* import { Channel, Data, Effect, Option, PubSub } from "effect"
|
|
27495
|
-
*
|
|
27496
|
-
* class BatchError extends Data.TaggedError("BatchError")<{
|
|
27497
|
-
* readonly message: string
|
|
27498
|
-
* }> {}
|
|
27499
|
-
*
|
|
27500
|
-
* const program = Effect.gen(function*() {
|
|
27501
|
-
* const pubsub = yield* PubSub.unbounded<number>({ replay: 4 })
|
|
27502
|
-
*
|
|
27503
|
-
* // Create a channel that reads arrays of values
|
|
27504
|
-
* const channel = Channel.fromPubSubArray(pubsub)
|
|
27505
|
-
*
|
|
27506
|
-
* // Publish some values
|
|
27507
|
-
* yield* PubSub.publish(pubsub, 1)
|
|
27508
|
-
* yield* PubSub.publish(pubsub, 2)
|
|
27509
|
-
* yield* PubSub.publish(pubsub, 3)
|
|
27510
|
-
* yield* PubSub.publish(pubsub, 4)
|
|
27511
|
-
*
|
|
27512
|
-
* // The channel will output arrays like [1, 2, 3] and [4]
|
|
27513
|
-
* return channel
|
|
27514
|
-
* })
|
|
27515
|
-
* const result = Effect.scoped(Effect.flatMap(program, Channel.runHead))
|
|
27516
|
-
* await Effect.runPromise(result) // => Option.some([1, 2, 3, 4])
|
|
27517
|
-
* ```
|
|
27518
|
-
*
|
|
27519
|
-
* **Example** (Processing PubSub orders in batches)
|
|
27520
|
-
*
|
|
27521
|
-
* ```ts import.meta.vitest
|
|
27522
|
-
* import { Channel, Effect, Option, PubSub } from "effect"
|
|
27523
|
-
*
|
|
27524
|
-
* interface Order {
|
|
27525
|
-
* readonly id: string
|
|
27526
|
-
* readonly customerId: string
|
|
27527
|
-
* readonly items: ReadonlyArray<string>
|
|
27528
|
-
* readonly total: number
|
|
27529
|
-
* readonly submittedAt: number
|
|
27530
|
-
* }
|
|
27531
|
-
*
|
|
27532
|
-
* const orderBatchProcessor = Effect.gen(function*() {
|
|
27533
|
-
* const orderPubSub = yield* PubSub.unbounded<Order>({ replay: 1 })
|
|
27534
|
-
*
|
|
27535
|
-
* // Create a channel that processes orders in batches
|
|
27536
|
-
* const orderChannel = Channel.fromPubSubArray(orderPubSub)
|
|
27537
|
-
*
|
|
27538
|
-
* // Transform to process each batch of orders
|
|
27539
|
-
* const processedChannel = Channel.map(orderChannel, (orderBatch) => {
|
|
27540
|
-
* const totalRevenue = orderBatch.reduce((sum, order) => sum + order.total, 0)
|
|
27541
|
-
* const customerCount = new Set(orderBatch.map((order) =>
|
|
27542
|
-
* order.customerId
|
|
27543
|
-
* )).size
|
|
27544
|
-
*
|
|
27545
|
-
* return {
|
|
27546
|
-
* batchSize: orderBatch.length,
|
|
27547
|
-
* totalRevenue,
|
|
27548
|
-
* uniqueCustomers: customerCount,
|
|
27549
|
-
* firstSubmittedAt: Math.min(...orderBatch.map((order) => order.submittedAt)),
|
|
27550
|
-
* orders: orderBatch
|
|
27551
|
-
* }
|
|
27552
|
-
* })
|
|
27553
|
-
*
|
|
27554
|
-
* yield* PubSub.publish(orderPubSub, {
|
|
27555
|
-
* id: "1", customerId: "a", items: ["book"], total: 10, submittedAt: 1
|
|
27556
|
-
* })
|
|
27557
|
-
* return processedChannel
|
|
27558
|
-
* })
|
|
27559
|
-
* const order = Effect.scoped(Effect.flatMap(orderBatchProcessor, Channel.runHead))
|
|
27560
|
-
* const result = await Effect.runPromise(order)
|
|
27561
|
-
* Option.map(result, (batch) => [batch.batchSize, batch.totalRevenue, batch.uniqueCustomers]) // => Option.some([1, 10, 1])
|
|
27562
|
-
* ```
|
|
27563
|
-
*
|
|
27564
|
-
* **Example** (Processing PubSub logs in batches)
|
|
27565
|
-
*
|
|
27566
|
-
* ```ts import.meta.vitest
|
|
27567
|
-
* import { Channel, Effect, Option, PubSub } from "effect"
|
|
27568
|
-
*
|
|
27569
|
-
* interface LogEntry {
|
|
27570
|
-
* readonly timestamp: number
|
|
27571
|
-
* readonly level: "info" | "warn" | "error"
|
|
27572
|
-
* readonly message: string
|
|
27573
|
-
* readonly source: string
|
|
27574
|
-
* }
|
|
27575
|
-
*
|
|
27576
|
-
* const logAggregator = Effect.gen(function*() {
|
|
27577
|
-
* const logPubSub = yield* PubSub.unbounded<LogEntry>({ replay: 1 })
|
|
27578
|
-
*
|
|
27579
|
-
* // Create a channel that collects logs in batches
|
|
27580
|
-
* const logChannel = Channel.fromPubSubArray(logPubSub)
|
|
27581
|
-
*
|
|
27582
|
-
* // Transform to analyze log batches
|
|
27583
|
-
* const analysisChannel = Channel.map(logChannel, (logBatch) => {
|
|
27584
|
-
* const errorCount = logBatch.filter((log) => log.level === "error").length
|
|
27585
|
-
* const warnCount = logBatch.filter((log) => log.level === "warn").length
|
|
27586
|
-
* const infoCount = logBatch.filter((log) => log.level === "info").length
|
|
27587
|
-
*
|
|
27588
|
-
* const timeRange = {
|
|
27589
|
-
* start: Math.min(...logBatch.map((log) => log.timestamp)),
|
|
27590
|
-
* end: Math.max(...logBatch.map((log) => log.timestamp))
|
|
27591
|
-
* }
|
|
27592
|
-
*
|
|
27593
|
-
* return {
|
|
27594
|
-
* batchId: `${timeRange.start}-${timeRange.end}`,
|
|
27595
|
-
* totalEntries: logBatch.length,
|
|
27596
|
-
* errorCount,
|
|
27597
|
-
* warnCount,
|
|
27598
|
-
* infoCount,
|
|
27599
|
-
* timeRange,
|
|
27600
|
-
* sources: [...new Set(logBatch.map((log) => log.source))]
|
|
27601
|
-
* }
|
|
27602
|
-
* })
|
|
27603
|
-
*
|
|
27604
|
-
* yield* PubSub.publish(logPubSub, {
|
|
27605
|
-
* timestamp: 1,
|
|
27606
|
-
* level: "info",
|
|
27607
|
-
* message: "ready",
|
|
27608
|
-
* source: "app"
|
|
27609
|
-
* } satisfies LogEntry)
|
|
27610
|
-
* return analysisChannel
|
|
27611
|
-
* })
|
|
27612
|
-
* const log = Effect.scoped(Effect.flatMap(logAggregator, Channel.runHead))
|
|
27613
|
-
* const result = await Effect.runPromise(log)
|
|
27614
|
-
* Option.map(result, (batch) => [batch.batchId, batch.totalEntries, batch.infoCount]) // => Option.some(["1-1", 1, 1])
|
|
27615
|
-
* ```
|
|
27616
|
-
*
|
|
27617
|
-
* @stability stable
|
|
27618
|
-
* @category constructors
|
|
27619
|
-
* @since 4.0.0
|
|
27620
|
-
*/
|
|
27621
|
-
const fromPubSubArray = (pubsub) => unwrap$6(map$7(subscribe(pubsub), fromSubscriptionArray));
|
|
27622
|
-
/**
|
|
27623
27293
|
* Creates a channel from a lazily supplied Web `ReadableStream`.
|
|
27624
27294
|
*
|
|
27625
27295
|
* **Details**
|
|
@@ -28096,6 +27766,38 @@ const catch_$1 = /*#__PURE__*/ dual(2, (self, f) => catchCauseFilter(self, findR
|
|
|
28096
27766
|
*/
|
|
28097
27767
|
const tapError$2 = /*#__PURE__*/ dual(2, (self, f) => transformPull$1(self, (pull) => succeed$5(tapError$3(pull, (err) => isDone(err) ? void_$2 : asVoid(f(err))))));
|
|
28098
27768
|
/**
|
|
27769
|
+
* Recovers from typed channel errors that match a predicate or refinement.
|
|
27770
|
+
*
|
|
27771
|
+
* **When to use**
|
|
27772
|
+
*
|
|
27773
|
+
* Use to recover from typed channel errors when a predicate or refinement
|
|
27774
|
+
* selects the failures that should switch to a recovery channel.
|
|
27775
|
+
*
|
|
27776
|
+
* **Details**
|
|
27777
|
+
*
|
|
27778
|
+
* Matching errors are handled by the recovery function. Non-matching errors
|
|
27779
|
+
* are handled by `orElse` when provided. Without `orElse`, non-matching errors
|
|
27780
|
+
* are re-failed.
|
|
27781
|
+
*
|
|
27782
|
+
* **Gotchas**
|
|
27783
|
+
*
|
|
27784
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
27785
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
27786
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
27787
|
+
*
|
|
27788
|
+
* @see {@link catch_ catch} for recovering from every typed channel error
|
|
27789
|
+
* @see {@link catchFilter} for selecting typed errors with a `Filter`
|
|
27790
|
+
* @see {@link catchTag} for selecting tagged typed errors
|
|
27791
|
+
* @see {@link catchCauseFilter} for selecting full causes with a `Filter`
|
|
27792
|
+
*
|
|
27793
|
+
* @stability stable
|
|
27794
|
+
* @category error handling
|
|
27795
|
+
* @since 4.0.0
|
|
27796
|
+
*/
|
|
27797
|
+
const catchIf$1 = /*#__PURE__*/ dual((args) => isChannel(args[0]), (self, predicate, f, orElse) => catch_$1(self, (err) => {
|
|
27798
|
+
return predicate(err) ? f(err) : orElse ? orElse(err) : fail$5(err);
|
|
27799
|
+
}));
|
|
27800
|
+
/**
|
|
28099
27801
|
* Recovers from typed channel errors selected by a `Filter`.
|
|
28100
27802
|
*
|
|
28101
27803
|
* **When to use**
|
|
@@ -28889,7 +28591,7 @@ const runFold = /*#__PURE__*/ dual(3, (self, initial, f) => suspend$3(() => {
|
|
|
28889
28591
|
*/
|
|
28890
28592
|
const toPullScoped = (self, scope) => toTransform(self)(done(), scope);
|
|
28891
28593
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/stream.js
|
|
28892
|
-
const TypeId$
|
|
28594
|
+
const TypeId$57 = "~effect/Stream";
|
|
28893
28595
|
const streamVariance = {
|
|
28894
28596
|
_R: identity,
|
|
28895
28597
|
_E: identity,
|
|
@@ -28899,7 +28601,7 @@ const Stream$2 = function(channel) {
|
|
|
28899
28601
|
this.channel = channel;
|
|
28900
28602
|
};
|
|
28901
28603
|
Stream$2.prototype = {
|
|
28902
|
-
[TypeId$
|
|
28604
|
+
[TypeId$57]: streamVariance,
|
|
28903
28605
|
pipe() {
|
|
28904
28606
|
return pipeArguments(this, arguments);
|
|
28905
28607
|
}
|
|
@@ -28907,7 +28609,7 @@ Stream$2.prototype = {
|
|
|
28907
28609
|
/** @internal */
|
|
28908
28610
|
const fromChannel$2 = (channel) => new Stream$2(channel);
|
|
28909
28611
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Sink.js
|
|
28910
|
-
const TypeId$
|
|
28612
|
+
const TypeId$56 = "~effect/Sink";
|
|
28911
28613
|
const endVoid = /*#__PURE__*/ succeed$5([void 0]);
|
|
28912
28614
|
const sinkVariance = {
|
|
28913
28615
|
_A: identity,
|
|
@@ -28917,7 +28619,7 @@ const sinkVariance = {
|
|
|
28917
28619
|
_R: identity
|
|
28918
28620
|
};
|
|
28919
28621
|
const SinkProto = {
|
|
28920
|
-
[TypeId$
|
|
28622
|
+
[TypeId$56]: sinkVariance,
|
|
28921
28623
|
pipe() {
|
|
28922
28624
|
return pipeArguments(this, arguments);
|
|
28923
28625
|
}
|
|
@@ -28941,7 +28643,7 @@ const SinkProto = {
|
|
|
28941
28643
|
* @category guards
|
|
28942
28644
|
* @since 4.0.0
|
|
28943
28645
|
*/
|
|
28944
|
-
const isSink = (u) => hasProperty(u, TypeId$
|
|
28646
|
+
const isSink = (u) => hasProperty(u, TypeId$56);
|
|
28945
28647
|
/**
|
|
28946
28648
|
* Creates a sink from a `Channel`.
|
|
28947
28649
|
*
|
|
@@ -29154,9 +28856,9 @@ const unwrap$5 = (effect) => fromChannel$1(unwrap$6(map$7(effect, toChannel$1)))
|
|
|
29154
28856
|
* @stability stable
|
|
29155
28857
|
* @since 3.5.0
|
|
29156
28858
|
*/
|
|
29157
|
-
const TypeId$
|
|
28859
|
+
const TypeId$55 = "~effect/RcMap";
|
|
29158
28860
|
const makeUnsafe$3 = (options) => ({
|
|
29159
|
-
[TypeId$
|
|
28861
|
+
[TypeId$55]: TypeId$55,
|
|
29160
28862
|
lookup: options.lookup,
|
|
29161
28863
|
context: options.context,
|
|
29162
28864
|
scope: options.scope,
|
|
@@ -29164,7 +28866,7 @@ const makeUnsafe$3 = (options) => ({
|
|
|
29164
28866
|
capacity: options.capacity,
|
|
29165
28867
|
state: {
|
|
29166
28868
|
_tag: "Open",
|
|
29167
|
-
map: empty$
|
|
28869
|
+
map: empty$11()
|
|
29168
28870
|
},
|
|
29169
28871
|
pipe() {
|
|
29170
28872
|
return pipeArguments(this, arguments);
|
|
@@ -29298,7 +29000,7 @@ const get$6 = /*#__PURE__*/ dual(2, (self, key) => uninterruptibleMask((restore)
|
|
|
29298
29000
|
if (o._tag === "Some") {
|
|
29299
29001
|
entry = o.value;
|
|
29300
29002
|
entry.refCount++;
|
|
29301
|
-
} else if (Number.isFinite(self.capacity) && size$
|
|
29003
|
+
} else if (Number.isFinite(self.capacity) && size$2(self.state.map) >= self.capacity) return fail$6(new ExceededCapacityError(`RcMap attempted to exceed capacity of ${self.capacity}`));
|
|
29302
29004
|
else {
|
|
29303
29005
|
entry = {
|
|
29304
29006
|
deferred: makeUnsafe$8(),
|
|
@@ -29329,7 +29031,7 @@ const removeInterrupted = (self, key, entry, context) => {
|
|
|
29329
29031
|
if (self.state._tag === "Closed") return;
|
|
29330
29032
|
const o = get$7(self.state.map, key);
|
|
29331
29033
|
if (o._tag === "None" || o.value !== entry) return;
|
|
29332
|
-
remove$
|
|
29034
|
+
remove$3(self.state.map, key);
|
|
29333
29035
|
if (entry.refCount > 0) return;
|
|
29334
29036
|
closeEntry(entry).pipe(ignoreCause({
|
|
29335
29037
|
log: "Unhandled",
|
|
@@ -29347,7 +29049,7 @@ const release$1 = (self, key, entry) => suspend$3(() => {
|
|
|
29347
29049
|
const o = get$7(self.state.map, key);
|
|
29348
29050
|
if (o._tag === "None" || o.value !== entry) return closeEntry(entry);
|
|
29349
29051
|
else if (isZero$1(entry.idleTimeToLive)) {
|
|
29350
|
-
remove$
|
|
29052
|
+
remove$3(self.state.map, key);
|
|
29351
29053
|
return closeEntry(entry);
|
|
29352
29054
|
} else if (!isFinite$2(entry.idleTimeToLive)) return void_$2;
|
|
29353
29055
|
const clock = get$8(self.context, Clock);
|
|
@@ -29360,7 +29062,7 @@ const release$1 = (self, key, entry) => suspend$3(() => {
|
|
|
29360
29062
|
if (self.state._tag === "Closed" || entry.refCount > 0) return void_$2;
|
|
29361
29063
|
const o = get$7(self.state.map, key);
|
|
29362
29064
|
if (o._tag === "None" || o.value !== entry) return void_$2;
|
|
29363
|
-
remove$
|
|
29065
|
+
remove$3(self.state.map, key);
|
|
29364
29066
|
return ignoreCause(close(entry.scope, void_$3), {
|
|
29365
29067
|
log: "Unhandled",
|
|
29366
29068
|
message: "Unhandled error in RcMap finalizer"
|
|
@@ -29373,7 +29075,7 @@ const release$1 = (self, key, entry) => suspend$3(() => {
|
|
|
29373
29075
|
return void_$2;
|
|
29374
29076
|
});
|
|
29375
29077
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/rcRef.js
|
|
29376
|
-
const TypeId$
|
|
29078
|
+
const TypeId$54 = "~effect/RcRef";
|
|
29377
29079
|
const stateEmpty = { _tag: "Empty" };
|
|
29378
29080
|
const stateClosed = { _tag: "Closed" };
|
|
29379
29081
|
const variance = {
|
|
@@ -29381,7 +29083,7 @@ const variance = {
|
|
|
29381
29083
|
_E: identity
|
|
29382
29084
|
};
|
|
29383
29085
|
var RcRefImpl = class {
|
|
29384
|
-
[TypeId$
|
|
29086
|
+
[TypeId$54] = variance;
|
|
29385
29087
|
pipe() {
|
|
29386
29088
|
return pipeArguments(this, arguments);
|
|
29387
29089
|
}
|
|
@@ -29613,7 +29315,7 @@ const get$4 = get$5;
|
|
|
29613
29315
|
* @category type IDs
|
|
29614
29316
|
* @since 4.0.0
|
|
29615
29317
|
*/
|
|
29616
|
-
const TypeId$
|
|
29318
|
+
const TypeId$53 = "~effect/Stream";
|
|
29617
29319
|
/**
|
|
29618
29320
|
* Checks whether a value is a Stream.
|
|
29619
29321
|
*
|
|
@@ -29630,7 +29332,7 @@ const TypeId$54 = "~effect/Stream";
|
|
|
29630
29332
|
* @category guards
|
|
29631
29333
|
* @since 4.0.0
|
|
29632
29334
|
*/
|
|
29633
|
-
const isStream = (u) => hasProperty(u, TypeId$
|
|
29335
|
+
const isStream = (u) => hasProperty(u, TypeId$53);
|
|
29634
29336
|
/**
|
|
29635
29337
|
* Creates a stream from a array-emitting `Channel`.
|
|
29636
29338
|
*
|
|
@@ -29813,7 +29515,7 @@ const callback = (f, options) => fromChannel(callbackArray(f, options));
|
|
|
29813
29515
|
* @category constructors
|
|
29814
29516
|
* @since 2.0.0
|
|
29815
29517
|
*/
|
|
29816
|
-
const empty$
|
|
29518
|
+
const empty$9 = /*#__PURE__*/ fromChannel(empty$10);
|
|
29817
29519
|
/**
|
|
29818
29520
|
* Creates a single-valued pure stream.
|
|
29819
29521
|
*
|
|
@@ -29979,7 +29681,7 @@ const fromIterable$3 = (iterable, options) => Array.isArray(iterable) && options
|
|
|
29979
29681
|
* @category constructors
|
|
29980
29682
|
* @since 4.0.0
|
|
29981
29683
|
*/
|
|
29982
|
-
const fromArray = (array) => isReadonlyArrayNonEmpty(array) ? fromChannel(succeed$4(array)) : empty$
|
|
29684
|
+
const fromArray = (array) => isReadonlyArrayNonEmpty(array) ? fromChannel(succeed$4(array)) : empty$9;
|
|
29983
29685
|
/**
|
|
29984
29686
|
* Creates a stream that pulls values from a `Queue.Dequeue`.
|
|
29985
29687
|
*
|
|
@@ -30014,39 +29716,6 @@ const fromArray = (array) => isReadonlyArrayNonEmpty(array) ? fromChannel(succee
|
|
|
30014
29716
|
*/
|
|
30015
29717
|
const fromQueue = (queue) => fromChannel(fromQueueArray(queue));
|
|
30016
29718
|
/**
|
|
30017
|
-
* Creates a stream from a subscription to a `PubSub`.
|
|
30018
|
-
*
|
|
30019
|
-
* **Example** (Creating a stream from a subscription to a PubSub)
|
|
30020
|
-
*
|
|
30021
|
-
* ```ts import.meta.vitest
|
|
30022
|
-
* import { Effect, Fiber, PubSub, Stream } from "effect"
|
|
30023
|
-
*
|
|
30024
|
-
* const program = Effect.gen(function*() {
|
|
30025
|
-
* const pubsub = yield* PubSub.unbounded<number>({ replay: 3 })
|
|
30026
|
-
*
|
|
30027
|
-
* const fiber = yield* Stream.fromPubSub(pubsub).pipe(
|
|
30028
|
-
* Stream.take(3),
|
|
30029
|
-
* Stream.runCollect,
|
|
30030
|
-
* Effect.forkChild
|
|
30031
|
-
* )
|
|
30032
|
-
*
|
|
30033
|
-
* yield* PubSub.publish(pubsub, 1)
|
|
30034
|
-
* yield* PubSub.publish(pubsub, 2)
|
|
30035
|
-
* yield* PubSub.publish(pubsub, 3)
|
|
30036
|
-
*
|
|
30037
|
-
* const values = yield* Fiber.join(fiber)
|
|
30038
|
-
* values // => [1, 2, 3]
|
|
30039
|
-
* })
|
|
30040
|
-
*
|
|
30041
|
-
* await Effect.runPromise(program)
|
|
30042
|
-
* ```
|
|
30043
|
-
*
|
|
30044
|
-
* @stability stable
|
|
30045
|
-
* @category constructors
|
|
30046
|
-
* @since 2.0.0
|
|
30047
|
-
*/
|
|
30048
|
-
const fromPubSub = (pubsub) => fromChannel(fromPubSubArray(pubsub));
|
|
30049
|
-
/**
|
|
30050
29719
|
* Creates a stream from a lazily supplied Web `ReadableStream`.
|
|
30051
29720
|
*
|
|
30052
29721
|
* **Details**
|
|
@@ -30421,7 +30090,7 @@ function* concatChannels(self, that) {
|
|
|
30421
30090
|
} catch (defect) {
|
|
30422
30091
|
stack.push(die(defect));
|
|
30423
30092
|
}
|
|
30424
|
-
yield empty$
|
|
30093
|
+
yield empty$10;
|
|
30425
30094
|
}
|
|
30426
30095
|
}
|
|
30427
30096
|
/**
|
|
@@ -30555,7 +30224,7 @@ const mergeAll = /*#__PURE__*/ dual(2, (streams, options) => flatten(fromIterabl
|
|
|
30555
30224
|
* @category filtering
|
|
30556
30225
|
* @since 2.0.0
|
|
30557
30226
|
*/
|
|
30558
|
-
const filter$
|
|
30227
|
+
const filter$1 = /*#__PURE__*/ dual(2, (self, predicate) => fromChannel(filterArray(toChannel(self), predicate)));
|
|
30559
30228
|
/**
|
|
30560
30229
|
* Switches over to the stream produced by the provided function in case this
|
|
30561
30230
|
* one fails. Allows recovery from all causes of failure, including
|
|
@@ -30619,6 +30288,47 @@ const catch_ = /*#__PURE__*/ dual(2, (self, f) => fromChannel(catch_$1(self.chan
|
|
|
30619
30288
|
*/
|
|
30620
30289
|
const tapError$1 = /*#__PURE__*/ dual(2, (self, f) => self.channel.pipe(tapError$2(f), fromChannel));
|
|
30621
30290
|
/**
|
|
30291
|
+
* Recovers from errors that match a predicate by switching to a recovery stream.
|
|
30292
|
+
*
|
|
30293
|
+
* **Details**
|
|
30294
|
+
*
|
|
30295
|
+
* When a failure matches the filter, the stream switches to the recovery
|
|
30296
|
+
* stream. Non-matching failures propagate downstream, so the error type is
|
|
30297
|
+
* preserved unless the filter narrows it.
|
|
30298
|
+
*
|
|
30299
|
+
* **Gotchas**
|
|
30300
|
+
*
|
|
30301
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
30302
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
30303
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
30304
|
+
*
|
|
30305
|
+
* **Example** (Catching matching failures)
|
|
30306
|
+
*
|
|
30307
|
+
* ```ts import.meta.vitest
|
|
30308
|
+
* import { Effect, Stream } from "effect"
|
|
30309
|
+
*
|
|
30310
|
+
* const stream = Stream.make(1, 2).pipe(
|
|
30311
|
+
* Stream.concat(Stream.fail(42)),
|
|
30312
|
+
* Stream.catchIf(
|
|
30313
|
+
* (error): error is 42 => error === 42,
|
|
30314
|
+
* () => Stream.make(999)
|
|
30315
|
+
* )
|
|
30316
|
+
* )
|
|
30317
|
+
*
|
|
30318
|
+
* const program = Effect.gen(function*() {
|
|
30319
|
+
* const values = yield* Stream.runCollect(stream)
|
|
30320
|
+
* values // => [ 1, 2, 999 ]
|
|
30321
|
+
* })
|
|
30322
|
+
*
|
|
30323
|
+
* await Effect.runPromise(program)
|
|
30324
|
+
* ```
|
|
30325
|
+
*
|
|
30326
|
+
* @stability stable
|
|
30327
|
+
* @category error handling
|
|
30328
|
+
* @since 4.0.0
|
|
30329
|
+
*/
|
|
30330
|
+
const catchIf = /*#__PURE__*/ dual((args) => isStream(args[0]), (self, predicate, f, orElse) => fromChannel(catchIf$1(toChannel(self), predicate, (e) => f(e).channel, orElse && ((e) => orElse(e).channel))));
|
|
30331
|
+
/**
|
|
30622
30332
|
* Recovers from errors that match a `Filter` by switching to a recovery
|
|
30623
30333
|
* stream.
|
|
30624
30334
|
*
|
|
@@ -31545,7 +31255,7 @@ const toReadableStreamWith = /*#__PURE__*/ dual((args) => isStream(args[0]), (se
|
|
|
31545
31255
|
* @category destructors
|
|
31546
31256
|
* @since 2.0.0
|
|
31547
31257
|
*/
|
|
31548
|
-
const toReadableStream = /*#__PURE__*/ dual((args) => isStream(args[0]), (self, options) => toReadableStreamWith(self, empty$
|
|
31258
|
+
const toReadableStream = /*#__PURE__*/ dual((args) => isStream(args[0]), (self, options) => toReadableStreamWith(self, empty$16(), options));
|
|
31549
31259
|
/**
|
|
31550
31260
|
* Creates an Effect that builds a ReadableStream from the stream.
|
|
31551
31261
|
*
|
|
@@ -31592,7 +31302,7 @@ const toReadableStreamEffect = /*#__PURE__*/ dual((args) => isStream(args[0]), (
|
|
|
31592
31302
|
* @stability unstable
|
|
31593
31303
|
* @since 4.0.0
|
|
31594
31304
|
*/
|
|
31595
|
-
const TypeId$
|
|
31305
|
+
const TypeId$52 = "~effect/FileSystem";
|
|
31596
31306
|
/**
|
|
31597
31307
|
* Service tag for platform file-system operations.
|
|
31598
31308
|
*
|
|
@@ -31662,7 +31372,7 @@ const FileSystem = /*#__PURE__*/ Service$1("effect/FileSystem");
|
|
|
31662
31372
|
*/
|
|
31663
31373
|
const make$73 = (impl) => FileSystem.of({
|
|
31664
31374
|
...impl,
|
|
31665
|
-
[TypeId$
|
|
31375
|
+
[TypeId$52]: TypeId$52,
|
|
31666
31376
|
glob: make$84(impl),
|
|
31667
31377
|
exists: (path) => pipe(impl.access(path), as(true), catchTag("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed$5(false) : fail$6(e))),
|
|
31668
31378
|
readFileString: (path, encoding) => flatMap$3(impl.readFile(path), (_) => try_({
|
|
@@ -31794,7 +31504,7 @@ var WatchBackend = class extends (/*#__PURE__*/ Service$1()("effect/FileSystem/W
|
|
|
31794
31504
|
* @category type IDs
|
|
31795
31505
|
* @since 4.0.0
|
|
31796
31506
|
*/
|
|
31797
|
-
const TypeId$
|
|
31507
|
+
const TypeId$51 = "~effect/Path";
|
|
31798
31508
|
/**
|
|
31799
31509
|
* Service tag for accessing the current `Path` implementation.
|
|
31800
31510
|
*
|
|
@@ -31884,7 +31594,7 @@ const Path$1 = /*#__PURE__*/ Service$1("effect/Path");
|
|
|
31884
31594
|
*/
|
|
31885
31595
|
const make$72 = (impl) => Path$1.of({
|
|
31886
31596
|
...impl,
|
|
31887
|
-
[TypeId$
|
|
31597
|
+
[TypeId$51]: TypeId$51,
|
|
31888
31598
|
resolveWithin(root, input) {
|
|
31889
31599
|
if (impl.parse(input).root !== "") return none();
|
|
31890
31600
|
const base = impl.resolve(root);
|
|
@@ -31979,7 +31689,7 @@ const fromOptionExit = (option) => option._tag === "None" ? missingExit : succee
|
|
|
31979
31689
|
* @stability stable
|
|
31980
31690
|
* @since 4.0.0
|
|
31981
31691
|
*/
|
|
31982
|
-
const TypeId$
|
|
31692
|
+
const TypeId$50 = "~effect/SchemaIssue/Issue";
|
|
31983
31693
|
/**
|
|
31984
31694
|
* Returns `true` if the given value is an {@link Issue}.
|
|
31985
31695
|
*
|
|
@@ -32010,7 +31720,7 @@ const TypeId$51 = "~effect/SchemaIssue/Issue";
|
|
|
32010
31720
|
* @since 4.0.0
|
|
32011
31721
|
*/
|
|
32012
31722
|
function isIssue(u) {
|
|
32013
|
-
return hasProperty(u, TypeId$
|
|
31723
|
+
return hasProperty(u, TypeId$50) && u[TypeId$50] === TypeId$50;
|
|
32014
31724
|
}
|
|
32015
31725
|
/**
|
|
32016
31726
|
* Returns `true` when an issue contains an input reported by the schema parser.
|
|
@@ -32046,7 +31756,7 @@ function hasInput(issue) {
|
|
|
32046
31756
|
return Object.hasOwn(issue, "input");
|
|
32047
31757
|
}
|
|
32048
31758
|
var IssueNodeImpl = class {
|
|
32049
|
-
[TypeId$
|
|
31759
|
+
[TypeId$50] = TypeId$50;
|
|
32050
31760
|
constructor(input, options) {
|
|
32051
31761
|
if (options?.reportInput === true && input !== missing) this.input = input;
|
|
32052
31762
|
}
|
|
@@ -32709,26 +32419,6 @@ const now = now$1;
|
|
|
32709
32419
|
*/
|
|
32710
32420
|
const toUtc = toUtc$1;
|
|
32711
32421
|
/**
|
|
32712
|
-
* Checks whether the first `DateTime` is after the second `DateTime`.
|
|
32713
|
-
*
|
|
32714
|
-
* **Example** (Checking whether a DateTime is later)
|
|
32715
|
-
*
|
|
32716
|
-
* ```ts import.meta.vitest
|
|
32717
|
-
* import { DateTime } from "effect"
|
|
32718
|
-
*
|
|
32719
|
-
* const date1 = DateTime.makeUnsafe("2024-02-01")
|
|
32720
|
-
* const date2 = DateTime.makeUnsafe("2024-01-01")
|
|
32721
|
-
*
|
|
32722
|
-
* DateTime.isGreaterThan(date1, date2) // => true
|
|
32723
|
-
* DateTime.isGreaterThan(date2, date1) // => false
|
|
32724
|
-
* ```
|
|
32725
|
-
*
|
|
32726
|
-
* @stability stable
|
|
32727
|
-
* @category comparisons
|
|
32728
|
-
* @since 4.0.0
|
|
32729
|
-
*/
|
|
32730
|
-
const isGreaterThan$1 = isGreaterThan$2;
|
|
32731
|
-
/**
|
|
32732
32422
|
* Gets the milliseconds since the Unix epoch of a `DateTime`.
|
|
32733
32423
|
*
|
|
32734
32424
|
* **Details**
|
|
@@ -32750,44 +32440,6 @@ const isGreaterThan$1 = isGreaterThan$2;
|
|
|
32750
32440
|
*/
|
|
32751
32441
|
const toEpochMillis = toEpochMillis$1;
|
|
32752
32442
|
/**
|
|
32753
|
-
* Adds the given `Duration` to a `DateTime`.
|
|
32754
|
-
*
|
|
32755
|
-
* **When to use**
|
|
32756
|
-
*
|
|
32757
|
-
* Use to move a `DateTime` by an elapsed duration such as minutes, seconds, or
|
|
32758
|
-
* milliseconds.
|
|
32759
|
-
*
|
|
32760
|
-
* **Details**
|
|
32761
|
-
*
|
|
32762
|
-
* The duration is converted to milliseconds and added to the epoch
|
|
32763
|
-
* milliseconds. Zoned values keep their original time zone.
|
|
32764
|
-
*
|
|
32765
|
-
* **Gotchas**
|
|
32766
|
-
*
|
|
32767
|
-
* This is elapsed-time arithmetic, not calendar-aware local date arithmetic.
|
|
32768
|
-
* Use `add` when adding days, weeks, months, or years should account for the
|
|
32769
|
-
* date/time zone rules.
|
|
32770
|
-
*
|
|
32771
|
-
* **Example** (Adding durations)
|
|
32772
|
-
*
|
|
32773
|
-
* ```ts import.meta.vitest
|
|
32774
|
-
* import { DateTime } from "effect"
|
|
32775
|
-
*
|
|
32776
|
-
* // add 5 minutes
|
|
32777
|
-
* DateTime.makeUnsafe(0).pipe(
|
|
32778
|
-
* DateTime.addDuration("5 minutes")
|
|
32779
|
-
* ) // => DateTime.makeUnsafe(300000)
|
|
32780
|
-
* ```
|
|
32781
|
-
*
|
|
32782
|
-
* @see {@link add} for calendar-aware date/time part arithmetic
|
|
32783
|
-
* @see {@link subtractDuration} for subtracting an elapsed duration
|
|
32784
|
-
*
|
|
32785
|
-
* @stability stable
|
|
32786
|
-
* @category math
|
|
32787
|
-
* @since 3.6.0
|
|
32788
|
-
*/
|
|
32789
|
-
const addDuration = addDuration$1;
|
|
32790
|
-
/**
|
|
32791
32443
|
* Subtracts the given `amount` of `unit` from a `DateTime`.
|
|
32792
32444
|
*
|
|
32793
32445
|
* **Example** (Subtracting date and time parts)
|
|
@@ -33527,7 +33179,7 @@ function omit$1() {
|
|
|
33527
33179
|
*/
|
|
33528
33180
|
function withDefault$4(defaultValue) {
|
|
33529
33181
|
return transformOptionalEffect((o) => {
|
|
33530
|
-
const filtered = filter$
|
|
33182
|
+
const filtered = filter$7(o, isNotUndefined);
|
|
33531
33183
|
return isSome(filtered) ? succeed$5(filtered) : mapEager(defaultValue, some$1);
|
|
33532
33184
|
});
|
|
33533
33185
|
}
|
|
@@ -33934,9 +33586,9 @@ function decodeUriComponent() {
|
|
|
33934
33586
|
* @stability stable
|
|
33935
33587
|
* @since 2.0.0
|
|
33936
33588
|
*/
|
|
33937
|
-
const TypeId$
|
|
33589
|
+
const TypeId$49 = "~effect/BigDecimal";
|
|
33938
33590
|
const BigDecimalProto = {
|
|
33939
|
-
[TypeId$
|
|
33591
|
+
[TypeId$49]: TypeId$49,
|
|
33940
33592
|
[symbol$3]() {
|
|
33941
33593
|
const normalized = normalize(this);
|
|
33942
33594
|
return combine$2(string$2(String(normalized.value)), number$2(normalized.scale));
|
|
@@ -33984,7 +33636,7 @@ const BigDecimalProto = {
|
|
|
33984
33636
|
* @category guards
|
|
33985
33637
|
* @since 2.0.0
|
|
33986
33638
|
*/
|
|
33987
|
-
const isBigDecimal = (u) => hasProperty(u, TypeId$
|
|
33639
|
+
const isBigDecimal = (u) => hasProperty(u, TypeId$49);
|
|
33988
33640
|
/**
|
|
33989
33641
|
* Creates a `BigDecimal` from a `bigint` value and a safe integer scale.
|
|
33990
33642
|
*
|
|
@@ -34243,7 +33895,7 @@ const Middleware = class extends Class$4 {
|
|
|
34243
33895
|
return new Middleware(this.encode, this.decode);
|
|
34244
33896
|
}
|
|
34245
33897
|
};
|
|
34246
|
-
const TypeId$
|
|
33898
|
+
const TypeId$48 = "~effect/SchemaTransformation/Transformation";
|
|
34247
33899
|
/**
|
|
34248
33900
|
* Constructs a bidirectional schema transformation from its decode and encode getters.
|
|
34249
33901
|
*
|
|
@@ -34252,7 +33904,7 @@ const TypeId$49 = "~effect/SchemaTransformation/Transformation";
|
|
|
34252
33904
|
* @since 4.0.0
|
|
34253
33905
|
*/
|
|
34254
33906
|
const Transformation = class extends Class$4 {
|
|
34255
|
-
[TypeId$
|
|
33907
|
+
[TypeId$48] = TypeId$48;
|
|
34256
33908
|
_tag = "Transformation";
|
|
34257
33909
|
decode;
|
|
34258
33910
|
encode;
|
|
@@ -34295,7 +33947,7 @@ const Transformation = class extends Class$4 {
|
|
|
34295
33947
|
* @since 4.0.0
|
|
34296
33948
|
*/
|
|
34297
33949
|
function isTransformation(u) {
|
|
34298
|
-
return hasProperty(u, TypeId$
|
|
33950
|
+
return hasProperty(u, TypeId$48) && u[TypeId$48] === TypeId$48;
|
|
34299
33951
|
}
|
|
34300
33952
|
/**
|
|
34301
33953
|
* Constructs a `Transformation` from an object with `decode` and `encode`
|
|
@@ -35027,9 +34679,9 @@ const Context = class {
|
|
|
35027
34679
|
this.annotations = annotations;
|
|
35028
34680
|
}
|
|
35029
34681
|
};
|
|
35030
|
-
const TypeId$
|
|
34682
|
+
const TypeId$47 = "~effect/Schema";
|
|
35031
34683
|
var ASTNodeImpl = class {
|
|
35032
|
-
[TypeId$
|
|
34684
|
+
[TypeId$47] = TypeId$47;
|
|
35033
34685
|
annotations;
|
|
35034
34686
|
checks;
|
|
35035
34687
|
encoding;
|
|
@@ -35942,7 +35594,7 @@ const Objects = class extends ASTNodeImpl {
|
|
|
35942
35594
|
}
|
|
35943
35595
|
}
|
|
35944
35596
|
else if (parseIndexes) {
|
|
35945
|
-
const keyPairs = empty$
|
|
35597
|
+
const keyPairs = empty$13();
|
|
35946
35598
|
for (let i = 0; i < indexCount; i++) {
|
|
35947
35599
|
const index = indexes[i];
|
|
35948
35600
|
const keys = indexKeys?.[i] ?? (index.is.parameter === string$1 ? Object.keys(record) : getIndexSignatureKeys(record, index.is.parameter, options));
|
|
@@ -37358,7 +37010,7 @@ const stringOrRedacted = (val) => typeof val === "string" ? val : value$3(val);
|
|
|
37358
37010
|
* @stability stable
|
|
37359
37011
|
* @since 3.3.0
|
|
37360
37012
|
*/
|
|
37361
|
-
const TypeId$
|
|
37013
|
+
const TypeId$46 = "~effect/Redacted";
|
|
37362
37014
|
/**
|
|
37363
37015
|
* Returns `true` if a value is a `Redacted` wrapper.
|
|
37364
37016
|
*
|
|
@@ -37387,7 +37039,7 @@ const TypeId$47 = "~effect/Redacted";
|
|
|
37387
37039
|
* @category guards
|
|
37388
37040
|
* @since 3.3.0
|
|
37389
37041
|
*/
|
|
37390
|
-
const isRedacted = (u) => hasProperty(u, TypeId$
|
|
37042
|
+
const isRedacted = (u) => hasProperty(u, TypeId$46);
|
|
37391
37043
|
/**
|
|
37392
37044
|
* Creates a `Redacted` wrapper for a sensitive value.
|
|
37393
37045
|
*
|
|
@@ -37416,13 +37068,13 @@ const isRedacted = (u) => hasProperty(u, TypeId$47);
|
|
|
37416
37068
|
* @since 3.3.0
|
|
37417
37069
|
*/
|
|
37418
37070
|
const make$68 = (value, options) => {
|
|
37419
|
-
const self = Object.create(Proto$
|
|
37071
|
+
const self = Object.create(Proto$20);
|
|
37420
37072
|
if (options?.label) self.label = options.label;
|
|
37421
37073
|
redactedRegistry.set(self, value);
|
|
37422
37074
|
return self;
|
|
37423
37075
|
};
|
|
37424
|
-
const Proto$
|
|
37425
|
-
[TypeId$
|
|
37076
|
+
const Proto$20 = {
|
|
37077
|
+
[TypeId$46]: { _A: (_) => _ },
|
|
37426
37078
|
label: void 0,
|
|
37427
37079
|
...PipeInspectableProto,
|
|
37428
37080
|
toJSON() {
|
|
@@ -37829,17 +37481,17 @@ const parseTemplate$1 = (texts, values) => {
|
|
|
37829
37481
|
* @stability unstable
|
|
37830
37482
|
* @since 4.0.0
|
|
37831
37483
|
*/
|
|
37832
|
-
const TypeId$
|
|
37833
|
-
const Proto$
|
|
37484
|
+
const TypeId$45 = "~effect/process/ChildProcess";
|
|
37485
|
+
const Proto$19 = {
|
|
37834
37486
|
.../*#__PURE__*/ Prototype({
|
|
37835
37487
|
label: "Command",
|
|
37836
37488
|
evaluate(fiber) {
|
|
37837
37489
|
return getUnsafe$1(fiber.context, ChildProcessSpawner).spawn(this);
|
|
37838
37490
|
}
|
|
37839
37491
|
}),
|
|
37840
|
-
[TypeId$
|
|
37492
|
+
[TypeId$45]: TypeId$45
|
|
37841
37493
|
};
|
|
37842
|
-
const makeStandardCommand = (command, args, options) => Object.assign(Object.create(Proto$
|
|
37494
|
+
const makeStandardCommand = (command, args, options) => Object.assign(Object.create(Proto$19), {
|
|
37843
37495
|
_tag: "StandardCommand",
|
|
37844
37496
|
command,
|
|
37845
37497
|
args,
|
|
@@ -38506,7 +38158,7 @@ const layer$23 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
|
|
|
38506
38158
|
const setupAdditionalFds = fnUntraced(function* (command, childProcess, additionalFds, inputFailure) {
|
|
38507
38159
|
if (additionalFds.length === 0) return {
|
|
38508
38160
|
getInputFd: () => drain,
|
|
38509
|
-
getOutputFd: () => empty$
|
|
38161
|
+
getOutputFd: () => empty$9
|
|
38510
38162
|
};
|
|
38511
38163
|
const inputSinks = /* @__PURE__ */ new Map();
|
|
38512
38164
|
const outputStreams = /* @__PURE__ */ new Map();
|
|
@@ -38526,7 +38178,7 @@ const layer$23 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
|
|
|
38526
38178
|
return void_$2;
|
|
38527
38179
|
});
|
|
38528
38180
|
const setupOutput = (fd, nodeStream, sink) => {
|
|
38529
|
-
let stream = empty$
|
|
38181
|
+
let stream = empty$9;
|
|
38530
38182
|
if (nodeStream && "read" in nodeStream) {
|
|
38531
38183
|
const passThrough = new PassThrough();
|
|
38532
38184
|
let error = void 0;
|
|
@@ -38561,7 +38213,7 @@ const layer$23 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
|
|
|
38561
38213
|
}
|
|
38562
38214
|
return {
|
|
38563
38215
|
getInputFd: (fd) => inputSinks.get(fd) ?? drain,
|
|
38564
|
-
getOutputFd: (fd) => outputStreams.get(fd) ?? empty$
|
|
38216
|
+
getOutputFd: (fd) => outputStreams.get(fd) ?? empty$9
|
|
38565
38217
|
};
|
|
38566
38218
|
});
|
|
38567
38219
|
const setupChildStdin = (command, childProcess, config, inputFailure) => suspend$3(() => {
|
|
@@ -38587,7 +38239,7 @@ const layer$23 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
|
|
|
38587
38239
|
evaluate: () => passThrough,
|
|
38588
38240
|
onError: (error) => toPlatformError("fromReadable(stdout)", toError(error), command)
|
|
38589
38241
|
});
|
|
38590
|
-
})() : empty$
|
|
38242
|
+
})() : empty$9;
|
|
38591
38243
|
let stderr = childProcess.stderr ? (() => {
|
|
38592
38244
|
const passThrough = new PassThrough();
|
|
38593
38245
|
childProcess.stderr.on("error", (error) => passThrough.destroy(error));
|
|
@@ -38596,7 +38248,7 @@ const layer$23 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
|
|
|
38596
38248
|
evaluate: () => passThrough,
|
|
38597
38249
|
onError: (error) => toPlatformError("fromReadable(stderr)", toError(error), command)
|
|
38598
38250
|
});
|
|
38599
|
-
})() : empty$
|
|
38251
|
+
})() : empty$9;
|
|
38600
38252
|
if (isSink(stdoutConfig.stream)) stdout = transduce(stdout, stdoutConfig.stream);
|
|
38601
38253
|
if (isSink(stderrConfig.stream)) stderr = transduce(stderr, stderrConfig.stream);
|
|
38602
38254
|
const all = merge$1(stdout, stderr);
|
|
@@ -38908,7 +38560,7 @@ const flattenCommand = (command) => {
|
|
|
38908
38560
|
* @stability unstable
|
|
38909
38561
|
* @since 4.0.0
|
|
38910
38562
|
*/
|
|
38911
|
-
const TypeId$
|
|
38563
|
+
const TypeId$44 = "~effect/http/Cookies";
|
|
38912
38564
|
/**
|
|
38913
38565
|
* Returns `true` when a value is a `Cookies` collection.
|
|
38914
38566
|
*
|
|
@@ -38916,7 +38568,7 @@ const TypeId$45 = "~effect/http/Cookies";
|
|
|
38916
38568
|
* @category guards
|
|
38917
38569
|
* @since 4.0.0
|
|
38918
38570
|
*/
|
|
38919
|
-
const isCookies = (u) => hasProperty(u, TypeId$
|
|
38571
|
+
const isCookies = (u) => hasProperty(u, TypeId$44);
|
|
38920
38572
|
const CookieTypeId = "~effect/http/Cookies/Cookie";
|
|
38921
38573
|
const CookieErrorTypeId = "~effect/http/Cookies/CookieError";
|
|
38922
38574
|
/**
|
|
@@ -38969,8 +38621,8 @@ var CookiesError = class CookiesError extends (/*#__PURE__*/ TaggedError$1("Cook
|
|
|
38969
38621
|
return this.reason._tag;
|
|
38970
38622
|
}
|
|
38971
38623
|
};
|
|
38972
|
-
const Proto$
|
|
38973
|
-
[TypeId$
|
|
38624
|
+
const Proto$18 = {
|
|
38625
|
+
[TypeId$44]: TypeId$44,
|
|
38974
38626
|
...BaseProto,
|
|
38975
38627
|
toJSON() {
|
|
38976
38628
|
return {
|
|
@@ -38990,7 +38642,7 @@ const Proto$19 = {
|
|
|
38990
38642
|
* @since 4.0.0
|
|
38991
38643
|
*/
|
|
38992
38644
|
const fromReadonlyRecord = (cookies) => {
|
|
38993
|
-
const self = Object.create(Proto$
|
|
38645
|
+
const self = Object.create(Proto$18);
|
|
38994
38646
|
self.cookies = cookies;
|
|
38995
38647
|
return self;
|
|
38996
38648
|
};
|
|
@@ -39111,7 +38763,7 @@ function parseSetCookie(header) {
|
|
|
39111
38763
|
* @category constructors
|
|
39112
38764
|
* @since 4.0.0
|
|
39113
38765
|
*/
|
|
39114
|
-
const empty$
|
|
38766
|
+
const empty$8 = /*#__PURE__*/ fromIterable$2([]);
|
|
39115
38767
|
/**
|
|
39116
38768
|
* Returns `true` when the `Cookies` collection contains no cookies.
|
|
39117
38769
|
*
|
|
@@ -39182,7 +38834,7 @@ const makeCookieUnsafe = (name, value, options) => getOrThrow(makeCookie(name, v
|
|
|
39182
38834
|
* @category combinators
|
|
39183
38835
|
* @since 4.0.0
|
|
39184
38836
|
*/
|
|
39185
|
-
const setUnsafe
|
|
38837
|
+
const setUnsafe = /*#__PURE__*/ dual((args) => isCookies(args[0]), (self, name, value, options) => fromReadonlyRecord(set$5(self.cookies, name, makeCookieUnsafe(name, value, options))));
|
|
39186
38838
|
/**
|
|
39187
38839
|
* Adds an expired cookie to a Cookies object, throwing an error if invalid
|
|
39188
38840
|
*
|
|
@@ -39190,7 +38842,7 @@ const setUnsafe$1 = /*#__PURE__*/ dual((args) => isCookies(args[0]), (self, name
|
|
|
39190
38842
|
* @category combinators
|
|
39191
38843
|
* @since 4.0.0
|
|
39192
38844
|
*/
|
|
39193
|
-
const expireCookieUnsafe$1 = /*#__PURE__*/ dual((args) => isCookies(args[0]), (self, name, options) => setUnsafe
|
|
38845
|
+
const expireCookieUnsafe$1 = /*#__PURE__*/ dual((args) => isCookies(args[0]), (self, name, options) => setUnsafe(self, name, "", {
|
|
39194
38846
|
...options,
|
|
39195
38847
|
maxAge: 0,
|
|
39196
38848
|
expires: /* @__PURE__ */ new Date(0)
|
|
@@ -39317,9 +38969,9 @@ const tryDecodeURIComponent = (str) => {
|
|
|
39317
38969
|
* @category type IDs
|
|
39318
38970
|
* @since 4.0.0
|
|
39319
38971
|
*/
|
|
39320
|
-
const TypeId$
|
|
39321
|
-
const Proto$
|
|
39322
|
-
[TypeId$
|
|
38972
|
+
const TypeId$43 = /*#__PURE__*/ Symbol.for("~effect/http/Headers");
|
|
38973
|
+
const Proto$17 = /*#__PURE__*/ Object.defineProperties(/*#__PURE__*/ Object.create(null), {
|
|
38974
|
+
[TypeId$43]: { value: TypeId$43 },
|
|
39323
38975
|
[symbolRedactable]: { value(context) {
|
|
39324
38976
|
return redact$1(this, get$8(context, CurrentRedactedNames$1));
|
|
39325
38977
|
} },
|
|
@@ -39335,7 +38987,7 @@ const Proto$18 = /*#__PURE__*/ Object.defineProperties(/*#__PURE__*/ Object.crea
|
|
|
39335
38987
|
toString: { value: BaseProto.toString },
|
|
39336
38988
|
[NodeInspectSymbol]: { value: BaseProto[NodeInspectSymbol] }
|
|
39337
38989
|
});
|
|
39338
|
-
const make$65 = (input) => Object.assign(Object.create(Proto$
|
|
38990
|
+
const make$65 = (input) => Object.assign(Object.create(Proto$17), input);
|
|
39339
38991
|
/**
|
|
39340
38992
|
* Provides an `Equivalence` instance that compares `Headers` by header names
|
|
39341
38993
|
* and string values.
|
|
@@ -39352,7 +39004,7 @@ const Equivalence$1 = /*#__PURE__*/ makeEquivalence$3(/*#__PURE__*/ strictEqual(
|
|
|
39352
39004
|
* @category constructors
|
|
39353
39005
|
* @since 4.0.0
|
|
39354
39006
|
*/
|
|
39355
|
-
const empty$
|
|
39007
|
+
const empty$7 = /*#__PURE__*/ Object.create(Proto$17);
|
|
39356
39008
|
/**
|
|
39357
39009
|
* Creates `Headers` from a record or iterable of header entries.
|
|
39358
39010
|
*
|
|
@@ -39369,16 +39021,16 @@ const empty$8 = /*#__PURE__*/ Object.create(Proto$18);
|
|
|
39369
39021
|
* @since 4.0.0
|
|
39370
39022
|
*/
|
|
39371
39023
|
const fromInput$1 = (input) => {
|
|
39372
|
-
if (input === void 0) return empty$
|
|
39024
|
+
if (input === void 0) return empty$7;
|
|
39373
39025
|
else if (Symbol.iterator in input) {
|
|
39374
|
-
const out = Object.create(Proto$
|
|
39026
|
+
const out = Object.create(Proto$17);
|
|
39375
39027
|
for (const [k, v] of input) {
|
|
39376
39028
|
const key = k.toLowerCase();
|
|
39377
39029
|
out[key] = key in out ? `${out[key]}, ${v}` : v;
|
|
39378
39030
|
}
|
|
39379
39031
|
return out;
|
|
39380
39032
|
}
|
|
39381
|
-
const out = Object.create(Proto$
|
|
39033
|
+
const out = Object.create(Proto$17);
|
|
39382
39034
|
for (const [k, v] of Object.entries(input)) if (Array.isArray(v)) out[k.toLowerCase()] = v.join(", ");
|
|
39383
39035
|
else if (v !== void 0) out[k.toLowerCase()] = v;
|
|
39384
39036
|
return out;
|
|
@@ -39394,7 +39046,19 @@ const fromInput$1 = (input) => {
|
|
|
39394
39046
|
* @category constructors
|
|
39395
39047
|
* @since 4.0.0
|
|
39396
39048
|
*/
|
|
39397
|
-
const fromRecordUnsafe = (input) => Object.setPrototypeOf(input, Proto$
|
|
39049
|
+
const fromRecordUnsafe = (input) => Object.setPrototypeOf(input, Proto$17);
|
|
39050
|
+
/**
|
|
39051
|
+
* Gets a header value by name safely.
|
|
39052
|
+
*
|
|
39053
|
+
* **Details**
|
|
39054
|
+
*
|
|
39055
|
+
* The lookup lowercases the provided header name and returns `Option.none()` when absent.
|
|
39056
|
+
*
|
|
39057
|
+
* @stability unstable
|
|
39058
|
+
* @category combinators
|
|
39059
|
+
* @since 4.0.0
|
|
39060
|
+
*/
|
|
39061
|
+
const get$3 = /*#__PURE__*/ dual(2, (self, key) => fromUndefinedOr(self[key.toLowerCase()]));
|
|
39398
39062
|
/**
|
|
39399
39063
|
* Returns a new `Headers` collection with the given header set.
|
|
39400
39064
|
*
|
|
@@ -39453,7 +39117,7 @@ const merge = /*#__PURE__*/ dual(2, (self, headers) => {
|
|
|
39453
39117
|
* @category combinators
|
|
39454
39118
|
* @since 4.0.0
|
|
39455
39119
|
*/
|
|
39456
|
-
const remove$
|
|
39120
|
+
const remove$1 = /*#__PURE__*/ dual(2, (self, key) => {
|
|
39457
39121
|
const out = make$65(self);
|
|
39458
39122
|
delete out[key.toLowerCase()];
|
|
39459
39123
|
return out;
|
|
@@ -39717,7 +39381,7 @@ const retryAfterDelay$1 = (self, now) => self._tag === "Duration" ? self.duratio
|
|
|
39717
39381
|
* @stability unstable
|
|
39718
39382
|
* @since 4.0.0
|
|
39719
39383
|
*/
|
|
39720
|
-
const TypeId$
|
|
39384
|
+
const TypeId$42 = "~effect/crypto/CryptoError";
|
|
39721
39385
|
const ReasonTypeId$2 = "~effect/crypto/CryptoError/Reason";
|
|
39722
39386
|
/**
|
|
39723
39387
|
* Reason for an argument that the operation rejects before using the key or
|
|
@@ -39870,7 +39534,7 @@ var CryptoError = class extends (/*#__PURE__*/ TaggedError$1("CryptoError")) {
|
|
|
39870
39534
|
*
|
|
39871
39535
|
* @since 4.0.0
|
|
39872
39536
|
*/
|
|
39873
|
-
[TypeId$
|
|
39537
|
+
[TypeId$42] = TypeId$42;
|
|
39874
39538
|
/**
|
|
39875
39539
|
* The reason's cause, when it has one.
|
|
39876
39540
|
*
|
|
@@ -41210,7 +40874,7 @@ var Aead_exports = /* @__PURE__ */ __exportAll({
|
|
|
41210
40874
|
toBytes: () => toBytes$5,
|
|
41211
40875
|
xchacha20Poly1305: () => xchacha20Poly1305
|
|
41212
40876
|
});
|
|
41213
|
-
const TypeId$
|
|
40877
|
+
const TypeId$41 = "~effect/crypto/Aead/Key";
|
|
41214
40878
|
/**
|
|
41215
40879
|
* AES-128-GCM, with a 16-byte key and a 12-byte nonce.
|
|
41216
40880
|
*
|
|
@@ -41279,7 +40943,7 @@ const xchacha20Poly1305 = {
|
|
|
41279
40943
|
nonceLength: 24,
|
|
41280
40944
|
implementation: /* @__PURE__ */ chachaImplementation(xchacha20Poly1305$1)
|
|
41281
40945
|
};
|
|
41282
|
-
const KeyProto$3 = /*#__PURE__*/ redactedProto(TypeId$
|
|
40946
|
+
const KeyProto$3 = /*#__PURE__*/ redactedProto(TypeId$41, "Aead.Key");
|
|
41283
40947
|
/**
|
|
41284
40948
|
* Checks whether a value is a {@link Key}.
|
|
41285
40949
|
*
|
|
@@ -41287,7 +40951,7 @@ const KeyProto$3 = /*#__PURE__*/ redactedProto(TypeId$42, "Aead.Key");
|
|
|
41287
40951
|
* @category guards
|
|
41288
40952
|
* @since 4.0.0
|
|
41289
40953
|
*/
|
|
41290
|
-
const isKey$3 = (u) => hasProperty(u, TypeId$
|
|
40954
|
+
const isKey$3 = (u) => hasProperty(u, TypeId$41);
|
|
41291
40955
|
/**
|
|
41292
40956
|
* Service that generates keys, encrypts, and decrypts with authentication.
|
|
41293
40957
|
*
|
|
@@ -41518,7 +41182,7 @@ var Cipher_exports = /* @__PURE__ */ __exportAll({
|
|
|
41518
41182
|
layerWebCrypto: () => layerWebCrypto$5,
|
|
41519
41183
|
toBytes: () => toBytes$4
|
|
41520
41184
|
});
|
|
41521
|
-
const TypeId$
|
|
41185
|
+
const TypeId$40 = "~effect/crypto/Cipher/Key";
|
|
41522
41186
|
/**
|
|
41523
41187
|
* AES-128-CTR, with a 16-byte key.
|
|
41524
41188
|
*
|
|
@@ -41577,7 +41241,7 @@ const aes256Cbc = {
|
|
|
41577
41241
|
mode: "AES-CBC",
|
|
41578
41242
|
keyLength: 32
|
|
41579
41243
|
};
|
|
41580
|
-
const KeyProto$2 = /*#__PURE__*/ redactedProto(TypeId$
|
|
41244
|
+
const KeyProto$2 = /*#__PURE__*/ redactedProto(TypeId$40, "Cipher.Key");
|
|
41581
41245
|
/**
|
|
41582
41246
|
* Checks whether a value is a {@link Key}.
|
|
41583
41247
|
*
|
|
@@ -41585,7 +41249,7 @@ const KeyProto$2 = /*#__PURE__*/ redactedProto(TypeId$41, "Cipher.Key");
|
|
|
41585
41249
|
* @category guards
|
|
41586
41250
|
* @since 4.0.0
|
|
41587
41251
|
*/
|
|
41588
|
-
const isKey$2 = (u) => hasProperty(u, TypeId$
|
|
41252
|
+
const isKey$2 = (u) => hasProperty(u, TypeId$40);
|
|
41589
41253
|
/**
|
|
41590
41254
|
* Service that generates keys, encrypts, and decrypts without
|
|
41591
41255
|
* authentication.
|
|
@@ -42101,7 +41765,7 @@ var Mac_exports = /* @__PURE__ */ __exportAll({
|
|
|
42101
41765
|
timingSafeEqual: () => timingSafeEqual,
|
|
42102
41766
|
toBytes: () => toBytes$2
|
|
42103
41767
|
});
|
|
42104
|
-
const TypeId$
|
|
41768
|
+
const TypeId$39 = "~effect/crypto/Mac/Key";
|
|
42105
41769
|
/**
|
|
42106
41770
|
* HMAC with SHA-1, with a 20-byte tag.
|
|
42107
41771
|
*
|
|
@@ -42151,7 +41815,7 @@ const hmacSha512 = {
|
|
|
42151
41815
|
name: "hmacSha512",
|
|
42152
41816
|
hash: sha512
|
|
42153
41817
|
};
|
|
42154
|
-
const KeyProto$1 = /*#__PURE__*/ redactedProto(TypeId$
|
|
41818
|
+
const KeyProto$1 = /*#__PURE__*/ redactedProto(TypeId$39, "Mac.Key");
|
|
42155
41819
|
/**
|
|
42156
41820
|
* Checks whether a value is a {@link Key}.
|
|
42157
41821
|
*
|
|
@@ -42159,7 +41823,7 @@ const KeyProto$1 = /*#__PURE__*/ redactedProto(TypeId$40, "Mac.Key");
|
|
|
42159
41823
|
* @category guards
|
|
42160
41824
|
* @since 4.0.0
|
|
42161
41825
|
*/
|
|
42162
|
-
const isKey$1 = (u) => hasProperty(u, TypeId$
|
|
41826
|
+
const isKey$1 = (u) => hasProperty(u, TypeId$39);
|
|
42163
41827
|
const blockSizes = {
|
|
42164
41828
|
"MD5": 64,
|
|
42165
41829
|
"SHA-1": 64,
|
|
@@ -43236,7 +42900,6 @@ var HashMapIterator = class {
|
|
|
43236
42900
|
}
|
|
43237
42901
|
};
|
|
43238
42902
|
const toEntry = (key, value) => [key, value];
|
|
43239
|
-
const toValue = (_, value) => value;
|
|
43240
42903
|
/** @internal */
|
|
43241
42904
|
var HashMapImpl = class {
|
|
43242
42905
|
[HashMapTypeId] = HashMapTypeId;
|
|
@@ -43261,7 +42924,7 @@ var HashMapImpl = class {
|
|
|
43261
42924
|
const thatImpl = that;
|
|
43262
42925
|
if (this.size !== thatImpl.size) return false;
|
|
43263
42926
|
for (const [key, value] of this) {
|
|
43264
|
-
const otherValue = pipe(that, get$
|
|
42927
|
+
const otherValue = pipe(that, get$2(key));
|
|
43265
42928
|
if (isNone(otherValue) || !equals$1(value, otherValue.value)) return false;
|
|
43266
42929
|
}
|
|
43267
42930
|
return true;
|
|
@@ -43292,9 +42955,9 @@ const emptyNode = /*#__PURE__*/ new EmptyNode();
|
|
|
43292
42955
|
/** @internal */
|
|
43293
42956
|
const isHashMap$1 = (u) => hasProperty(u, HashMapTypeId);
|
|
43294
42957
|
/** @internal */
|
|
43295
|
-
const empty$
|
|
42958
|
+
const empty$6 = () => new HashMapImpl(false, 0, emptyNode, 0);
|
|
43296
42959
|
/** @internal */
|
|
43297
|
-
const get$
|
|
42960
|
+
const get$2 = /*#__PURE__*/ dual(2, (self, key) => {
|
|
43298
42961
|
return self._root.get(0, hash(key), key);
|
|
43299
42962
|
});
|
|
43300
42963
|
/** @internal */
|
|
@@ -43321,43 +42984,7 @@ const set$1 = /*#__PURE__*/ dual(3, (self, key, value) => {
|
|
|
43321
42984
|
/** @internal */
|
|
43322
42985
|
const keys = (self) => new HashMapIterator(self._root, identity);
|
|
43323
42986
|
/** @internal */
|
|
43324
|
-
const
|
|
43325
|
-
/** @internal */
|
|
43326
|
-
const size$2 = (self) => self.size;
|
|
43327
|
-
/** @internal */
|
|
43328
|
-
const modifyAt = /*#__PURE__*/ dual(3, (self, key, f) => {
|
|
43329
|
-
const updated = f(get$3(self, key));
|
|
43330
|
-
if (isNone(updated)) return has$2(self, key) ? remove$2(self, key) : self;
|
|
43331
|
-
return set$1(self, key, updated.value);
|
|
43332
|
-
});
|
|
43333
|
-
/** @internal */
|
|
43334
|
-
const modify$3 = /*#__PURE__*/ dual(3, (self, key, f) => {
|
|
43335
|
-
return modifyAt(self, key, map$13(f));
|
|
43336
|
-
});
|
|
43337
|
-
const removeHash = (self, key, hash) => {
|
|
43338
|
-
const impl = self;
|
|
43339
|
-
const removed = { value: false };
|
|
43340
|
-
const edit = impl._editable ? impl._edit : NaN;
|
|
43341
|
-
const newRoot = impl._root.remove(edit, 0, hash, key, removed);
|
|
43342
|
-
if (!removed.value) return self;
|
|
43343
|
-
if (impl._editable) {
|
|
43344
|
-
impl._root = newRoot ?? emptyNode;
|
|
43345
|
-
impl._size--;
|
|
43346
|
-
return self;
|
|
43347
|
-
}
|
|
43348
|
-
if (newRoot === void 0) return empty$7();
|
|
43349
|
-
return new HashMapImpl(false, impl._edit, newRoot, impl._size - 1);
|
|
43350
|
-
};
|
|
43351
|
-
/** @internal */
|
|
43352
|
-
const remove$2 = /*#__PURE__*/ dual(2, (self, key) => {
|
|
43353
|
-
return removeHash(self, key, hash(key));
|
|
43354
|
-
});
|
|
43355
|
-
/** @internal */
|
|
43356
|
-
const filter$2 = /*#__PURE__*/ dual(2, (self, f) => {
|
|
43357
|
-
let result = empty$7();
|
|
43358
|
-
for (const [key, value] of self) if (f(value, key)) result = set$1(result, key, value);
|
|
43359
|
-
return result;
|
|
43360
|
-
});
|
|
42987
|
+
const size$1 = (self) => self.size;
|
|
43361
42988
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/HashMap.js
|
|
43362
42989
|
/**
|
|
43363
42990
|
* Stores key/value entries in an immutable hash map.
|
|
@@ -43392,192 +43019,6 @@ const filter$2 = /*#__PURE__*/ dual(2, (self, f) => {
|
|
|
43392
43019
|
* @since 2.0.0
|
|
43393
43020
|
*/
|
|
43394
43021
|
const isHashMap = isHashMap$1;
|
|
43395
|
-
/**
|
|
43396
|
-
* Creates a new empty `HashMap`.
|
|
43397
|
-
*
|
|
43398
|
-
* **Example** (Creating an empty HashMap)
|
|
43399
|
-
*
|
|
43400
|
-
* ```ts import.meta.vitest
|
|
43401
|
-
* import { HashMap } from "effect"
|
|
43402
|
-
*
|
|
43403
|
-
* HashMap.empty<string, number>() // => HashMap.empty()
|
|
43404
|
-
* ```
|
|
43405
|
-
*
|
|
43406
|
-
* @stability stable
|
|
43407
|
-
* @category constructors
|
|
43408
|
-
* @since 2.0.0
|
|
43409
|
-
*/
|
|
43410
|
-
const empty$6 = empty$7;
|
|
43411
|
-
/**
|
|
43412
|
-
* Looks up the value for the specified key in the `HashMap` safely using the
|
|
43413
|
-
* internal hashing function.
|
|
43414
|
-
*
|
|
43415
|
-
* **Example** (Looking up values)
|
|
43416
|
-
*
|
|
43417
|
-
* ```ts import.meta.vitest
|
|
43418
|
-
* import { HashMap, Option } from "effect"
|
|
43419
|
-
*
|
|
43420
|
-
* const map = HashMap.make(["a", 1], ["b", 2])
|
|
43421
|
-
*
|
|
43422
|
-
* HashMap.get(map, "a") // => Option.some(1)
|
|
43423
|
-
* HashMap.get(map, "c") // => Option.none()
|
|
43424
|
-
*
|
|
43425
|
-
* // Using pipe syntax
|
|
43426
|
-
* HashMap.get("b")(map) // => Option.some(2)
|
|
43427
|
-
* ```
|
|
43428
|
-
*
|
|
43429
|
-
* @stability stable
|
|
43430
|
-
* @category getters
|
|
43431
|
-
* @since 2.0.0
|
|
43432
|
-
*/
|
|
43433
|
-
const get$2 = get$3;
|
|
43434
|
-
/**
|
|
43435
|
-
* Sets the specified key to the specified value using the internal hashing
|
|
43436
|
-
* function.
|
|
43437
|
-
*
|
|
43438
|
-
* **Example** (Setting a value)
|
|
43439
|
-
*
|
|
43440
|
-
* ```ts import.meta.vitest
|
|
43441
|
-
* import { HashMap } from "effect"
|
|
43442
|
-
*
|
|
43443
|
-
* const map1 = HashMap.make(["a", 1])
|
|
43444
|
-
* HashMap.set(map1, "b", 2) // => HashMap.make(["a", 1], ["b", 2])
|
|
43445
|
-
*
|
|
43446
|
-
* // Original map is unchanged
|
|
43447
|
-
* map1 // => HashMap.make(["a", 1])
|
|
43448
|
-
* ```
|
|
43449
|
-
*
|
|
43450
|
-
* @stability stable
|
|
43451
|
-
* @category transforming
|
|
43452
|
-
* @since 2.0.0
|
|
43453
|
-
*/
|
|
43454
|
-
const set = set$1;
|
|
43455
|
-
/**
|
|
43456
|
-
* Returns an `IterableIterator` of the values within the `HashMap`.
|
|
43457
|
-
*
|
|
43458
|
-
* **Example** (Iterating values)
|
|
43459
|
-
*
|
|
43460
|
-
* ```ts import.meta.vitest
|
|
43461
|
-
* import { HashMap } from "effect"
|
|
43462
|
-
*
|
|
43463
|
-
* const map = HashMap.make(["a", 1], ["b", 2], ["c", 3])
|
|
43464
|
-
* Array.from(HashMap.values(map)).sort() // => [1, 2, 3]
|
|
43465
|
-
* ```
|
|
43466
|
-
*
|
|
43467
|
-
* @stability stable
|
|
43468
|
-
* @category getters
|
|
43469
|
-
* @since 2.0.0
|
|
43470
|
-
*/
|
|
43471
|
-
const values = values$1;
|
|
43472
|
-
/**
|
|
43473
|
-
* Returns an `Array` of the values within the `HashMap`.
|
|
43474
|
-
*
|
|
43475
|
-
* **Example** (Converting values to an array)
|
|
43476
|
-
*
|
|
43477
|
-
* ```ts import.meta.vitest
|
|
43478
|
-
* import { HashMap } from "effect"
|
|
43479
|
-
*
|
|
43480
|
-
* const employees = HashMap.make(
|
|
43481
|
-
* ["alice", { department: "engineering", salary: 90000 }],
|
|
43482
|
-
* ["bob", { department: "marketing", salary: 75000 }],
|
|
43483
|
-
* ["charlie", { department: "engineering", salary: 95000 }]
|
|
43484
|
-
* )
|
|
43485
|
-
*
|
|
43486
|
-
* // Extract all employee records
|
|
43487
|
-
* const allEmployees = HashMap.toValues(employees)
|
|
43488
|
-
* allEmployees.length // => 3
|
|
43489
|
-
*
|
|
43490
|
-
* // Calculate total salary
|
|
43491
|
-
* allEmployees.reduce((sum, emp) => sum + emp.salary, 0) // => 260000
|
|
43492
|
-
*
|
|
43493
|
-
* // Filter by department
|
|
43494
|
-
* allEmployees.filter((emp) => emp.department === "engineering").length // => 2
|
|
43495
|
-
* ```
|
|
43496
|
-
*
|
|
43497
|
-
* @stability stable
|
|
43498
|
-
* @category getters
|
|
43499
|
-
* @since 3.13.0
|
|
43500
|
-
*/
|
|
43501
|
-
const toValues = (self) => Array.from(values(self));
|
|
43502
|
-
/**
|
|
43503
|
-
* Returns the number of entries within the `HashMap`.
|
|
43504
|
-
*
|
|
43505
|
-
* **Example** (Getting the size)
|
|
43506
|
-
*
|
|
43507
|
-
* ```ts import.meta.vitest
|
|
43508
|
-
* import { HashMap } from "effect"
|
|
43509
|
-
*
|
|
43510
|
-
* const emptyMap = HashMap.empty<string, number>()
|
|
43511
|
-
* const map = HashMap.make(["a", 1], ["b", 2], ["c", 3])
|
|
43512
|
-
*
|
|
43513
|
-
* HashMap.size(emptyMap) // => 0
|
|
43514
|
-
* HashMap.size(map) // => 3
|
|
43515
|
-
* ```
|
|
43516
|
-
*
|
|
43517
|
-
* @stability stable
|
|
43518
|
-
* @category getters
|
|
43519
|
-
* @since 2.0.0
|
|
43520
|
-
*/
|
|
43521
|
-
const size$1 = size$2;
|
|
43522
|
-
/**
|
|
43523
|
-
* Updates the value of the specified key within the `HashMap` if it exists.
|
|
43524
|
-
*
|
|
43525
|
-
* **Example** (Modifying existing values)
|
|
43526
|
-
*
|
|
43527
|
-
* ```ts import.meta.vitest
|
|
43528
|
-
* import { HashMap, Option } from "effect"
|
|
43529
|
-
*
|
|
43530
|
-
* const map1 = HashMap.make(["a", 1], ["b", 2])
|
|
43531
|
-
* const map2 = HashMap.modify(map1, "a", (value) => value * 3)
|
|
43532
|
-
*
|
|
43533
|
-
* HashMap.get(map2, "a") // => Option.some(3)
|
|
43534
|
-
* HashMap.get(map2, "b") // => Option.some(2)
|
|
43535
|
-
* ```
|
|
43536
|
-
*
|
|
43537
|
-
* @stability stable
|
|
43538
|
-
* @category transforming
|
|
43539
|
-
* @since 2.0.0
|
|
43540
|
-
*/
|
|
43541
|
-
const modify$2 = modify$3;
|
|
43542
|
-
/**
|
|
43543
|
-
* Removes the entry for the specified key in the `HashMap` using the internal
|
|
43544
|
-
* hashing function.
|
|
43545
|
-
*
|
|
43546
|
-
* **Example** (Removing a key)
|
|
43547
|
-
*
|
|
43548
|
-
* ```ts import.meta.vitest
|
|
43549
|
-
* import { HashMap } from "effect"
|
|
43550
|
-
*
|
|
43551
|
-
* const map1 = HashMap.make(["a", 1], ["b", 2], ["c", 3])
|
|
43552
|
-
* const map2 = HashMap.remove(map1, "b")
|
|
43553
|
-
*
|
|
43554
|
-
* map2 // => HashMap.make(["a", 1], ["c", 3])
|
|
43555
|
-
* ```
|
|
43556
|
-
*
|
|
43557
|
-
* @stability stable
|
|
43558
|
-
* @category transforming
|
|
43559
|
-
* @since 2.0.0
|
|
43560
|
-
*/
|
|
43561
|
-
const remove$1 = remove$2;
|
|
43562
|
-
/**
|
|
43563
|
-
* Filters entries out of a `HashMap` using the specified predicate.
|
|
43564
|
-
*
|
|
43565
|
-
* **Example** (Filtering entries)
|
|
43566
|
-
*
|
|
43567
|
-
* ```ts import.meta.vitest
|
|
43568
|
-
* import { HashMap } from "effect"
|
|
43569
|
-
*
|
|
43570
|
-
* const map1 = HashMap.make(["a", 1], ["b", 2], ["c", 3], ["d", 4])
|
|
43571
|
-
* const map2 = HashMap.filter(map1, (value) => value % 2 === 0)
|
|
43572
|
-
*
|
|
43573
|
-
* map2 // => HashMap.make(["b", 2], ["d", 4])
|
|
43574
|
-
* ```
|
|
43575
|
-
*
|
|
43576
|
-
* @stability stable
|
|
43577
|
-
* @category filtering
|
|
43578
|
-
* @since 2.0.0
|
|
43579
|
-
*/
|
|
43580
|
-
const filter$1 = filter$2;
|
|
43581
43022
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/hashSet.js
|
|
43582
43023
|
/**
|
|
43583
43024
|
* @since 2.0.0
|
|
@@ -43623,14 +43064,14 @@ const isHashSet$1 = (u) => hasProperty(u, HashSetTypeId);
|
|
|
43623
43064
|
const keyMap = (self) => self.keyMap;
|
|
43624
43065
|
/** @internal */
|
|
43625
43066
|
const fromIterable$1 = (values) => {
|
|
43626
|
-
let map = empty$
|
|
43067
|
+
let map = empty$6();
|
|
43627
43068
|
for (const value of values) map = set$1(map, value, true);
|
|
43628
43069
|
return makeImpl(map);
|
|
43629
43070
|
};
|
|
43630
43071
|
/** @internal */
|
|
43631
43072
|
const has$1 = (self, value) => has$2(keyMap(self), value);
|
|
43632
43073
|
/** @internal */
|
|
43633
|
-
const size = (self) => size$
|
|
43074
|
+
const size = (self) => size$1(keyMap(self));
|
|
43634
43075
|
/** @internal */
|
|
43635
43076
|
const every = (self, predicate) => {
|
|
43636
43077
|
for (const value of self) if (!predicate(value)) return false;
|
|
@@ -43762,7 +43203,7 @@ const toPath = (url) => {
|
|
|
43762
43203
|
* @stability unstable
|
|
43763
43204
|
* @since 4.0.0
|
|
43764
43205
|
*/
|
|
43765
|
-
const TypeId$
|
|
43206
|
+
const TypeId$38 = "~effect/http/UrlParams";
|
|
43766
43207
|
/**
|
|
43767
43208
|
* Returns `true` when a value is a `UrlParams` instance.
|
|
43768
43209
|
*
|
|
@@ -43770,10 +43211,10 @@ const TypeId$39 = "~effect/http/UrlParams";
|
|
|
43770
43211
|
* @category guards
|
|
43771
43212
|
* @since 4.0.0
|
|
43772
43213
|
*/
|
|
43773
|
-
const isUrlParams = (u) => hasProperty(u, TypeId$
|
|
43774
|
-
const Proto$
|
|
43214
|
+
const isUrlParams = (u) => hasProperty(u, TypeId$38);
|
|
43215
|
+
const Proto$16 = {
|
|
43775
43216
|
...PipeInspectableProto,
|
|
43776
|
-
[TypeId$
|
|
43217
|
+
[TypeId$38]: TypeId$38,
|
|
43777
43218
|
[Symbol.iterator]() {
|
|
43778
43219
|
return this.params[Symbol.iterator]();
|
|
43779
43220
|
},
|
|
@@ -43805,7 +43246,7 @@ const Proto$17 = {
|
|
|
43805
43246
|
* @since 4.0.0
|
|
43806
43247
|
*/
|
|
43807
43248
|
const make$62 = (params) => {
|
|
43808
|
-
const self = Object.create(Proto$
|
|
43249
|
+
const self = Object.create(Proto$16);
|
|
43809
43250
|
self.params = params;
|
|
43810
43251
|
return self;
|
|
43811
43252
|
};
|
|
@@ -43993,7 +43434,7 @@ const decodeQueryKey = (key) => {
|
|
|
43993
43434
|
return key;
|
|
43994
43435
|
}
|
|
43995
43436
|
};
|
|
43996
|
-
const currentRedactedNames = () => get$8(globalThis["~effect/Fiber/currentFiber"]?.context ?? empty$
|
|
43437
|
+
const currentRedactedNames = () => get$8(globalThis["~effect/Fiber/currentFiber"]?.context ?? empty$16(), CurrentRedactedNames);
|
|
43997
43438
|
/**
|
|
43998
43439
|
* Query parameter names or patterns to redact in inspection, spans and errors.
|
|
43999
43440
|
*
|
|
@@ -44536,10 +43977,10 @@ const normalCompiler = (ast) => resolve(ast).parser;
|
|
|
44536
43977
|
const constructorCompiler = (ast) => resolve(ast).makeEffect;
|
|
44537
43978
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/schema/make.js
|
|
44538
43979
|
/** @internal */
|
|
44539
|
-
const TypeId$
|
|
43980
|
+
const TypeId$37 = "~effect/Schema/Schema";
|
|
44540
43981
|
const RebuildOptions = /*#__PURE__*/ Symbol();
|
|
44541
43982
|
const SchemaProto = {
|
|
44542
|
-
[TypeId$
|
|
43983
|
+
[TypeId$37]: TypeId$37,
|
|
44543
43984
|
get make() {
|
|
44544
43985
|
const value = make$61(this);
|
|
44545
43986
|
Object.defineProperty(this, "make", {
|
|
@@ -46018,7 +45459,7 @@ function isSchemaError$1(u) {
|
|
|
46018
45459
|
* @stability unstable
|
|
46019
45460
|
* @since 4.0.0
|
|
46020
45461
|
*/
|
|
46021
|
-
const TypeId$
|
|
45462
|
+
const TypeId$36 = "~effect/net/IpInterface";
|
|
46022
45463
|
/**
|
|
46023
45464
|
* Returns `true` when a value is an IP interface address.
|
|
46024
45465
|
*
|
|
@@ -46026,11 +45467,11 @@ const TypeId$37 = "~effect/net/IpInterface";
|
|
|
46026
45467
|
* @category guards
|
|
46027
45468
|
* @since 4.0.0
|
|
46028
45469
|
*/
|
|
46029
|
-
const isIpInterface = (u) => hasProperty(u, TypeId$
|
|
45470
|
+
const isIpInterface = (u) => hasProperty(u, TypeId$36);
|
|
46030
45471
|
const IpInterfaceProto = {
|
|
46031
45472
|
...BaseProto,
|
|
46032
45473
|
_tag: "IpInterface",
|
|
46033
|
-
[TypeId$
|
|
45474
|
+
[TypeId$36]: TypeId$36,
|
|
46034
45475
|
[symbol$2](that) {
|
|
46035
45476
|
return isIpInterface(that) && this.prefixLength === that.prefixLength && equals$1(this.address, that.address);
|
|
46036
45477
|
},
|
|
@@ -46106,7 +45547,7 @@ const format$1 = (self) => `${formatIp(self.address)}/${self.prefixLength}`;
|
|
|
46106
45547
|
* @stability unstable
|
|
46107
45548
|
* @since 4.0.0
|
|
46108
45549
|
*/
|
|
46109
|
-
const TypeId$
|
|
45550
|
+
const TypeId$35 = "~effect/net/IpNetwork";
|
|
46110
45551
|
/**
|
|
46111
45552
|
* Returns `true` when a value is an IPv4 or IPv6 network prefix.
|
|
46112
45553
|
*
|
|
@@ -46114,11 +45555,11 @@ const TypeId$36 = "~effect/net/IpNetwork";
|
|
|
46114
45555
|
* @category guards
|
|
46115
45556
|
* @since 4.0.0
|
|
46116
45557
|
*/
|
|
46117
|
-
const isIpNetwork = (u) => hasProperty(u, TypeId$
|
|
45558
|
+
const isIpNetwork = (u) => hasProperty(u, TypeId$35);
|
|
46118
45559
|
const IpNetworkProto = {
|
|
46119
45560
|
...BaseProto,
|
|
46120
45561
|
_tag: "IpNetwork",
|
|
46121
|
-
[TypeId$
|
|
45562
|
+
[TypeId$35]: TypeId$35,
|
|
46122
45563
|
[symbol$2](that) {
|
|
46123
45564
|
return isIpNetwork(that) && this.prefixLength === that.prefixLength && equals$1(this.address, that.address);
|
|
46124
45565
|
},
|
|
@@ -46226,7 +45667,7 @@ const contains = /*#__PURE__*/ dual(2, containsBytes);
|
|
|
46226
45667
|
* @stability stable
|
|
46227
45668
|
* @since 4.0.0
|
|
46228
45669
|
*/
|
|
46229
|
-
const TypeId$
|
|
45670
|
+
const TypeId$34 = TypeId$37;
|
|
46230
45671
|
/**
|
|
46231
45672
|
* Creates a schema for a **parametric** type (a generic container such as
|
|
46232
45673
|
* `Array<A>`, `Option<A>`, etc.) by accepting a list of type-parameter schemas
|
|
@@ -46827,7 +46268,7 @@ const make$57 = make$60;
|
|
|
46827
46268
|
* @since 3.10.0
|
|
46828
46269
|
*/
|
|
46829
46270
|
function isSchema(u) {
|
|
46830
|
-
return hasProperty(u, TypeId$
|
|
46271
|
+
return hasProperty(u, TypeId$34) && u[TypeId$34] === TypeId$34;
|
|
46831
46272
|
}
|
|
46832
46273
|
/**
|
|
46833
46274
|
* Creates an exact optional key schema for struct fields. Unlike `optional`,
|
|
@@ -47959,7 +47400,7 @@ const Finite = /*#__PURE__*/ make$57(finite);
|
|
|
47959
47400
|
* @since 4.0.0
|
|
47960
47401
|
*/
|
|
47961
47402
|
function makeIsGreaterThan(options) {
|
|
47962
|
-
const gt = isGreaterThan$
|
|
47403
|
+
const gt = isGreaterThan$1(options.order);
|
|
47963
47404
|
const formatter = options.formatter ?? format$4;
|
|
47964
47405
|
return (exclusiveMinimum, annotations) => {
|
|
47965
47406
|
return makeFilter((input) => gt(input, exclusiveMinimum), {
|
|
@@ -48007,7 +47448,7 @@ function makeIsGreaterThanOrEqualTo(options) {
|
|
|
48007
47448
|
*/
|
|
48008
47449
|
function makeIsBetween(deriveOptions) {
|
|
48009
47450
|
const greaterThanOrEqualTo = isGreaterThanOrEqualTo$2(deriveOptions.order);
|
|
48010
|
-
const greaterThan = isGreaterThan$
|
|
47451
|
+
const greaterThan = isGreaterThan$1(deriveOptions.order);
|
|
48011
47452
|
const lessThanOrEqualTo = isLessThanOrEqualTo$1(deriveOptions.order);
|
|
48012
47453
|
const lessThan = isLessThan$1(deriveOptions.order);
|
|
48013
47454
|
const formatter = deriveOptions.formatter ?? format$4;
|
|
@@ -49132,7 +48573,7 @@ function OptionFromOptionalNullOr(schema, options) {
|
|
|
49132
48573
|
const onNoneEncoding = options === void 0 ? "omit" : options.onNoneEncoding;
|
|
49133
48574
|
const noneValue = onNoneEncoding === null ? null : void 0;
|
|
49134
48575
|
return optional$8(NullOr(schema)).pipe(decodeTo(Option(toType(schema)), transformOptional({
|
|
49135
|
-
decode: (oe) => oe.pipe(filter$
|
|
48576
|
+
decode: (oe) => oe.pipe(filter$7(isNotNullish), some$1),
|
|
49136
48577
|
encode: onNoneEncoding === "omit" ? flatten$6 : (ot) => some$1(getOrElse(flatten$6(ot), () => noneValue))
|
|
49137
48578
|
})));
|
|
49138
48579
|
}
|
|
@@ -49213,7 +48654,7 @@ function makeClass(Inherited, identifier, struct$1, annotations, proto) {
|
|
|
49213
48654
|
}
|
|
49214
48655
|
});
|
|
49215
48656
|
}
|
|
49216
|
-
static [TypeId$
|
|
48657
|
+
static [TypeId$34] = TypeId$34;
|
|
49217
48658
|
get [ClassTypeId]() {
|
|
49218
48659
|
return ClassTypeId;
|
|
49219
48660
|
}
|
|
@@ -49615,7 +49056,7 @@ const MutableJson = /*#__PURE__*/ make$57(/*#__PURE__*/ annotate$1(MutableJson$1
|
|
|
49615
49056
|
Type: "Schema.MutableJson"
|
|
49616
49057
|
}) }));
|
|
49617
49058
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/HttpBody.js
|
|
49618
|
-
const TypeId$
|
|
49059
|
+
const TypeId$33 = "~effect/http/HttpBody";
|
|
49619
49060
|
const HttpBodyErrorTypeId = "~effect/http/HttpBody/HttpBodyError";
|
|
49620
49061
|
/**
|
|
49621
49062
|
* Error produced while constructing an HTTP body from JSON or schema-encoded input.
|
|
@@ -49633,10 +49074,10 @@ var HttpBodyError = class extends (/*#__PURE__*/ TaggedError$1("HttpBodyError"))
|
|
|
49633
49074
|
*/
|
|
49634
49075
|
[HttpBodyErrorTypeId] = HttpBodyErrorTypeId;
|
|
49635
49076
|
};
|
|
49636
|
-
var Proto$
|
|
49637
|
-
[TypeId$
|
|
49077
|
+
var Proto$15 = class {
|
|
49078
|
+
[TypeId$33];
|
|
49638
49079
|
constructor() {
|
|
49639
|
-
this[TypeId$
|
|
49080
|
+
this[TypeId$33] = TypeId$33;
|
|
49640
49081
|
}
|
|
49641
49082
|
[NodeInspectSymbol]() {
|
|
49642
49083
|
return this.toJSON();
|
|
@@ -49652,7 +49093,7 @@ var Proto$16 = class {
|
|
|
49652
49093
|
* @category models
|
|
49653
49094
|
* @since 4.0.0
|
|
49654
49095
|
*/
|
|
49655
|
-
var Empty$1 = class extends Proto$
|
|
49096
|
+
var Empty$1 = class extends Proto$15 {
|
|
49656
49097
|
_tag = "Empty";
|
|
49657
49098
|
toJSON() {
|
|
49658
49099
|
return {
|
|
@@ -49680,7 +49121,7 @@ const empty$4 = /*#__PURE__*/ new Empty$1();
|
|
|
49680
49121
|
* @category models
|
|
49681
49122
|
* @since 4.0.0
|
|
49682
49123
|
*/
|
|
49683
|
-
var Raw = class extends Proto$
|
|
49124
|
+
var Raw = class extends Proto$15 {
|
|
49684
49125
|
_tag = "Raw";
|
|
49685
49126
|
body;
|
|
49686
49127
|
contentType;
|
|
@@ -49720,7 +49161,7 @@ const raw$1 = (body, options) => new Raw(body, options?.contentType, options?.co
|
|
|
49720
49161
|
* @category models
|
|
49721
49162
|
* @since 4.0.0
|
|
49722
49163
|
*/
|
|
49723
|
-
var Uint8Array$1 = class extends Proto$
|
|
49164
|
+
var Uint8Array$1 = class extends Proto$15 {
|
|
49724
49165
|
_tag = "Uint8Array";
|
|
49725
49166
|
contentType;
|
|
49726
49167
|
contentLength;
|
|
@@ -49849,7 +49290,7 @@ const urlParams = (urlParams, contentType) => text$1(toString$1(fromInput(urlPar
|
|
|
49849
49290
|
* @category models
|
|
49850
49291
|
* @since 4.0.0
|
|
49851
49292
|
*/
|
|
49852
|
-
var FormData$1 = class extends Proto$
|
|
49293
|
+
var FormData$1 = class extends Proto$15 {
|
|
49853
49294
|
_tag = "FormData";
|
|
49854
49295
|
contentType = void 0;
|
|
49855
49296
|
contentLength = void 0;
|
|
@@ -49906,7 +49347,7 @@ const formDataRecord = (entries) => {
|
|
|
49906
49347
|
* @category models
|
|
49907
49348
|
* @since 4.0.0
|
|
49908
49349
|
*/
|
|
49909
|
-
var Stream$1 = class extends Proto$
|
|
49350
|
+
var Stream$1 = class extends Proto$15 {
|
|
49910
49351
|
_tag = "Stream";
|
|
49911
49352
|
stream;
|
|
49912
49353
|
contentType;
|
|
@@ -49951,7 +49392,7 @@ const stream$2 = (body, contentType, contentLength) => new Stream$1(body, conten
|
|
|
49951
49392
|
* @stability unstable
|
|
49952
49393
|
* @since 4.0.0
|
|
49953
49394
|
*/
|
|
49954
|
-
const TypeId$
|
|
49395
|
+
const TypeId$32 = "~effect/http/HttpClientError";
|
|
49955
49396
|
/**
|
|
49956
49397
|
* Returns `true` when a value is an `HttpClientError`.
|
|
49957
49398
|
*
|
|
@@ -49959,7 +49400,7 @@ const TypeId$33 = "~effect/http/HttpClientError";
|
|
|
49959
49400
|
* @category guards
|
|
49960
49401
|
* @since 4.0.0
|
|
49961
49402
|
*/
|
|
49962
|
-
const isHttpClientError = (u) => hasProperty(u, TypeId$
|
|
49403
|
+
const isHttpClientError = (u) => hasProperty(u, TypeId$32);
|
|
49963
49404
|
/**
|
|
49964
49405
|
* Error wrapper for HTTP client failures, exposing the failed request and the optional response through its `reason`.
|
|
49965
49406
|
*
|
|
@@ -49981,7 +49422,7 @@ var HttpClientError = class extends (/*#__PURE__*/ TaggedError$1("HttpClientErro
|
|
|
49981
49422
|
* @stability unstable
|
|
49982
49423
|
* @since 4.0.0
|
|
49983
49424
|
*/
|
|
49984
|
-
[TypeId$
|
|
49425
|
+
[TypeId$32] = TypeId$32;
|
|
49985
49426
|
/**
|
|
49986
49427
|
* HTTP request associated with the client failure.
|
|
49987
49428
|
*
|
|
@@ -50288,8 +49729,8 @@ const compressBody$1 = (body, algorithm, options) => {
|
|
|
50288
49729
|
* @internal
|
|
50289
49730
|
*/
|
|
50290
49731
|
const updateHeaders = (headers, body) => {
|
|
50291
|
-
if (body._tag === "Empty" || body._tag === "FormData") return remove$
|
|
50292
|
-
headers = body.contentType === void 0 ? remove$
|
|
49732
|
+
if (body._tag === "Empty" || body._tag === "FormData") return remove$1(remove$1(headers, "content-type"), "content-length");
|
|
49733
|
+
headers = body.contentType === void 0 ? remove$1(headers, "content-type") : set$2(headers, "content-type", body.contentType);
|
|
50293
49734
|
return updateContentLength(headers, body);
|
|
50294
49735
|
};
|
|
50295
49736
|
/**
|
|
@@ -50297,7 +49738,15 @@ const updateHeaders = (headers, body) => {
|
|
|
50297
49738
|
*/
|
|
50298
49739
|
const updateContentLength = (headers, body) => {
|
|
50299
49740
|
const contentLength = body._tag === "Empty" || body._tag === "FormData" ? void 0 : body.contentLength;
|
|
50300
|
-
return contentLength === void 0 ? remove$
|
|
49741
|
+
return contentLength === void 0 ? remove$1(headers, "content-length") : set$2(headers, "content-length", contentLength.toString());
|
|
49742
|
+
};
|
|
49743
|
+
/**
|
|
49744
|
+
* @internal
|
|
49745
|
+
*/
|
|
49746
|
+
const parseContentLength = (contentLength) => {
|
|
49747
|
+
if (contentLength === null || contentLength === void 0 || !/^\d+$/.test(contentLength)) return;
|
|
49748
|
+
const parsed = Number(contentLength);
|
|
49749
|
+
return Number.isSafeInteger(parsed) ? parsed : void 0;
|
|
50301
49750
|
};
|
|
50302
49751
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/Url.js
|
|
50303
49752
|
/**
|
|
@@ -50398,7 +49847,7 @@ const fromString = (url, base) => try_$2({
|
|
|
50398
49847
|
catch: () => new IllegalArgumentError(`Invalid URL: "${url}"${base !== void 0 ? ` with base "${base}"` : ""}`)
|
|
50399
49848
|
});
|
|
50400
49849
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/HttpClientRequest.js
|
|
50401
|
-
const TypeId$
|
|
49850
|
+
const TypeId$31 = "~effect/http/HttpClientRequest";
|
|
50402
49851
|
/**
|
|
50403
49852
|
* Returns `true` when a value is an `HttpClientRequest`.
|
|
50404
49853
|
*
|
|
@@ -50406,9 +49855,9 @@ const TypeId$32 = "~effect/http/HttpClientRequest";
|
|
|
50406
49855
|
* @category guards
|
|
50407
49856
|
* @since 4.0.0
|
|
50408
49857
|
*/
|
|
50409
|
-
const isHttpClientRequest = (u) => hasProperty(u, TypeId$
|
|
50410
|
-
const Proto$
|
|
50411
|
-
[TypeId$
|
|
49858
|
+
const isHttpClientRequest = (u) => hasProperty(u, TypeId$31);
|
|
49859
|
+
const Proto$14 = {
|
|
49860
|
+
[TypeId$31]: TypeId$31,
|
|
50412
49861
|
...BaseProto,
|
|
50413
49862
|
toJSON() {
|
|
50414
49863
|
return {
|
|
@@ -50433,7 +49882,7 @@ const Proto$15 = {
|
|
|
50433
49882
|
* @since 4.0.0
|
|
50434
49883
|
*/
|
|
50435
49884
|
function makeWith$2(method, url, urlParams, hash, headers, body) {
|
|
50436
|
-
const self = Object.create(Proto$
|
|
49885
|
+
const self = Object.create(Proto$14);
|
|
50437
49886
|
self.method = method;
|
|
50438
49887
|
self.url = url;
|
|
50439
49888
|
self.urlParams = urlParams;
|
|
@@ -50449,7 +49898,7 @@ function makeWith$2(method, url, urlParams, hash, headers, body) {
|
|
|
50449
49898
|
* @category constructors
|
|
50450
49899
|
* @since 4.0.0
|
|
50451
49900
|
*/
|
|
50452
|
-
const empty$3 = /*#__PURE__*/ makeWith$2("GET", "", empty$5, /*#__PURE__*/ none(), empty$
|
|
49901
|
+
const empty$3 = /*#__PURE__*/ makeWith$2("GET", "", empty$5, /*#__PURE__*/ none(), empty$7, empty$4);
|
|
50453
49902
|
/**
|
|
50454
49903
|
* Creates a request constructor for the specified HTTP method.
|
|
50455
49904
|
*
|
|
@@ -50457,7 +49906,7 @@ const empty$3 = /*#__PURE__*/ makeWith$2("GET", "", empty$5, /*#__PURE__*/ none(
|
|
|
50457
49906
|
* @category constructors
|
|
50458
49907
|
* @since 4.0.0
|
|
50459
49908
|
*/
|
|
50460
|
-
const make$55 = (method) => (url, options) => modify
|
|
49909
|
+
const make$55 = (method) => (url, options) => modify(empty$3, {
|
|
50461
49910
|
method,
|
|
50462
49911
|
url,
|
|
50463
49912
|
...options ?? void 0
|
|
@@ -50486,7 +49935,7 @@ const del = /*#__PURE__*/ make$55("DELETE");
|
|
|
50486
49935
|
* @category combinators
|
|
50487
49936
|
* @since 4.0.0
|
|
50488
49937
|
*/
|
|
50489
|
-
const modify
|
|
49938
|
+
const modify = /*#__PURE__*/ dual(2, (self, options) => {
|
|
50490
49939
|
let result = self;
|
|
50491
49940
|
if (options.method) result = setMethod(result, options.method);
|
|
50492
49941
|
if (options.url) result = setUrl(result, options.url);
|
|
@@ -50700,7 +50149,7 @@ function toUrl(self) {
|
|
|
50700
50149
|
* @category type IDs
|
|
50701
50150
|
* @since 4.0.0
|
|
50702
50151
|
*/
|
|
50703
|
-
const TypeId$
|
|
50152
|
+
const TypeId$30 = "~effect/http/HttpIncomingMessage";
|
|
50704
50153
|
/**
|
|
50705
50154
|
* Creates a decoder that reads an incoming message's JSON body and decodes it with the supplied schema.
|
|
50706
50155
|
*
|
|
@@ -50768,7 +50217,7 @@ const getWebSource = (self) => self[WebSourceSymbol]?.();
|
|
|
50768
50217
|
* @category type IDs
|
|
50769
50218
|
* @since 4.0.0
|
|
50770
50219
|
*/
|
|
50771
|
-
const TypeId$
|
|
50220
|
+
const TypeId$29 = "~effect/http/HttpClientResponse";
|
|
50772
50221
|
/**
|
|
50773
50222
|
* Wraps a Web `Response` and its original `HttpClientRequest` as an `HttpClientResponse`.
|
|
50774
50223
|
*
|
|
@@ -50806,16 +50255,16 @@ const filterStatusOk$1 = (self) => self.status >= 200 && self.status < 300 ? suc
|
|
|
50806
50255
|
description: "non 2xx status code"
|
|
50807
50256
|
}) }));
|
|
50808
50257
|
var WebHttpClientResponse = class extends Class$3 {
|
|
50809
|
-
[TypeId$31];
|
|
50810
50258
|
[TypeId$30];
|
|
50259
|
+
[TypeId$29];
|
|
50811
50260
|
request;
|
|
50812
50261
|
source;
|
|
50813
50262
|
constructor(request, source) {
|
|
50814
50263
|
super();
|
|
50815
50264
|
this.request = request;
|
|
50816
50265
|
this.source = source;
|
|
50817
|
-
this[TypeId$31] = TypeId$31;
|
|
50818
50266
|
this[TypeId$30] = TypeId$30;
|
|
50267
|
+
this[TypeId$29] = TypeId$29;
|
|
50819
50268
|
}
|
|
50820
50269
|
toJSON() {
|
|
50821
50270
|
return inspect(this, {
|
|
@@ -51087,7 +50536,7 @@ const addHeaderAttributes = (span, phase, headers, filter, redactedNames) => {
|
|
|
51087
50536
|
}
|
|
51088
50537
|
};
|
|
51089
50538
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/HttpClient.js
|
|
51090
|
-
const TypeId$
|
|
50539
|
+
const TypeId$28 = "~effect/http/HttpClient";
|
|
51091
50540
|
/**
|
|
51092
50541
|
* Service tag for the default outgoing HTTP client service.
|
|
51093
50542
|
*
|
|
@@ -51129,7 +50578,7 @@ const filterStatusOk = /*#__PURE__*/ transformResponse(/*#__PURE__*/ flatMap$3(f
|
|
|
51129
50578
|
* @since 4.0.0
|
|
51130
50579
|
*/
|
|
51131
50580
|
const makeWith$1 = (postprocess, preprocess) => {
|
|
51132
|
-
const self = Object.create(Proto$
|
|
50581
|
+
const self = Object.create(Proto$13);
|
|
51133
50582
|
self.preprocess = preprocess;
|
|
51134
50583
|
self.postprocess = postprocess;
|
|
51135
50584
|
self.execute = function(request) {
|
|
@@ -51137,8 +50586,8 @@ const makeWith$1 = (postprocess, preprocess) => {
|
|
|
51137
50586
|
};
|
|
51138
50587
|
return self;
|
|
51139
50588
|
};
|
|
51140
|
-
const Proto$
|
|
51141
|
-
[TypeId$
|
|
50589
|
+
const Proto$13 = {
|
|
50590
|
+
[TypeId$28]: TypeId$28,
|
|
51142
50591
|
pipe() {
|
|
51143
50592
|
return pipeArguments(this, arguments);
|
|
51144
50593
|
},
|
|
@@ -51390,8 +50839,8 @@ var InterruptibleResponse = class {
|
|
|
51390
50839
|
this.original = original;
|
|
51391
50840
|
this.controller = controller;
|
|
51392
50841
|
}
|
|
50842
|
+
[TypeId$29] = TypeId$29;
|
|
51393
50843
|
[TypeId$30] = TypeId$30;
|
|
51394
|
-
[TypeId$31] = TypeId$31;
|
|
51395
50844
|
applyInterrupt(effect) {
|
|
51396
50845
|
return suspend$3(() => {
|
|
51397
50846
|
responseRegistry.unregister(this.original);
|
|
@@ -52425,13 +51874,13 @@ const report = (cause) => withFiber((fiber) => {
|
|
|
52425
51874
|
*/
|
|
52426
51875
|
const ignore = "~effect/ErrorReporter/ignore";
|
|
52427
51876
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/internal/headers.js
|
|
52428
|
-
const Proto$
|
|
51877
|
+
const Proto$12 = /*#__PURE__*/ Object.getPrototypeOf(empty$7);
|
|
52429
51878
|
/**
|
|
52430
51879
|
* @internal
|
|
52431
51880
|
*/
|
|
52432
|
-
const emptyMutableUnsafe = () => Object.create(Proto$
|
|
51881
|
+
const emptyMutableUnsafe = () => Object.create(Proto$12);
|
|
52433
51882
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/HttpServerResponse.js
|
|
52434
|
-
const TypeId$
|
|
51883
|
+
const TypeId$27 = "~effect/http/HttpServerResponse";
|
|
52435
51884
|
/**
|
|
52436
51885
|
* Returns `true` when the supplied value is an `HttpServerResponse`.
|
|
52437
51886
|
*
|
|
@@ -52439,7 +51888,7 @@ const TypeId$28 = "~effect/http/HttpServerResponse";
|
|
|
52439
51888
|
* @category guards
|
|
52440
51889
|
* @since 4.0.0
|
|
52441
51890
|
*/
|
|
52442
|
-
const isHttpServerResponse = (u) => hasProperty(u, TypeId$
|
|
51891
|
+
const isHttpServerResponse = (u) => hasProperty(u, TypeId$27);
|
|
52443
51892
|
/**
|
|
52444
51893
|
* Creates an empty HTTP response.
|
|
52445
51894
|
*
|
|
@@ -52475,7 +51924,7 @@ const redirect = (location, options) => {
|
|
|
52475
51924
|
status: options?.status ?? 302,
|
|
52476
51925
|
statusText: options?.statusText,
|
|
52477
51926
|
headers: options?.headers ? merge(headers, fromInput$1(options.headers)) : headers,
|
|
52478
|
-
cookies: options?.cookies ?? empty$
|
|
51927
|
+
cookies: options?.cookies ?? empty$8
|
|
52479
51928
|
});
|
|
52480
51929
|
};
|
|
52481
51930
|
/**
|
|
@@ -52486,12 +51935,12 @@ const redirect = (location, options) => {
|
|
|
52486
51935
|
* @since 4.0.0
|
|
52487
51936
|
*/
|
|
52488
51937
|
const uint8Array = (body, options) => {
|
|
52489
|
-
const headers = options?.headers ? fromInput$1(options.headers) : empty$
|
|
51938
|
+
const headers = options?.headers ? fromInput$1(options.headers) : empty$7;
|
|
52490
51939
|
return makeResponse$2({
|
|
52491
51940
|
status: options?.status ?? 200,
|
|
52492
51941
|
statusText: options?.statusText,
|
|
52493
51942
|
headers,
|
|
52494
|
-
cookies: options?.cookies ?? empty$
|
|
51943
|
+
cookies: options?.cookies ?? empty$8,
|
|
52495
51944
|
body: uint8Array$1(body, getContentType(options, headers))
|
|
52496
51945
|
});
|
|
52497
51946
|
};
|
|
@@ -52507,12 +51956,12 @@ const getContentType = (options, headers) => {
|
|
|
52507
51956
|
* @since 4.0.0
|
|
52508
51957
|
*/
|
|
52509
51958
|
const text = (body, options) => {
|
|
52510
|
-
const headers = options?.headers ? fromInput$1(options.headers) : empty$
|
|
51959
|
+
const headers = options?.headers ? fromInput$1(options.headers) : empty$7;
|
|
52511
51960
|
return makeResponse$2({
|
|
52512
51961
|
status: options?.status ?? 200,
|
|
52513
51962
|
statusText: options?.statusText,
|
|
52514
51963
|
headers,
|
|
52515
|
-
cookies: options?.cookies ?? empty$
|
|
51964
|
+
cookies: options?.cookies ?? empty$8,
|
|
52516
51965
|
body: text$1(body, getContentType(options, headers))
|
|
52517
51966
|
});
|
|
52518
51967
|
};
|
|
@@ -52532,7 +51981,7 @@ const text = (body, options) => {
|
|
|
52532
51981
|
const schemaJson = (schema, options) => {
|
|
52533
51982
|
const encode = jsonSchema(schema, options);
|
|
52534
51983
|
return (body, options) => {
|
|
52535
|
-
const headers = options?.headers ? fromInput$1(options.headers) : empty$
|
|
51984
|
+
const headers = options?.headers ? fromInput$1(options.headers) : empty$7;
|
|
52536
51985
|
return map$7(encode(body, getContentType(options, headers)), (body) => makeResponse$2({
|
|
52537
51986
|
status: options?.status ?? 200,
|
|
52538
51987
|
statusText: options?.statusText,
|
|
@@ -52560,7 +52009,7 @@ const schemaJson = (schema, options) => {
|
|
|
52560
52009
|
* @since 4.0.0
|
|
52561
52010
|
*/
|
|
52562
52011
|
const jsonUnsafe = (body, options) => {
|
|
52563
|
-
const headers = options?.headers ? fromInput$1(options.headers) : empty$
|
|
52012
|
+
const headers = options?.headers ? fromInput$1(options.headers) : empty$7;
|
|
52564
52013
|
return makeResponse$2({
|
|
52565
52014
|
status: options?.status ?? 200,
|
|
52566
52015
|
statusText: options?.statusText,
|
|
@@ -52605,7 +52054,7 @@ const raw = (body, options) => makeResponse$2({
|
|
|
52605
52054
|
* @since 4.0.0
|
|
52606
52055
|
*/
|
|
52607
52056
|
const stream$1 = (body, options) => {
|
|
52608
|
-
const headers = options?.headers ? fromInput$1(options.headers) : empty$
|
|
52057
|
+
const headers = options?.headers ? fromInput$1(options.headers) : empty$7;
|
|
52609
52058
|
return makeResponse$2({
|
|
52610
52059
|
status: options?.status ?? 200,
|
|
52611
52060
|
statusText: options?.statusText,
|
|
@@ -52631,7 +52080,7 @@ const setHeader = /*#__PURE__*/ dual(3, (self, key, value) => makeResponse$2(sel
|
|
|
52631
52080
|
*/
|
|
52632
52081
|
const removeHeader = /*#__PURE__*/ dual(2, (self, key) => makeResponse$2({
|
|
52633
52082
|
...self,
|
|
52634
|
-
headers: remove$
|
|
52083
|
+
headers: remove$1(self.headers, key)
|
|
52635
52084
|
}));
|
|
52636
52085
|
/**
|
|
52637
52086
|
* Returns a response with all supplied headers set on the existing header map.
|
|
@@ -52656,7 +52105,7 @@ const setHeaders = /*#__PURE__*/ dual(2, (self, input) => makeResponse$2(self, s
|
|
|
52656
52105
|
*/
|
|
52657
52106
|
const setCookieUnsafe = /*#__PURE__*/ dual((args) => isHttpServerResponse(args[0]), (self, name, value, options) => makeResponse$2({
|
|
52658
52107
|
...self,
|
|
52659
|
-
cookies: setUnsafe
|
|
52108
|
+
cookies: setUnsafe(self.cookies, name, value, options)
|
|
52660
52109
|
}));
|
|
52661
52110
|
/**
|
|
52662
52111
|
* Sets an expired cookie on an `HttpServerResponse`, throwing if the expiration cookie
|
|
@@ -52716,9 +52165,31 @@ const setStatus = /*#__PURE__*/ dual((args) => isHttpServerResponse(args[0]), (s
|
|
|
52716
52165
|
* @since 4.0.0
|
|
52717
52166
|
*/
|
|
52718
52167
|
const omitsBody = (response, withoutBody = false) => withoutBody || response.status === 204 || response.status === 205 || response.status === 304;
|
|
52719
|
-
|
|
52168
|
+
/**
|
|
52169
|
+
* Converts an `HttpClientResponse` to an `HttpServerResponse`.
|
|
52170
|
+
*
|
|
52171
|
+
* **Details**
|
|
52172
|
+
*
|
|
52173
|
+
* The response body is streamed from the client response. `Set-Cookie` headers are
|
|
52174
|
+
* removed from the header map and represented in the response cookie collection.
|
|
52175
|
+
*
|
|
52176
|
+
* @stability unstable
|
|
52177
|
+
* @category converting
|
|
52178
|
+
* @since 4.0.0
|
|
52179
|
+
*/
|
|
52180
|
+
const fromClientResponse = (response) => {
|
|
52181
|
+
const headers = remove$1(response.headers, "set-cookie");
|
|
52182
|
+
return makeResponse$2({
|
|
52183
|
+
status: response.status,
|
|
52184
|
+
headers,
|
|
52185
|
+
cookies: response.cookies,
|
|
52186
|
+
body: stream$2(catchIf(response.stream, isEmptyBodyError, () => empty$9), getOrUndefined$1(get$3(headers, "content-type")), parseContentLength(headers["content-length"]))
|
|
52187
|
+
});
|
|
52188
|
+
};
|
|
52189
|
+
const isEmptyBodyError = (error) => isHttpClientError(error) && error.reason._tag === "EmptyBodyError";
|
|
52190
|
+
const Proto$11 = {
|
|
52720
52191
|
...PipeInspectableProto,
|
|
52721
|
-
[TypeId$
|
|
52192
|
+
[TypeId$27]: TypeId$27,
|
|
52722
52193
|
[ignore]: true,
|
|
52723
52194
|
toJSON() {
|
|
52724
52195
|
return {
|
|
@@ -52732,18 +52203,18 @@ const Proto$12 = {
|
|
|
52732
52203
|
}
|
|
52733
52204
|
};
|
|
52734
52205
|
const makeResponse$2 = (options, ownedHeaders) => {
|
|
52735
|
-
const self = Object.create(Proto$
|
|
52206
|
+
const self = Object.create(Proto$11);
|
|
52736
52207
|
self.status = options.status;
|
|
52737
52208
|
self.statusText = options.statusText;
|
|
52738
|
-
self.cookies = options.cookies ?? empty$
|
|
52209
|
+
self.cookies = options.cookies ?? empty$8;
|
|
52739
52210
|
self.body = options.body ?? empty$4;
|
|
52740
52211
|
if (self.body._tag !== "Empty" && (self.body.contentType || self.body.contentLength !== void 0)) {
|
|
52741
52212
|
const owned = ownedHeaders !== void 0;
|
|
52742
|
-
const newHeaders = owned ? ownedHeaders : options.headers === void 0 || options.headers === empty$
|
|
52213
|
+
const newHeaders = owned ? ownedHeaders : options.headers === void 0 || options.headers === empty$7 ? emptyMutableUnsafe() : fromRecordUnsafe({ ...options.headers });
|
|
52743
52214
|
if (self.body.contentType && (!owned || newHeaders["content-type"] === void 0)) newHeaders["content-type"] = self.body.contentType;
|
|
52744
52215
|
if (self.body.contentLength !== void 0 && (!owned || newHeaders["content-length"] === void 0)) newHeaders["content-length"] = self.body.contentLength.toString();
|
|
52745
52216
|
self.headers = newHeaders;
|
|
52746
|
-
} else self.headers = ownedHeaders ?? options.headers ?? empty$
|
|
52217
|
+
} else self.headers = ownedHeaders ?? options.headers ?? empty$7;
|
|
52747
52218
|
return self;
|
|
52748
52219
|
};
|
|
52749
52220
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/internal/compression.js
|
|
@@ -53382,7 +52853,7 @@ const make$51 = /*#__PURE__*/ fnUntraced(function* (impl) {
|
|
|
53382
52853
|
});
|
|
53383
52854
|
});
|
|
53384
52855
|
const optionHeaders = (options) => {
|
|
53385
|
-
const headers = options?.headers ? fromInput$1(options.headers) : empty$
|
|
52856
|
+
const headers = options?.headers ? fromInput$1(options.headers) : empty$7;
|
|
53386
52857
|
return options?.contentType ? set$2(headers, "content-type", options.contentType) : headers;
|
|
53387
52858
|
};
|
|
53388
52859
|
const fileResponseSize = (input, field) => {
|
|
@@ -53499,7 +52970,7 @@ const toResponseOrElseDefect = (u, orElse) => {
|
|
|
53499
52970
|
* @stability unstable
|
|
53500
52971
|
* @since 4.0.0
|
|
53501
52972
|
*/
|
|
53502
|
-
const TypeId$
|
|
52973
|
+
const TypeId$26 = "~effect/http/HttpServerError";
|
|
53503
52974
|
/**
|
|
53504
52975
|
* Tagged error for failures that occur while handling an HTTP server request.
|
|
53505
52976
|
*
|
|
@@ -53521,7 +52992,7 @@ var HttpServerError = class extends (/*#__PURE__*/ TaggedError$1("HttpServerErro
|
|
|
53521
52992
|
});
|
|
53522
52993
|
else super(props);
|
|
53523
52994
|
}
|
|
53524
|
-
[TypeId$
|
|
52995
|
+
[TypeId$26] = TypeId$26;
|
|
53525
52996
|
stack = `${this.name}: ${this.message}`;
|
|
53526
52997
|
get request() {
|
|
53527
52998
|
return this.reason.request;
|
|
@@ -53764,7 +53235,7 @@ const serverAbortError = /*#__PURE__*/ succeed$5(/*#__PURE__*/ empty$2({ status:
|
|
|
53764
53235
|
* @category type IDs
|
|
53765
53236
|
* @since 4.0.0
|
|
53766
53237
|
*/
|
|
53767
|
-
const TypeId$
|
|
53238
|
+
const TypeId$25 = "~effect/socket/Socket";
|
|
53768
53239
|
/**
|
|
53769
53240
|
* Service tag for bidirectional socket transports.
|
|
53770
53241
|
*
|
|
@@ -53792,7 +53263,7 @@ const Socket = /*#__PURE__*/ Service$1("effect/socket/Socket");
|
|
|
53792
53263
|
* @since 4.0.0
|
|
53793
53264
|
*/
|
|
53794
53265
|
const make$50 = (options) => Socket.of({
|
|
53795
|
-
[TypeId$
|
|
53266
|
+
[TypeId$25]: TypeId$25,
|
|
53796
53267
|
reader: options.reader,
|
|
53797
53268
|
writer: options.writer
|
|
53798
53269
|
});
|
|
@@ -54816,7 +54287,7 @@ const decodeField = decodeField$1;
|
|
|
54816
54287
|
* @category type IDs
|
|
54817
54288
|
* @since 4.0.0
|
|
54818
54289
|
*/
|
|
54819
|
-
const TypeId$
|
|
54290
|
+
const TypeId$24 = "~effect/http/Multipart";
|
|
54820
54291
|
const MultipartErrorTypeId = "~effect/http/Multipart/MultipartError";
|
|
54821
54292
|
const toMultipartError = (cause) => isMultipartError(cause) ? cause : MultipartError.fromReason("InternalError", cause);
|
|
54822
54293
|
/**
|
|
@@ -54931,10 +54402,10 @@ const makeConfig = (headers) => withFiber((fiber) => {
|
|
|
54931
54402
|
});
|
|
54932
54403
|
});
|
|
54933
54404
|
var PartBase$1 = class extends Class$3 {
|
|
54934
|
-
[TypeId$
|
|
54405
|
+
[TypeId$24];
|
|
54935
54406
|
constructor() {
|
|
54936
54407
|
super();
|
|
54937
|
-
this[TypeId$
|
|
54408
|
+
this[TypeId$24] = TypeId$24;
|
|
54938
54409
|
}
|
|
54939
54410
|
};
|
|
54940
54411
|
const defaultWriteFile = (path, file) => flatMap$3(FileSystem, (fs) => mapError$2(run$6(file.content, fs.sink(path)), toMultipartError));
|
|
@@ -55074,7 +54545,7 @@ const FieldMimeTypes = /*#__PURE__*/ Reference("effect/http/Multipart/FieldMimeT
|
|
|
55074
54545
|
* @category type IDs
|
|
55075
54546
|
* @since 4.0.0
|
|
55076
54547
|
*/
|
|
55077
|
-
const TypeId$
|
|
54548
|
+
const TypeId$23 = "~effect/http/HttpServerRequest";
|
|
55078
54549
|
/**
|
|
55079
54550
|
* Service tag for the active server-side HTTP request.
|
|
55080
54551
|
*
|
|
@@ -55728,7 +55199,7 @@ const withLogAddress = (layer) => effectDiscard(logAddress).pipe(provideMerge(la
|
|
|
55728
55199
|
* @stability unstable
|
|
55729
55200
|
* @since 4.0.0
|
|
55730
55201
|
*/
|
|
55731
|
-
const TypeId$
|
|
55202
|
+
const TypeId$22 = "~effect/http/HttpRouter";
|
|
55732
55203
|
/**
|
|
55733
55204
|
* Service tag for the HTTP router used while constructing an HTTP application.
|
|
55734
55205
|
* Route and middleware layers require this service to register themselves with
|
|
@@ -55784,7 +55255,7 @@ const make$43 = /*#__PURE__*/ gen(function* () {
|
|
|
55784
55255
|
return void_$2;
|
|
55785
55256
|
});
|
|
55786
55257
|
return HttpRouter.of({
|
|
55787
|
-
[TypeId$
|
|
55258
|
+
[TypeId$22]: TypeId$22,
|
|
55788
55259
|
prefixed(prefix) {
|
|
55789
55260
|
prefix = removeTrailingSlash(prefix);
|
|
55790
55261
|
return HttpRouter.of({
|
|
@@ -56127,7 +55598,7 @@ const middlewareCache = /*#__PURE__*/ new WeakMap();
|
|
|
56127
55598
|
const getMiddleware$1 = (context) => {
|
|
56128
55599
|
let arr = middlewareCache.get(context);
|
|
56129
55600
|
if (arr) return arr;
|
|
56130
|
-
const topLevel = empty$
|
|
55601
|
+
const topLevel = empty$13();
|
|
56131
55602
|
let maxLength = 0;
|
|
56132
55603
|
for (const [key, value] of context.mapUnsafe) if (key.startsWith("effect/http/HttpRouter/Middleware-")) {
|
|
56133
55604
|
topLevel.push(value);
|
|
@@ -56235,7 +55706,7 @@ const makeCollectorUnsafe = () => {
|
|
|
56235
55706
|
* @stability stable
|
|
56236
55707
|
* @since 2.0.0
|
|
56237
55708
|
*/
|
|
56238
|
-
const TypeId$
|
|
55709
|
+
const TypeId$21 = "~effect/FiberSet";
|
|
56239
55710
|
/**
|
|
56240
55711
|
* Checks whether a value is a FiberSet.
|
|
56241
55712
|
*
|
|
@@ -56258,11 +55729,11 @@ const TypeId$22 = "~effect/FiberSet";
|
|
|
56258
55729
|
* @category guards
|
|
56259
55730
|
* @since 2.0.0
|
|
56260
55731
|
*/
|
|
56261
|
-
const isFiberSet = (u) => hasProperty(u, TypeId$
|
|
56262
|
-
const Proto$
|
|
56263
|
-
[TypeId$
|
|
55732
|
+
const isFiberSet = (u) => hasProperty(u, TypeId$21);
|
|
55733
|
+
const Proto$10 = {
|
|
55734
|
+
[TypeId$21]: TypeId$21,
|
|
56264
55735
|
[Symbol.iterator]() {
|
|
56265
|
-
if (this.state._tag === "Closed") return empty$
|
|
55736
|
+
if (this.state._tag === "Closed") return empty$15();
|
|
56266
55737
|
return this.state.backing[Symbol.iterator]();
|
|
56267
55738
|
},
|
|
56268
55739
|
...PipeInspectableProto,
|
|
@@ -56274,7 +55745,7 @@ const Proto$11 = {
|
|
|
56274
55745
|
}
|
|
56275
55746
|
};
|
|
56276
55747
|
const makeUnsafe$1 = (backing, deferred) => {
|
|
56277
|
-
const self = Object.create(Proto$
|
|
55748
|
+
const self = Object.create(Proto$10);
|
|
56278
55749
|
self.state = {
|
|
56279
55750
|
_tag: "Open",
|
|
56280
55751
|
backing
|
|
@@ -56665,7 +56136,7 @@ var ClientAbort = class extends (/*#__PURE__*/ Service$1()("effect/rpc/RpcSchema
|
|
|
56665
56136
|
}));
|
|
56666
56137
|
};
|
|
56667
56138
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/rpc/Rpc.js
|
|
56668
|
-
const TypeId$
|
|
56139
|
+
const TypeId$20 = "~effect/rpc/Rpc";
|
|
56669
56140
|
/**
|
|
56670
56141
|
* Represents server-side metadata for the client associated with an RPC request.
|
|
56671
56142
|
*
|
|
@@ -56688,15 +56159,15 @@ var ServerClient = class {
|
|
|
56688
56159
|
annotations;
|
|
56689
56160
|
constructor(id) {
|
|
56690
56161
|
this.id = id;
|
|
56691
|
-
this.annotations = empty$
|
|
56162
|
+
this.annotations = empty$16();
|
|
56692
56163
|
}
|
|
56693
56164
|
annotate(tag, value) {
|
|
56694
56165
|
this.annotations = add$2(this.annotations, tag, value);
|
|
56695
56166
|
return this;
|
|
56696
56167
|
}
|
|
56697
56168
|
};
|
|
56698
|
-
const Proto$
|
|
56699
|
-
[TypeId$
|
|
56169
|
+
const Proto$9 = {
|
|
56170
|
+
[TypeId$20]: TypeId$20,
|
|
56700
56171
|
pipe() {
|
|
56701
56172
|
return pipeArguments(this, arguments);
|
|
56702
56173
|
},
|
|
@@ -56780,7 +56251,7 @@ const Proto$10 = {
|
|
|
56780
56251
|
};
|
|
56781
56252
|
const makeProto$2 = (options) => {
|
|
56782
56253
|
function Rpc() {}
|
|
56783
|
-
Object.setPrototypeOf(Rpc, Proto$
|
|
56254
|
+
Object.setPrototypeOf(Rpc, Proto$9);
|
|
56784
56255
|
Object.assign(Rpc, options);
|
|
56785
56256
|
Rpc.key = `effect/rpc/Rpc/${options._tag}`;
|
|
56786
56257
|
return Rpc;
|
|
@@ -56816,7 +56287,7 @@ const make$41 = (tag, options) => {
|
|
|
56816
56287
|
successSchema: options?.stream ? Stream(successSchema, errorSchema) : successSchema,
|
|
56817
56288
|
errorSchema: options?.stream ? Never : errorSchema,
|
|
56818
56289
|
defectSchema,
|
|
56819
|
-
annotations: empty$
|
|
56290
|
+
annotations: empty$16(),
|
|
56820
56291
|
middlewares: /* @__PURE__ */ new Set()
|
|
56821
56292
|
});
|
|
56822
56293
|
};
|
|
@@ -61259,8 +60730,8 @@ const makeNoSerialization$1 = /*#__PURE__*/ fnUntraced(function* (group, options
|
|
|
61259
60730
|
const isStream = isStreamSchema(rpc.successSchema);
|
|
61260
60731
|
const middleware = getRpcClientMiddleware(rpc);
|
|
61261
60732
|
return (payload, opts) => {
|
|
61262
|
-
const headers = opts?.headers ? fromInput$1(opts.headers) : empty$
|
|
61263
|
-
const context = opts?.context ?? empty$
|
|
60733
|
+
const headers = opts?.headers ? fromInput$1(opts.headers) : empty$7;
|
|
60734
|
+
const context = opts?.context ?? empty$16();
|
|
61264
60735
|
if (!isStream) {
|
|
61265
60736
|
const onRequest = (span) => onEffectRequest(rpc, middleware, span, rpc.payloadSchema.make(payload), headers, context, opts?.discard ?? false);
|
|
61266
60737
|
return disableTracing ? onRequest(void 0) : useSpan(spanName$1(spanPrefix, rpc._tag), {
|
|
@@ -61615,7 +61086,7 @@ const makeRpcSchemas = (codecFor) => {
|
|
|
61615
61086
|
* @category services
|
|
61616
61087
|
* @since 4.0.0
|
|
61617
61088
|
*/
|
|
61618
|
-
const CurrentHeaders = /*#__PURE__*/ Reference("effect/rpc/RpcClient/CurrentHeaders", { defaultValue: () => empty$
|
|
61089
|
+
const CurrentHeaders = /*#__PURE__*/ Reference("effect/rpc/RpcClient/CurrentHeaders", { defaultValue: () => empty$7 });
|
|
61619
61090
|
/**
|
|
61620
61091
|
* Defines the service interface for an RPC client transport, responsible for running the
|
|
61621
61092
|
* receive loop and sending encoded client messages.
|
|
@@ -62045,7 +61516,7 @@ const getErrorReported = (u) => {
|
|
|
62045
61516
|
* @category type IDs
|
|
62046
61517
|
* @since 4.0.0
|
|
62047
61518
|
*/
|
|
62048
|
-
const TypeId$
|
|
61519
|
+
const TypeId$19 = "~effect/Stdio";
|
|
62049
61520
|
/**
|
|
62050
61521
|
* Service tag for process standard I/O.
|
|
62051
61522
|
*
|
|
@@ -62061,7 +61532,7 @@ const TypeId$20 = "~effect/Stdio";
|
|
|
62061
61532
|
* @category services
|
|
62062
61533
|
* @since 4.0.0
|
|
62063
61534
|
*/
|
|
62064
|
-
const Stdio = /*#__PURE__*/ Service$1(TypeId$
|
|
61535
|
+
const Stdio = /*#__PURE__*/ Service$1(TypeId$19);
|
|
62065
61536
|
/**
|
|
62066
61537
|
* Creates a `Stdio` service implementation from the provided fields and
|
|
62067
61538
|
* attaches the `Stdio` type identifier.
|
|
@@ -62084,7 +61555,7 @@ const Stdio = /*#__PURE__*/ Service$1(TypeId$20);
|
|
|
62084
61555
|
* @since 4.0.0
|
|
62085
61556
|
*/
|
|
62086
61557
|
const make$39 = (options) => ({
|
|
62087
|
-
[TypeId$
|
|
61558
|
+
[TypeId$19]: TypeId$19,
|
|
62088
61559
|
stdinIsTerminal: succeed$5(false),
|
|
62089
61560
|
stdoutIsTerminal: succeed$5(false),
|
|
62090
61561
|
stderrIsTerminal: succeed$5(false),
|
|
@@ -63057,7 +62528,7 @@ const makeProto$1 = (options) => Object.assign(function() {}, RpcGroupProto, {
|
|
|
63057
62528
|
*/
|
|
63058
62529
|
const make$37 = (...rpcs) => makeProto$1({
|
|
63059
62530
|
requests: new Map(rpcs.map((rpc) => [rpc._tag, rpc])),
|
|
63060
|
-
annotations: empty$
|
|
62531
|
+
annotations: empty$16()
|
|
63061
62532
|
});
|
|
63062
62533
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ConfigProvider.js
|
|
63063
62534
|
/**
|
|
@@ -63218,7 +62689,7 @@ function makeArray(length, value) {
|
|
|
63218
62689
|
* @since 4.0.0
|
|
63219
62690
|
*/
|
|
63220
62691
|
const ConfigProvider = /*#__PURE__*/ Reference("effect/ConfigProvider", { defaultValue: () => fromEnv() });
|
|
63221
|
-
const Proto$
|
|
62692
|
+
const Proto$8 = {
|
|
63222
62693
|
...PipeInspectableProto,
|
|
63223
62694
|
toJSON() {
|
|
63224
62695
|
return { _id: "ConfigProvider" };
|
|
@@ -63226,7 +62697,7 @@ const Proto$9 = {
|
|
|
63226
62697
|
};
|
|
63227
62698
|
const identityPath = (path) => path;
|
|
63228
62699
|
function makeProvider(load, mapInput) {
|
|
63229
|
-
const self = Object.create(Proto$
|
|
62700
|
+
const self = Object.create(Proto$8);
|
|
63230
62701
|
self.load = load;
|
|
63231
62702
|
self.mapInput = mapInput;
|
|
63232
62703
|
return self;
|
|
@@ -63559,7 +63030,7 @@ function trieNodeAt(root, path) {
|
|
|
63559
63030
|
* @stability stable
|
|
63560
63031
|
* @since 4.0.0
|
|
63561
63032
|
*/
|
|
63562
|
-
const TypeId$
|
|
63033
|
+
const TypeId$18 = "~effect/Config";
|
|
63563
63034
|
/**
|
|
63564
63035
|
* Returns `true` if `u` is a `Config` instance.
|
|
63565
63036
|
*
|
|
@@ -63581,7 +63052,7 @@ const TypeId$19 = "~effect/Config";
|
|
|
63581
63052
|
* @category guards
|
|
63582
63053
|
* @since 2.0.0
|
|
63583
63054
|
*/
|
|
63584
|
-
const isConfig = (u) => hasProperty(u, TypeId$
|
|
63055
|
+
const isConfig = (u) => hasProperty(u, TypeId$18);
|
|
63585
63056
|
/**
|
|
63586
63057
|
* Represents the error type produced when config loading or validation fails.
|
|
63587
63058
|
*
|
|
@@ -63617,20 +63088,20 @@ var ConfigError = class {
|
|
|
63617
63088
|
return `ConfigError(${this.message})`;
|
|
63618
63089
|
}
|
|
63619
63090
|
};
|
|
63620
|
-
const Proto$
|
|
63091
|
+
const Proto$7 = {
|
|
63621
63092
|
.../*#__PURE__*/ Prototype({
|
|
63622
63093
|
label: "Config",
|
|
63623
63094
|
evaluate(fiber) {
|
|
63624
63095
|
return this.parse(fiber.getRef(ConfigProvider));
|
|
63625
63096
|
}
|
|
63626
63097
|
}),
|
|
63627
|
-
[TypeId$
|
|
63098
|
+
[TypeId$18]: TypeId$18,
|
|
63628
63099
|
toJSON() {
|
|
63629
63100
|
return { _id: "Config" };
|
|
63630
63101
|
}
|
|
63631
63102
|
};
|
|
63632
63103
|
function make$35(evaluator) {
|
|
63633
|
-
const self = Object.create(Proto$
|
|
63104
|
+
const self = Object.create(Proto$7);
|
|
63634
63105
|
self.evaluator = evaluator;
|
|
63635
63106
|
self.parse = (provider) => flatMapEager(evaluator(provider, []), fromResult);
|
|
63636
63107
|
return self;
|
|
@@ -64207,7 +63678,7 @@ const recordConnectionWait = (span, clock) => span.attribute("db.client.connecti
|
|
|
64207
63678
|
* @category type IDs
|
|
64208
63679
|
* @since 4.0.0
|
|
64209
63680
|
*/
|
|
64210
|
-
const TypeId$
|
|
63681
|
+
const TypeId$17 = "~effect/reactivity/Reactivity";
|
|
64211
63682
|
/**
|
|
64212
63683
|
* Service key for reactive invalidation.
|
|
64213
63684
|
*
|
|
@@ -64314,7 +63785,7 @@ const make$34 = /*#__PURE__*/ sync(() => {
|
|
|
64314
63785
|
return effect.pipe(provideService$2(PendingInvalidation, pending), onExit$1((_) => sync(() => runHandlers(pending))));
|
|
64315
63786
|
});
|
|
64316
63787
|
return Reactivity.of({
|
|
64317
|
-
[TypeId$
|
|
63788
|
+
[TypeId$17]: TypeId$17,
|
|
64318
63789
|
mutation,
|
|
64319
63790
|
query,
|
|
64320
63791
|
stream,
|
|
@@ -64379,7 +63850,7 @@ const keysToHashes = (keys, f) => {
|
|
|
64379
63850
|
* @stability unstable
|
|
64380
63851
|
* @since 4.0.0
|
|
64381
63852
|
*/
|
|
64382
|
-
const TypeId$
|
|
63853
|
+
const TypeId$16 = "~effect/sql/SqlError";
|
|
64383
63854
|
const ReasonTypeId$1 = "~effect/sql/SqlError/Reason";
|
|
64384
63855
|
const ReasonFields = {
|
|
64385
63856
|
cause: /*#__PURE__*/ Defect(),
|
|
@@ -64705,7 +64176,7 @@ var SqlError = class extends (/*#__PURE__*/ TaggedError("effect/sql/SqlError")("
|
|
|
64705
64176
|
* @stability unstable
|
|
64706
64177
|
* @since 4.0.0
|
|
64707
64178
|
*/
|
|
64708
|
-
[TypeId$
|
|
64179
|
+
[TypeId$16] = TypeId$16;
|
|
64709
64180
|
/**
|
|
64710
64181
|
* Exposes the structured SQL reason as the JavaScript error cause.
|
|
64711
64182
|
*
|
|
@@ -65528,7 +64999,7 @@ const isInLineComment = (sql, index) => sql.lastIndexOf("--", index) > sql.lastI
|
|
|
65528
64999
|
* @stability unstable
|
|
65529
65000
|
* @since 4.0.0
|
|
65530
65001
|
*/
|
|
65531
|
-
const TypeId$
|
|
65002
|
+
const TypeId$15 = "~effect/sql/SqlClient";
|
|
65532
65003
|
/**
|
|
65533
65004
|
* Service tag for the active SQL client service.
|
|
65534
65005
|
*
|
|
@@ -65590,7 +65061,7 @@ const make$32 = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
|
65590
65061
|
onSome: (transaction) => flatMap$3(activeTransactionConnection(transaction), f)
|
|
65591
65062
|
}));
|
|
65592
65063
|
const client = Object.assign(make$33(getConnection, options.compiler, options.spanAttributes, options.transformRows, borrower), {
|
|
65593
|
-
[TypeId$
|
|
65064
|
+
[TypeId$15]: TypeId$15,
|
|
65594
65065
|
safe: void 0,
|
|
65595
65066
|
withTransaction,
|
|
65596
65067
|
transactionService,
|
|
@@ -65650,7 +65121,7 @@ const makeSqliteAcquirers = (options) => {
|
|
|
65650
65121
|
}) });
|
|
65651
65122
|
const rollback = (conn) => {
|
|
65652
65123
|
if (isTransaction) return isTransaction(conn) ? asVoid(conn.executeUnprepared("ROLLBACK", [], void 0)) : void_$2;
|
|
65653
|
-
return conn.executeUnprepared("ROLLBACK", [], void 0).pipe(asVoid, catchIf(isNoTransactionError, () => void_$2));
|
|
65124
|
+
return conn.executeUnprepared("ROLLBACK", [], void 0).pipe(asVoid, catchIf$2(isNoTransactionError, () => void_$2));
|
|
65654
65125
|
};
|
|
65655
65126
|
const available = flatMap$3(options.connection, (conn) => {
|
|
65656
65127
|
if (poisoned === void 0) return succeed$5(conn);
|
|
@@ -65783,7 +65254,7 @@ const makeWithTransaction = (options) => {
|
|
|
65783
65254
|
controlSpan.attribute(ATTR_DB_OPERATION_NAME, operation);
|
|
65784
65255
|
return effect;
|
|
65785
65256
|
});
|
|
65786
|
-
const connOption = getOption(services, options.transactionService);
|
|
65257
|
+
const connOption = getOption$1(services, options.transactionService);
|
|
65787
65258
|
const conn = connOption._tag === "Some" ? map$7(suspend$3(() => activeTransactionConnection(connOption.value)), (conn) => [void 0, conn]) : flatMap$3(make$88(), (scope) => provide$3(options.acquireConnection(restore), scope).pipe(provideService$2(ParentSpan, span), map$7((conn) => {
|
|
65788
65259
|
if (waitedClock !== void 0) recordConnectionWait(span, waitedClock);
|
|
65789
65260
|
return [scope, conn];
|
|
@@ -70710,7 +70181,7 @@ var NodeHttpIncomingMessage = class extends Class$3 {
|
|
|
70710
70181
|
*
|
|
70711
70182
|
* @since 4.0.0
|
|
70712
70183
|
*/
|
|
70713
|
-
[TypeId$
|
|
70184
|
+
[TypeId$30];
|
|
70714
70185
|
source;
|
|
70715
70186
|
onError;
|
|
70716
70187
|
remoteAddressOverride;
|
|
@@ -70718,7 +70189,7 @@ var NodeHttpIncomingMessage = class extends Class$3 {
|
|
|
70718
70189
|
closeOnDone = true;
|
|
70719
70190
|
constructor(source, onError, remoteAddressOverride) {
|
|
70720
70191
|
super();
|
|
70721
|
-
this[TypeId$
|
|
70192
|
+
this[TypeId$30] = TypeId$30;
|
|
70722
70193
|
this.source = source;
|
|
70723
70194
|
this.onError = onError;
|
|
70724
70195
|
this.remoteAddressOverride = remoteAddressOverride;
|
|
@@ -70910,7 +70381,7 @@ const layer$15 = /*#__PURE__*/ layerMergedContext(/*#__PURE__*/ succeed$5(/* @__
|
|
|
70910
70381
|
const fetch = fiber.getRef(Fetch);
|
|
70911
70382
|
const options = getOrUndefined(fiber.context, RequestInit) ?? {};
|
|
70912
70383
|
let headers = options.headers ? merge(fromInput$1(options.headers), request.headers) : request.headers;
|
|
70913
|
-
if (headers["content-length"]) headers = remove$
|
|
70384
|
+
if (headers["content-length"]) headers = remove$1(headers, "content-length");
|
|
70914
70385
|
let uploadController;
|
|
70915
70386
|
const stopUpload = sync(() => uploadController?.abort());
|
|
70916
70387
|
const send = (body) => map$7(tryPromise({
|
|
@@ -71462,10 +70933,10 @@ const persisted = (source, headers) => toPersisted(stream(source, headers), (pat
|
|
|
71462
70933
|
}));
|
|
71463
70934
|
const convertPart = (part) => part._tag === "Field" ? new FieldImpl(part.info, part.value) : new FileImpl(part);
|
|
71464
70935
|
var PartBase = class extends Class$3 {
|
|
71465
|
-
[TypeId$
|
|
70936
|
+
[TypeId$24];
|
|
71466
70937
|
constructor() {
|
|
71467
70938
|
super();
|
|
71468
|
-
this[TypeId$
|
|
70939
|
+
this[TypeId$24] = TypeId$24;
|
|
71469
70940
|
}
|
|
71470
70941
|
};
|
|
71471
70942
|
var FieldImpl = class extends PartBase {
|
|
@@ -71649,7 +71120,7 @@ const layer$10 = /* @__PURE__ */ succeed$6(Stdio, /*#__PURE__*/ make$39({
|
|
|
71649
71120
|
})
|
|
71650
71121
|
}));
|
|
71651
71122
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Terminal.js
|
|
71652
|
-
const TypeId$
|
|
71123
|
+
const TypeId$14 = "~effect/Terminal";
|
|
71653
71124
|
const QuitErrorTypeId = "~effect/Terminal/QuitError";
|
|
71654
71125
|
/**
|
|
71655
71126
|
* Represents an error that occurs when a user attempts to
|
|
@@ -71728,7 +71199,7 @@ const Terminal = /*#__PURE__*/ Service$1("effect/Terminal");
|
|
|
71728
71199
|
*/
|
|
71729
71200
|
const make$27 = (impl) => Terminal.of({
|
|
71730
71201
|
...impl,
|
|
71731
|
-
[TypeId$
|
|
71202
|
+
[TypeId$14]: TypeId$14
|
|
71732
71203
|
});
|
|
71733
71204
|
/**
|
|
71734
71205
|
* Provides the default process-backed `Terminal` service, ending key input on
|
|
@@ -72241,7 +71712,7 @@ const bodyBytesRead = /*#__PURE__*/ new WeakMap();
|
|
|
72241
71712
|
var ServerRequestImpl = class ServerRequestImpl extends NodeHttpIncomingMessage {
|
|
72242
71713
|
destroyOnOverflow = false;
|
|
72243
71714
|
closeOnDone = false;
|
|
72244
|
-
[TypeId$
|
|
71715
|
+
[TypeId$23];
|
|
72245
71716
|
response;
|
|
72246
71717
|
upgradeState;
|
|
72247
71718
|
url;
|
|
@@ -72254,7 +71725,7 @@ var ServerRequestImpl = class ServerRequestImpl extends NodeHttpIncomingMessage
|
|
|
72254
71725
|
reason: cause instanceof MaxBytesError ? "BodyTooLarge" : "Parse",
|
|
72255
71726
|
cause
|
|
72256
71727
|
}) }), remoteAddressOverride);
|
|
72257
|
-
this[TypeId$
|
|
71728
|
+
this[TypeId$23] = TypeId$23;
|
|
72258
71729
|
this.response = response;
|
|
72259
71730
|
this.upgradeState = upgradeState;
|
|
72260
71731
|
if (url === void 0) {
|
|
@@ -72617,7 +72088,7 @@ const handleCause = (nodeResponse, originalResponse) => (originalCause) => flatM
|
|
|
72617
72088
|
* @stability stable
|
|
72618
72089
|
* @since 4.0.0
|
|
72619
72090
|
*/
|
|
72620
|
-
const TypeId$
|
|
72091
|
+
const TypeId$13 = "~effect/Cache";
|
|
72621
72092
|
/**
|
|
72622
72093
|
* Creates a cache with dynamic time-to-live based on the result and key.
|
|
72623
72094
|
*
|
|
@@ -72665,16 +72136,89 @@ const TypeId$14 = "~effect/Cache";
|
|
|
72665
72136
|
* @since 2.0.0
|
|
72666
72137
|
*/
|
|
72667
72138
|
const makeWith = (lookup, options) => contextWith$1((context) => {
|
|
72668
|
-
const self = Object.create(Proto$
|
|
72139
|
+
const self = Object.create(Proto$6);
|
|
72669
72140
|
self.lookup = (key) => updateContext$1(lookup(key), (input) => merge$4(context, input));
|
|
72670
72141
|
self.map = make$86();
|
|
72671
72142
|
self.capacity = options.capacity;
|
|
72672
72143
|
self.timeToLive = options.timeToLive ? (exit, key) => fromInputUnsafe$1(options.timeToLive(exit, key)) : defaultTimeToLive;
|
|
72673
72144
|
return succeed$9(self);
|
|
72674
72145
|
});
|
|
72675
|
-
|
|
72146
|
+
/**
|
|
72147
|
+
* Creates a cache with a fixed time-to-live for all entries.
|
|
72148
|
+
*
|
|
72149
|
+
* **Details**
|
|
72150
|
+
*
|
|
72151
|
+
* This is the basic cache constructor where all entries share the same TTL.
|
|
72152
|
+
* The lookup function will be called when a key is not found or has expired.
|
|
72153
|
+
*
|
|
72154
|
+
* **Example** (Creating a basic cache)
|
|
72155
|
+
*
|
|
72156
|
+
* ```ts import.meta.vitest
|
|
72157
|
+
* import { Cache, Effect } from "effect"
|
|
72158
|
+
*
|
|
72159
|
+
* // Basic cache with string keys
|
|
72160
|
+
* const program = Effect.gen(function*() {
|
|
72161
|
+
* const cache = yield* Cache.make<string, number>({
|
|
72162
|
+
* capacity: 100,
|
|
72163
|
+
* lookup: (key) => Effect.succeed(key.length)
|
|
72164
|
+
* })
|
|
72165
|
+
*
|
|
72166
|
+
* const result1 = yield* Cache.get(cache, "hello")
|
|
72167
|
+
* const result2 = yield* Cache.get(cache, "world")
|
|
72168
|
+
* return { result1, result2 }
|
|
72169
|
+
* })
|
|
72170
|
+
*
|
|
72171
|
+
* const actual = await Effect.runPromise(program)
|
|
72172
|
+
* actual // => { result1: 5, result2: 5 }
|
|
72173
|
+
* ```
|
|
72174
|
+
*
|
|
72175
|
+
* **Example** (Creating a cache with TTL)
|
|
72176
|
+
*
|
|
72177
|
+
* ```ts import.meta.vitest
|
|
72178
|
+
* import { Cache, Effect } from "effect"
|
|
72179
|
+
*
|
|
72180
|
+
* const program = Effect.gen(function*() {
|
|
72181
|
+
* const users = new Map([
|
|
72182
|
+
* [123, { name: "Ada", email: "ada@example.com" }],
|
|
72183
|
+
* [456, { name: "Grace", email: "grace@example.com" }]
|
|
72184
|
+
* ])
|
|
72185
|
+
*
|
|
72186
|
+
* const cache = yield* Cache.make<
|
|
72187
|
+
* number,
|
|
72188
|
+
* { name: string; email: string },
|
|
72189
|
+
* string
|
|
72190
|
+
* >({
|
|
72191
|
+
* capacity: 500,
|
|
72192
|
+
* lookup: (userId) =>
|
|
72193
|
+
* Effect.suspend(() => {
|
|
72194
|
+
* const user = users.get(userId)
|
|
72195
|
+
* return user === undefined
|
|
72196
|
+
* ? Effect.fail(`User ${userId} not found`)
|
|
72197
|
+
* : Effect.succeed(user)
|
|
72198
|
+
* }),
|
|
72199
|
+
* timeToLive: "15 minutes"
|
|
72200
|
+
* })
|
|
72201
|
+
*
|
|
72202
|
+
* const user1 = yield* Cache.get(cache, 123)
|
|
72203
|
+
* const user2 = yield* Cache.get(cache, 123)
|
|
72204
|
+
* return [user1, user2, user1 === user2] as const
|
|
72205
|
+
* })
|
|
72206
|
+
*
|
|
72207
|
+
* const actual = await Effect.runPromise(program)
|
|
72208
|
+
* actual // => [{ name: "Ada", email: "ada@example.com" }, { name: "Ada", email: "ada@example.com" }, true]
|
|
72209
|
+
* ```
|
|
72210
|
+
*
|
|
72211
|
+
* @stability stable
|
|
72212
|
+
* @category constructors
|
|
72213
|
+
* @since 2.0.0
|
|
72214
|
+
*/
|
|
72215
|
+
const make$24 = (options) => makeWith(options.lookup, {
|
|
72216
|
+
...options,
|
|
72217
|
+
timeToLive: options.timeToLive !== void 0 ? () => options.timeToLive : defaultTimeToLive
|
|
72218
|
+
});
|
|
72219
|
+
const Proto$6 = {
|
|
72676
72220
|
...PipeInspectableProto,
|
|
72677
|
-
[TypeId$
|
|
72221
|
+
[TypeId$13]: TypeId$13,
|
|
72678
72222
|
toJSON() {
|
|
72679
72223
|
return {
|
|
72680
72224
|
_id: "Cache",
|
|
@@ -72783,7 +72327,7 @@ const defaultTimeToLive = (_, _key) => infinity;
|
|
|
72783
72327
|
const get = /*#__PURE__*/ dual(2, (self, key) => withFiber$1((fiber) => {
|
|
72784
72328
|
const oentry = get$7(self.map, key);
|
|
72785
72329
|
if (isSome(oentry)) {
|
|
72786
|
-
remove$
|
|
72330
|
+
remove$3(self.map, key);
|
|
72787
72331
|
if (!hasExpired(oentry.value, fiber)) {
|
|
72788
72332
|
set$4(self.map, key, oentry.value);
|
|
72789
72333
|
return oentry.value.await(fiber);
|
|
@@ -72835,21 +72379,317 @@ var EntryImpl = class {
|
|
|
72835
72379
|
};
|
|
72836
72380
|
const removeEntry = (self, key, entry) => {
|
|
72837
72381
|
const current = get$7(self.map, key);
|
|
72838
|
-
if (isSome(current) && current.value === entry) remove$
|
|
72382
|
+
if (isSome(current) && current.value === entry) remove$3(self.map, key);
|
|
72839
72383
|
};
|
|
72840
72384
|
const hasExpired = (entry, fiber) => {
|
|
72841
72385
|
if (entry.expiresAt === void 0) return false;
|
|
72842
72386
|
return fiber.getRef(ClockRef).currentTimeMillisUnsafe() >= entry.expiresAt;
|
|
72843
72387
|
};
|
|
72844
72388
|
const checkCapacity = (self) => {
|
|
72845
|
-
let diff = size$
|
|
72389
|
+
let diff = size$2(self.map) - self.capacity;
|
|
72846
72390
|
if (diff <= 0) return;
|
|
72847
72391
|
for (const [key] of self.map) {
|
|
72848
|
-
remove$
|
|
72392
|
+
remove$3(self.map, key);
|
|
72849
72393
|
diff--;
|
|
72850
72394
|
if (diff === 0) return;
|
|
72851
72395
|
}
|
|
72852
72396
|
};
|
|
72397
|
+
/**
|
|
72398
|
+
* Reads an existing cache entry without invoking the lookup function.
|
|
72399
|
+
*
|
|
72400
|
+
* **Details**
|
|
72401
|
+
*
|
|
72402
|
+
* Returns `Option.none()` when the key is missing or expired, and `Option.some`
|
|
72403
|
+
* when a cached lookup has succeeded. If the entry is still pending, waits for
|
|
72404
|
+
* it to complete. If the cached or pending lookup fails, this effect fails with
|
|
72405
|
+
* the same error.
|
|
72406
|
+
*
|
|
72407
|
+
* **Example** (Reading cached values without lookup)
|
|
72408
|
+
*
|
|
72409
|
+
* ```ts import.meta.vitest
|
|
72410
|
+
* import { Cache, Effect, Option } from "effect"
|
|
72411
|
+
*
|
|
72412
|
+
* const program = Effect.gen(function*() {
|
|
72413
|
+
* const cache = yield* Cache.make({
|
|
72414
|
+
* capacity: 10,
|
|
72415
|
+
* lookup: (key: string) => Effect.succeed(key.length)
|
|
72416
|
+
* })
|
|
72417
|
+
*
|
|
72418
|
+
* // No value in cache yet - returns None without lookup
|
|
72419
|
+
* const empty = yield* Cache.getOption(cache, "hello")
|
|
72420
|
+
*
|
|
72421
|
+
* // Populate cache using get
|
|
72422
|
+
* yield* Cache.get(cache, "hello")
|
|
72423
|
+
*
|
|
72424
|
+
* // Now getOption returns the cached value
|
|
72425
|
+
* const cached = yield* Cache.getOption(cache, "hello")
|
|
72426
|
+
* return [empty, cached] as const
|
|
72427
|
+
* })
|
|
72428
|
+
*
|
|
72429
|
+
* const actual = await Effect.runPromise(program)
|
|
72430
|
+
* actual // => [Option.none(), Option.some(5)]
|
|
72431
|
+
* ```
|
|
72432
|
+
*
|
|
72433
|
+
* **Example** (Skipping expired entries)
|
|
72434
|
+
*
|
|
72435
|
+
* ```ts import.meta.vitest
|
|
72436
|
+
* import { Cache, Effect, Option } from "effect"
|
|
72437
|
+
* import { TestClock } from "effect/testing"
|
|
72438
|
+
*
|
|
72439
|
+
* // Expired entries return None
|
|
72440
|
+
* const program = Effect.gen(function*() {
|
|
72441
|
+
* const cache = yield* Cache.make({
|
|
72442
|
+
* capacity: 10,
|
|
72443
|
+
* lookup: (key: string) => Effect.succeed(key.length),
|
|
72444
|
+
* timeToLive: "1 hour"
|
|
72445
|
+
* })
|
|
72446
|
+
*
|
|
72447
|
+
* // Add value to cache
|
|
72448
|
+
* yield* Cache.get(cache, "hello")
|
|
72449
|
+
*
|
|
72450
|
+
* // Value exists before expiration
|
|
72451
|
+
* const beforeExpiry = yield* Cache.getOption(cache, "hello")
|
|
72452
|
+
*
|
|
72453
|
+
* // Simulate time passing
|
|
72454
|
+
* yield* TestClock.adjust("2 hours")
|
|
72455
|
+
*
|
|
72456
|
+
* // Value expired - returns None
|
|
72457
|
+
* const afterExpiry = yield* Cache.getOption(cache, "hello")
|
|
72458
|
+
* return [beforeExpiry, afterExpiry] as const
|
|
72459
|
+
* })
|
|
72460
|
+
*
|
|
72461
|
+
* const actual = await Effect.runPromise(Effect.provide(program, TestClock.layer()))
|
|
72462
|
+
* actual // => [Option.some(5), Option.none()]
|
|
72463
|
+
* ```
|
|
72464
|
+
*
|
|
72465
|
+
* **Example** (Waiting for pending lookups)
|
|
72466
|
+
*
|
|
72467
|
+
* ```ts import.meta.vitest
|
|
72468
|
+
* import { Cache, Deferred, Effect, Fiber, Option } from "effect"
|
|
72469
|
+
*
|
|
72470
|
+
* // Waits for ongoing computation to complete
|
|
72471
|
+
* const program = Effect.gen(function*() {
|
|
72472
|
+
* const deferred = yield* Deferred.make<void>()
|
|
72473
|
+
* const cache = yield* Cache.make({
|
|
72474
|
+
* capacity: 10,
|
|
72475
|
+
* lookup: (_key: string) => Deferred.await(deferred).pipe(Effect.as(42))
|
|
72476
|
+
* })
|
|
72477
|
+
*
|
|
72478
|
+
* // Start lookup in background
|
|
72479
|
+
* const getFiber = yield* Effect.forkChild(Cache.get(cache, "key"))
|
|
72480
|
+
*
|
|
72481
|
+
* // getOption waits for ongoing computation
|
|
72482
|
+
* const optionFiber = yield* Effect.forkChild(Cache.getOption(cache, "key"))
|
|
72483
|
+
*
|
|
72484
|
+
* // Complete the computation
|
|
72485
|
+
* yield* Deferred.succeed(deferred, void 0)
|
|
72486
|
+
*
|
|
72487
|
+
* const result = yield* Fiber.join(optionFiber)
|
|
72488
|
+
* const value = yield* Fiber.join(getFiber)
|
|
72489
|
+
* return [result, value] as const
|
|
72490
|
+
* })
|
|
72491
|
+
*
|
|
72492
|
+
* const actual = await Effect.runPromise(program)
|
|
72493
|
+
* actual // => [Option.some(42), 42]
|
|
72494
|
+
* ```
|
|
72495
|
+
*
|
|
72496
|
+
* @stability stable
|
|
72497
|
+
* @category combinators
|
|
72498
|
+
* @since 4.0.0
|
|
72499
|
+
*/
|
|
72500
|
+
const getOption = /*#__PURE__*/ dual(2, (self, key) => withFiber$1((fiber) => {
|
|
72501
|
+
const entry = getImpl(self, key, fiber);
|
|
72502
|
+
return entry ? asSome$1(entry.await(fiber)) : succeedNone$1;
|
|
72503
|
+
}));
|
|
72504
|
+
const getImpl = (self, key, fiber, isRead = true) => {
|
|
72505
|
+
const oentry = get$7(self.map, key);
|
|
72506
|
+
if (isNone(oentry)) return;
|
|
72507
|
+
else if (hasExpired(oentry.value, fiber)) {
|
|
72508
|
+
remove$3(self.map, key);
|
|
72509
|
+
return;
|
|
72510
|
+
} else if (isRead) {
|
|
72511
|
+
remove$3(self.map, key);
|
|
72512
|
+
set$4(self.map, key, oentry.value);
|
|
72513
|
+
}
|
|
72514
|
+
return oentry.value;
|
|
72515
|
+
};
|
|
72516
|
+
/**
|
|
72517
|
+
* Sets the value associated with the specified key in the cache. This will
|
|
72518
|
+
* overwrite any existing value for that key, skipping the lookup function.
|
|
72519
|
+
*
|
|
72520
|
+
* **Example** (Setting values directly)
|
|
72521
|
+
*
|
|
72522
|
+
* ```ts import.meta.vitest
|
|
72523
|
+
* import { Cache, Effect } from "effect"
|
|
72524
|
+
*
|
|
72525
|
+
* const program = Effect.gen(function*() {
|
|
72526
|
+
* const cache = yield* Cache.make({
|
|
72527
|
+
* capacity: 100,
|
|
72528
|
+
* lookup: (key: string) => Effect.succeed(key.length)
|
|
72529
|
+
* })
|
|
72530
|
+
*
|
|
72531
|
+
* // Set a value directly without invoking lookup
|
|
72532
|
+
* yield* Cache.set(cache, "hello", 42)
|
|
72533
|
+
* return yield* Cache.get(cache, "hello")
|
|
72534
|
+
* })
|
|
72535
|
+
*
|
|
72536
|
+
* const actual = await Effect.runPromise(program)
|
|
72537
|
+
* actual // => 42
|
|
72538
|
+
* ```
|
|
72539
|
+
*
|
|
72540
|
+
* **Example** (Overwriting cached values)
|
|
72541
|
+
*
|
|
72542
|
+
* ```ts import.meta.vitest
|
|
72543
|
+
* import { Cache, Effect } from "effect"
|
|
72544
|
+
*
|
|
72545
|
+
* // Overwriting existing cached values
|
|
72546
|
+
* const program = Effect.gen(function*() {
|
|
72547
|
+
* const cache = yield* Cache.make({
|
|
72548
|
+
* capacity: 100,
|
|
72549
|
+
* lookup: (key: string) => Effect.succeed(key.length)
|
|
72550
|
+
* })
|
|
72551
|
+
*
|
|
72552
|
+
* // First get populates via lookup
|
|
72553
|
+
* const original = yield* Cache.get(cache, "test") // 4
|
|
72554
|
+
*
|
|
72555
|
+
* // Set overwrites the cached value
|
|
72556
|
+
* yield* Cache.set(cache, "test", 999)
|
|
72557
|
+
* const updated = yield* Cache.get(cache, "test") // 999
|
|
72558
|
+
*
|
|
72559
|
+
* return { original, updated }
|
|
72560
|
+
* })
|
|
72561
|
+
*
|
|
72562
|
+
* const actual = await Effect.runPromise(program)
|
|
72563
|
+
* actual // => { original: 4, updated: 999 }
|
|
72564
|
+
* ```
|
|
72565
|
+
*
|
|
72566
|
+
* **Example** (Applying TTL to set values)
|
|
72567
|
+
*
|
|
72568
|
+
* ```ts import.meta.vitest
|
|
72569
|
+
* import { Cache, Effect } from "effect"
|
|
72570
|
+
* import { TestClock } from "effect/testing"
|
|
72571
|
+
*
|
|
72572
|
+
* // TTL behavior with set operations
|
|
72573
|
+
* const program = Effect.gen(function*() {
|
|
72574
|
+
* const cache = yield* Cache.make({
|
|
72575
|
+
* capacity: 100,
|
|
72576
|
+
* lookup: (key: string) => Effect.succeed(key.length),
|
|
72577
|
+
* timeToLive: "1 hour"
|
|
72578
|
+
* })
|
|
72579
|
+
*
|
|
72580
|
+
* // Set value with TTL applied
|
|
72581
|
+
* yield* Cache.set(cache, "temporary", 123)
|
|
72582
|
+
* const beforeExpiry = yield* Cache.has(cache, "temporary")
|
|
72583
|
+
*
|
|
72584
|
+
* // Advance time past TTL
|
|
72585
|
+
* yield* TestClock.adjust("2 hours")
|
|
72586
|
+
* const afterExpiry = yield* Cache.has(cache, "temporary")
|
|
72587
|
+
* return [beforeExpiry, afterExpiry]
|
|
72588
|
+
* })
|
|
72589
|
+
*
|
|
72590
|
+
* const actual = await Effect.runPromise(Effect.provide(program, TestClock.layer()))
|
|
72591
|
+
* actual // => [true, false]
|
|
72592
|
+
* ```
|
|
72593
|
+
*
|
|
72594
|
+
* **Example** (Enforcing capacity when setting values)
|
|
72595
|
+
*
|
|
72596
|
+
* ```ts import.meta.vitest
|
|
72597
|
+
* import { Cache, Effect } from "effect"
|
|
72598
|
+
*
|
|
72599
|
+
* // Capacity enforcement with set operations
|
|
72600
|
+
* const program = Effect.gen(function*() {
|
|
72601
|
+
* const cache = yield* Cache.make({
|
|
72602
|
+
* capacity: 2,
|
|
72603
|
+
* lookup: (key: string) => Effect.succeed(key.length)
|
|
72604
|
+
* })
|
|
72605
|
+
*
|
|
72606
|
+
* // Fill cache to capacity
|
|
72607
|
+
* yield* Cache.set(cache, "a", 1)
|
|
72608
|
+
* yield* Cache.set(cache, "b", 2)
|
|
72609
|
+
* const sizeBeforeEviction = yield* Cache.size(cache)
|
|
72610
|
+
*
|
|
72611
|
+
* // Adding another entry evicts oldest
|
|
72612
|
+
* yield* Cache.set(cache, "c", 3)
|
|
72613
|
+
* const sizeAfterEviction = yield* Cache.size(cache)
|
|
72614
|
+
* const hasOldest = yield* Cache.has(cache, "a")
|
|
72615
|
+
* const hasNewest = yield* Cache.has(cache, "c")
|
|
72616
|
+
* return [sizeBeforeEviction, sizeAfterEviction, hasOldest, hasNewest]
|
|
72617
|
+
* })
|
|
72618
|
+
*
|
|
72619
|
+
* const actual = await Effect.runPromise(program)
|
|
72620
|
+
* actual // => [2, 2, false, true]
|
|
72621
|
+
* ```
|
|
72622
|
+
*
|
|
72623
|
+
* @stability stable
|
|
72624
|
+
* @category combinators
|
|
72625
|
+
* @since 4.0.0
|
|
72626
|
+
*/
|
|
72627
|
+
const set = /*#__PURE__*/ dual(3, (self, key, value) => withFiber$1((fiber) => {
|
|
72628
|
+
const exit = exitSucceed(value);
|
|
72629
|
+
const entry = new EntryImpl(fiber, exit);
|
|
72630
|
+
const ttl = self.timeToLive(exit, key);
|
|
72631
|
+
if (isZero$1(ttl)) {
|
|
72632
|
+
remove$3(self.map, key);
|
|
72633
|
+
return void_$4;
|
|
72634
|
+
}
|
|
72635
|
+
entry.expiresAt = isFinite$2(ttl) ? fiber.getRef(ClockRef).currentTimeMillisUnsafe() + toMillis(ttl) : void 0;
|
|
72636
|
+
set$4(self.map, key, entry);
|
|
72637
|
+
checkCapacity(self);
|
|
72638
|
+
return void_$4;
|
|
72639
|
+
}));
|
|
72640
|
+
/**
|
|
72641
|
+
* Invalidates the entry associated with the specified key in the cache.
|
|
72642
|
+
*
|
|
72643
|
+
* **Example** (Invalidating cached entries)
|
|
72644
|
+
*
|
|
72645
|
+
* ```ts import.meta.vitest
|
|
72646
|
+
* import { Cache, Effect } from "effect"
|
|
72647
|
+
*
|
|
72648
|
+
* const program = Effect.gen(function*() {
|
|
72649
|
+
* const cache = yield* Cache.make({
|
|
72650
|
+
* capacity: 10,
|
|
72651
|
+
* lookup: (key: string) => Effect.succeed(key.length)
|
|
72652
|
+
* })
|
|
72653
|
+
*
|
|
72654
|
+
* // Add a value to the cache
|
|
72655
|
+
* yield* Cache.get(cache, "hello")
|
|
72656
|
+
* const beforeInvalidation = yield* Cache.has(cache, "hello")
|
|
72657
|
+
*
|
|
72658
|
+
* // Invalidate the entry
|
|
72659
|
+
* yield* Cache.invalidate(cache, "hello")
|
|
72660
|
+
* const afterInvalidation = yield* Cache.has(cache, "hello")
|
|
72661
|
+
*
|
|
72662
|
+
* // Invalidating non-existent keys doesn't error
|
|
72663
|
+
* yield* Cache.invalidate(cache, "nonexistent")
|
|
72664
|
+
*
|
|
72665
|
+
* // Get after invalidation will invoke lookup again
|
|
72666
|
+
* let lookupCount = 0
|
|
72667
|
+
* const cache2 = yield* Cache.make({
|
|
72668
|
+
* capacity: 10,
|
|
72669
|
+
* lookup: (key: string) =>
|
|
72670
|
+
* Effect.sync(() => {
|
|
72671
|
+
* lookupCount++
|
|
72672
|
+
* return key.length
|
|
72673
|
+
* })
|
|
72674
|
+
* })
|
|
72675
|
+
*
|
|
72676
|
+
* yield* Cache.get(cache2, "test") // lookupCount = 1
|
|
72677
|
+
* yield* Cache.invalidate(cache2, "test")
|
|
72678
|
+
* yield* Cache.get(cache2, "test") // lookupCount = 2 (lookup called again)
|
|
72679
|
+
* return { beforeInvalidation, afterInvalidation, lookupCount }
|
|
72680
|
+
* })
|
|
72681
|
+
*
|
|
72682
|
+
* const actual = await Effect.runPromise(program)
|
|
72683
|
+
* actual // => { beforeInvalidation: true, afterInvalidation: false, lookupCount: 2 }
|
|
72684
|
+
* ```
|
|
72685
|
+
*
|
|
72686
|
+
* @stability stable
|
|
72687
|
+
* @category combinators
|
|
72688
|
+
* @since 4.0.0
|
|
72689
|
+
*/
|
|
72690
|
+
const invalidate = /*#__PURE__*/ dual(2, (self, key) => sync$2(() => {
|
|
72691
|
+
remove$3(self.map, key);
|
|
72692
|
+
}));
|
|
72853
72693
|
// ../../node_modules/.pnpm/@effect+platform-node@4.1.4_effect@4.1.4_redis@6.3.1/node_modules/@effect/platform-node/dist/NodeRuntime.js
|
|
72854
72694
|
/**
|
|
72855
72695
|
* Node.js process runner for Effect programs.
|
|
@@ -73237,7 +73077,7 @@ const LogToStderr = LogToStderr$1;
|
|
|
73237
73077
|
* @category constructors
|
|
73238
73078
|
* @since 2.0.0
|
|
73239
73079
|
*/
|
|
73240
|
-
const make$
|
|
73080
|
+
const make$23 = loggerMake;
|
|
73241
73081
|
/**
|
|
73242
73082
|
* Creates a `Layer` which will overwrite the current set of loggers with the
|
|
73243
73083
|
* specified array of `loggers`.
|
|
@@ -73276,9 +73116,9 @@ const layer$5 = (loggers, options) => effect(CurrentLoggers, withFiber$1(fnUntra
|
|
|
73276
73116
|
})));
|
|
73277
73117
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/matcher.js
|
|
73278
73118
|
/** @internal */
|
|
73279
|
-
const TypeId$
|
|
73119
|
+
const TypeId$12 = "~effect/Match/Matcher";
|
|
73280
73120
|
const TypeMatcherProto = {
|
|
73281
|
-
[TypeId$
|
|
73121
|
+
[TypeId$12]: {
|
|
73282
73122
|
_input: identity,
|
|
73283
73123
|
_filters: identity,
|
|
73284
73124
|
_remaining: identity,
|
|
@@ -73301,7 +73141,7 @@ function makeTypeMatcher(select, cases) {
|
|
|
73301
73141
|
return matcher;
|
|
73302
73142
|
}
|
|
73303
73143
|
const ValueMatcherProto = {
|
|
73304
|
-
[TypeId$
|
|
73144
|
+
[TypeId$12]: {
|
|
73305
73145
|
_input: identity,
|
|
73306
73146
|
_filters: identity,
|
|
73307
73147
|
_result: identity,
|
|
@@ -73909,204 +73749,6 @@ const exhaustive = exhaustive$1;
|
|
|
73909
73749
|
* @since 4.0.0
|
|
73910
73750
|
*/
|
|
73911
73751
|
const map$2 = /*#__PURE__*/ dual(2, (self, f) => self === void 0 ? void 0 : f(self));
|
|
73912
|
-
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/SubscriptionRef.js
|
|
73913
|
-
/**
|
|
73914
|
-
* Stores mutable state and publishes changes as a stream.
|
|
73915
|
-
*
|
|
73916
|
-
* A `SubscriptionRef<A>` stores the latest value, publishes the initial value,
|
|
73917
|
-
* and publishes every committed update so subscribers can observe state over
|
|
73918
|
-
* time. Updates are serialized so only one change is applied at a time. This
|
|
73919
|
-
* module includes constructors, current-value reads, the `changes` stream,
|
|
73920
|
-
* writes, updates, partial updates, and effectful update helpers.
|
|
73921
|
-
*
|
|
73922
|
-
* @stability stable
|
|
73923
|
-
* @since 2.0.0
|
|
73924
|
-
*/
|
|
73925
|
-
const TypeId$12 = "~effect/SubscriptionRef";
|
|
73926
|
-
const Proto$6 = {
|
|
73927
|
-
...PipeInspectableProto,
|
|
73928
|
-
[TypeId$12]: { _A: identity },
|
|
73929
|
-
toJSON() {
|
|
73930
|
-
return {
|
|
73931
|
-
_id: "SubscriptionRef",
|
|
73932
|
-
value: this.value
|
|
73933
|
-
};
|
|
73934
|
-
}
|
|
73935
|
-
};
|
|
73936
|
-
/**
|
|
73937
|
-
* Constructs a new `SubscriptionRef` from an initial value.
|
|
73938
|
-
*
|
|
73939
|
-
* **When to use**
|
|
73940
|
-
*
|
|
73941
|
-
* Use to create a `SubscriptionRef` when consumers need to read the latest
|
|
73942
|
-
* value and subscribe to every update.
|
|
73943
|
-
*
|
|
73944
|
-
* **Details**
|
|
73945
|
-
*
|
|
73946
|
-
* The initial value is published during construction, so `changes` starts new
|
|
73947
|
-
* subscribers with that value before future updates.
|
|
73948
|
-
*
|
|
73949
|
-
* @see {@link changes} for streaming the current value and subsequent updates
|
|
73950
|
-
* @see {@link set} for replacing the value and notifying subscribers
|
|
73951
|
-
*
|
|
73952
|
-
* @stability stable
|
|
73953
|
-
* @category constructors
|
|
73954
|
-
* @since 2.0.0
|
|
73955
|
-
*/
|
|
73956
|
-
const make$23 = (value) => map$7(unbounded({ replay: 1 }), (pubsub) => {
|
|
73957
|
-
const self = Object.create(Proto$6);
|
|
73958
|
-
self.semaphore = makeUnsafe$4(1);
|
|
73959
|
-
self.value = value;
|
|
73960
|
-
self.pubsub = pubsub;
|
|
73961
|
-
publishUnsafe(self.pubsub, value);
|
|
73962
|
-
return self;
|
|
73963
|
-
});
|
|
73964
|
-
/**
|
|
73965
|
-
* Creates a stream that emits the current value and all subsequent changes to
|
|
73966
|
-
* the `SubscriptionRef`.
|
|
73967
|
-
*
|
|
73968
|
-
* **Details**
|
|
73969
|
-
*
|
|
73970
|
-
* The stream will first emit the current value, then emit all future changes
|
|
73971
|
-
* as they occur.
|
|
73972
|
-
*
|
|
73973
|
-
* **Example** (Streaming changes)
|
|
73974
|
-
*
|
|
73975
|
-
* ```ts import.meta.vitest
|
|
73976
|
-
* import { Deferred, Effect, Fiber, Stream, SubscriptionRef } from "effect"
|
|
73977
|
-
*
|
|
73978
|
-
* const program = Effect.gen(function*() {
|
|
73979
|
-
* const ref = yield* SubscriptionRef.make(0)
|
|
73980
|
-
* const ready = yield* Deferred.make<void>()
|
|
73981
|
-
*
|
|
73982
|
-
* const fiber = yield* SubscriptionRef.changes(ref).pipe(
|
|
73983
|
-
* Stream.tap(() => Deferred.succeed(ready, void 0)),
|
|
73984
|
-
* Stream.take(3),
|
|
73985
|
-
* Stream.runCollect,
|
|
73986
|
-
* Effect.forkChild
|
|
73987
|
-
* )
|
|
73988
|
-
*
|
|
73989
|
-
* yield* Deferred.await(ready)
|
|
73990
|
-
* yield* SubscriptionRef.set(ref, 1)
|
|
73991
|
-
* yield* SubscriptionRef.set(ref, 2)
|
|
73992
|
-
*
|
|
73993
|
-
* const values = yield* Fiber.join(fiber)
|
|
73994
|
-
* return Array.from(values)
|
|
73995
|
-
* })
|
|
73996
|
-
*
|
|
73997
|
-
* await Effect.runPromise(program) // => [0, 1, 2]
|
|
73998
|
-
* ```
|
|
73999
|
-
*
|
|
74000
|
-
* @stability stable
|
|
74001
|
-
* @category subscriptions
|
|
74002
|
-
* @since 4.0.0
|
|
74003
|
-
*/
|
|
74004
|
-
const changes = (self) => fromPubSub(self.pubsub);
|
|
74005
|
-
const setUnsafe = (self, value) => {
|
|
74006
|
-
self.value = value;
|
|
74007
|
-
publishUnsafe(self.pubsub, value);
|
|
74008
|
-
};
|
|
74009
|
-
/**
|
|
74010
|
-
* Modifies the `SubscriptionRef` atomically with a function that computes a
|
|
74011
|
-
* return value and a new value, notifying subscribers of the change.
|
|
74012
|
-
*
|
|
74013
|
-
* **Example** (Modifying a value)
|
|
74014
|
-
*
|
|
74015
|
-
* ```ts import.meta.vitest
|
|
74016
|
-
* import { Effect, SubscriptionRef } from "effect"
|
|
74017
|
-
*
|
|
74018
|
-
* const program = Effect.gen(function*() {
|
|
74019
|
-
* const ref = yield* SubscriptionRef.make(10)
|
|
74020
|
-
*
|
|
74021
|
-
* const result = yield* SubscriptionRef.modify(ref, (n) => [
|
|
74022
|
-
* `Old value was ${n}`,
|
|
74023
|
-
* n * 2
|
|
74024
|
-
* ])
|
|
74025
|
-
* const newValue = yield* SubscriptionRef.get(ref)
|
|
74026
|
-
* return [result, newValue]
|
|
74027
|
-
* })
|
|
74028
|
-
*
|
|
74029
|
-
* await Effect.runPromise(program) // => ["Old value was 10", 20]
|
|
74030
|
-
* ```
|
|
74031
|
-
*
|
|
74032
|
-
* @stability stable
|
|
74033
|
-
* @category mutations
|
|
74034
|
-
* @since 2.0.0
|
|
74035
|
-
*/
|
|
74036
|
-
const modify = /*#__PURE__*/ dual(2, (self, modify) => self.semaphore.withPermit(sync(() => {
|
|
74037
|
-
const [b, newValue] = modify(self.value);
|
|
74038
|
-
setUnsafe(self, newValue);
|
|
74039
|
-
return b;
|
|
74040
|
-
})));
|
|
74041
|
-
/**
|
|
74042
|
-
* Computes a return value and optionally updates the reference.
|
|
74043
|
-
*
|
|
74044
|
-
* **When to use**
|
|
74045
|
-
*
|
|
74046
|
-
* Use to return a separate result while synchronously deciding whether to
|
|
74047
|
-
* publish a new `SubscriptionRef` value.
|
|
74048
|
-
*
|
|
74049
|
-
* **Details**
|
|
74050
|
-
*
|
|
74051
|
-
* If the function returns `Option.some` for the new value, the value is set and
|
|
74052
|
-
* published. If it returns `Option.none`, the reference is left unchanged and
|
|
74053
|
-
* no update is published.
|
|
74054
|
-
*
|
|
74055
|
-
* **Example** (Conditionally modifying a value)
|
|
74056
|
-
*
|
|
74057
|
-
* ```ts import.meta.vitest
|
|
74058
|
-
* import { Effect, Option, SubscriptionRef } from "effect"
|
|
74059
|
-
*
|
|
74060
|
-
* const program = Effect.gen(function*() {
|
|
74061
|
-
* const ref = yield* SubscriptionRef.make(10)
|
|
74062
|
-
*
|
|
74063
|
-
* const result = yield* SubscriptionRef.modifySome(
|
|
74064
|
-
* ref,
|
|
74065
|
-
* (n) =>
|
|
74066
|
-
* n > 5 ? ["Updated", Option.some(n * 2)] : ["Not updated", Option.none()]
|
|
74067
|
-
* )
|
|
74068
|
-
* const newValue = yield* SubscriptionRef.get(ref)
|
|
74069
|
-
* return [result, newValue]
|
|
74070
|
-
* })
|
|
74071
|
-
*
|
|
74072
|
-
* await Effect.runPromise(program) // => ["Updated", 20]
|
|
74073
|
-
* ```
|
|
74074
|
-
*
|
|
74075
|
-
* @stability stable
|
|
74076
|
-
* @category mutations
|
|
74077
|
-
* @since 2.0.0
|
|
74078
|
-
*/
|
|
74079
|
-
const modifySome = /*#__PURE__*/ dual(2, (self, modify) => self.semaphore.withPermit(sync(() => {
|
|
74080
|
-
const [b, option] = modify(self.value);
|
|
74081
|
-
if (isNone(option)) return b;
|
|
74082
|
-
setUnsafe(self, option.value);
|
|
74083
|
-
return b;
|
|
74084
|
-
})));
|
|
74085
|
-
/**
|
|
74086
|
-
* Updates the value of the `SubscriptionRef` with the result of applying a
|
|
74087
|
-
* function, notifying subscribers of the change.
|
|
74088
|
-
*
|
|
74089
|
-
* **Example** (Updating a value)
|
|
74090
|
-
*
|
|
74091
|
-
* ```ts import.meta.vitest
|
|
74092
|
-
* import { Effect, SubscriptionRef } from "effect"
|
|
74093
|
-
*
|
|
74094
|
-
* const program = Effect.gen(function*() {
|
|
74095
|
-
* const ref = yield* SubscriptionRef.make(10)
|
|
74096
|
-
*
|
|
74097
|
-
* yield* SubscriptionRef.update(ref, (n) => n * 2)
|
|
74098
|
-
*
|
|
74099
|
-
* return yield* SubscriptionRef.get(ref)
|
|
74100
|
-
* })
|
|
74101
|
-
*
|
|
74102
|
-
* await Effect.runPromise(program) // => 20
|
|
74103
|
-
* ```
|
|
74104
|
-
*
|
|
74105
|
-
* @stability stable
|
|
74106
|
-
* @category mutations
|
|
74107
|
-
* @since 2.0.0
|
|
74108
|
-
*/
|
|
74109
|
-
const update = /*#__PURE__*/ dual(2, (self, update) => self.semaphore.withPermit(sync(() => setUnsafe(self, update(self.value)))));
|
|
74110
73752
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Version.js
|
|
74111
73753
|
/**
|
|
74112
73754
|
* The `effect` package version used in telemetry headers, resources, and scopes.
|
|
@@ -76752,7 +76394,7 @@ const make$20 = (name, options) => {
|
|
|
76752
76394
|
successSchema,
|
|
76753
76395
|
failureSchema,
|
|
76754
76396
|
failureMode: options?.failureMode ?? "error",
|
|
76755
|
-
annotations: empty$
|
|
76397
|
+
annotations: empty$16(),
|
|
76756
76398
|
needsApproval: options?.needsApproval,
|
|
76757
76399
|
toModelOutput: options?.toModelOutput,
|
|
76758
76400
|
execution: options?.execution
|
|
@@ -77366,7 +77008,7 @@ function compilerAnnotations(annotations) {
|
|
|
77366
77008
|
}
|
|
77367
77009
|
function optionalToNullable(type) {
|
|
77368
77010
|
return decodeTo$1(isNullable(type) ? replaceContext(type, void 0) : new Union$3([type, null_]), optionalKey$1(toType$1(type)), transformOptional({
|
|
77369
|
-
decode: filter$
|
|
77011
|
+
decode: filter$7(isNotNull),
|
|
77370
77012
|
encode: orElseSome(() => null)
|
|
77371
77013
|
}));
|
|
77372
77014
|
}
|
|
@@ -78973,7 +78615,7 @@ const make$18 = /*#__PURE__*/ fnUntraced(function* (params) {
|
|
|
78973
78615
|
const content = yield* decodeContent(rawContent);
|
|
78974
78616
|
yield* validateProviderExecutedToolCalls(toolkit, rawContent);
|
|
78975
78617
|
const incompleteFinishReason = findIncompleteFinishReason(rawContent);
|
|
78976
|
-
const toolResults = incompleteFinishReason !== void 0 ? rawContent.filter((part) => part.type === "tool-call" && part.providerExecuted !== true && resolvableTool(toolkit, part.name) !== void 0).map((part) => makeInterruptedToolResult(part, incompleteFinishReason)) : yield* resolveToolCalls(rawContent, toolkit, providerOptions.prompt.content, concurrency).pipe(filter$
|
|
78618
|
+
const toolResults = incompleteFinishReason !== void 0 ? rawContent.filter((part) => part.type === "tool-call" && part.providerExecuted !== true && resolvableTool(toolkit, part.name) !== void 0).map((part) => makeInterruptedToolResult(part, incompleteFinishReason)) : yield* resolveToolCalls(rawContent, toolkit, providerOptions.prompt.content, concurrency).pipe(filter$1((result) => result.type === "tool-approval-request" || result.preliminary === false), runCollect);
|
|
78977
78619
|
if (tracker) {
|
|
78978
78620
|
const responseMetadata = content.find((part) => part.type === "response-metadata");
|
|
78979
78621
|
if (isNotUndefined(responseMetadata) && isNotUndefined(responseMetadata.id)) tracker.markParts(providerOptions.prompt.content, responseMetadata.id);
|
|
@@ -79273,7 +78915,7 @@ const executeApprovedToolCalls = (approvals, toolkit, concurrency) => {
|
|
|
79273
78915
|
availableTools: Object.keys(toolkit.tools)
|
|
79274
78916
|
})
|
|
79275
78917
|
});
|
|
79276
|
-
const terminalResult = yield* (yield* toolkit.handle(toolCall.name, toolCall.params, approval.toolCallId)).pipe(filter$
|
|
78918
|
+
const terminalResult = yield* (yield* toolkit.handle(toolCall.name, toolCall.params, approval.toolCallId)).pipe(filter$1((result) => result.preliminary === false), run$6(last()), flatMap$3(match$8({
|
|
79277
78919
|
onNone: () => die$2("Tool handler did not produce a final result"),
|
|
79278
78920
|
onSome: succeed$5
|
|
79279
78921
|
})));
|
|
@@ -79348,7 +78990,7 @@ const resolveToolCalls = (content, toolkit, messages, concurrency) => {
|
|
|
79348
78990
|
const deniedByToolCallId = new Map(denied.map((denial) => [denial.toolCallId, denial]));
|
|
79349
78991
|
const streams = toolCalls.map((toolCall) => gen(function* () {
|
|
79350
78992
|
const tool = resolvableTool(toolkit, toolCall.name);
|
|
79351
|
-
if (!tool) return empty$
|
|
78993
|
+
if (!tool) return empty$9;
|
|
79352
78994
|
if (deniedByToolCallId.has(toolCall.id)) {
|
|
79353
78995
|
const denial = deniedByToolCallId.get(toolCall.id);
|
|
79354
78996
|
return succeed$3(makePart("tool-result", {
|
|
@@ -81740,7 +81382,7 @@ const make$17 = /*#__PURE__*/ sync(() => {
|
|
|
81740
81382
|
const skillRegistrations = /* @__PURE__ */ new Map();
|
|
81741
81383
|
const skillFiles = /* @__PURE__ */ new Set();
|
|
81742
81384
|
const completionRegistrations = /* @__PURE__ */ new Map();
|
|
81743
|
-
const filterList = (registrations, invocation) => map$7(filter$
|
|
81385
|
+
const filterList = (registrations, invocation) => map$7(filter$3(filter$5(registrations, (entry) => entry.isVisible(invocation.protocol)), (entry) => entry.visible === void 0 ? succeed$5(true) : entry.visible(invocation)), (entries) => entries.map((entry) => entry.descriptor));
|
|
81744
81386
|
return {
|
|
81745
81387
|
tools: {
|
|
81746
81388
|
register: (registration) => sync(() => {
|
|
@@ -85514,7 +85156,7 @@ const makeHandlers = (core, _lifecycle, context) => {
|
|
|
85514
85156
|
const decodeReadResourceDirectoryResult = decodeUnknownEffect(ReadResourceDirectoryResult);
|
|
85515
85157
|
const sendNotification = context.sendNotification;
|
|
85516
85158
|
const supportsSubscriptions = sendNotification !== void 0;
|
|
85517
|
-
const extensions = context.serverInfo.extensions === void 0 ? void 0 : filter$
|
|
85159
|
+
const extensions = context.serverInfo.extensions === void 0 ? void 0 : filter$6(context.serverInfo.extensions, (value) => isReadonlyObject(value));
|
|
85518
85160
|
const cacheHint = (family) => {
|
|
85519
85161
|
const hint = context.serverInfo.cacheHints?.[family];
|
|
85520
85162
|
return hint === void 0 ? privateStaleCache : {
|
|
@@ -86001,7 +85643,7 @@ const middlewareStack = (localMiddleware, globalMiddleware) => {
|
|
|
86001
85643
|
};
|
|
86002
85644
|
const runMiddleware = (handler, middleware, invocation, request) => {
|
|
86003
85645
|
const effect = middleware.length === 0 ? handler : withFiber((fiber) => {
|
|
86004
|
-
const headers = getOrUndefined(fiber.context, HttpServerRequest)?.headers ?? empty$
|
|
85646
|
+
const headers = getOrUndefined(fiber.context, HttpServerRequest)?.headers ?? empty$7;
|
|
86005
85647
|
const options = {
|
|
86006
85648
|
...request,
|
|
86007
85649
|
requestContext: invocation.requestContext,
|
|
@@ -86024,7 +85666,7 @@ const runMiddleware = (handler, middleware, invocation, request) => {
|
|
|
86024
85666
|
}));
|
|
86025
85667
|
};
|
|
86026
85668
|
const makeInvoke = (context, globalMiddleware) => {
|
|
86027
|
-
const services = context === void 0 ? empty$
|
|
85669
|
+
const services = context === void 0 ? empty$16() : omitRequestServices(context);
|
|
86028
85670
|
const localMiddleware = context === void 0 ? [] : getMiddleware(context);
|
|
86029
85671
|
const invoke = (handler, invocation, request) => runMiddleware(services.mapUnsafe.size === 0 ? handler : updateContext(handler, (context) => merge$4(services, context)), middlewareStack(localMiddleware, globalMiddleware), invocation, request).pipe(catchHidden(() => fail$6(notFound(request.method, request.target))));
|
|
86030
85672
|
const visible = (method, target) => (invocation) => {
|
|
@@ -86073,7 +85715,7 @@ var McpServer = class McpServer extends (/*#__PURE__*/ Service$1()("effect/ai/Mc
|
|
|
86073
85715
|
*/
|
|
86074
85716
|
static make = /*#__PURE__*/ gen(function* () {
|
|
86075
85717
|
const internalCore = yield* make$17;
|
|
86076
|
-
const tools = empty$
|
|
85718
|
+
const tools = empty$13();
|
|
86077
85719
|
const resources = [];
|
|
86078
85720
|
const resourceTemplates = [];
|
|
86079
85721
|
const prompts = [];
|
|
@@ -86658,7 +86300,7 @@ const runWithRuntime = /*#__PURE__*/ fnUntraced(function* (options, runtime, tra
|
|
|
86658
86300
|
const request = request_;
|
|
86659
86301
|
const httpRequest = isHttp ? getOrUndefined(fiber.context, HttpServerRequest) : void 0;
|
|
86660
86302
|
if (httpRequest !== void 0 && request._tag !== "Eof") appendPreResponseHandlerUnsafe(fiber.context, (_, response) => succeed$5(response.status === 200 && response.body._tag === "Uint8Array" && response.body.contentLength === 0 ? empty$2({
|
|
86661
|
-
headers: remove$
|
|
86303
|
+
headers: remove$1(response.headers, "content-type"),
|
|
86662
86304
|
status: 202
|
|
86663
86305
|
}) : response));
|
|
86664
86306
|
switch (request._tag) {
|
|
@@ -86835,7 +86477,7 @@ const runWithRuntime = /*#__PURE__*/ fnUntraced(function* (options, runtime, tra
|
|
|
86835
86477
|
const metadata = requestContext?.requestMetadata;
|
|
86836
86478
|
const level = hasProperty(metadata, "io.modelcontextprotocol/logLevel") ? metadata["io.modelcontextprotocol/logLevel"] : void 0;
|
|
86837
86479
|
if (requestContext?.clientId !== clientId || !isLoggingLevel(level) || LoggingLevel$2.literals.indexOf(notification.level) < LoggingLevel$2.literals.indexOf(level)) return;
|
|
86838
|
-
} else if (!runtime.canDeliver(clientId, (requestContext?.clientId === clientId ? requestHeaders : void 0) ?? clientStates.get(clientId)?.sessionHeaders ?? empty$
|
|
86480
|
+
} else if (!runtime.canDeliver(clientId, (requestContext?.clientId === clientId ? requestHeaders : void 0) ?? clientStates.get(clientId)?.sessionHeaders ?? empty$7, notification, defaultLogLevel, listChangeRevision)) return;
|
|
86839
86481
|
const rpc = selectedProtocol.serverNotificationRpcs.requests.get(projected.tag);
|
|
86840
86482
|
if (!rpc) return;
|
|
86841
86483
|
const encoded = yield* selectedProtocol.payloadCodecs(rpc).encode(projected.payload);
|
|
@@ -86877,7 +86519,7 @@ const layerWithRuntime = (options, transport) => effectDiscard(gen(function* ()
|
|
|
86877
86519
|
...options,
|
|
86878
86520
|
cacheHints
|
|
86879
86521
|
}, runtime, transport));
|
|
86880
|
-
})).pipe(provide$2(options.registrations ?? empty$
|
|
86522
|
+
})).pipe(provide$2(options.registrations ?? empty$12), provideMerge(McpServer.layer));
|
|
86881
86523
|
/**
|
|
86882
86524
|
* Registers a Streamable HTTP MCP endpoint at `options.path`.
|
|
86883
86525
|
*
|
|
@@ -86982,7 +86624,7 @@ const addMcpHttpRoutes = /*#__PURE__*/ fnUntraced(function* (options, httpEffect
|
|
|
86982
86624
|
if (admission.acknowledge) return yield* catchCause$2(map$7(httpEffect, toResponse), () => succeed$5(empty$2({ status: 202 })));
|
|
86983
86625
|
return yield* flatMap$3(httpEffect, (response) => {
|
|
86984
86626
|
if (response.body._tag !== "Uint8Array" || response.body.body.length > 0) return succeed$5(toResponse(response));
|
|
86985
|
-
return httpPostResponses.get(request)?.expected === 0 ? succeed$5(stream$1(empty$
|
|
86627
|
+
return httpPostResponses.get(request)?.expected === 0 ? succeed$5(stream$1(empty$9, { contentType: "text/event-stream" })) : die$2(/* @__PURE__ */ new Error("MCP request ended without writing its response"));
|
|
86986
86628
|
});
|
|
86987
86629
|
});
|
|
86988
86630
|
});
|
|
@@ -87059,7 +86701,7 @@ const toServerSentEvents = (response, keepAlive) => {
|
|
|
87059
86701
|
const options = {
|
|
87060
86702
|
status: response.status,
|
|
87061
86703
|
statusText: response.statusText,
|
|
87062
|
-
headers: remove$
|
|
86704
|
+
headers: remove$1(response.headers, "content-type"),
|
|
87063
86705
|
cookies: response.cookies,
|
|
87064
86706
|
contentType: "text/event-stream"
|
|
87065
86707
|
};
|
|
@@ -87179,7 +86821,7 @@ const registerToolkit = /*#__PURE__*/ fnUntraced(function* (toolkit) {
|
|
|
87179
86821
|
inputSchema,
|
|
87180
86822
|
outputSchema,
|
|
87181
86823
|
annotations: {
|
|
87182
|
-
...getOption(tool.annotations, Title).pipe(map$13((title) => ({ title })), getOrUndefined$1),
|
|
86824
|
+
...getOption$1(tool.annotations, Title).pipe(map$13((title) => ({ title })), getOrUndefined$1),
|
|
87183
86825
|
readOnlyHint: get$8(tool.annotations, Readonly),
|
|
87184
86826
|
destructiveHint: get$8(tool.annotations, Destructive),
|
|
87185
86827
|
idempotentHint: get$8(tool.annotations, Idempotent),
|
|
@@ -87770,7 +87412,7 @@ const toInternalServerError = (request, cause) => new HttpServerError({ reason:
|
|
|
87770
87412
|
request,
|
|
87771
87413
|
cause
|
|
87772
87414
|
}) });
|
|
87773
|
-
const handlePlatformError = (request, self) => catchIf(self, (error) => error.reason._tag === "NotFound", () => fail$6(toRouteNotFoundError(request)), (error) => fail$6(toInternalServerError(request, error)));
|
|
87415
|
+
const handlePlatformError = (request, self) => catchIf$2(self, (error) => error.reason._tag === "NotFound", () => fail$6(toRouteNotFoundError(request)), (error) => fail$6(toInternalServerError(request, error)));
|
|
87774
87416
|
const acceptsHtml = (accept) => accept !== void 0 && accept.toLowerCase().includes("text/html");
|
|
87775
87417
|
const stripWeakEtagPrefix = (value) => {
|
|
87776
87418
|
const trimmed = value.trim();
|
|
@@ -89600,7 +89242,7 @@ const makeDateParts = (dateMask, date, locales) => {
|
|
|
89600
89242
|
if (element.isToken() && lastElement !== void 0 && lastElement.isToken()) lastElement.setValue(element.token);
|
|
89601
89243
|
else array.push(element);
|
|
89602
89244
|
return array;
|
|
89603
|
-
}, empty$
|
|
89245
|
+
}, empty$13());
|
|
89604
89246
|
parts.splice(0, parts.length, ...orderedParts);
|
|
89605
89247
|
return parts;
|
|
89606
89248
|
};
|
|
@@ -90466,7 +90108,7 @@ const makeSingle = (params) => {
|
|
|
90466
90108
|
description: params.description ?? none(),
|
|
90467
90109
|
aliases: params.aliases ?? [],
|
|
90468
90110
|
hidden: params.hidden ?? false,
|
|
90469
|
-
annotations: params.annotations ?? empty$
|
|
90111
|
+
annotations: params.annotations ?? empty$16(),
|
|
90470
90112
|
parse
|
|
90471
90113
|
}, Proto$1);
|
|
90472
90114
|
};
|
|
@@ -91699,7 +91341,7 @@ const makeCommand = (options) => {
|
|
|
91699
91341
|
const config = options.config;
|
|
91700
91342
|
const contextConfig = options.contextConfig ?? emptyConfig;
|
|
91701
91343
|
const service = options.service ?? Service$1(`~effect/cli/Command/${options.name}`);
|
|
91702
|
-
const annotations = options.annotations ?? empty$
|
|
91344
|
+
const annotations = options.annotations ?? empty$16();
|
|
91703
91345
|
const globalFlags = options.globalFlags ?? [];
|
|
91704
91346
|
const subcommands = options.subcommands ?? [];
|
|
91705
91347
|
const resolveExamples = options.resolveExamples ?? noExamples;
|
|
@@ -95109,7 +94751,7 @@ const runWith = (command, config) => {
|
|
|
95109
94751
|
program = provideService$2(program, flag, value);
|
|
95110
94752
|
}
|
|
95111
94753
|
const services = match$8(logLevel, {
|
|
95112
|
-
onNone: () => empty$
|
|
94754
|
+
onNone: () => empty$16(),
|
|
95113
94755
|
onSome: (level) => make$92(MinimumLogLevel, level)
|
|
95114
94756
|
});
|
|
95115
94757
|
yield* provideContext$2(program, services);
|
|
@@ -101986,7 +101628,7 @@ const make$9 = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
|
101986
101628
|
BetaErrorResponse
|
|
101987
101629
|
]);
|
|
101988
101630
|
const buildMessageStream = (response) => {
|
|
101989
|
-
return [response, response.stream.pipe(decodeText$1, pipeThroughChannel(decodeDataSchema(MessageEvent)), takeUntil((event) => event.data.type === "message_stop"), map$5((event) => event.data), filter$
|
|
101631
|
+
return [response, response.stream.pipe(decodeText$1, pipeThroughChannel(decodeDataSchema(MessageEvent)), takeUntil((event) => event.data.type === "message_stop"), map$5((event) => event.data), filter$1((event) => event.type !== "ping"), catchTags({
|
|
101990
101632
|
Retry: (error) => die(error),
|
|
101991
101633
|
SseError: (error) => fail$4(mapSseError$1(error, "createMessageStream")),
|
|
101992
101634
|
HttpClientError: (error) => fromEffect(mapHttpClientError$1(error, "createMessageStream")),
|
|
@@ -107509,8 +107151,8 @@ function identifyRequestOf(headers) {
|
|
|
107509
107151
|
}
|
|
107510
107152
|
const clientAddress = make$45((app) => xForwardedHeaders({ trustedProxies: isLoopback })(gen(function* () {
|
|
107511
107153
|
const request = yield* HttpServerRequest;
|
|
107512
|
-
const unclaimed = remove$
|
|
107513
|
-
const headers = pipe(request.remoteAddress, filter$
|
|
107154
|
+
const unclaimed = remove$1(request.headers, CLIENT_HEADER);
|
|
107155
|
+
const headers = pipe(request.remoteAddress, filter$7((address) => !exists(getSuccess(ipFromString(address)), isLoopback)), match$8({
|
|
107514
107156
|
onNone: () => unclaimed,
|
|
107515
107157
|
onSome: (address) => set$2(unclaimed, CLIENT_HEADER, address)
|
|
107516
107158
|
}));
|
|
@@ -108075,7 +107717,7 @@ const make$3 = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
|
108075
107717
|
excludeLogSpans: options.excludeLogSpans ?? false,
|
|
108076
107718
|
clock: yield* Clock
|
|
108077
107719
|
};
|
|
108078
|
-
return make$
|
|
107720
|
+
return make$23((options) => {
|
|
108079
107721
|
exporter.push(makeLogRecord(options, opts));
|
|
108080
107722
|
});
|
|
108081
107723
|
});
|
|
@@ -108433,7 +108075,7 @@ const layerServerProtocol = mergeAll$2(layerSchemaBinary(), succeed$6(MaxBodySiz
|
|
|
108433
108075
|
const layerTelemetry = unwrap$7(gen(function* () {
|
|
108434
108076
|
const metadata = yield* packageMetadata;
|
|
108435
108077
|
return match$8(yield* option(String$5("OTEL_URL")), {
|
|
108436
|
-
onNone: () => empty$
|
|
108078
|
+
onNone: () => empty$12,
|
|
108437
108079
|
onSome: (url) => layerOtlp(`${metadata.name}-server`, url, "server", metadata.version)
|
|
108438
108080
|
});
|
|
108439
108081
|
}));
|
|
@@ -108457,7 +108099,20 @@ const layerRoutes = use((router) => gen(function* () {
|
|
|
108457
108099
|
if (isFailure$1(account)) return empty$2(failureOptions(account.failure, 401));
|
|
108458
108100
|
return yield* schemaJson(Account$1)(account.success, { headers: { "cache-control": "no-store" } });
|
|
108459
108101
|
}));
|
|
108460
|
-
for (const origin of toArray(issuer))
|
|
108102
|
+
for (const origin of toArray(issuer)) {
|
|
108103
|
+
yield* router.add("GET", "/auth/sign-in", map$7(HttpServerRequest, (request) => redirect(`${new URL("/sign-in", origin).href}?${new URLSearchParams({ next: new URL(request.url, "http://local").searchParams.get("next") ?? canonical })}`)));
|
|
108104
|
+
const client = yield* HttpClient;
|
|
108105
|
+
yield* router.add("POST", "/auth/sign-out", gen(function* () {
|
|
108106
|
+
const request = yield* HttpServerRequest;
|
|
108107
|
+
if (request.headers["origin"] !== new URL(canonical).origin) return text("Invalid sign-out origin; no changes committed", { status: 403 });
|
|
108108
|
+
const target = new URL("/sign-out", origin);
|
|
108109
|
+
target.search = new URLSearchParams({ next: new URL(request.url, canonical).searchParams.get("next") ?? canonical }).toString();
|
|
108110
|
+
return yield* pipe(client.post(target.href, { headers: {
|
|
108111
|
+
cookie: request.headers["cookie"] ?? "",
|
|
108112
|
+
origin: new URL(origin).origin
|
|
108113
|
+
} }), provideService$2(RequestInit, { redirect: "manual" }), timeout("10 seconds"), map$7(fromClientResponse), tapError$3(() => logWarning("Auth did not confirm sign-out")), catch_$2(() => succeed$5(text("Auth sign-out was not confirmed; the shared session may remain", { status: 503 }))));
|
|
108114
|
+
}));
|
|
108115
|
+
}
|
|
108461
108116
|
}));
|
|
108462
108117
|
function layerIcon(icon) {
|
|
108463
108118
|
const response = succeed$5(text(icon, {
|
|
@@ -108468,7 +108123,7 @@ function layerIcon(icon) {
|
|
|
108468
108123
|
}
|
|
108469
108124
|
const layerWeb = unwrap$7(gen(function* () {
|
|
108470
108125
|
const client = fileURLToPath(new URL("./client", import.meta.url));
|
|
108471
|
-
if (!(yield* (yield* FileSystem).exists((yield* Path$1).join(client, "index.html")))) return empty$
|
|
108126
|
+
if (!(yield* (yield* FileSystem).exists((yield* Path$1).join(client, "index.html")))) return empty$12;
|
|
108472
108127
|
const name = capitalize(yield* appName);
|
|
108473
108128
|
return mergeAll$2(add("GET", MANIFEST_PATH, succeed$5(jsonUnsafe({
|
|
108474
108129
|
background_color: "#0d0c0c",
|
|
@@ -108813,6 +108468,7 @@ const dataDirectory = gen(function* () {
|
|
|
108813
108468
|
mode: 448,
|
|
108814
108469
|
recursive: true
|
|
108815
108470
|
});
|
|
108471
|
+
yield* (yield* FileSystem).chmod(directory, 448);
|
|
108816
108472
|
return directory;
|
|
108817
108473
|
});
|
|
108818
108474
|
const retiredSessions = effectDiscard(make$31({})({
|
|
@@ -108880,7 +108536,7 @@ const tool = fn("ToolPath.resolve")(function* (name) {
|
|
|
108880
108536
|
yield* fs.chmod(temporary, 493);
|
|
108881
108537
|
yield* fs.rename(temporary, target);
|
|
108882
108538
|
}));
|
|
108883
|
-
yield* pipe(yield* fs.readDirectory(tools), filter$
|
|
108539
|
+
yield* pipe(yield* fs.readDirectory(tools), filter$5((entry) => entry !== version), forEach$1((entry) => fs.remove(path.join(tools, entry), { recursive: true }), { concurrency: 1 }));
|
|
108884
108540
|
return target;
|
|
108885
108541
|
});
|
|
108886
108542
|
var ToolPath = class extends Service$1()("@deslop/runtime/server/process/ToolPath") {
|
|
@@ -108980,7 +108636,7 @@ const uninstallAgents = fnUntraced(function* (name) {
|
|
|
108980
108636
|
return `deslop-${name}.plist removed; application data preserved\n`;
|
|
108981
108637
|
});
|
|
108982
108638
|
function agentStatus(name) {
|
|
108983
|
-
return map$7(executeProcess("launchctl", ["print", `${domain()}/deslop-${name}`]), (output) => `${pipe(output, split$1("\n"), filter$
|
|
108639
|
+
return map$7(executeProcess("launchctl", ["print", `${domain()}/deslop-${name}`]), (output) => `${pipe(output, split$1("\n"), filter$5((line) => isSome(match$2(/^\s*(?:path|state|pid|last exit code|last terminating signal) =/u)(line))), map$10(trim), join$4("\n"))}\n`);
|
|
108984
108640
|
}
|
|
108985
108641
|
function restartAgent(name) {
|
|
108986
108642
|
return timeout(executeProcess("launchctl", [
|
|
@@ -109155,7 +108811,7 @@ Literals(["Error", "GlobalError"]);
|
|
|
109155
108811
|
Literals(["Requires", "GlobalRequires"]);
|
|
109156
108812
|
function server(app) {
|
|
109157
108813
|
const routes = provide$2(mergeAll$2(app.routes, layerRoutes, layerIcon(app.icon), layerWeb), match$8(fromUndefinedOr(app.middleware), {
|
|
109158
|
-
onNone: () => empty$
|
|
108814
|
+
onNone: () => empty$12,
|
|
109159
108815
|
onSome: (middleware$1) => middleware()(middleware$1).layer
|
|
109160
108816
|
}));
|
|
109161
108817
|
return pipe(serve(pipe(match$8(fromUndefinedOr(app.auth), {
|
|
@@ -109166,7 +108822,7 @@ function server(app) {
|
|
|
109166
108822
|
middleware: (handler) => clientAddress(crossSiteGuard(handler))
|
|
109167
108823
|
}), provide$2(mergeAll$2(layerServerProtocol, match(app.telemetry === false, {
|
|
109168
108824
|
onFalse: () => layerTelemetry,
|
|
109169
|
-
onTrue: () => empty$
|
|
108825
|
+
onTrue: () => empty$12
|
|
109170
108826
|
}))), provide$2(layerNodeHttpServer), provide$2(layerPlatform), launch);
|
|
109171
108827
|
}
|
|
109172
108828
|
function output(text) {
|
|
@@ -109415,7 +109071,7 @@ const fields = fields$1;
|
|
|
109415
109071
|
* @since 4.0.0
|
|
109416
109072
|
*/
|
|
109417
109073
|
const optionalOption = (schema) => optionalKey(NullOr(schema)).pipe(decodeTo(Option(toType(schema)), transformOptional({
|
|
109418
|
-
decode: (oe) => oe.pipe(filter$
|
|
109074
|
+
decode: (oe) => oe.pipe(filter$7(isNotNull), some$1),
|
|
109419
109075
|
encode: flatten$6
|
|
109420
109076
|
})));
|
|
109421
109077
|
/**
|
|
@@ -109465,7 +109121,7 @@ var ListedSession = class extends Class("ListedSession")({
|
|
|
109465
109121
|
]),
|
|
109466
109122
|
current: Boolean$5
|
|
109467
109123
|
}) {};
|
|
109468
|
-
// src/services/
|
|
109124
|
+
// src/services/crypto/lib/utils.ts
|
|
109469
109125
|
function randomTokenOf(random) {
|
|
109470
109126
|
return (bytes) => map$7(random.randomBytes(bytes), encode);
|
|
109471
109127
|
}
|
|
@@ -109539,7 +109195,11 @@ var CookieSessions = class CookieSessions extends Service$1()("@deslop/auth/serv
|
|
|
109539
109195
|
// src/services/github/schema.ts
|
|
109540
109196
|
const OAuthState = pipe(NonEmptyString, brand("OAuthState"));
|
|
109541
109197
|
const GitHubClientId = pipe(String$6, brand("GitHubClientId"));
|
|
109542
|
-
const AppSignIn = Struct$2({ app:
|
|
109198
|
+
const AppSignIn = Struct$2({ app: Literals([
|
|
109199
|
+
"opm",
|
|
109200
|
+
"stash",
|
|
109201
|
+
"trips"
|
|
109202
|
+
]) });
|
|
109543
109203
|
Struct$2({
|
|
109544
109204
|
app: OptionFromOptionalKey(AppSignIn),
|
|
109545
109205
|
next: NonEmptyString
|
|
@@ -109566,20 +109226,14 @@ const SignedAccount = Struct$2({
|
|
|
109566
109226
|
});
|
|
109567
109227
|
const Person = Struct$2({
|
|
109568
109228
|
...Account.fields,
|
|
109569
|
-
since:
|
|
109570
|
-
decode: transform$3((value) => pipe(value, liftPredicate((time) => time !== 0), map$13(makeUnsafe$2))),
|
|
109571
|
-
encode: transform$3((value) => match$8(value, {
|
|
109572
|
-
onNone: constant(0),
|
|
109573
|
-
onSome: toEpochMillis
|
|
109574
|
-
}))
|
|
109575
|
-
}))
|
|
109229
|
+
since: OptionFromNullOr(DateTimeUtcFromMillis)
|
|
109576
109230
|
});
|
|
109577
109231
|
const MemberStatus = Literals(["Waiting", "Allowed"]);
|
|
109578
109232
|
var Member = class extends Class("Member")({
|
|
109579
109233
|
fullName: FieldOption(String$6),
|
|
109580
109234
|
id: User.fields.id,
|
|
109581
109235
|
name: User.fields.name,
|
|
109582
|
-
since: DateTimeUtcFromMillis,
|
|
109236
|
+
since: FieldOption(DateTimeUtcFromMillis),
|
|
109583
109237
|
status: MemberStatus
|
|
109584
109238
|
}) {
|
|
109585
109239
|
static table = "members";
|
|
@@ -109593,46 +109247,6 @@ const AdmitParams = Struct$2({
|
|
|
109593
109247
|
allow: Boolean$5,
|
|
109594
109248
|
id: UserId
|
|
109595
109249
|
});
|
|
109596
|
-
// src/services/records/service.ts
|
|
109597
|
-
const makeRecords = fnUntraced(function* (lifetime) {
|
|
109598
|
-
const records = yield* make$23(empty$6());
|
|
109599
|
-
const current = flatMap$3(now, (now) => modifySome(records, (entries) => {
|
|
109600
|
-
const live = filter$1(entries, (entry) => isGreaterThan$1(entry.expiresAt, now));
|
|
109601
|
-
return [live, liftPredicate(live, (remaining) => size$1(remaining) !== size$1(entries))];
|
|
109602
|
-
}));
|
|
109603
|
-
function get(key) {
|
|
109604
|
-
return map$7(current, (entries) => get$2(entries, key));
|
|
109605
|
-
}
|
|
109606
|
-
return {
|
|
109607
|
-
changes: pipe(changes(records), merge$1(mapEffect$1(tick(seconds(1)), () => current)), mapEffect$1(() => current)),
|
|
109608
|
-
consume: fnUntraced(function* (key, receipt) {
|
|
109609
|
-
yield* current;
|
|
109610
|
-
return yield* modify(records, (entries) => [get$2(entries, key), match$8(receipt, {
|
|
109611
|
-
onNone: () => remove$1(entries, key),
|
|
109612
|
-
onSome: (value) => modify$2(entries, key, (entry) => ({
|
|
109613
|
-
...entry,
|
|
109614
|
-
value
|
|
109615
|
-
}))
|
|
109616
|
-
})]);
|
|
109617
|
-
}),
|
|
109618
|
-
create: fnUntraced(function* (key, value) {
|
|
109619
|
-
yield* current;
|
|
109620
|
-
const entry = {
|
|
109621
|
-
expiresAt: addDuration(yield* now, lifetime),
|
|
109622
|
-
value
|
|
109623
|
-
};
|
|
109624
|
-
yield* update(records, set(key, entry));
|
|
109625
|
-
return entry;
|
|
109626
|
-
}),
|
|
109627
|
-
get,
|
|
109628
|
-
remove: (key) => update(records, remove$1(key)),
|
|
109629
|
-
update: (key, f) => andThen(current, update(records, modify$2(key, (entry) => ({
|
|
109630
|
-
...entry,
|
|
109631
|
-
value: f(entry.value)
|
|
109632
|
-
})))),
|
|
109633
|
-
values: map$7(current, toValues)
|
|
109634
|
-
};
|
|
109635
|
-
});
|
|
109636
109250
|
// src/services/github/service.ts
|
|
109637
109251
|
const HEADERS = {
|
|
109638
109252
|
accept: "application/vnd.github+json",
|
|
@@ -109646,16 +109260,17 @@ const DEVELOPER_PROFILE = GitHubUser.make({
|
|
|
109646
109260
|
var GitHub = class GitHub extends Service$1()("@deslop/auth/services/github/service/GitHub") {
|
|
109647
109261
|
static layer = effect(GitHub, gen(function* () {
|
|
109648
109262
|
const CALLBACK = new URL("/auth/github/callback", yield* String$5("APP_URL")).href;
|
|
109649
|
-
const flows = yield*
|
|
109263
|
+
const flows = yield* make$24({
|
|
109264
|
+
capacity: 64,
|
|
109265
|
+
lookup: () => fail$6(AuthError.make({ message: "The sign-in expired" })),
|
|
109266
|
+
timeToLive: minutes(10)
|
|
109267
|
+
});
|
|
109268
|
+
const callbacks = yield* make$78(1);
|
|
109650
109269
|
const nonce = randomTokenOf(yield* SecureRandom)(32);
|
|
109651
109270
|
const take = fnUntraced(function* (state) {
|
|
109652
|
-
return
|
|
109653
|
-
});
|
|
109654
|
-
const cancel = fn("GitHub.cancel")(function* (state) {
|
|
109655
|
-
return omit(yield* take(state), ["verifier"]);
|
|
109271
|
+
return yield* pipe(getOption(flows, state), tap$2(() => invalidate(flows, state)), flatMap$3(fromOption), mapError$2(() => AuthError.make({ message: "The sign-in expired" })), uninterruptible, withPermit(callbacks));
|
|
109656
109272
|
});
|
|
109657
109273
|
if (yield* localAuth) return GitHub.of({
|
|
109658
|
-
cancel,
|
|
109659
109274
|
finish: fn("GitHub.finish")(function* (_code, state) {
|
|
109660
109275
|
return {
|
|
109661
109276
|
flow: omit(yield* take(state), ["verifier"]),
|
|
@@ -109663,10 +109278,9 @@ var GitHub = class GitHub extends Service$1()("@deslop/auth/services/github/serv
|
|
|
109663
109278
|
};
|
|
109664
109279
|
}),
|
|
109665
109280
|
login: () => withSpan(succeed$5(DEVELOPER_PROFILE), "GitHub.login"),
|
|
109666
|
-
profile: () => withSpan(succeed$5(DEVELOPER_PROFILE), "GitHub.profile"),
|
|
109667
109281
|
start: fn("GitHub.start")(function* (flow) {
|
|
109668
109282
|
const state = OAuthState.make(yield* nonce);
|
|
109669
|
-
yield* flows
|
|
109283
|
+
yield* set(flows, state, {
|
|
109670
109284
|
...flow,
|
|
109671
109285
|
verifier: none()
|
|
109672
109286
|
});
|
|
@@ -109688,8 +109302,24 @@ var GitHub = class GitHub extends Service$1()("@deslop/auth/services/github/serv
|
|
|
109688
109302
|
const user = fnUntraced(function* (request) {
|
|
109689
109303
|
return yield* pipe(client.execute(setHeaders$1(request, HEADERS)), flatMap$3(schemaBodyJson$1(GitHubUser)), timeout("10 seconds"));
|
|
109690
109304
|
});
|
|
109305
|
+
const logins = yield* makeWith((login) => mapError$2(user(get$1(`https://api.github.com/users/${encodeURIComponent(login)}`)), (cause) => match(isHttpClientError(cause) && cause.response?.status === 404, {
|
|
109306
|
+
onFalse: () => AuthError.make({
|
|
109307
|
+
cause,
|
|
109308
|
+
error: "temporarily_unavailable",
|
|
109309
|
+
message: "GitHub could not be reached"
|
|
109310
|
+
}),
|
|
109311
|
+
onTrue: () => AuthError.make({
|
|
109312
|
+
cause,
|
|
109313
|
+
message: "GitHub no longer knows this login"
|
|
109314
|
+
})
|
|
109315
|
+
})), {
|
|
109316
|
+
capacity: 64,
|
|
109317
|
+
timeToLive: (exit) => match$3(exit, {
|
|
109318
|
+
onFailure: constant(0),
|
|
109319
|
+
onSuccess: constant("1 day")
|
|
109320
|
+
})
|
|
109321
|
+
});
|
|
109691
109322
|
return GitHub.of({
|
|
109692
|
-
cancel,
|
|
109693
109323
|
finish: fn("GitHub.finish")(function* (code, state) {
|
|
109694
109324
|
const flow = yield* take(state);
|
|
109695
109325
|
const token = yield* pipe(post("https://github.com/login/oauth/access_token"), acceptJson, bodyUrlParams({
|
|
@@ -109704,14 +109334,11 @@ var GitHub = class GitHub extends Service$1()("@deslop/auth/services/github/serv
|
|
|
109704
109334
|
profile: yield* user(bearerToken(get$1("https://api.github.com/user"), token.access_token))
|
|
109705
109335
|
};
|
|
109706
109336
|
}, asAuthError("GitHub sign-in failed")),
|
|
109707
|
-
login: (login) =>
|
|
109708
|
-
profile: fn("GitHub.profile")(function* (id) {
|
|
109709
|
-
return yield* user(get$1(`https://api.github.com/user/${id}`));
|
|
109710
|
-
}, asAuthError("Cannot read the GitHub profile")),
|
|
109337
|
+
login: (login) => get(logins, login),
|
|
109711
109338
|
start: fn("GitHub.start")(function* (flow) {
|
|
109712
109339
|
const state = OAuthState.make(yield* nonce);
|
|
109713
109340
|
const verifier = yield* nonce;
|
|
109714
|
-
yield* flows
|
|
109341
|
+
yield* set(flows, state, {
|
|
109715
109342
|
...flow,
|
|
109716
109343
|
verifier: some$1(verifier)
|
|
109717
109344
|
});
|
|
@@ -109731,24 +109358,6 @@ var GitHub = class GitHub extends Service$1()("@deslop/auth/services/github/serv
|
|
|
109731
109358
|
});
|
|
109732
109359
|
}));
|
|
109733
109360
|
};
|
|
109734
|
-
// src/services/identity/schema.ts
|
|
109735
|
-
const Profile = Struct$2({
|
|
109736
|
-
DisplayName: String$6,
|
|
109737
|
-
ID: Finite,
|
|
109738
|
-
LoginName: String$6
|
|
109739
|
-
});
|
|
109740
|
-
const Node = Struct$2({ Tags: optionalKey(NullOr(ArraySchema(String$6))) });
|
|
109741
|
-
const Whois = Struct$2({
|
|
109742
|
-
Node,
|
|
109743
|
-
UserProfile: Profile
|
|
109744
|
-
});
|
|
109745
|
-
const Status = Struct$2({
|
|
109746
|
-
Self: Struct$2({
|
|
109747
|
-
...Node.fields,
|
|
109748
|
-
UserID: Finite
|
|
109749
|
-
}),
|
|
109750
|
-
User: Record$1(String$6, Profile)
|
|
109751
|
-
});
|
|
109752
109361
|
// src/services/people/lib/utils.ts
|
|
109753
109362
|
const ROLE_ORDER = {
|
|
109754
109363
|
Admin: 1,
|
|
@@ -109792,15 +109401,15 @@ function personOf(admins, row) {
|
|
|
109792
109401
|
return Person.make({
|
|
109793
109402
|
admin: isAdmin(admins, row.id),
|
|
109794
109403
|
...pick(row, ["id", "name"]),
|
|
109795
|
-
fullName: filter$
|
|
109404
|
+
fullName: filter$7(row.fullName, isNonEmpty$1),
|
|
109796
109405
|
role: roleOf(admins, row.id, some$1(row)),
|
|
109797
|
-
since:
|
|
109406
|
+
since: row.since
|
|
109798
109407
|
});
|
|
109799
109408
|
}
|
|
109800
109409
|
function listPeople(rows, admins) {
|
|
109801
109410
|
const known = map$10(rows, (row) => personOf(admins, row));
|
|
109802
109411
|
const knownIds = fromIterable(map$10(known, (person) => person.id));
|
|
109803
|
-
return sort([...pipe(admins, filter$
|
|
109412
|
+
return sort([...pipe(admins, filter$5((id) => !has(knownIds, `github:${id}`)), map$10((id) => Person.make({
|
|
109804
109413
|
admin: true,
|
|
109805
109414
|
fullName: none(),
|
|
109806
109415
|
id: UserId.make(`github:${id}`),
|
|
@@ -109833,6 +109442,13 @@ var People = class People extends Service$1()("@deslop/auth/services/people/serv
|
|
|
109833
109442
|
"apps_migrations"
|
|
109834
109443
|
]) yield* sql`DROP TABLE IF EXISTS ${sql(table)}`;
|
|
109835
109444
|
yield* sql`ALTER TABLE members DROP COLUMN incarnation`;
|
|
109445
|
+
}),
|
|
109446
|
+
"0003_nullable_since": gen(function* () {
|
|
109447
|
+
const sql = yield* SqlClient;
|
|
109448
|
+
yield* sql`CREATE TABLE members_next (id TEXT PRIMARY KEY, name TEXT NOT NULL, fullName TEXT, since INTEGER, status TEXT NOT NULL) STRICT`;
|
|
109449
|
+
yield* sql`INSERT INTO members_next SELECT id, name, fullName, NULLIF(since, 0), status FROM members`;
|
|
109450
|
+
yield* sql`DROP TABLE members`;
|
|
109451
|
+
yield* sql`ALTER TABLE members_next RENAME TO members`;
|
|
109836
109452
|
})
|
|
109837
109453
|
}),
|
|
109838
109454
|
table: "members_migrations"
|
|
@@ -109878,21 +109494,11 @@ var People = class People extends Service$1()("@deslop/auth/services/people/serv
|
|
|
109878
109494
|
onTrue: () => existing(params.id)
|
|
109879
109495
|
}));
|
|
109880
109496
|
}, mutate, sql.withTransaction, asAuthError("Cannot answer the access request")),
|
|
109881
|
-
allowed: fn("People.allowed")(function* (id) {
|
|
109882
|
-
return yield* authorizeMember(admins, id, yield* find(id));
|
|
109883
|
-
}, asAuthError("Cannot read the account")),
|
|
109884
109497
|
find,
|
|
109885
109498
|
list: fn("People.list")(function* (user) {
|
|
109886
109499
|
yield* requireAdmin(user, "Only an admin can manage people");
|
|
109887
109500
|
return listPeople(yield* all(), admins);
|
|
109888
109501
|
}, asAuthError("Cannot read people")),
|
|
109889
|
-
login: fn("People.login")(function* (login) {
|
|
109890
|
-
return yield* findOneOption({
|
|
109891
|
-
Request: String$6,
|
|
109892
|
-
Result: Member,
|
|
109893
|
-
execute: (name) => sql`SELECT * FROM ${table} WHERE id LIKE 'github:%' AND lower(name) = lower(${name}) LIMIT 1`
|
|
109894
|
-
})(login);
|
|
109895
|
-
}, asAuthError("Cannot read the person")),
|
|
109896
109502
|
register: fn("People.register")(function* (user, fullName, tailnet) {
|
|
109897
109503
|
const status = match(tailnet || isAdmin(admins, user.id), {
|
|
109898
109504
|
onFalse: constant("Waiting"),
|
|
@@ -109900,7 +109506,7 @@ var People = class People extends Service$1()("@deslop/auth/services/people/serv
|
|
|
109900
109506
|
});
|
|
109901
109507
|
const row = yield* find(user.id);
|
|
109902
109508
|
if (exists(row, (member) => member.name === user.name && getOrUndefined$1(member.fullName) === getOrUndefined$1(fullName) && (status === "Waiting" || member.status === "Allowed"))) return yield* fromOption(row);
|
|
109903
|
-
yield* mutate(sql`INSERT INTO ${table} (id, name, fullName, since, status) VALUES (${user.id}, ${user.name}, ${getOrUndefined$1(filter$
|
|
109509
|
+
yield* mutate(sql`INSERT INTO ${table} (id, name, fullName, since, status) VALUES (${user.id}, ${user.name}, ${getOrUndefined$1(filter$7(fullName, isNonEmpty$1))}, ${toEpochMillis(yield* now)}, ${status}) ON CONFLICT (id) DO UPDATE SET name = excluded.name, fullName = excluded.fullName, status = CASE WHEN excluded.status = 'Allowed' THEN 'Allowed' ELSE ${table}.status END`);
|
|
109904
109510
|
return yield* existing(user.id);
|
|
109905
109511
|
}, sql.withTransaction, asAuthError("Cannot register the person")),
|
|
109906
109512
|
remove: fn("People.remove")(function* (id, user) {
|
|
@@ -109916,9 +109522,49 @@ var People = class People extends Service$1()("@deslop/auth/services/people/serv
|
|
|
109916
109522
|
});
|
|
109917
109523
|
})), People.migrations);
|
|
109918
109524
|
};
|
|
109525
|
+
// src/services/tailnet/schema.ts
|
|
109526
|
+
const Profile = Struct$2({
|
|
109527
|
+
DisplayName: String$6,
|
|
109528
|
+
ID: Finite,
|
|
109529
|
+
LoginName: String$6
|
|
109530
|
+
});
|
|
109531
|
+
const Node = Struct$2({ Tags: optionalKey(NullOr(ArraySchema(String$6))) });
|
|
109532
|
+
const Whois = Struct$2({
|
|
109533
|
+
Node,
|
|
109534
|
+
UserProfile: Profile
|
|
109535
|
+
});
|
|
109536
|
+
const Status = Struct$2({
|
|
109537
|
+
Self: Struct$2({
|
|
109538
|
+
...Node.fields,
|
|
109539
|
+
UserID: Finite
|
|
109540
|
+
}),
|
|
109541
|
+
User: Record$1(String$6, Profile)
|
|
109542
|
+
});
|
|
109543
|
+
// src/services/tailnet/service.ts
|
|
109544
|
+
var Tailnet = class Tailnet extends Service$1()("@deslop/auth/services/tailnet/service/Tailnet") {
|
|
109545
|
+
static layer = effect(Tailnet, gen(function* () {
|
|
109546
|
+
const spawner = yield* ChildProcessSpawner;
|
|
109547
|
+
const status = yield* makeWith(() => pipe(executeProcess("tailscale", ["status", "--json"]), flatMap$3(decodeUnknownEffect(fromJsonString(Status))), provideService$2(ChildProcessSpawner, spawner), timeout("10 seconds"), asAuthError("Cannot read the tailnet owner")), {
|
|
109548
|
+
capacity: 1,
|
|
109549
|
+
timeToLive: constant("1 minute")
|
|
109550
|
+
});
|
|
109551
|
+
const whois = yield* makeWith((address) => pipe(executeProcess("tailscale", [
|
|
109552
|
+
"whois",
|
|
109553
|
+
"--json",
|
|
109554
|
+
address
|
|
109555
|
+
]), flatMap$3(decodeUnknownEffect(fromJsonString(Whois))), provideService$2(ChildProcessSpawner, spawner), timeout("10 seconds"), asAuthError("Cannot identify the tailnet caller")), {
|
|
109556
|
+
capacity: 1024,
|
|
109557
|
+
timeToLive: constant("1 minute")
|
|
109558
|
+
});
|
|
109559
|
+
return Tailnet.of({
|
|
109560
|
+
status: get(status, "self"),
|
|
109561
|
+
whois: (address) => get(whois, address)
|
|
109562
|
+
});
|
|
109563
|
+
}));
|
|
109564
|
+
};
|
|
109919
109565
|
// src/services/identity/service.ts
|
|
109920
109566
|
function isMachine(address) {
|
|
109921
|
-
return some(values
|
|
109567
|
+
return some(values(networkInterfaces()), (entries) => entries !== void 0 && some(entries, (entry) => entry.address === address));
|
|
109922
109568
|
}
|
|
109923
109569
|
const TAILNET = [fromStringUnsafe("100.64.0.0/10"), fromStringUnsafe("fd7a:115c:a1e0::/48")];
|
|
109924
109570
|
function isTailnet(address) {
|
|
@@ -109931,35 +109577,14 @@ var Identity = class Identity extends Service$1()("@deslop/auth/services/identit
|
|
|
109931
109577
|
const github = yield* GitHub;
|
|
109932
109578
|
const local = yield* localAuth;
|
|
109933
109579
|
const admins = yield* adminIds;
|
|
109934
|
-
const
|
|
109935
|
-
const status = yield* makeWith(() => pipe(executeProcess("tailscale", ["status", "--json"]), flatMap$3(decodeUnknownEffect(fromJsonString(Status))), provideService$2(ChildProcessSpawner, spawner), timeout("10 seconds"), asAuthError("Cannot read the tailnet owner")), {
|
|
109936
|
-
capacity: 1,
|
|
109937
|
-
timeToLive: constant("1 minute")
|
|
109938
|
-
});
|
|
109939
|
-
const whois = yield* makeWith((address) => pipe(executeProcess("tailscale", [
|
|
109940
|
-
"whois",
|
|
109941
|
-
"--json",
|
|
109942
|
-
address
|
|
109943
|
-
]), flatMap$3(decodeUnknownEffect(fromJsonString(Whois))), provideService$2(ChildProcessSpawner, spawner), timeout("10 seconds"), asAuthError("Cannot identify the tailnet caller")), {
|
|
109944
|
-
capacity: 1024,
|
|
109945
|
-
timeToLive: constant("1 minute")
|
|
109946
|
-
});
|
|
109580
|
+
const owners = yield* Tailnet;
|
|
109947
109581
|
const tailnet = fnUntraced(function* (profile) {
|
|
109948
109582
|
if (endsWith("@github")(profile.LoginName)) {
|
|
109949
|
-
const
|
|
109950
|
-
return yield*
|
|
109951
|
-
|
|
109952
|
-
|
|
109953
|
-
|
|
109954
|
-
id: UserId.make(`github:${user.id}`),
|
|
109955
|
-
name: user.login
|
|
109956
|
-
}, user.name, true);
|
|
109957
|
-
}),
|
|
109958
|
-
onSome: (member) => people.register({
|
|
109959
|
-
id: member.id,
|
|
109960
|
-
name: member.name
|
|
109961
|
-
}, member.fullName, true)
|
|
109962
|
-
});
|
|
109583
|
+
const user = yield* github.login(slice(0, -7)(profile.LoginName));
|
|
109584
|
+
return yield* people.register({
|
|
109585
|
+
id: UserId.make(`github:${user.id}`),
|
|
109586
|
+
name: user.login
|
|
109587
|
+
}, user.name, true);
|
|
109963
109588
|
}
|
|
109964
109589
|
return yield* people.register({
|
|
109965
109590
|
id: UserId.make(`tailnet:${profile.LoginName}`),
|
|
@@ -109982,9 +109607,9 @@ var Identity = class Identity extends Service$1()("@deslop/auth/services/identit
|
|
|
109982
109607
|
onSome: (address) => gen(function* () {
|
|
109983
109608
|
if (isMachine(address)) return yield* match$8(request.onBehalfOf, {
|
|
109984
109609
|
onNone: () => gen(function* () {
|
|
109985
|
-
const found = yield*
|
|
109610
|
+
const found = yield* owners.status;
|
|
109986
109611
|
if ((found.Self.Tags?.length ?? 0) > 0) return yield* AuthError.make({ message: "Sign in first" });
|
|
109987
|
-
return yield* pipe(values
|
|
109612
|
+
return yield* pipe(values(found.User), findFirst((profile) => profile.ID === found.Self.UserID), match$8({
|
|
109988
109613
|
onNone: () => fail$6(AuthError.make({ message: "Sign in first" })),
|
|
109989
109614
|
onSome: tailnet
|
|
109990
109615
|
}));
|
|
@@ -109992,7 +109617,7 @@ var Identity = class Identity extends Service$1()("@deslop/auth/services/identit
|
|
|
109992
109617
|
onSome: (id) => succeed$5({ id })
|
|
109993
109618
|
});
|
|
109994
109619
|
if (!isTailnet(address)) return yield* AuthError.make({ message: "Sign in first" });
|
|
109995
|
-
const found = yield*
|
|
109620
|
+
const found = yield* owners.whois(address);
|
|
109996
109621
|
if ((found.Node.Tags?.length ?? 0) > 0) return yield* AuthError.make({ message: "Sign in first" });
|
|
109997
109622
|
return yield* tailnet(found.UserProfile);
|
|
109998
109623
|
})
|
|
@@ -110033,8 +109658,103 @@ var Identity = class Identity extends Service$1()("@deslop/auth/services/identit
|
|
|
110033
109658
|
}));
|
|
110034
109659
|
};
|
|
110035
109660
|
const layerIdentityAuth = effectContext(map$7(Identity, (identity) => Auth.makeContext(identity.account)));
|
|
109661
|
+
// src/services/sign-ins/service.ts
|
|
109662
|
+
function loginCookie(state) {
|
|
109663
|
+
return `__Host-login-${state}`;
|
|
109664
|
+
}
|
|
109665
|
+
const association = { webcredentials: { apps: flatMap$6([
|
|
109666
|
+
"opm",
|
|
109667
|
+
"stash",
|
|
109668
|
+
"trips"
|
|
109669
|
+
], (slug) => map$10(["", ".dev"], (suffix) => `99K7MQUK7F.xyz.mp281x.${slug}${suffix}`)) } };
|
|
109670
|
+
var SignIns = class SignIns extends Service$1()("@deslop/auth/services/sign-ins/service/SignIns") {
|
|
109671
|
+
static layer = effect(SignIns, gen(function* () {
|
|
109672
|
+
const github = yield* GitHub;
|
|
109673
|
+
const people = yield* People;
|
|
109674
|
+
const sessions = yield* CookieSessions;
|
|
109675
|
+
const identity = yield* Identity;
|
|
109676
|
+
const canonical = yield* String$5("APP_URL");
|
|
109677
|
+
const local = yield* localAuth;
|
|
109678
|
+
function nextOf(query) {
|
|
109679
|
+
const next = query.get("next") ?? canonical;
|
|
109680
|
+
if (returnable(next, canonical, local)) return succeed$5(next);
|
|
109681
|
+
return fail$6(AuthError.make({
|
|
109682
|
+
error: "access_denied",
|
|
109683
|
+
message: "Invalid return URL"
|
|
109684
|
+
}));
|
|
109685
|
+
}
|
|
109686
|
+
return SignIns.of({
|
|
109687
|
+
finish: fn("SignIns.finish")(function* (query, headers) {
|
|
109688
|
+
if (query.has("error")) return yield* AuthError.make({
|
|
109689
|
+
error: "access_denied",
|
|
109690
|
+
message: "GitHub sign-in was cancelled"
|
|
109691
|
+
});
|
|
109692
|
+
const params = yield* mapError$2(decodeUnknownEffect(CallbackParams)(fromEntries(query)), (cause) => AuthError.make({
|
|
109693
|
+
cause,
|
|
109694
|
+
error: "access_denied",
|
|
109695
|
+
message: "Invalid GitHub callback"
|
|
109696
|
+
}));
|
|
109697
|
+
if (parseHeader(headers["cookie"] ?? "")[loginCookie(params.state)] !== params.state) return yield* AuthError.make({
|
|
109698
|
+
error: "access_denied",
|
|
109699
|
+
message: "This browser did not start the sign-in"
|
|
109700
|
+
});
|
|
109701
|
+
const result = yield* github.finish(params.code, params.state);
|
|
109702
|
+
const secret = yield* sessions.create((yield* people.register({
|
|
109703
|
+
id: UserId.make(`github:${result.profile.id}`),
|
|
109704
|
+
name: result.profile.login
|
|
109705
|
+
}, result.profile.name, false)).id, fromNullishOr$1(headers[CLIENT_HEADER]), headers["user-agent"] ?? "Browser");
|
|
109706
|
+
const account = yield* identity.resolve(IdentifyRequest.make({
|
|
109707
|
+
address: none(),
|
|
109708
|
+
onBehalfOf: none(),
|
|
109709
|
+
session: some$1(secret)
|
|
109710
|
+
}), true);
|
|
109711
|
+
return match$8(result.flow.app, {
|
|
109712
|
+
onNone: () => ({
|
|
109713
|
+
session: some$1(secret),
|
|
109714
|
+
state: params.state,
|
|
109715
|
+
target: match(account.role === "Waiting", {
|
|
109716
|
+
onFalse: () => result.flow.next,
|
|
109717
|
+
onTrue: () => `/?${new URLSearchParams({ next: result.flow.next })}`
|
|
109718
|
+
})
|
|
109719
|
+
}),
|
|
109720
|
+
onSome: (app) => ({
|
|
109721
|
+
session: none(),
|
|
109722
|
+
state: params.state,
|
|
109723
|
+
target: new URL(`/signed-in/${app.app}?${new URLSearchParams({ session: secret })}`, canonical).href
|
|
109724
|
+
})
|
|
109725
|
+
});
|
|
109726
|
+
}),
|
|
109727
|
+
signOut: fn("SignIns.signOut")(function* (query, headers) {
|
|
109728
|
+
if (headers["origin"] !== new URL(canonical).origin) return yield* AuthError.make({
|
|
109729
|
+
error: "access_denied",
|
|
109730
|
+
message: "Invalid sign-out origin; no changes committed"
|
|
109731
|
+
});
|
|
109732
|
+
const next = yield* nextOf(query);
|
|
109733
|
+
const secret = parseHeader(headers["cookie"] ?? "")[SESSION_COOKIE];
|
|
109734
|
+
if (secret) yield* sessions.forget(secret);
|
|
109735
|
+
return next;
|
|
109736
|
+
}),
|
|
109737
|
+
start: fn("SignIns.start")(function* (query) {
|
|
109738
|
+
const app = yield* match(query.has("app"), {
|
|
109739
|
+
onFalse: () => succeedNone,
|
|
109740
|
+
onTrue: () => pipe(decodeUnknownEffect(AppSignIn)(fromEntries(query)), asSome, mapError$2((cause) => AuthError.make({
|
|
109741
|
+
cause,
|
|
109742
|
+
error: "access_denied",
|
|
109743
|
+
message: "Invalid app sign-in"
|
|
109744
|
+
})))
|
|
109745
|
+
});
|
|
109746
|
+
return yield* github.start({
|
|
109747
|
+
app,
|
|
109748
|
+
next: yield* match$8(app, {
|
|
109749
|
+
onNone: () => nextOf(query),
|
|
109750
|
+
onSome: () => succeed$5(canonical)
|
|
109751
|
+
})
|
|
109752
|
+
});
|
|
109753
|
+
})
|
|
109754
|
+
});
|
|
109755
|
+
}));
|
|
109756
|
+
};
|
|
110036
109757
|
// src/http/handlers.ts
|
|
110037
|
-
const LOGIN_COOKIE = "__Host-login";
|
|
110038
109758
|
const COOKIE = {
|
|
110039
109759
|
httpOnly: true,
|
|
110040
109760
|
path: "/",
|
|
@@ -110042,90 +109762,47 @@ const COOKIE = {
|
|
|
110042
109762
|
secure: true
|
|
110043
109763
|
};
|
|
110044
109764
|
function respond(effect) {
|
|
110045
|
-
return pipe(effect, catchIf(is$2(AuthError), (error) => succeed$5(text(error.message, failureOptions(error, 401)))), map$7(setHeader("cache-control", "no-store")));
|
|
109765
|
+
return pipe(effect, catchIf$2(is$2(AuthError), (error) => succeed$5(text(error.message, failureOptions(error, 401)))), map$7(setHeader("cache-control", "no-store")));
|
|
110046
109766
|
}
|
|
110047
109767
|
const HttpHandlers = use((router) => gen(function* () {
|
|
110048
109768
|
const identity = yield* Identity;
|
|
110049
|
-
const
|
|
110050
|
-
const people = yield* People;
|
|
110051
|
-
const sessions = yield* CookieSessions;
|
|
109769
|
+
const signIns = yield* SignIns;
|
|
110052
109770
|
const canonical = yield* String$5("APP_URL");
|
|
110053
|
-
const local = yield* localAuth;
|
|
110054
109771
|
const sessionCookie = {
|
|
110055
109772
|
...COOKIE,
|
|
110056
|
-
...match(
|
|
109773
|
+
...match(yield* localAuth, {
|
|
110057
109774
|
onFalse: () => ({ domain: parentDomain(canonical) }),
|
|
110058
109775
|
onTrue: () => ({})
|
|
110059
109776
|
}),
|
|
110060
109777
|
maxAge: "365 days"
|
|
110061
109778
|
};
|
|
110062
|
-
|
|
110063
|
-
const next = new URL(request.url, canonical).searchParams.get("next") ?? canonical;
|
|
110064
|
-
if (!returnable(next, canonical, local)) return fail$6(AuthError.make({
|
|
110065
|
-
error: "access_denied",
|
|
110066
|
-
message: "Invalid return URL"
|
|
110067
|
-
}));
|
|
110068
|
-
return succeed$5(next);
|
|
110069
|
-
}
|
|
109779
|
+
yield* router.add("GET", "/.well-known/apple-app-site-association", succeed$5(jsonUnsafe(association)));
|
|
110070
109780
|
yield* router.add("POST", IDENTIFY_PATH, respond(gen(function* () {
|
|
110071
109781
|
if (!isMachine((yield* HttpServerRequest).headers["x-deslop-client"] ?? "")) return text("Only this machine may identify callers", { status: 403 });
|
|
110072
|
-
return yield* schemaJson(Account$1)(yield* identity.resolve(yield* schemaBodyJson(IdentifyRequest))
|
|
109782
|
+
return yield* schemaJson(Account$1)(yield* identity.resolve(yield* mapError$2(schemaBodyJson(IdentifyRequest), (cause) => AuthError.make({
|
|
109783
|
+
cause,
|
|
109784
|
+
error: "access_denied",
|
|
109785
|
+
message: "Invalid identify request"
|
|
109786
|
+
}))));
|
|
110073
109787
|
})));
|
|
110074
109788
|
yield* router.add("GET", "/sign-in", respond(gen(function* () {
|
|
110075
|
-
const
|
|
110076
|
-
|
|
110077
|
-
const app = yield* match(query.has("app"), {
|
|
110078
|
-
onFalse: () => succeed$5(none()),
|
|
110079
|
-
onTrue: () => pipe(decodeUnknownEffect(AppSignIn)(fromEntries(query)), asSome, mapError$2((cause) => AuthError.make({
|
|
110080
|
-
cause,
|
|
110081
|
-
error: "access_denied",
|
|
110082
|
-
message: "Invalid app sign-in"
|
|
110083
|
-
})))
|
|
110084
|
-
});
|
|
110085
|
-
const started = yield* github.start({
|
|
110086
|
-
app,
|
|
110087
|
-
next: yield* match$8(app, {
|
|
110088
|
-
onNone: () => nextOf(request),
|
|
110089
|
-
onSome: () => succeed$5(canonical)
|
|
110090
|
-
})
|
|
110091
|
-
});
|
|
110092
|
-
return setCookieUnsafe(redirect(started.url), LOGIN_COOKIE, started.state, {
|
|
109789
|
+
const started = yield* signIns.start(new URL((yield* HttpServerRequest).url, canonical).searchParams);
|
|
109790
|
+
return setCookieUnsafe(redirect(started.url), loginCookie(started.state), started.state, {
|
|
110093
109791
|
...COOKIE,
|
|
110094
109792
|
maxAge: "10 minutes"
|
|
110095
109793
|
});
|
|
110096
109794
|
})));
|
|
110097
109795
|
yield* router.add("GET", "/auth/github/callback", respond(gen(function* () {
|
|
110098
109796
|
const request = yield* HttpServerRequest;
|
|
110099
|
-
const
|
|
110100
|
-
|
|
110101
|
-
|
|
110102
|
-
|
|
110103
|
-
});
|
|
110104
|
-
const result = yield* github.finish(params.code, OAuthState.make(params.state));
|
|
110105
|
-
const member = yield* people.register({
|
|
110106
|
-
id: UserId.make(`github:${result.profile.id}`),
|
|
110107
|
-
name: result.profile.login
|
|
110108
|
-
}, result.profile.name, false);
|
|
110109
|
-
const secret = yield* sessions.create(member.id, fromNullishOr$1(request.headers[CLIENT_HEADER]), request.headers["user-agent"] ?? "Browser");
|
|
110110
|
-
const account = yield* identity.resolve(IdentifyRequest.make({
|
|
110111
|
-
address: none(),
|
|
110112
|
-
onBehalfOf: none(),
|
|
110113
|
-
session: some$1(secret)
|
|
110114
|
-
}), true);
|
|
110115
|
-
return yield* match$8(result.flow.app, {
|
|
110116
|
-
onNone: () => succeed$5(pipe(redirect(match(account.role === "Waiting", {
|
|
110117
|
-
onFalse: () => result.flow.next,
|
|
110118
|
-
onTrue: () => `/?${new URLSearchParams({ next: result.flow.next })}`
|
|
110119
|
-
})), setCookieUnsafe(SESSION_COOKIE, secret, sessionCookie), expireCookieUnsafe(LOGIN_COOKIE, COOKIE))),
|
|
110120
|
-
onSome: (app) => succeed$5(expireCookieUnsafe(redirect(`${app.app}://signed-in?${new URLSearchParams({ session: secret })}`), LOGIN_COOKIE, COOKIE))
|
|
110121
|
-
});
|
|
109797
|
+
const result = yield* signIns.finish(new URL(request.url, canonical).searchParams, request.headers);
|
|
109798
|
+
return pipe(redirect(result.target), (response) => match$8(result.session, {
|
|
109799
|
+
onNone: () => response,
|
|
109800
|
+
onSome: (secret) => setCookieUnsafe(response, SESSION_COOKIE, secret, sessionCookie)
|
|
109801
|
+
}), expireCookieUnsafe(loginCookie(result.state), COOKIE));
|
|
110122
109802
|
})));
|
|
110123
|
-
yield* router.add("
|
|
109803
|
+
yield* router.add("POST", "/sign-out", respond(gen(function* () {
|
|
110124
109804
|
const request = yield* HttpServerRequest;
|
|
110125
|
-
|
|
110126
|
-
const secret = parseHeader(request.headers["cookie"] ?? "")[SESSION_COOKIE];
|
|
110127
|
-
if (secret) yield* sessions.forget(secret);
|
|
110128
|
-
return expireCookieUnsafe(redirect(next), SESSION_COOKIE, sessionCookie);
|
|
109805
|
+
return expireCookieUnsafe(redirect(yield* signIns.signOut(new URL(request.url, canonical).searchParams, request.headers), { status: 303 }), SESSION_COOKIE, sessionCookie);
|
|
110129
109806
|
})));
|
|
110130
109807
|
}));
|
|
110131
109808
|
// src/routes/icon.svg
|
|
@@ -110223,7 +109900,7 @@ const ToolHandlers = ToolContracts.toLayer(gen(function* () {
|
|
|
110223
109900
|
};
|
|
110224
109901
|
}));
|
|
110225
109902
|
// src/main.server.ts
|
|
110226
|
-
const layerServices = pipe(Identity.layer, provideMerge(People.layer), provideMerge(mergeAll$2(CookieSessions.layer, GitHub.layer)), provide$2(succeed$6(RequestInit, { redirect: "error" })));
|
|
109903
|
+
const layerServices = pipe(SignIns.layer, provideMerge(Identity.layer), provide$2(Tailnet.layer), provideMerge(People.layer), provideMerge(mergeAll$2(CookieSessions.layer, GitHub.layer)), provide$2(succeed$6(RequestInit, { redirect: "error" })));
|
|
110227
109904
|
runApp({
|
|
110228
109905
|
auth: provide$2(layerIdentityAuth, layerServices),
|
|
110229
109906
|
icon: icon_default,
|