@samva/cli 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/bin.mjs +1316 -644
- package/package.json +8 -7
package/dist/bin.mjs
CHANGED
|
@@ -2086,54 +2086,8 @@ var Reference = Service;
|
|
|
2086
2086
|
var isArrayNonEmpty = (self) => self.length > 0;
|
|
2087
2087
|
|
|
2088
2088
|
// ../../node_modules/.bun/effect@4.0.0-rc.112/node_modules/effect/dist/Result.js
|
|
2089
|
-
var exports_Result = {};
|
|
2090
|
-
__export(exports_Result, {
|
|
2091
|
-
Do: () => Do2,
|
|
2092
|
-
all: () => all2,
|
|
2093
|
-
andThen: () => andThen2,
|
|
2094
|
-
bind: () => bind3,
|
|
2095
|
-
bindTo: () => bindTo3,
|
|
2096
|
-
fail: () => fail2,
|
|
2097
|
-
failVoid: () => failVoid,
|
|
2098
|
-
filterOrFail: () => filterOrFail,
|
|
2099
|
-
flatMap: () => flatMap2,
|
|
2100
|
-
flip: () => flip,
|
|
2101
|
-
fromNullishOr: () => fromNullishOr2,
|
|
2102
|
-
fromOption: () => fromOption2,
|
|
2103
|
-
gen: () => gen2,
|
|
2104
|
-
getFailure: () => getFailure3,
|
|
2105
|
-
getOrElse: () => getOrElse3,
|
|
2106
|
-
getOrNull: () => getOrNull2,
|
|
2107
|
-
getOrThrow: () => getOrThrow2,
|
|
2108
|
-
getOrThrowWith: () => getOrThrowWith2,
|
|
2109
|
-
getOrUndefined: () => getOrUndefined3,
|
|
2110
|
-
getSuccess: () => getSuccess3,
|
|
2111
|
-
isFailure: () => isFailure2,
|
|
2112
|
-
isResult: () => isResult2,
|
|
2113
|
-
isSuccess: () => isSuccess2,
|
|
2114
|
-
let: () => let_3,
|
|
2115
|
-
liftPredicate: () => liftPredicate2,
|
|
2116
|
-
makeEquivalence: () => makeEquivalence2,
|
|
2117
|
-
map: () => map2,
|
|
2118
|
-
mapBoth: () => mapBoth,
|
|
2119
|
-
mapError: () => mapError,
|
|
2120
|
-
match: () => match2,
|
|
2121
|
-
merge: () => merge2,
|
|
2122
|
-
orElse: () => orElse2,
|
|
2123
|
-
succeed: () => succeed2,
|
|
2124
|
-
succeedNone: () => succeedNone,
|
|
2125
|
-
succeedSome: () => succeedSome,
|
|
2126
|
-
tap: () => tap2,
|
|
2127
|
-
transposeMapOption: () => transposeMapOption,
|
|
2128
|
-
transposeOption: () => transposeOption,
|
|
2129
|
-
try: () => try_,
|
|
2130
|
-
void: () => void_2
|
|
2131
|
-
});
|
|
2132
2089
|
var succeed2 = succeed;
|
|
2133
2090
|
var fail2 = fail;
|
|
2134
|
-
var void_2 = /* @__PURE__ */ succeed2(undefined);
|
|
2135
|
-
var failVoid = /* @__PURE__ */ fail2(undefined);
|
|
2136
|
-
var fromNullishOr2 = /* @__PURE__ */ dual(2, (self, onNullish) => self == null ? fail2(onNullish(self)) : succeed2(self));
|
|
2137
2091
|
var fromOption2 = fromOption;
|
|
2138
2092
|
var try_ = (evaluate2) => {
|
|
2139
2093
|
if (isFunction(evaluate2)) {
|
|
@@ -2153,41 +2107,19 @@ var try_ = (evaluate2) => {
|
|
|
2153
2107
|
var isResult2 = isResult;
|
|
2154
2108
|
var isFailure2 = isFailure;
|
|
2155
2109
|
var isSuccess2 = isSuccess;
|
|
2156
|
-
var getSuccess3 = getSuccess;
|
|
2157
|
-
var getFailure3 = getFailure;
|
|
2158
2110
|
var makeEquivalence2 = (success, failure) => make3((x, y) => isFailure2(x) ? isFailure2(y) && failure(x.failure, y.failure) : isSuccess2(y) && success(x.success, y.success));
|
|
2159
|
-
var mapBoth = /* @__PURE__ */ dual(2, (self, {
|
|
2160
|
-
onFailure,
|
|
2161
|
-
onSuccess
|
|
2162
|
-
}) => isFailure2(self) ? fail2(onFailure(self.failure)) : succeed2(onSuccess(self.success)));
|
|
2163
2111
|
var mapError = /* @__PURE__ */ dual(2, (self, f) => isFailure2(self) ? fail2(f(self.failure)) : self);
|
|
2164
2112
|
var map2 = /* @__PURE__ */ dual(2, (self, f) => isSuccess2(self) ? succeed2(f(self.success)) : self);
|
|
2165
2113
|
var match2 = /* @__PURE__ */ dual(2, (self, {
|
|
2166
2114
|
onFailure,
|
|
2167
2115
|
onSuccess
|
|
2168
2116
|
}) => isFailure2(self) ? onFailure(self.failure) : onSuccess(self.success));
|
|
2169
|
-
var liftPredicate2 = /* @__PURE__ */ dual(3, (a, predicate, orFailWith) => predicate(a) ? succeed2(a) : fail2(orFailWith(a)));
|
|
2170
|
-
var filterOrFail = /* @__PURE__ */ dual(3, (self, predicate, orFailWith) => flatMap2(self, (a) => predicate(a) ? succeed2(a) : fail2(orFailWith(a))));
|
|
2171
2117
|
var merge2 = /* @__PURE__ */ match2({
|
|
2172
2118
|
onFailure: identity,
|
|
2173
2119
|
onSuccess: identity
|
|
2174
2120
|
});
|
|
2175
2121
|
var getOrElse3 = /* @__PURE__ */ dual(2, (self, onFailure) => isFailure2(self) ? onFailure(self.failure) : self.success);
|
|
2176
|
-
var getOrNull2 = /* @__PURE__ */ getOrElse3(constNull);
|
|
2177
|
-
var getOrUndefined3 = /* @__PURE__ */ getOrElse3(constUndefined);
|
|
2178
|
-
var getOrThrowWith2 = /* @__PURE__ */ dual(2, (self, onFailure) => {
|
|
2179
|
-
if (isSuccess2(self)) {
|
|
2180
|
-
return self.success;
|
|
2181
|
-
}
|
|
2182
|
-
throw onFailure(self.failure);
|
|
2183
|
-
});
|
|
2184
|
-
var getOrThrow2 = /* @__PURE__ */ getOrThrowWith2(identity);
|
|
2185
|
-
var orElse2 = /* @__PURE__ */ dual(2, (self, that) => isFailure2(self) ? that(self.failure) : succeed2(self.success));
|
|
2186
2122
|
var flatMap2 = /* @__PURE__ */ dual(2, (self, f) => isFailure2(self) ? fail2(self.failure) : f(self.success));
|
|
2187
|
-
var andThen2 = /* @__PURE__ */ dual(2, (self, f) => flatMap2(self, (a) => {
|
|
2188
|
-
const out = isFunction(f) ? f(a) : f;
|
|
2189
|
-
return isResult2(out) ? out : succeed2(out);
|
|
2190
|
-
}));
|
|
2191
2123
|
var all2 = (input) => {
|
|
2192
2124
|
if (Symbol.iterator in input) {
|
|
2193
2125
|
const out2 = [];
|
|
@@ -2209,36 +2141,6 @@ var all2 = (input) => {
|
|
|
2209
2141
|
}
|
|
2210
2142
|
return succeed2(out);
|
|
2211
2143
|
};
|
|
2212
|
-
var flip = (self) => isFailure2(self) ? succeed2(self.failure) : fail2(self.success);
|
|
2213
|
-
var gen2 = (...args2) => {
|
|
2214
|
-
const f = args2.length === 1 ? args2[0] : args2[1].bind(args2[0]);
|
|
2215
|
-
const iterator = f();
|
|
2216
|
-
let state = iterator.next();
|
|
2217
|
-
while (!state.done) {
|
|
2218
|
-
const current = state.value;
|
|
2219
|
-
if (isFailure2(current)) {
|
|
2220
|
-
return current;
|
|
2221
|
-
}
|
|
2222
|
-
state = iterator.next(current.success);
|
|
2223
|
-
}
|
|
2224
|
-
return succeed2(state.value);
|
|
2225
|
-
};
|
|
2226
|
-
var Do2 = /* @__PURE__ */ succeed2({});
|
|
2227
|
-
var bind3 = /* @__PURE__ */ bind(map2, flatMap2);
|
|
2228
|
-
var bindTo3 = /* @__PURE__ */ bindTo(map2);
|
|
2229
|
-
var let_3 = /* @__PURE__ */ let_(map2);
|
|
2230
|
-
var transposeOption = (self) => {
|
|
2231
|
-
return isNone(self) ? succeedNone : map2(self.value, some2);
|
|
2232
|
-
};
|
|
2233
|
-
var transposeMapOption = /* @__PURE__ */ dual(2, (self, f) => isNone(self) ? succeedNone : map2(f(self.value), some2));
|
|
2234
|
-
var succeedNone = /* @__PURE__ */ succeed2(none);
|
|
2235
|
-
var succeedSome = (a) => succeed2(some2(a));
|
|
2236
|
-
var tap2 = /* @__PURE__ */ dual(2, (self, f) => {
|
|
2237
|
-
if (isSuccess2(self)) {
|
|
2238
|
-
f(self.success);
|
|
2239
|
-
}
|
|
2240
|
-
return self;
|
|
2241
|
-
});
|
|
2242
2144
|
|
|
2243
2145
|
// ../../node_modules/.bun/effect@4.0.0-rc.112/node_modules/effect/dist/Tuple.js
|
|
2244
2146
|
var makeEquivalence3 = Tuple2;
|
|
@@ -4238,7 +4140,7 @@ var fromResult = /* @__PURE__ */ match2({
|
|
|
4238
4140
|
onFailure: fail3,
|
|
4239
4141
|
onSuccess: succeed3
|
|
4240
4142
|
});
|
|
4241
|
-
var
|
|
4143
|
+
var fromNullishOr2 = (value) => value == null ? fail3(new NoSuchElementError) : succeed3(value);
|
|
4242
4144
|
var yieldNowWith = /* @__PURE__ */ makePrimitive({
|
|
4243
4145
|
op: "Yield",
|
|
4244
4146
|
[evaluate](fiber) {
|
|
@@ -4254,13 +4156,13 @@ var yieldNowWith = /* @__PURE__ */ makePrimitive({
|
|
|
4254
4156
|
}
|
|
4255
4157
|
});
|
|
4256
4158
|
var yieldNow = /* @__PURE__ */ yieldNowWith(0);
|
|
4257
|
-
var
|
|
4258
|
-
var
|
|
4259
|
-
var
|
|
4159
|
+
var succeedSome = (a) => succeed3(some3(a));
|
|
4160
|
+
var succeedNone = /* @__PURE__ */ succeed3(/* @__PURE__ */ none2());
|
|
4161
|
+
var transposeOption = (self) => isNone2(self) ? succeedNone : map5(self.value, some3);
|
|
4260
4162
|
var failCauseSync = (evaluate2) => suspend(() => failCause(internalCall(evaluate2)));
|
|
4261
4163
|
var die = (defect) => exitDie(defect);
|
|
4262
4164
|
var failSync = (error) => suspend(() => fail3(internalCall(error)));
|
|
4263
|
-
var
|
|
4165
|
+
var void_2 = /* @__PURE__ */ succeed3(undefined);
|
|
4264
4166
|
var try_2 = (options) => {
|
|
4265
4167
|
const evaluate2 = typeof options === "function" ? options : options.try;
|
|
4266
4168
|
const catcher = typeof options === "function" ? (cause) => new UnknownError(cause, "An error occurred in Effect.try") : options.catch;
|
|
@@ -4345,7 +4247,7 @@ var asyncFinalizer = /* @__PURE__ */ makePrimitive({
|
|
|
4345
4247
|
});
|
|
4346
4248
|
var callback = (register) => callbackOptions(register, register.length >= 2);
|
|
4347
4249
|
var never = /* @__PURE__ */ callback(constVoid);
|
|
4348
|
-
var
|
|
4250
|
+
var gen2 = (...args2) => suspend(() => fromIteratorUnsafe(args2.length === 1 ? args2[0]() : args2[1].call(args2[0].self)));
|
|
4349
4251
|
var fnUntraced = (body, ...pipeables) => {
|
|
4350
4252
|
const fn = pipeables.length === 0 ? function() {
|
|
4351
4253
|
return suspend(() => fromIteratorUnsafe(body.apply(this, arguments)));
|
|
@@ -4471,12 +4373,12 @@ var as2 = /* @__PURE__ */ dual(2, (self, value) => {
|
|
|
4471
4373
|
return flatMap3(self, (_) => b);
|
|
4472
4374
|
});
|
|
4473
4375
|
var asSome = (self) => map5(self, some3);
|
|
4474
|
-
var
|
|
4376
|
+
var flip = (self) => matchEffect(self, {
|
|
4475
4377
|
onFailure: succeed3,
|
|
4476
4378
|
onSuccess: fail3
|
|
4477
4379
|
});
|
|
4478
|
-
var
|
|
4479
|
-
var
|
|
4380
|
+
var andThen2 = /* @__PURE__ */ dual(2, (self, f) => flatMap3(self, (a) => isEffect(f) ? f : internalCall(() => f(a))));
|
|
4381
|
+
var tap2 = /* @__PURE__ */ dual(2, (self, f) => flatMap3(self, (a) => as2(isEffect(f) ? f : internalCall(() => f(a)), a)));
|
|
4480
4382
|
var asVoid2 = (self) => flatMap3(self, (_) => exitVoid);
|
|
4481
4383
|
var sandbox = (self) => catchCause(self, fail3);
|
|
4482
4384
|
var raceAll = (all3, options) => withFiber((parent) => callback((resume) => {
|
|
@@ -4579,7 +4481,7 @@ var flatten4 = (self) => flatMap3(self, identity);
|
|
|
4579
4481
|
var map5 = /* @__PURE__ */ dual(2, (self, f) => flatMap3(self, (a) => succeed3(internalCall(() => f(a)))));
|
|
4580
4482
|
var mapEager = /* @__PURE__ */ dual(2, (self, f) => effectIsExit(self) ? exitMap(self, f) : map5(self, f));
|
|
4581
4483
|
var mapErrorEager = /* @__PURE__ */ dual(2, (self, f) => effectIsExit(self) ? exitMapError(self, f) : mapError2(self, f));
|
|
4582
|
-
var mapBothEager = /* @__PURE__ */ dual(2, (self, options) => effectIsExit(self) ? exitMapBoth(self, options) :
|
|
4484
|
+
var mapBothEager = /* @__PURE__ */ dual(2, (self, options) => effectIsExit(self) ? exitMapBoth(self, options) : mapBoth(self, options));
|
|
4583
4485
|
var catchEager = /* @__PURE__ */ dual(2, (self, f) => {
|
|
4584
4486
|
if (effectIsExit(self)) {
|
|
4585
4487
|
if (self._tag === "Success")
|
|
@@ -4654,13 +4556,13 @@ var updateServiceScoped = (service2, update, options) => uninterruptible(withFib
|
|
|
4654
4556
|
let next;
|
|
4655
4557
|
if (options?.reset === undefined) {
|
|
4656
4558
|
if (current !== updated)
|
|
4657
|
-
return
|
|
4559
|
+
return void_2;
|
|
4658
4560
|
next = original;
|
|
4659
4561
|
} else {
|
|
4660
4562
|
next = options.reset(original, updated, current);
|
|
4661
4563
|
}
|
|
4662
4564
|
fiber2.setContext(add(fiber2.context, service2, next));
|
|
4663
|
-
return
|
|
4565
|
+
return void_2;
|
|
4664
4566
|
});
|
|
4665
4567
|
}));
|
|
4666
4568
|
var context = () => getContext;
|
|
@@ -4684,8 +4586,8 @@ var zip = /* @__PURE__ */ dual((args2) => isEffect(args2[1]), (self, that, optio
|
|
|
4684
4586
|
var zipWith2 = /* @__PURE__ */ dual((args2) => isEffect(args2[1]), (self, that, f, options) => options?.concurrent ? map5(all3([self, that], {
|
|
4685
4587
|
concurrency: 2
|
|
4686
4588
|
}), ([a, a2]) => internalCall(() => f(a, a2))) : flatMap3(self, (a) => map5(that, (a2) => internalCall(() => f(a, a2)))));
|
|
4687
|
-
var
|
|
4688
|
-
var when = /* @__PURE__ */ dual(2, (self, condition) => flatMap3(condition, (pass) => pass ? asSome(self) :
|
|
4589
|
+
var filterOrFail = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, predicate, orFailWith) => filterOrElse(self, predicate, orFailWith ? (a) => fail3(orFailWith(a)) : () => fail3(new NoSuchElementError)));
|
|
4590
|
+
var when = /* @__PURE__ */ dual(2, (self, condition) => flatMap3(condition, (pass) => pass ? asSome(self) : succeedNone));
|
|
4689
4591
|
var replicate = /* @__PURE__ */ dual(2, (self, n) => Array.from({
|
|
4690
4592
|
length: n
|
|
4691
4593
|
}, () => self));
|
|
@@ -4720,62 +4622,62 @@ var catchCauseFilter = /* @__PURE__ */ dual(3, (self, filter4, f) => catchCause(
|
|
|
4720
4622
|
}));
|
|
4721
4623
|
var catch_ = /* @__PURE__ */ dual(2, (self, f) => catchCauseFilter(self, findError, (e) => f(e)));
|
|
4722
4624
|
var catchNoSuchElement = (self) => matchEffect(self, {
|
|
4723
|
-
onFailure: (error) => isNoSuchElementError(error) ?
|
|
4724
|
-
onSuccess:
|
|
4625
|
+
onFailure: (error) => isNoSuchElementError(error) ? succeedNone : fail3(error),
|
|
4626
|
+
onSuccess: succeedSome
|
|
4725
4627
|
});
|
|
4726
4628
|
var catchDefect = /* @__PURE__ */ dual(2, (self, f) => catchCauseFilter(self, findDefect, f));
|
|
4727
|
-
var tapCause = /* @__PURE__ */ dual(2, (self, f) => catchCause(self, (cause) =>
|
|
4728
|
-
var tapCauseIf = /* @__PURE__ */ dual(3, (self, predicate, f) => catchCauseIf(self, predicate, (cause) =>
|
|
4629
|
+
var tapCause = /* @__PURE__ */ dual(2, (self, f) => catchCause(self, (cause) => andThen2(internalCall(() => f(cause)), failCause(cause))));
|
|
4630
|
+
var tapCauseIf = /* @__PURE__ */ dual(3, (self, predicate, f) => catchCauseIf(self, predicate, (cause) => andThen2(internalCall(() => f(cause)), failCause(cause))));
|
|
4729
4631
|
var tapCauseFilter = /* @__PURE__ */ dual(3, (self, filter4, f) => catchCause(self, (cause) => {
|
|
4730
4632
|
const result = filter4(cause);
|
|
4731
4633
|
if (isFailure2(result)) {
|
|
4732
4634
|
return failCause(cause);
|
|
4733
4635
|
}
|
|
4734
|
-
return
|
|
4636
|
+
return andThen2(internalCall(() => f(result.success, cause)), failCause(cause));
|
|
4735
4637
|
}));
|
|
4736
4638
|
var tapError = /* @__PURE__ */ dual(2, (self, f) => tapCauseFilter(self, findError, (e) => f(e)));
|
|
4737
4639
|
var tapErrorTag = /* @__PURE__ */ dual(3, (self, k, f) => {
|
|
4738
4640
|
const predicate = Array.isArray(k) ? (e) => hasProperty(e, "_tag") && k.includes(e._tag) : isTagged(k);
|
|
4739
|
-
return tapError(self, (error) => predicate(error) ? f(error) :
|
|
4641
|
+
return tapError(self, (error) => predicate(error) ? f(error) : void_2);
|
|
4740
4642
|
});
|
|
4741
4643
|
var tapDefect = /* @__PURE__ */ dual(2, (self, f) => tapCauseFilter(self, findDefect, (_) => f(_)));
|
|
4742
|
-
var catchIf = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, predicate, f,
|
|
4644
|
+
var catchIf = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, predicate, f, orElse2) => catchCause(self, (cause) => {
|
|
4743
4645
|
const error = findError(cause);
|
|
4744
4646
|
if (isFailure2(error))
|
|
4745
4647
|
return failCause(error.failure);
|
|
4746
4648
|
if (!predicate(error.success)) {
|
|
4747
|
-
return
|
|
4649
|
+
return orElse2 ? internalCall(() => orElse2(error.success)) : failCause(cause);
|
|
4748
4650
|
}
|
|
4749
4651
|
return internalCall(() => f(error.success));
|
|
4750
4652
|
}));
|
|
4751
|
-
var catchFilter = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, filter4, f,
|
|
4653
|
+
var catchFilter = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, filter4, f, orElse2) => catchCause(self, (cause) => {
|
|
4752
4654
|
const error = findError(cause);
|
|
4753
4655
|
if (isFailure2(error))
|
|
4754
4656
|
return failCause(error.failure);
|
|
4755
4657
|
const result = filter4(error.success);
|
|
4756
4658
|
if (isFailure2(result)) {
|
|
4757
|
-
return
|
|
4659
|
+
return orElse2 ? internalCall(() => orElse2(result.failure)) : failCause(cause);
|
|
4758
4660
|
}
|
|
4759
4661
|
return internalCall(() => f(result.success));
|
|
4760
4662
|
}));
|
|
4761
|
-
var catchTag = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, k, f,
|
|
4663
|
+
var catchTag = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, k, f, orElse2) => {
|
|
4762
4664
|
const pred = Array.isArray(k) ? (e) => hasProperty(e, "_tag") && k.includes(e._tag) : isTagged(k);
|
|
4763
|
-
return catchIf(self, pred, f,
|
|
4665
|
+
return catchIf(self, pred, f, orElse2);
|
|
4764
4666
|
});
|
|
4765
|
-
var catchTags = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, cases,
|
|
4667
|
+
var catchTags = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, cases, orElse2) => {
|
|
4766
4668
|
let keys2;
|
|
4767
4669
|
return catchFilter(self, (e) => {
|
|
4768
4670
|
keys2 ??= Object.keys(cases);
|
|
4769
4671
|
return hasProperty(e, "_tag") && isString(e["_tag"]) && keys2.includes(e["_tag"]) ? succeed2(e) : fail2(e);
|
|
4770
|
-
}, (e) => internalCall(() => cases[e["_tag"]](e)),
|
|
4672
|
+
}, (e) => internalCall(() => cases[e["_tag"]](e)), orElse2);
|
|
4771
4673
|
});
|
|
4772
|
-
var catchReason = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, errorTag, reasonTag, f,
|
|
4674
|
+
var catchReason = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, errorTag, reasonTag, f, orElse2) => catchIf(self, (e) => isTagged(e, errorTag) && hasProperty(e, "reason"), (e) => {
|
|
4773
4675
|
const reason = e.reason;
|
|
4774
4676
|
if (isTagged(reason, reasonTag))
|
|
4775
4677
|
return f(reason, e);
|
|
4776
|
-
return
|
|
4678
|
+
return orElse2 ? internalCall(() => orElse2(reason, e)) : fail3(e);
|
|
4777
4679
|
}));
|
|
4778
|
-
var catchReasons = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, errorTag, cases,
|
|
4680
|
+
var catchReasons = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, errorTag, cases, orElse2) => {
|
|
4779
4681
|
let keys2;
|
|
4780
4682
|
return catchIf(self, (e) => isTagged(e, errorTag) && hasProperty(e, "reason") && hasProperty(e.reason, "_tag") && isString(e.reason._tag), (e) => {
|
|
4781
4683
|
const reason = e.reason;
|
|
@@ -4783,7 +4685,7 @@ var catchReasons = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, er
|
|
|
4783
4685
|
if (keys2.includes(reason._tag)) {
|
|
4784
4686
|
return internalCall(() => cases[reason._tag](reason, e));
|
|
4785
4687
|
}
|
|
4786
|
-
return
|
|
4688
|
+
return orElse2 ? internalCall(() => orElse2(reason, e)) : fail3(e);
|
|
4787
4689
|
});
|
|
4788
4690
|
});
|
|
4789
4691
|
var unwrapReason = /* @__PURE__ */ dual(2, (self, errorTag) => catchFilter(self, (e) => {
|
|
@@ -4793,7 +4695,7 @@ var unwrapReason = /* @__PURE__ */ dual(2, (self, errorTag) => catchFilter(self,
|
|
|
4793
4695
|
return fail2(e);
|
|
4794
4696
|
}, fail3));
|
|
4795
4697
|
var mapError2 = /* @__PURE__ */ dual(2, (self, f) => catch_(self, (error) => failSync(() => f(error))));
|
|
4796
|
-
var
|
|
4698
|
+
var mapBoth = /* @__PURE__ */ dual(2, (self, options) => matchEffect(self, {
|
|
4797
4699
|
onFailure: (e) => failSync(() => options.onFailure(e)),
|
|
4798
4700
|
onSuccess: (a) => sync(() => options.onSuccess(a))
|
|
4799
4701
|
}));
|
|
@@ -4817,8 +4719,8 @@ var eventually = (self) => catch_(self, (_) => flatMap3(yieldNow, () => eventual
|
|
|
4817
4719
|
var ignore = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, options) => {
|
|
4818
4720
|
if (!options?.log) {
|
|
4819
4721
|
return matchEffect(self, {
|
|
4820
|
-
onFailure: (_) =>
|
|
4821
|
-
onSuccess: (_) =>
|
|
4722
|
+
onFailure: (_) => void_2,
|
|
4723
|
+
onSuccess: (_) => void_2
|
|
4822
4724
|
});
|
|
4823
4725
|
}
|
|
4824
4726
|
const logEffect = logWithLevel(options.log === true ? undefined : options.log);
|
|
@@ -4827,20 +4729,20 @@ var ignore = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, options)
|
|
|
4827
4729
|
const failure = findFail(cause);
|
|
4828
4730
|
return isFailure2(failure) ? failCause(failure.failure) : options.message === undefined ? logEffect(cause) : logEffect(options.message, cause);
|
|
4829
4731
|
},
|
|
4830
|
-
onSuccess: (_) =>
|
|
4732
|
+
onSuccess: (_) => void_2
|
|
4831
4733
|
});
|
|
4832
4734
|
});
|
|
4833
4735
|
var ignoreCause = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, options) => {
|
|
4834
4736
|
if (!options?.log) {
|
|
4835
4737
|
return matchCauseEffect(self, {
|
|
4836
|
-
onFailure: (_) =>
|
|
4837
|
-
onSuccess: (_) =>
|
|
4738
|
+
onFailure: (_) => void_2,
|
|
4739
|
+
onSuccess: (_) => void_2
|
|
4838
4740
|
});
|
|
4839
4741
|
}
|
|
4840
4742
|
const logEffect = logWithLevel(options.log === true ? undefined : options.log);
|
|
4841
4743
|
return matchCauseEffect(self, {
|
|
4842
4744
|
onFailure: (cause) => options.message === undefined ? logEffect(cause) : logEffect(options.message, cause),
|
|
4843
|
-
onSuccess: (_) =>
|
|
4745
|
+
onSuccess: (_) => void_2
|
|
4844
4746
|
});
|
|
4845
4747
|
});
|
|
4846
4748
|
var option = (self) => match5(self, {
|
|
@@ -4921,7 +4823,7 @@ var isSuccess3 = /* @__PURE__ */ matchEager({
|
|
|
4921
4823
|
onFailure: () => false,
|
|
4922
4824
|
onSuccess: () => true
|
|
4923
4825
|
});
|
|
4924
|
-
var delay = /* @__PURE__ */ dual(2, (self, duration) =>
|
|
4826
|
+
var delay = /* @__PURE__ */ dual(2, (self, duration) => andThen2(sleep(duration), self));
|
|
4925
4827
|
var timeoutOrElse = /* @__PURE__ */ dual(2, (self, options) => raceFirst(self, flatMap3(sleep(options.duration), options.orElse)));
|
|
4926
4828
|
var timeout = /* @__PURE__ */ dual(2, (self, duration) => timeoutOrElse(self, {
|
|
4927
4829
|
duration,
|
|
@@ -4935,7 +4837,7 @@ var timed = (self) => clockWith((clock) => {
|
|
|
4935
4837
|
var ScopeTypeId = "~effect/Scope";
|
|
4936
4838
|
var ScopeCloseableTypeId = "~effect/Scope/Closeable";
|
|
4937
4839
|
var scopeTag = /* @__PURE__ */ Service("effect/Scope");
|
|
4938
|
-
var scopeClose = (self, exit_) => suspend(() => scopeCloseUnsafe(self, exit_) ??
|
|
4840
|
+
var scopeClose = (self, exit_) => suspend(() => scopeCloseUnsafe(self, exit_) ?? void_2);
|
|
4939
4841
|
var scopeCloseUnsafe = (self, exit_) => {
|
|
4940
4842
|
if (self.state._tag === "Closed")
|
|
4941
4843
|
return;
|
|
@@ -4996,7 +4898,7 @@ var scopeAddFinalizerExit = (scope, finalizer) => {
|
|
|
4996
4898
|
return finalizer(scope.state.exit);
|
|
4997
4899
|
}
|
|
4998
4900
|
scopeAddFinalizerUnsafe(scope, {}, finalizer);
|
|
4999
|
-
return
|
|
4901
|
+
return void_2;
|
|
5000
4902
|
});
|
|
5001
4903
|
};
|
|
5002
4904
|
var scopeAddFinalizer = (scope, finalizer) => scopeAddFinalizerExit(scope, constant(finalizer));
|
|
@@ -5057,9 +4959,9 @@ var scoped = (self) => withFiber((fiber2) => {
|
|
|
5057
4959
|
});
|
|
5058
4960
|
var scopedWith = (f) => suspend(() => {
|
|
5059
4961
|
const scope2 = scopeMakeUnsafe();
|
|
5060
|
-
return onExit(f(scope2), (exit2) => suspend(() => scopeCloseUnsafe(scope2, exit2) ??
|
|
4962
|
+
return onExit(f(scope2), (exit2) => suspend(() => scopeCloseUnsafe(scope2, exit2) ?? void_2));
|
|
5061
4963
|
});
|
|
5062
|
-
var acquireRelease = (acquire, release, options) => contextWith((context2) => uninterruptibleMask((restore) => flatMap3(scope, (scope2) =>
|
|
4964
|
+
var acquireRelease = (acquire, release, options) => contextWith((context2) => uninterruptibleMask((restore) => flatMap3(scope, (scope2) => tap2(options?.interruptible ? restore(acquire) : acquire, (a) => scopeAddFinalizerExit(scope2, (exit2) => provideContext(release(a, exit2), context2))))));
|
|
5063
4965
|
var addFinalizer = (finalizer) => flatMap3(scope, (scope2) => contextWith((context2) => scopeAddFinalizerExit(scope2, (exit2) => provideContext(finalizer(exit2), context2))));
|
|
5064
4966
|
var onExitPrimitive = /* @__PURE__ */ makePrimitive({
|
|
5065
4967
|
op: "OnExit",
|
|
@@ -5089,13 +4991,13 @@ var onExit = /* @__PURE__ */ dual(2, onExitPrimitive);
|
|
|
5089
4991
|
var ensuring = /* @__PURE__ */ dual(2, (self, finalizer) => onExit(self, (_) => finalizer));
|
|
5090
4992
|
var onExitIf = /* @__PURE__ */ dual(3, (self, predicate, f) => onExit(self, (exit2) => {
|
|
5091
4993
|
if (!predicate(exit2)) {
|
|
5092
|
-
return
|
|
4994
|
+
return void_2;
|
|
5093
4995
|
}
|
|
5094
4996
|
return f(exit2);
|
|
5095
4997
|
}));
|
|
5096
4998
|
var onExitFilter = /* @__PURE__ */ dual(3, (self, filter4, f) => onExit(self, (exit2) => {
|
|
5097
4999
|
const b = filter4(exit2);
|
|
5098
|
-
return isFailure2(b) ?
|
|
5000
|
+
return isFailure2(b) ? void_2 : f(b.success, exit2);
|
|
5099
5001
|
}));
|
|
5100
5002
|
var onError = /* @__PURE__ */ dual(2, (self, f) => onExitFilter(self, exitFilterCause, f));
|
|
5101
5003
|
var onErrorIf = /* @__PURE__ */ dual(3, (self, predicate, f) => onExitIf(self, (exit2) => {
|
|
@@ -5106,10 +5008,10 @@ var onErrorIf = /* @__PURE__ */ dual(3, (self, predicate, f) => onExitIf(self, (
|
|
|
5106
5008
|
}, (exit2) => f(exit2.cause)));
|
|
5107
5009
|
var onErrorFilter = /* @__PURE__ */ dual(3, (self, filter4, f) => onExit(self, (exit2) => {
|
|
5108
5010
|
if (exit2._tag !== "Failure") {
|
|
5109
|
-
return
|
|
5011
|
+
return void_2;
|
|
5110
5012
|
}
|
|
5111
5013
|
const result2 = filter4(exit2.cause);
|
|
5112
|
-
return isFailure2(result2) ?
|
|
5014
|
+
return isFailure2(result2) ? void_2 : f(result2.success, exit2.cause);
|
|
5113
5015
|
}));
|
|
5114
5016
|
var onInterrupt = /* @__PURE__ */ dual(2, (self, finalizer) => onErrorFilter(causeFilterInterruptors, finalizer)(self));
|
|
5115
5017
|
var acquireUseRelease = (acquire, use, release) => uninterruptibleMask((restore) => flatMap3(acquire, (a) => onExitPrimitive(restore(use(a)), (exit2) => release(a, exit2), true)));
|
|
@@ -5229,7 +5131,7 @@ var validate = /* @__PURE__ */ dual((args2) => isIterable(args2[0]) && !isEffect
|
|
|
5229
5131
|
if (isArrayNonEmpty2(excluded)) {
|
|
5230
5132
|
return fail3(excluded);
|
|
5231
5133
|
}
|
|
5232
|
-
return options?.discard ?
|
|
5134
|
+
return options?.discard ? void_2 : succeed3(satisfying);
|
|
5233
5135
|
}));
|
|
5234
5136
|
var findFirst3 = /* @__PURE__ */ dual((args2) => isIterable(args2[0]) && !isEffect(args2[0]), (elements, predicate) => suspend(() => {
|
|
5235
5137
|
const iterator = elements[Symbol.iterator]();
|
|
@@ -5294,7 +5196,7 @@ var forEach = /* @__PURE__ */ dual((args2) => typeof args2[1] === "function", (i
|
|
|
5294
5196
|
const items = fromIterable2(iterable);
|
|
5295
5197
|
let length = items.length;
|
|
5296
5198
|
if (length === 0) {
|
|
5297
|
-
return options?.discard ?
|
|
5199
|
+
return options?.discard ? void_2 : succeed3([]);
|
|
5298
5200
|
}
|
|
5299
5201
|
const out = options?.discard ? undefined : new Array(length);
|
|
5300
5202
|
const eff = forEachConcurrent({
|
|
@@ -5332,7 +5234,7 @@ var iterateEagerImpl = (options) => {
|
|
|
5332
5234
|
const item = items[index];
|
|
5333
5235
|
const effect = onItem(state, item, index);
|
|
5334
5236
|
if (!effectIsExit(effect)) {
|
|
5335
|
-
return flatMap3(exit(effect), (itemExit) => step(state, item, itemExit, index) ?? runSequential(state, items, index + 1, end) ??
|
|
5237
|
+
return flatMap3(exit(effect), (itemExit) => step(state, item, itemExit, index) ?? runSequential(state, items, index + 1, end) ?? void_2);
|
|
5336
5238
|
}
|
|
5337
5239
|
const terminal = step(state, item, effect, index);
|
|
5338
5240
|
if (terminal)
|
|
@@ -5406,7 +5308,7 @@ var iterateEagerImpl = (options) => {
|
|
|
5406
5308
|
return suspend(() => {
|
|
5407
5309
|
terminal = exitVoid;
|
|
5408
5310
|
interrupted = true;
|
|
5409
|
-
return fibers ? fiberInterruptAll(fibers) :
|
|
5311
|
+
return fibers ? fiberInterruptAll(fibers) : void_2;
|
|
5410
5312
|
});
|
|
5411
5313
|
});
|
|
5412
5314
|
} else {
|
|
@@ -5447,7 +5349,7 @@ var iterateEagerImpl = (options) => {
|
|
|
5447
5349
|
if (eff2)
|
|
5448
5350
|
resume(eff2);
|
|
5449
5351
|
} else if (done2 && fibers.size === 0) {
|
|
5450
|
-
resume(terminal ??
|
|
5352
|
+
resume(terminal ?? void_2);
|
|
5451
5353
|
}
|
|
5452
5354
|
} catch (error) {
|
|
5453
5355
|
resume(failDefect(error));
|
|
@@ -5474,7 +5376,7 @@ var iterateEagerImpl = (options) => {
|
|
|
5474
5376
|
if (!fibers) {
|
|
5475
5377
|
return exitVoid;
|
|
5476
5378
|
} else if (fibers.size === 0) {
|
|
5477
|
-
resume(
|
|
5379
|
+
resume(void_2);
|
|
5478
5380
|
}
|
|
5479
5381
|
}
|
|
5480
5382
|
};
|
|
@@ -5494,10 +5396,10 @@ var forEachConcurrent = /* @__PURE__ */ iterateEagerImpl({
|
|
|
5494
5396
|
}
|
|
5495
5397
|
}
|
|
5496
5398
|
});
|
|
5497
|
-
var filterOrElse = /* @__PURE__ */ dual(3, (self, predicate,
|
|
5498
|
-
var filterMapOrElse = /* @__PURE__ */ dual(3, (self, filter4,
|
|
5399
|
+
var filterOrElse = /* @__PURE__ */ dual(3, (self, predicate, orElse2) => flatMap3(self, (a) => predicate(a) ? succeed3(a) : orElse2(a)));
|
|
5400
|
+
var filterMapOrElse = /* @__PURE__ */ dual(3, (self, filter4, orElse2) => flatMap3(self, (a) => {
|
|
5499
5401
|
const result2 = filter4(a);
|
|
5500
|
-
return isFailure2(result2) ?
|
|
5402
|
+
return isFailure2(result2) ? orElse2(result2.failure) : succeed3(result2.success);
|
|
5501
5403
|
}));
|
|
5502
5404
|
var filterMapOrFail = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, filter4, orFailWith) => filterMapOrElse(self, filter4, orFailWith ? (x) => fail3(orFailWith(x)) : () => fail3(new NoSuchElementError)));
|
|
5503
5405
|
var filter4 = /* @__PURE__ */ dual((args2) => isIterable(args2[0]) && !isEffect(args2[0]), (elements, predicate, options) => suspend(() => {
|
|
@@ -5507,7 +5409,7 @@ var filter4 = /* @__PURE__ */ dual((args2) => isIterable(args2[0]) && !isEffect(
|
|
|
5507
5409
|
if (typeof result2 === "boolean") {
|
|
5508
5410
|
if (result2)
|
|
5509
5411
|
out.push(a);
|
|
5510
|
-
return
|
|
5412
|
+
return void_2;
|
|
5511
5413
|
}
|
|
5512
5414
|
return map5(result2, (keep) => {
|
|
5513
5415
|
if (keep) {
|
|
@@ -5540,10 +5442,10 @@ var filterMapEffect = /* @__PURE__ */ dual((args2) => isIterable(args2[0]) && !i
|
|
|
5540
5442
|
concurrency: options?.concurrency
|
|
5541
5443
|
}), out);
|
|
5542
5444
|
}));
|
|
5543
|
-
var
|
|
5544
|
-
var
|
|
5545
|
-
var
|
|
5546
|
-
var
|
|
5445
|
+
var Do2 = /* @__PURE__ */ succeed3({});
|
|
5446
|
+
var bindTo3 = /* @__PURE__ */ bindTo(map5);
|
|
5447
|
+
var bind3 = /* @__PURE__ */ bind(map5, flatMap3);
|
|
5448
|
+
var let_3 = /* @__PURE__ */ let_(map5);
|
|
5547
5449
|
var forkChild = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, options) => withFiber((fiber2) => {
|
|
5548
5450
|
interruptChildrenPatch();
|
|
5549
5451
|
return succeed3(forkUnsafe(fiber2, self, options?.startImmediately, false, options?.uninterruptible ?? false));
|
|
@@ -5569,7 +5471,7 @@ var awaitAllChildren = (self) => withFiber((fiber2) => {
|
|
|
5569
5471
|
return onExit(self, (_) => {
|
|
5570
5472
|
let children = fiber2._children;
|
|
5571
5473
|
if (children === undefined || children.size === 0) {
|
|
5572
|
-
return
|
|
5474
|
+
return void_2;
|
|
5573
5475
|
} else if (initialChildren) {
|
|
5574
5476
|
children = filter2(children, (child) => !initialChildren.has(child));
|
|
5575
5477
|
}
|
|
@@ -5581,7 +5483,7 @@ var forkIn = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, scope2,
|
|
|
5581
5483
|
if (!fiber2._exit) {
|
|
5582
5484
|
if (scope2.state._tag !== "Closed") {
|
|
5583
5485
|
const key = {};
|
|
5584
|
-
const finalizer = () => withFiberId((interruptor) => interruptor === fiber2.id ?
|
|
5486
|
+
const finalizer = () => withFiberId((interruptor) => interruptor === fiber2.id ? void_2 : fiberInterrupt(fiber2));
|
|
5585
5487
|
scopeAddFinalizerUnsafe(scope2, key, finalizer);
|
|
5586
5488
|
fiber2.addObserver(() => scopeRemoveFinalizerUnsafe(scope2, key));
|
|
5587
5489
|
} else {
|
|
@@ -5740,7 +5642,7 @@ class Latch {
|
|
|
5740
5642
|
}
|
|
5741
5643
|
await = /* @__PURE__ */ callback((resume) => {
|
|
5742
5644
|
if (this._isOpen) {
|
|
5743
|
-
return resume(
|
|
5645
|
+
return resume(void_2);
|
|
5744
5646
|
}
|
|
5745
5647
|
this.waiters.push(resume);
|
|
5746
5648
|
return sync(() => {
|
|
@@ -5941,7 +5843,7 @@ var annotateCurrentSpan = (...args2) => withFiber((fiber2) => {
|
|
|
5941
5843
|
span.attribute(args2[0], args2[1]);
|
|
5942
5844
|
}
|
|
5943
5845
|
}
|
|
5944
|
-
return
|
|
5846
|
+
return void_2;
|
|
5945
5847
|
});
|
|
5946
5848
|
var currentSpan = /* @__PURE__ */ withFiber((fiber2) => {
|
|
5947
5849
|
const span = fiber2.currentSpanLocal;
|
|
@@ -5975,7 +5877,7 @@ class ClockImpl {
|
|
|
5975
5877
|
else if (!Number.isFinite(millis2))
|
|
5976
5878
|
return never;
|
|
5977
5879
|
return callback((resume) => {
|
|
5978
|
-
const continuation = millis2 > MAX_TIMER_MILLIS ? this.sleepMillis(millis2 - MAX_TIMER_MILLIS) :
|
|
5880
|
+
const continuation = millis2 > MAX_TIMER_MILLIS ? this.sleepMillis(millis2 - MAX_TIMER_MILLIS) : void_2;
|
|
5979
5881
|
const handle = setTimeout(() => resume(continuation), Math.min(millis2, MAX_TIMER_MILLIS));
|
|
5980
5882
|
return sync(() => clearTimeout(handle));
|
|
5981
5883
|
});
|
|
@@ -6126,7 +6028,7 @@ var annotateLogsScoped = function() {
|
|
|
6126
6028
|
}
|
|
6127
6029
|
}
|
|
6128
6030
|
fiber2.setContext(add(fiber2.context, CurrentLogAnnotations, next2));
|
|
6129
|
-
return
|
|
6031
|
+
return void_2;
|
|
6130
6032
|
});
|
|
6131
6033
|
}));
|
|
6132
6034
|
};
|
|
@@ -6170,7 +6072,7 @@ var logWithLevel = (level) => (...message) => {
|
|
|
6170
6072
|
return withFiber((fiber2) => {
|
|
6171
6073
|
const logLevel = level ?? fiber2.currentLogLevel;
|
|
6172
6074
|
if (isLogLevelGreaterThan(fiber2.minimumLogLevel, logLevel)) {
|
|
6173
|
-
return
|
|
6075
|
+
return void_2;
|
|
6174
6076
|
}
|
|
6175
6077
|
const clock = fiber2.getRef(ClockRef);
|
|
6176
6078
|
const loggers = fiber2.getRef(CurrentLoggers);
|
|
@@ -6186,7 +6088,7 @@ var logWithLevel = (level) => (...message) => {
|
|
|
6186
6088
|
});
|
|
6187
6089
|
}
|
|
6188
6090
|
}
|
|
6189
|
-
return
|
|
6091
|
+
return void_2;
|
|
6190
6092
|
});
|
|
6191
6093
|
};
|
|
6192
6094
|
var colors = {
|
|
@@ -6265,7 +6167,7 @@ function interruptChildrenPatch() {
|
|
|
6265
6167
|
var undefined_ = /* @__PURE__ */ succeed3(undefined);
|
|
6266
6168
|
var withErrorReporting = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, options) => onError(self, (cause) => withFiber((fiber2) => {
|
|
6267
6169
|
reportCauseUnsafe(fiber2, cause, options?.defectsOnly);
|
|
6268
|
-
return
|
|
6170
|
+
return void_2;
|
|
6269
6171
|
})));
|
|
6270
6172
|
var reportCauseUnsafe = (fiber2, cause, defectsOnly) => {
|
|
6271
6173
|
const reporters = fiber2.getRef(CurrentErrorReporters);
|
|
@@ -6311,7 +6213,7 @@ var UnknownError2 = UnknownError;
|
|
|
6311
6213
|
// ../../node_modules/.bun/effect@4.0.0-rc.112/node_modules/effect/dist/Effect.js
|
|
6312
6214
|
var exports_Effect = {};
|
|
6313
6215
|
__export(exports_Effect, {
|
|
6314
|
-
Do: () =>
|
|
6216
|
+
Do: () => Do3,
|
|
6315
6217
|
Transaction: () => Transaction,
|
|
6316
6218
|
TypeId: () => TypeId13,
|
|
6317
6219
|
abortSignal: () => abortSignal2,
|
|
@@ -6320,7 +6222,7 @@ __export(exports_Effect, {
|
|
|
6320
6222
|
acquireUseRelease: () => acquireUseRelease2,
|
|
6321
6223
|
addFinalizer: () => addFinalizer3,
|
|
6322
6224
|
all: () => all4,
|
|
6323
|
-
andThen: () =>
|
|
6225
|
+
andThen: () => andThen3,
|
|
6324
6226
|
annotateCurrentSpan: () => annotateCurrentSpan2,
|
|
6325
6227
|
annotateLogs: () => annotateLogs,
|
|
6326
6228
|
annotateLogsScoped: () => annotateLogsScoped2,
|
|
@@ -6329,8 +6231,8 @@ __export(exports_Effect, {
|
|
|
6329
6231
|
asSome: () => asSome2,
|
|
6330
6232
|
asVoid: () => asVoid3,
|
|
6331
6233
|
awaitAllChildren: () => awaitAllChildren2,
|
|
6332
|
-
bind: () =>
|
|
6333
|
-
bindTo: () =>
|
|
6234
|
+
bind: () => bind4,
|
|
6235
|
+
bindTo: () => bindTo4,
|
|
6334
6236
|
cached: () => cached2,
|
|
6335
6237
|
cachedInvalidateWithTTL: () => cachedInvalidateWithTTL2,
|
|
6336
6238
|
cachedWithTTL: () => cachedWithTTL2,
|
|
@@ -6371,14 +6273,14 @@ __export(exports_Effect, {
|
|
|
6371
6273
|
filterMapOrElse: () => filterMapOrElse2,
|
|
6372
6274
|
filterMapOrFail: () => filterMapOrFail2,
|
|
6373
6275
|
filterOrElse: () => filterOrElse2,
|
|
6374
|
-
filterOrFail: () =>
|
|
6276
|
+
filterOrFail: () => filterOrFail2,
|
|
6375
6277
|
findFirst: () => findFirst4,
|
|
6376
6278
|
findFirstFilter: () => findFirstFilter2,
|
|
6377
6279
|
firstSuccessOf: () => firstSuccessOf2,
|
|
6378
6280
|
flatMap: () => flatMap5,
|
|
6379
6281
|
flatMapEager: () => flatMapEager2,
|
|
6380
6282
|
flatten: () => flatten5,
|
|
6381
|
-
flip: () =>
|
|
6283
|
+
flip: () => flip2,
|
|
6382
6284
|
fn: () => fn2,
|
|
6383
6285
|
fnUntraced: () => fnUntraced2,
|
|
6384
6286
|
fnUntracedEager: () => fnUntracedEager2,
|
|
@@ -6388,10 +6290,10 @@ __export(exports_Effect, {
|
|
|
6388
6290
|
forkDetach: () => forkDetach2,
|
|
6389
6291
|
forkIn: () => forkIn2,
|
|
6390
6292
|
forkScoped: () => forkScoped2,
|
|
6391
|
-
fromNullishOr: () =>
|
|
6293
|
+
fromNullishOr: () => fromNullishOr3,
|
|
6392
6294
|
fromOption: () => fromOption4,
|
|
6393
6295
|
fromResult: () => fromResult2,
|
|
6394
|
-
gen: () =>
|
|
6296
|
+
gen: () => gen3,
|
|
6395
6297
|
head: () => head2,
|
|
6396
6298
|
ignore: () => ignore2,
|
|
6397
6299
|
ignoreCause: () => ignoreCause2,
|
|
@@ -6401,7 +6303,7 @@ __export(exports_Effect, {
|
|
|
6401
6303
|
isEffect: () => isEffect2,
|
|
6402
6304
|
isFailure: () => isFailure5,
|
|
6403
6305
|
isSuccess: () => isSuccess5,
|
|
6404
|
-
let: () =>
|
|
6306
|
+
let: () => let_4,
|
|
6405
6307
|
linkSpans: () => linkSpans2,
|
|
6406
6308
|
log: () => log,
|
|
6407
6309
|
logDebug: () => logDebug,
|
|
@@ -6414,7 +6316,7 @@ __export(exports_Effect, {
|
|
|
6414
6316
|
makeSpan: () => makeSpan2,
|
|
6415
6317
|
makeSpanScoped: () => makeSpanScoped2,
|
|
6416
6318
|
map: () => map8,
|
|
6417
|
-
mapBoth: () =>
|
|
6319
|
+
mapBoth: () => mapBoth2,
|
|
6418
6320
|
mapBothEager: () => mapBothEager2,
|
|
6419
6321
|
mapEager: () => mapEager2,
|
|
6420
6322
|
mapError: () => mapError3,
|
|
@@ -6486,11 +6388,11 @@ __export(exports_Effect, {
|
|
|
6486
6388
|
spanAnnotations: () => spanAnnotations2,
|
|
6487
6389
|
spanLinks: () => spanLinks2,
|
|
6488
6390
|
succeed: () => succeed6,
|
|
6489
|
-
succeedNone: () =>
|
|
6490
|
-
succeedSome: () =>
|
|
6391
|
+
succeedNone: () => succeedNone2,
|
|
6392
|
+
succeedSome: () => succeedSome2,
|
|
6491
6393
|
suspend: () => suspend3,
|
|
6492
6394
|
sync: () => sync3,
|
|
6493
|
-
tap: () =>
|
|
6395
|
+
tap: () => tap5,
|
|
6494
6396
|
tapCause: () => tapCause3,
|
|
6495
6397
|
tapCauseFilter: () => tapCauseFilter2,
|
|
6496
6398
|
tapCauseIf: () => tapCauseIf2,
|
|
@@ -6507,7 +6409,7 @@ __export(exports_Effect, {
|
|
|
6507
6409
|
trackDuration: () => trackDuration,
|
|
6508
6410
|
trackErrors: () => trackErrors,
|
|
6509
6411
|
trackSuccesses: () => trackSuccesses,
|
|
6510
|
-
transposeOption: () =>
|
|
6412
|
+
transposeOption: () => transposeOption2,
|
|
6511
6413
|
try: () => try_3,
|
|
6512
6414
|
tryPromise: () => tryPromise2,
|
|
6513
6415
|
tx: () => tx,
|
|
@@ -6521,7 +6423,7 @@ __export(exports_Effect, {
|
|
|
6521
6423
|
updateServiceScoped: () => updateServiceScoped2,
|
|
6522
6424
|
useSpan: () => useSpan2,
|
|
6523
6425
|
validate: () => validate2,
|
|
6524
|
-
void: () =>
|
|
6426
|
+
void: () => void_4,
|
|
6525
6427
|
when: () => when2,
|
|
6526
6428
|
whileLoop: () => whileLoop2,
|
|
6527
6429
|
withErrorReporting: () => withErrorReporting2,
|
|
@@ -6548,7 +6450,7 @@ var failCause2 = exitFailCause;
|
|
|
6548
6450
|
var fail5 = exitFail;
|
|
6549
6451
|
var die3 = exitDie;
|
|
6550
6452
|
var interrupt2 = exitInterrupt;
|
|
6551
|
-
var
|
|
6453
|
+
var void_3 = exitVoid;
|
|
6552
6454
|
var isSuccess4 = exitIsSuccess;
|
|
6553
6455
|
var isFailure4 = exitIsFailure;
|
|
6554
6456
|
var match6 = exitMatch;
|
|
@@ -6593,7 +6495,7 @@ __export(exports_Layer, {
|
|
|
6593
6495
|
suspend: () => suspend2,
|
|
6594
6496
|
sync: () => sync2,
|
|
6595
6497
|
syncContext: () => syncContext,
|
|
6596
|
-
tap: () =>
|
|
6498
|
+
tap: () => tap3,
|
|
6597
6499
|
tapCause: () => tapCause2,
|
|
6598
6500
|
tapError: () => tapError2,
|
|
6599
6501
|
unwrap: () => unwrap,
|
|
@@ -6674,7 +6576,7 @@ var TypeId6 = "~effect/Layer";
|
|
|
6674
6576
|
var MemoMapTypeId = "~effect/Layer/MemoMap";
|
|
6675
6577
|
var memoMapReuse = (entry, scope2) => {
|
|
6676
6578
|
entry.observers++;
|
|
6677
|
-
return
|
|
6579
|
+
return andThen2(scopeAddFinalizerExit(scope2, (exit2) => entry.finalizer(exit2)), entry.effect);
|
|
6678
6580
|
};
|
|
6679
6581
|
var isLayer = (u) => hasProperty(u, TypeId6);
|
|
6680
6582
|
var LayerProto = {
|
|
@@ -6694,7 +6596,7 @@ var fromBuildUnsafe = (build) => {
|
|
|
6694
6596
|
};
|
|
6695
6597
|
var fromBuild = (build) => fromBuildUnsafe((memoMap, scope2) => {
|
|
6696
6598
|
const layerScope = forkUnsafe2(scope2);
|
|
6697
|
-
return onExit(build(memoMap, layerScope), (exit2) => exit2._tag === "Failure" ? close(layerScope, exit2) :
|
|
6599
|
+
return onExit(build(memoMap, layerScope), (exit2) => exit2._tag === "Failure" ? close(layerScope, exit2) : void_2);
|
|
6698
6600
|
});
|
|
6699
6601
|
var fromBuildMemo = (build) => {
|
|
6700
6602
|
const self = fromBuild((memoMap, scope2) => memoMap.getOrElseMemoize(self, scope2, build));
|
|
@@ -6712,7 +6614,7 @@ var memoMapBuild = (memoMap, layer, scope2, build) => {
|
|
|
6712
6614
|
memoMap.map.delete(layer);
|
|
6713
6615
|
return close(layerScope, exit2);
|
|
6714
6616
|
}
|
|
6715
|
-
return
|
|
6617
|
+
return void_2;
|
|
6716
6618
|
})
|
|
6717
6619
|
};
|
|
6718
6620
|
memoMap.map.set(layer, entry);
|
|
@@ -6803,16 +6705,16 @@ var provideWith = (self, that, f) => fromBuild((memoMap, scope2) => flatMap3(Arr
|
|
|
6803
6705
|
var provide2 = /* @__PURE__ */ dual(2, (self, that) => provideWith(self, that, identity));
|
|
6804
6706
|
var provideMerge = /* @__PURE__ */ dual(2, (self, that) => provideWith(self, that, (self2, that2) => merge(that2, self2)));
|
|
6805
6707
|
var flatMap4 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope2) => flatMap3(self.build(memoMap, scope2), (context2) => f(context2).build(memoMap, scope2))));
|
|
6806
|
-
var
|
|
6807
|
-
var tapError2 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope2) => catch_(self.build(memoMap, scope2), (error) => provide(
|
|
6808
|
-
var tapCause2 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope2) => catchCause(self.build(memoMap, scope2), (cause) => provide(
|
|
6708
|
+
var tap3 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope2) => flatMap3(self.build(memoMap, scope2), (context2) => provide(as2(f(context2), context2), scope2))));
|
|
6709
|
+
var tapError2 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope2) => catch_(self.build(memoMap, scope2), (error) => provide(andThen2(f(error), fail3(error)), scope2))));
|
|
6710
|
+
var tapCause2 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope2) => catchCause(self.build(memoMap, scope2), (cause) => provide(andThen2(f(cause), failCause(cause)), scope2))));
|
|
6809
6711
|
var orDie2 = (self) => fromBuildUnsafe((memoMap, scope2) => orDie(self.build(memoMap, scope2)));
|
|
6810
6712
|
var catch_2 = /* @__PURE__ */ dual(2, (self, onError2) => fromBuildUnsafe((memoMap, scope2) => catch_(self.build(memoMap, scope2), (e) => onError2(e).build(memoMap, scope2))));
|
|
6811
6713
|
var catchTag2 = /* @__PURE__ */ dual(3, (self, k, f) => fromBuildUnsafe((memoMap, scope2) => catchTag(self.build(memoMap, scope2), k, (error) => f(error).build(memoMap, scope2))));
|
|
6812
6714
|
var catchCause2 = /* @__PURE__ */ dual(2, (self, onError2) => fromBuildUnsafe((memoMap, scope2) => catchCause(self.build(memoMap, scope2), (cause) => onError2(cause).build(memoMap, scope2))));
|
|
6813
6715
|
var updateService2 = /* @__PURE__ */ dual(3, (layer, service2, f) => provide2(layer, effect(service2, map5(service2, f))));
|
|
6814
6716
|
var fresh = (self) => fromBuildUnsafe((_, scope2) => self.build(makeMemoMapUnsafe(), scope2));
|
|
6815
|
-
var launch = (self) => scoped(
|
|
6717
|
+
var launch = (self) => scoped(andThen2(build(self), never));
|
|
6816
6718
|
var mock = function() {
|
|
6817
6719
|
if (arguments.length === 1) {
|
|
6818
6720
|
return (implementation) => mockImpl(arguments[0], implementation);
|
|
@@ -6862,7 +6764,7 @@ var satisfiesErrorType = () => (layer) => layer;
|
|
|
6862
6764
|
var satisfiesServicesType = () => (layer) => layer;
|
|
6863
6765
|
var span = (name, options) => {
|
|
6864
6766
|
options = addSpanStackTrace(options);
|
|
6865
|
-
return effect(ParentSpan, options?.onEnd ?
|
|
6767
|
+
return effect(ParentSpan, options?.onEnd ? tap2(makeSpanScoped(name, options), (span2) => addFinalizer((exit2) => options.onEnd(span2, exit2))) : makeSpanScoped(name, options));
|
|
6866
6768
|
};
|
|
6867
6769
|
var parentSpan = (span2) => succeedContext(ParentSpan.context(span2));
|
|
6868
6770
|
var withSpan2 = function() {
|
|
@@ -6871,9 +6773,9 @@ var withSpan2 = function() {
|
|
|
6871
6773
|
const options = addSpanStackTrace(dataFirst ? arguments[2] : arguments[1]);
|
|
6872
6774
|
if (dataFirst) {
|
|
6873
6775
|
const self = arguments[0];
|
|
6874
|
-
return unwrap(map5(options?.onEnd !== undefined ?
|
|
6776
|
+
return unwrap(map5(options?.onEnd !== undefined ? tap2(makeSpanScoped(name, options), (span2) => addFinalizer((exit2) => options.onEnd(span2, exit2))) : makeSpanScoped(name, options), (span2) => withParentSpan2(self, span2)));
|
|
6875
6777
|
}
|
|
6876
|
-
return (self) => unwrap(map5(options?.onEnd !== undefined ?
|
|
6778
|
+
return (self) => unwrap(map5(options?.onEnd !== undefined ? tap2(makeSpanScoped(name, options), (span2) => addFinalizer((exit2) => options.onEnd(span2, exit2))) : makeSpanScoped(name, options), (span2) => withParentSpan2(self, span2)));
|
|
6877
6779
|
};
|
|
6878
6780
|
var withParentSpan2 = function() {
|
|
6879
6781
|
const dataFirst = isLayer(arguments[0]);
|
|
@@ -6953,7 +6855,7 @@ __export(exports_Schedule, {
|
|
|
6953
6855
|
recurs: () => recurs,
|
|
6954
6856
|
setInputType: () => setInputType,
|
|
6955
6857
|
spaced: () => spaced,
|
|
6956
|
-
tap: () =>
|
|
6858
|
+
tap: () => tap4,
|
|
6957
6859
|
toStep: () => toStep,
|
|
6958
6860
|
toStepWithMetadata: () => toStepWithMetadata,
|
|
6959
6861
|
toStepWithSleep: () => toStepWithSleep,
|
|
@@ -8327,9 +8229,9 @@ var spaced = (duration2) => {
|
|
|
8327
8229
|
const decoded = fromInputUnsafe(duration2);
|
|
8328
8230
|
return fromStepWithMetadata(succeed3((meta) => succeed3([meta.attempt - 1, decoded])));
|
|
8329
8231
|
};
|
|
8330
|
-
var
|
|
8232
|
+
var tap4 = /* @__PURE__ */ dual(2, (self, f) => fromStep(map5(toStep(self), (step) => {
|
|
8331
8233
|
const meta = metadataFn();
|
|
8332
|
-
return (now, input) =>
|
|
8234
|
+
return (now, input) => tap2(step(now, input), ([output, duration2]) => f({
|
|
8333
8235
|
...meta(now, input),
|
|
8334
8236
|
output,
|
|
8335
8237
|
duration: duration2
|
|
@@ -8368,15 +8270,15 @@ var provideLayer = (self, layer, options) => scopedWith((scope2) => flatMap3(opt
|
|
|
8368
8270
|
var provide3 = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, source, options) => isContext(source) ? provideContext(self, source) : provideLayer(self, Array.isArray(source) ? mergeAll2(...source) : source, options));
|
|
8369
8271
|
|
|
8370
8272
|
// ../../node_modules/.bun/effect@4.0.0-rc.112/node_modules/effect/dist/internal/schedule.js
|
|
8371
|
-
var repeatOrElse = /* @__PURE__ */ dual(3, (self, schedule,
|
|
8273
|
+
var repeatOrElse = /* @__PURE__ */ dual(3, (self, schedule, orElse2) => flatMap3(toStepWithMetadata(schedule), (step) => {
|
|
8372
8274
|
let meta = CurrentMetadata2.defaultValue();
|
|
8373
|
-
return catch_(forever2(
|
|
8275
|
+
return catch_(forever2(tap2(flatMap3(suspend(() => provideService(self, CurrentMetadata2, meta)), step), (meta_) => sync(() => {
|
|
8374
8276
|
meta = meta_;
|
|
8375
8277
|
})), {
|
|
8376
8278
|
disableYield: true
|
|
8377
|
-
}), (error) => isDone(error) ? succeed3(error.value) :
|
|
8279
|
+
}), (error) => isDone(error) ? succeed3(error.value) : orElse2(error, meta.attempt === 0 ? none2() : some3(meta)));
|
|
8378
8280
|
}));
|
|
8379
|
-
var retryOrElse = /* @__PURE__ */ dual(3, (self, policy,
|
|
8281
|
+
var retryOrElse = /* @__PURE__ */ dual(3, (self, policy, orElse2) => flatMap3(toStepWithMetadata(policy), (step) => {
|
|
8380
8282
|
let meta = CurrentMetadata2.defaultValue();
|
|
8381
8283
|
let lastError;
|
|
8382
8284
|
const loop = catch_(suspend(() => provideService(self, CurrentMetadata2, meta)), (error) => {
|
|
@@ -8386,7 +8288,7 @@ var retryOrElse = /* @__PURE__ */ dual(3, (self, policy, orElse3) => flatMap3(to
|
|
|
8386
8288
|
return loop;
|
|
8387
8289
|
});
|
|
8388
8290
|
});
|
|
8389
|
-
return catchDone(loop, (out) => internalCall(() =>
|
|
8291
|
+
return catchDone(loop, (out) => internalCall(() => orElse2(lastError, out)));
|
|
8390
8292
|
}));
|
|
8391
8293
|
var repeat2 = /* @__PURE__ */ dual(2, (self, options) => {
|
|
8392
8294
|
const schedule = typeof options === "function" ? options(identity) : isSchedule(options) ? options : buildFromOptions(options);
|
|
@@ -8628,7 +8530,7 @@ var addEntry = (resolver, request2, resume, fiber2) => {
|
|
|
8628
8530
|
newBatch.map = undefined;
|
|
8629
8531
|
batchPool.push(newBatch);
|
|
8630
8532
|
}
|
|
8631
|
-
return
|
|
8533
|
+
return void_2;
|
|
8632
8534
|
})
|
|
8633
8535
|
};
|
|
8634
8536
|
batch = newBatch;
|
|
@@ -8668,7 +8570,7 @@ var removeEntryUnsafe = (resolver, entry) => {
|
|
|
8668
8570
|
var maybeRemoveEntry = (resolver, entry) => sync(() => removeEntryUnsafe(resolver, entry));
|
|
8669
8571
|
function runBatch(batch) {
|
|
8670
8572
|
if (!batch.map.has(batch.key))
|
|
8671
|
-
return
|
|
8573
|
+
return void_2;
|
|
8672
8574
|
batch.map.delete(batch.key);
|
|
8673
8575
|
return batch.run;
|
|
8674
8576
|
}
|
|
@@ -8789,19 +8691,19 @@ var whileLoop2 = whileLoop;
|
|
|
8789
8691
|
var promise2 = promise;
|
|
8790
8692
|
var tryPromise2 = tryPromise;
|
|
8791
8693
|
var succeed6 = succeed3;
|
|
8792
|
-
var
|
|
8793
|
-
var
|
|
8694
|
+
var succeedNone2 = succeedNone;
|
|
8695
|
+
var succeedSome2 = succeedSome;
|
|
8794
8696
|
var suspend3 = suspend;
|
|
8795
8697
|
var sync3 = sync;
|
|
8796
|
-
var
|
|
8698
|
+
var void_4 = void_2;
|
|
8797
8699
|
var undefined_2 = undefined_;
|
|
8798
8700
|
var callback2 = callback;
|
|
8799
8701
|
var never2 = never;
|
|
8800
|
-
var
|
|
8801
|
-
var
|
|
8802
|
-
var
|
|
8803
|
-
var
|
|
8804
|
-
var
|
|
8702
|
+
var Do3 = Do2;
|
|
8703
|
+
var bindTo4 = bindTo3;
|
|
8704
|
+
var let_4 = let_3;
|
|
8705
|
+
var bind4 = bind3;
|
|
8706
|
+
var gen3 = gen2;
|
|
8805
8707
|
var fail6 = fail3;
|
|
8806
8708
|
var failSync2 = failSync;
|
|
8807
8709
|
var failCause4 = failCause;
|
|
@@ -8813,12 +8715,12 @@ var yieldNowWith2 = yieldNowWith;
|
|
|
8813
8715
|
var withFiber2 = withFiber;
|
|
8814
8716
|
var fromResult2 = fromResult;
|
|
8815
8717
|
var fromOption4 = fromOption3;
|
|
8816
|
-
var
|
|
8817
|
-
var
|
|
8718
|
+
var transposeOption2 = transposeOption;
|
|
8719
|
+
var fromNullishOr3 = fromNullishOr2;
|
|
8818
8720
|
var flatMap5 = flatMap3;
|
|
8819
8721
|
var flatten5 = flatten4;
|
|
8820
|
-
var
|
|
8821
|
-
var
|
|
8722
|
+
var andThen3 = andThen2;
|
|
8723
|
+
var tap5 = tap2;
|
|
8822
8724
|
var result2 = result;
|
|
8823
8725
|
var option2 = option;
|
|
8824
8726
|
var exit2 = exit;
|
|
@@ -8826,7 +8728,7 @@ var map8 = map5;
|
|
|
8826
8728
|
var as3 = as2;
|
|
8827
8729
|
var asSome2 = asSome;
|
|
8828
8730
|
var asVoid3 = asVoid2;
|
|
8829
|
-
var
|
|
8731
|
+
var flip2 = flip;
|
|
8830
8732
|
var zip2 = zip;
|
|
8831
8733
|
var zipWith3 = zipWith2;
|
|
8832
8734
|
var catch_3 = catch_;
|
|
@@ -8843,7 +8745,7 @@ var catchNoSuchElement2 = catchNoSuchElement;
|
|
|
8843
8745
|
var catchCauseIf2 = catchCauseIf;
|
|
8844
8746
|
var catchCauseFilter2 = catchCauseFilter;
|
|
8845
8747
|
var mapError3 = mapError2;
|
|
8846
|
-
var
|
|
8748
|
+
var mapBoth2 = mapBoth;
|
|
8847
8749
|
var orDie3 = orDie;
|
|
8848
8750
|
var tapError3 = tapError;
|
|
8849
8751
|
var tapErrorTag2 = tapErrorTag;
|
|
@@ -8876,7 +8778,7 @@ var filterMap3 = filterMap2;
|
|
|
8876
8778
|
var filterMapEffect2 = filterMapEffect;
|
|
8877
8779
|
var filterOrElse2 = filterOrElse;
|
|
8878
8780
|
var filterMapOrElse2 = filterMapOrElse;
|
|
8879
|
-
var
|
|
8781
|
+
var filterOrFail2 = filterOrFail;
|
|
8880
8782
|
var filterMapOrFail2 = filterMapOrFail;
|
|
8881
8783
|
var when2 = when;
|
|
8882
8784
|
var match7 = match5;
|
|
@@ -9005,7 +8907,7 @@ var track = /* @__PURE__ */ dual((args2) => isEffect2(args2[0]), (self, metric,
|
|
|
9005
8907
|
const input = f === undefined ? exit3 : internalCall(() => f(exit3));
|
|
9006
8908
|
return update(metric, input);
|
|
9007
8909
|
}));
|
|
9008
|
-
var trackSuccesses = /* @__PURE__ */ dual((args2) => isEffect2(args2[0]), (self, metric, f) =>
|
|
8910
|
+
var trackSuccesses = /* @__PURE__ */ dual((args2) => isEffect2(args2[0]), (self, metric, f) => tap5(self, (value) => {
|
|
9009
8911
|
const input = f === undefined ? value : f(value);
|
|
9010
8912
|
return update(metric, input);
|
|
9011
8913
|
}));
|
|
@@ -9043,7 +8945,7 @@ var tx = (effect2) => withFiber2((fiber3) => {
|
|
|
9043
8945
|
while: () => !result3,
|
|
9044
8946
|
body: constant(restore(effect2).pipe(provideService2(Transaction, state), tapCause3(() => {
|
|
9045
8947
|
if (!state.retry)
|
|
9046
|
-
return
|
|
8948
|
+
return void_4;
|
|
9047
8949
|
return restore(awaitPendingTransaction(state));
|
|
9048
8950
|
}), exit2)),
|
|
9049
8951
|
step(exit3) {
|
|
@@ -9080,7 +8982,7 @@ var awaitPendingTransaction = (state) => suspend3(() => {
|
|
|
9080
8982
|
return callback2((resume) => {
|
|
9081
8983
|
const onCall = () => {
|
|
9082
8984
|
clearPending();
|
|
9083
|
-
resume(
|
|
8985
|
+
resume(void_4);
|
|
9084
8986
|
};
|
|
9085
8987
|
for (const ref of refs) {
|
|
9086
8988
|
ref.pending.set(key, onCall);
|
|
@@ -9144,9 +9046,9 @@ var defaultTeardown = (exit3, onExit3) => {
|
|
|
9144
9046
|
var makeRunMain = (f) => dual((args2) => isEffect2(args2[0]), (effect2, options) => {
|
|
9145
9047
|
const fiber3 = options?.disableErrorReporting === true ? runFork2(effect2) : runFork2(tapCause3(effect2, (cause) => {
|
|
9146
9048
|
if (hasInterruptsOnly2(cause))
|
|
9147
|
-
return
|
|
9049
|
+
return void_4;
|
|
9148
9050
|
const isReported = getErrorReported(squash(cause));
|
|
9149
|
-
return isReported ? logError(cause) :
|
|
9051
|
+
return isReported ? logError(cause) : void_4;
|
|
9150
9052
|
}));
|
|
9151
9053
|
try {
|
|
9152
9054
|
const keepAlive = globalThis.setInterval(constVoid, 2147483647);
|
|
@@ -9679,7 +9581,7 @@ var makeAtomicUnbounded = (options) => {
|
|
|
9679
9581
|
};
|
|
9680
9582
|
var shutdown = (self) => uninterruptible2(withFiber2((fiber3) => {
|
|
9681
9583
|
set(self.shutdownFlag, true);
|
|
9682
|
-
return close(self.scope, interrupt2(fiber3.id)).pipe(
|
|
9584
|
+
return close(self.scope, interrupt2(fiber3.id)).pipe(andThen3(self.strategy.shutdown), when2(self.shutdownHook.open), asVoid3);
|
|
9683
9585
|
}));
|
|
9684
9586
|
var publish = /* @__PURE__ */ dual(2, (self, value) => suspend3(() => {
|
|
9685
9587
|
if (self.shutdownFlag.current) {
|
|
@@ -9706,14 +9608,14 @@ var subscribe = (self) => uninterruptible2(contextWith2((services) => {
|
|
|
9706
9608
|
const localScope = get(services, Scope);
|
|
9707
9609
|
const scope3 = forkUnsafe2(self.scope);
|
|
9708
9610
|
const subscription = makeSubscriptionUnsafe(self.pubsub, self.subscribers, self.strategy);
|
|
9709
|
-
return addFinalizer2(scope3, unsubscribe(subscription)).pipe(
|
|
9611
|
+
return addFinalizer2(scope3, unsubscribe(subscription)).pipe(andThen3(addFinalizerExit(localScope, (exit3) => close(scope3, exit3))), as3(subscription));
|
|
9710
9612
|
}));
|
|
9711
9613
|
var unsubscribe = (self) => uninterruptible2(withFiber2((state) => {
|
|
9712
9614
|
set(self.shutdownFlag, true);
|
|
9713
9615
|
return forEach2(takeAll(self.pollers), (d) => interruptWith(d, state.id), {
|
|
9714
9616
|
discard: true,
|
|
9715
9617
|
concurrency: "unbounded"
|
|
9716
|
-
}).pipe(
|
|
9618
|
+
}).pipe(tap5(() => sync3(() => {
|
|
9717
9619
|
self.subscribers.delete(self.subscription);
|
|
9718
9620
|
self.subscription.unsubscribe();
|
|
9719
9621
|
self.replayWindow.close();
|
|
@@ -9764,7 +9666,7 @@ var pollForItem = (self) => {
|
|
|
9764
9666
|
self.strategy.completePollersUnsafe(self.pubsub, self.subscribers, self.subscription, self.pollers);
|
|
9765
9667
|
return onInterrupt2(_await(deferred), () => {
|
|
9766
9668
|
remove2(self.pollers, deferred);
|
|
9767
|
-
return
|
|
9669
|
+
return void_4;
|
|
9768
9670
|
});
|
|
9769
9671
|
};
|
|
9770
9672
|
var AbsentValue = /* @__PURE__ */ Symbol.for("effect/PubSub/AbsentValue");
|
|
@@ -10490,7 +10392,7 @@ var ensureCapacity = (capacity) => {
|
|
|
10490
10392
|
class BackPressureStrategy {
|
|
10491
10393
|
publishers = /* @__PURE__ */ make12();
|
|
10492
10394
|
get shutdown() {
|
|
10493
|
-
return withFiber2((fiber3) => forEach2(takeAll(this.publishers), ([_, deferred, last]) => last ? interruptWith(deferred, fiber3.id) :
|
|
10395
|
+
return withFiber2((fiber3) => forEach2(takeAll(this.publishers), ([_, deferred, last]) => last ? interruptWith(deferred, fiber3.id) : void_4, {
|
|
10494
10396
|
concurrency: "unbounded",
|
|
10495
10397
|
discard: true
|
|
10496
10398
|
}));
|
|
@@ -10503,7 +10405,7 @@ class BackPressureStrategy {
|
|
|
10503
10405
|
this.completeSubscribersUnsafe(pubsub, subscribers);
|
|
10504
10406
|
return (get2(isShutdown) ? interrupt3 : _await(deferred)).pipe(onInterrupt2(() => {
|
|
10505
10407
|
this.removeUnsafe(deferred);
|
|
10506
|
-
return
|
|
10408
|
+
return void_4;
|
|
10507
10409
|
}));
|
|
10508
10410
|
});
|
|
10509
10411
|
}
|
|
@@ -10553,7 +10455,7 @@ class BackPressureStrategy {
|
|
|
10553
10455
|
|
|
10554
10456
|
class DroppingStrategy {
|
|
10555
10457
|
get shutdown() {
|
|
10556
|
-
return
|
|
10458
|
+
return void_4;
|
|
10557
10459
|
}
|
|
10558
10460
|
handleSurplus(_pubsub, _subscribers, _elements, _isShutdown) {
|
|
10559
10461
|
return succeed6(false);
|
|
@@ -10569,7 +10471,7 @@ class DroppingStrategy {
|
|
|
10569
10471
|
|
|
10570
10472
|
class SlidingStrategy {
|
|
10571
10473
|
get shutdown() {
|
|
10572
|
-
return
|
|
10474
|
+
return void_4;
|
|
10573
10475
|
}
|
|
10574
10476
|
handleSurplus(pubsub, subscribers, elements, _isShutdown) {
|
|
10575
10477
|
return sync3(() => {
|
|
@@ -10920,8 +10822,8 @@ var shutdown2 = (self) => sync(() => {
|
|
|
10920
10822
|
return true;
|
|
10921
10823
|
});
|
|
10922
10824
|
var takeAll3 = (self) => takeBetween(self, 1, Number.POSITIVE_INFINITY);
|
|
10923
|
-
var takeBetween = (self, min5, max5) => suspend(() => takeBetweenUnsafe(self, min5, max5) ??
|
|
10924
|
-
var take3 = (self) => suspend(() => takeUnsafe(self) ??
|
|
10825
|
+
var takeBetween = (self, min5, max5) => suspend(() => takeBetweenUnsafe(self, min5, max5) ?? andThen2(awaitTake(self), takeBetween(self, 1, max5)));
|
|
10826
|
+
var take3 = (self) => suspend(() => takeUnsafe(self) ?? andThen2(awaitTake(self), take3(self)));
|
|
10925
10827
|
var poll = (self) => suspend(() => {
|
|
10926
10828
|
const result3 = takeUnsafe(self);
|
|
10927
10829
|
if (result3 === undefined) {
|
|
@@ -11156,9 +11058,9 @@ class SemaphoreImpl {
|
|
|
11156
11058
|
return withFiber((fiber3) => {
|
|
11157
11059
|
this.permits = permits;
|
|
11158
11060
|
if (this.free < 0)
|
|
11159
|
-
return
|
|
11061
|
+
return void_2;
|
|
11160
11062
|
this.releaseUnsafe(fiber3, 0);
|
|
11161
|
-
return
|
|
11063
|
+
return void_2;
|
|
11162
11064
|
});
|
|
11163
11065
|
}
|
|
11164
11066
|
release(n) {
|
|
@@ -11171,7 +11073,7 @@ class SemaphoreImpl {
|
|
|
11171
11073
|
return (self) => uninterruptibleMask((restore) => {
|
|
11172
11074
|
const acquire = suspend(() => {
|
|
11173
11075
|
if (this.free < n) {
|
|
11174
|
-
const wait = waitForPermits(this, n,
|
|
11076
|
+
const wait = waitForPermits(this, n, void_2);
|
|
11175
11077
|
return flatMap3(restore(wait), () => acquire);
|
|
11176
11078
|
}
|
|
11177
11079
|
this.taken += n;
|
|
@@ -11187,7 +11089,7 @@ class SemaphoreImpl {
|
|
|
11187
11089
|
withPermitsIfAvailable(n) {
|
|
11188
11090
|
return (self) => uninterruptibleMask((restore) => {
|
|
11189
11091
|
if (this.free < n)
|
|
11190
|
-
return
|
|
11092
|
+
return succeedNone;
|
|
11191
11093
|
this.taken += n;
|
|
11192
11094
|
return onExitPrimitive(restore(asSome(self)), () => {
|
|
11193
11095
|
this.releaseUnsafe(getCurrentFiber(), n);
|
|
@@ -11233,12 +11135,12 @@ var DefaultChunkSize = 4096;
|
|
|
11233
11135
|
var asyncQueue = (scope3, f, options) => make14({
|
|
11234
11136
|
capacity: options?.bufferSize,
|
|
11235
11137
|
strategy: options?.strategy
|
|
11236
|
-
}).pipe(
|
|
11138
|
+
}).pipe(tap5((queue) => addFinalizer2(scope3, shutdown2(queue))), tap5((queue) => forkIn2(provide(f(queue), scope3), scope3)));
|
|
11237
11139
|
var callbackArray = (f, options) => fromTransform((_, scope3) => map8(asyncQueue(scope3, f, options), takeAll3));
|
|
11238
11140
|
var suspend4 = (evaluate2) => fromTransform((upstream, scope3) => suspend3(() => toTransform(evaluate2())(upstream, scope3)));
|
|
11239
11141
|
var acquireUseRelease3 = (acquire, use, release) => fromTransformBracket(fnUntraced2(function* (upstream, scope3, forkedScope) {
|
|
11240
11142
|
let option3 = none2();
|
|
11241
|
-
yield* addFinalizerExit(forkedScope, (exit3) => isSome2(option3) ? release(option3.value, exit3) :
|
|
11143
|
+
yield* addFinalizerExit(forkedScope, (exit3) => isSome2(option3) ? release(option3.value, exit3) : void_4);
|
|
11242
11144
|
const value = yield* uninterruptible2(acquire);
|
|
11243
11145
|
option3 = some3(value);
|
|
11244
11146
|
return yield* toTransform(use(value))(upstream, scope3);
|
|
@@ -11363,7 +11265,7 @@ var mapEffectConcurrent = (self, f, options) => fromTransformBracket(fnUntraced2
|
|
|
11363
11265
|
});
|
|
11364
11266
|
yield* semaphore.take(1).pipe(flatMap5(() => pull), flatMap5((value) => {
|
|
11365
11267
|
trackFiber(runFork3(handle(f(value, i++))));
|
|
11366
|
-
return
|
|
11268
|
+
return void_4;
|
|
11367
11269
|
}), forever4({
|
|
11368
11270
|
disableYield: true
|
|
11369
11271
|
}), catchCause3((cause) => semaphore.withPermits(concurrencyN - 1)(failCause5(queue, cause))), forkIn2(forkedScope));
|
|
@@ -11389,7 +11291,7 @@ var mapEffectConcurrent = (self, f, options) => fromTransformBracket(fnUntraced2
|
|
|
11389
11291
|
return offer(effects, join2(fiber3));
|
|
11390
11292
|
}), forever4({
|
|
11391
11293
|
disableYield: true
|
|
11392
|
-
}), catchCause3((cause) => offer(effects, failCause2(cause)).pipe(
|
|
11294
|
+
}), catchCause3((cause) => offer(effects, failCause2(cause)).pipe(andThen3(failCause5(effects, cause)))), forkIn2(forkedScope));
|
|
11393
11295
|
}
|
|
11394
11296
|
return take3(queue);
|
|
11395
11297
|
}));
|
|
@@ -11409,7 +11311,7 @@ var flatMapSequential = (self, f) => fromTransform((upstream, scope3) => map8(to
|
|
|
11409
11311
|
if (childScope.state._tag === "Open" && scopeFinalizerCountUnsafe(childScope) === 1) {
|
|
11410
11312
|
return makePull;
|
|
11411
11313
|
}
|
|
11412
|
-
const close2 = close(childScope,
|
|
11314
|
+
const close2 = close(childScope, void_3);
|
|
11413
11315
|
childScope = undefined;
|
|
11414
11316
|
return flatMap5(close2, () => makePull);
|
|
11415
11317
|
});
|
|
@@ -11421,7 +11323,7 @@ var concatWith = /* @__PURE__ */ dual(2, (self, f) => fromTransform((upstream, s
|
|
|
11421
11323
|
const forkedScope = forkUnsafe2(scope3);
|
|
11422
11324
|
const makePull = flatMap5(toTransform(self)(upstream, forkedScope), (pull) => {
|
|
11423
11325
|
currentPull = catchDone(pull, (leftover) => {
|
|
11424
|
-
return close(forkedScope,
|
|
11326
|
+
return close(forkedScope, void_3).pipe(flatMap5(() => toTransform(f(leftover))(upstream, scope3)), flatMap5((pull2) => {
|
|
11425
11327
|
currentPull = pull2;
|
|
11426
11328
|
return pull2;
|
|
11427
11329
|
}));
|
|
@@ -11446,10 +11348,10 @@ var orElseIfEmpty = /* @__PURE__ */ dual(2, (self, f) => fromTransform((upstream
|
|
|
11446
11348
|
let currentPull;
|
|
11447
11349
|
const forkedScope = forkUnsafe2(scope3);
|
|
11448
11350
|
const makePull = flatMap5(toTransform(self)(upstream, forkedScope), (pull) => {
|
|
11449
|
-
const next2 = pull.pipe(
|
|
11351
|
+
const next2 = pull.pipe(tap5(() => {
|
|
11450
11352
|
currentPull = pull;
|
|
11451
|
-
return
|
|
11452
|
-
}), catchDone((leftover) => close(forkedScope, succeed4(leftover)).pipe(
|
|
11353
|
+
return void_4;
|
|
11354
|
+
}), catchDone((leftover) => close(forkedScope, succeed4(leftover)).pipe(andThen3(toTransform(f(leftover))(upstream, scope3)), flatMap5((pull2) => {
|
|
11453
11355
|
currentPull = pull2;
|
|
11454
11356
|
return pull2;
|
|
11455
11357
|
}))));
|
|
@@ -11499,7 +11401,7 @@ var repeat4 = /* @__PURE__ */ dual(2, (self, schedule2) => toStepWithMetadata(ty
|
|
|
11499
11401
|
}), unwrap2));
|
|
11500
11402
|
var forever5 = (self) => concatWith(self, () => forever5(self));
|
|
11501
11403
|
var schedule2 = /* @__PURE__ */ dual(2, (self, schedule3) => transformPull(self, (pull, _scope) => map8(toStepWithSleep(schedule3), (step) => {
|
|
11502
|
-
const pullWithStep =
|
|
11404
|
+
const pullWithStep = tap5(pull, step);
|
|
11503
11405
|
return pullWithStep;
|
|
11504
11406
|
})));
|
|
11505
11407
|
var filter7 = /* @__PURE__ */ dual(2, (self, predicate) => fromTransform((upstream, scope3) => map8(toTransform(self)(upstream, scope3), (pull) => flatMap5(pull, function loop(elem) {
|
|
@@ -11596,7 +11498,7 @@ var catchCause4 = /* @__PURE__ */ dual(2, (self, f) => fromTransform((upstream,
|
|
|
11596
11498
|
}
|
|
11597
11499
|
const toClose = forkedScope;
|
|
11598
11500
|
forkedScope = forkUnsafe2(scope3);
|
|
11599
|
-
return close(toClose, failCause2(cause)).pipe(
|
|
11501
|
+
return close(toClose, failCause2(cause)).pipe(andThen3(toTransform(f(cause))(upstream, forkedScope)), flatMap5((childPull) => {
|
|
11600
11502
|
currentPull = childPull;
|
|
11601
11503
|
return childPull;
|
|
11602
11504
|
}));
|
|
@@ -11613,25 +11515,25 @@ var catchCauseFilter3 = /* @__PURE__ */ dual(3, (self, filter8, f) => catchCause
|
|
|
11613
11515
|
return isFailure2(result3) ? failCause6(result3.failure) : f(result3.success, cause);
|
|
11614
11516
|
}));
|
|
11615
11517
|
var catch_4 = /* @__PURE__ */ dual(2, (self, f) => catchCauseFilter3(self, findError2, (e) => f(e)));
|
|
11616
|
-
var tapError4 = /* @__PURE__ */ dual(2, (self, f) => transformPull(self, (pull) => succeed6(tapError3(pull, (err) => isDone2(err) ?
|
|
11617
|
-
var catchIf3 = /* @__PURE__ */ dual((args2) => isChannel(args2[0]), (self, predicate, f,
|
|
11618
|
-
return predicate(err) ? f(err) :
|
|
11518
|
+
var tapError4 = /* @__PURE__ */ dual(2, (self, f) => transformPull(self, (pull) => succeed6(tapError3(pull, (err) => isDone2(err) ? void_4 : asVoid3(f(err))))));
|
|
11519
|
+
var catchIf3 = /* @__PURE__ */ dual((args2) => isChannel(args2[0]), (self, predicate, f, orElse2) => catch_4(self, (err) => {
|
|
11520
|
+
return predicate(err) ? f(err) : orElse2 ? orElse2(err) : fail7(err);
|
|
11619
11521
|
}));
|
|
11620
|
-
var catchFilter3 = /* @__PURE__ */ dual((args2) => isChannel(args2[0]), (self, filter8, f,
|
|
11522
|
+
var catchFilter3 = /* @__PURE__ */ dual((args2) => isChannel(args2[0]), (self, filter8, f, orElse2) => catch_4(self, (err) => {
|
|
11621
11523
|
const result3 = filter8(err);
|
|
11622
|
-
return isFailure2(result3) ?
|
|
11524
|
+
return isFailure2(result3) ? orElse2 ? orElse2(result3.failure) : fail7(result3.failure) : f(result3.success);
|
|
11623
11525
|
}));
|
|
11624
|
-
var catchReason3 = /* @__PURE__ */ dual((args2) => isChannel(args2[0]), (self, errorTag, reasonTag, f,
|
|
11526
|
+
var catchReason3 = /* @__PURE__ */ dual((args2) => isChannel(args2[0]), (self, errorTag, reasonTag, f, orElse2) => catch_4(self, (error) => {
|
|
11625
11527
|
if (isTagged(error, errorTag) && hasProperty(error, "reason")) {
|
|
11626
11528
|
const reason = error.reason;
|
|
11627
11529
|
if (isTagged(reason, reasonTag)) {
|
|
11628
11530
|
return f(reason, error);
|
|
11629
11531
|
}
|
|
11630
|
-
return
|
|
11532
|
+
return orElse2 ? orElse2(reason, error) : fail7(error);
|
|
11631
11533
|
}
|
|
11632
11534
|
return fail7(error);
|
|
11633
11535
|
}));
|
|
11634
|
-
var catchReasons3 = /* @__PURE__ */ dual((args2) => isChannel(args2[0]), (self, errorTag, cases,
|
|
11536
|
+
var catchReasons3 = /* @__PURE__ */ dual((args2) => isChannel(args2[0]), (self, errorTag, cases, orElse2) => {
|
|
11635
11537
|
let keys2;
|
|
11636
11538
|
return catch_4(self, (error) => {
|
|
11637
11539
|
if (isTagged(error, errorTag) && hasProperty(error, "reason") && hasProperty(error.reason, "_tag") && isString2(error.reason._tag)) {
|
|
@@ -11640,7 +11542,7 @@ var catchReasons3 = /* @__PURE__ */ dual((args2) => isChannel(args2[0]), (self,
|
|
|
11640
11542
|
if (keys2.has(reason._tag)) {
|
|
11641
11543
|
return cases[reason._tag](reason, error);
|
|
11642
11544
|
}
|
|
11643
|
-
return
|
|
11545
|
+
return orElse2 ? orElse2(reason, error) : fail7(error);
|
|
11644
11546
|
}
|
|
11645
11547
|
return fail7(error);
|
|
11646
11548
|
});
|
|
@@ -11652,7 +11554,7 @@ var ignore3 = /* @__PURE__ */ dual((args2) => isChannel(args2[0]), (self, option
|
|
|
11652
11554
|
return catch_4(self, () => empty6);
|
|
11653
11555
|
}
|
|
11654
11556
|
const logEffect = logWithLevel2(options.log === true ? undefined : options.log);
|
|
11655
|
-
return catch_4(tapCause4(self, (cause) => hasFails2(cause) ? logEffect(cause) :
|
|
11557
|
+
return catch_4(tapCause4(self, (cause) => hasFails2(cause) ? logEffect(cause) : void_4), () => empty6);
|
|
11656
11558
|
});
|
|
11657
11559
|
var ignoreCause_ = (self) => catchCause4(self, () => empty6);
|
|
11658
11560
|
var ignoreCause3 = /* @__PURE__ */ dual((args2) => isChannel(args2[0]), (self, options) => {
|
|
@@ -11667,7 +11569,7 @@ var retry3 = /* @__PURE__ */ dual(2, (self, schedule3) => suspend4(() => {
|
|
|
11667
11569
|
const selfWithMeta = provideServiceEffect3(self, CurrentMetadata2, sync3(() => meta));
|
|
11668
11570
|
const withReset = onFirst(selfWithMeta, () => {
|
|
11669
11571
|
step = undefined;
|
|
11670
|
-
return
|
|
11572
|
+
return void_4;
|
|
11671
11573
|
});
|
|
11672
11574
|
const resolvedSchedule = typeof schedule3 === "function" ? schedule3(identity) : schedule3;
|
|
11673
11575
|
const loop = catch_4(withReset, fnUntraced2(function* (error) {
|
|
@@ -11696,7 +11598,7 @@ var mergeAll3 = /* @__PURE__ */ dual(2, (channels, {
|
|
|
11696
11598
|
const queue = yield* bounded2(bufferSize);
|
|
11697
11599
|
yield* addFinalizer2(forkedScope, shutdown2(queue));
|
|
11698
11600
|
const pull = yield* toTransform(channels)(upstream, scope3);
|
|
11699
|
-
yield*
|
|
11601
|
+
yield* gen3(function* () {
|
|
11700
11602
|
while (true) {
|
|
11701
11603
|
let pullFiber;
|
|
11702
11604
|
if (semaphore) {
|
|
@@ -11704,7 +11606,7 @@ var mergeAll3 = /* @__PURE__ */ dual(2, (channels, {
|
|
|
11704
11606
|
yield* semaphore.take(1);
|
|
11705
11607
|
} else {
|
|
11706
11608
|
pullFiber = yield* forkChild2(pull);
|
|
11707
|
-
yield* raceFirst2(semaphore.take(1),
|
|
11609
|
+
yield* raceFirst2(semaphore.take(1), andThen3(join2(pullFiber), never2));
|
|
11708
11610
|
}
|
|
11709
11611
|
}
|
|
11710
11612
|
const channel = pullFiber === undefined ? yield* pull : yield* join2(pullFiber);
|
|
@@ -11717,7 +11619,7 @@ var mergeAll3 = /* @__PURE__ */ dual(2, (channels, {
|
|
|
11717
11619
|
yield* doneLatch.open;
|
|
11718
11620
|
yield* interrupt4(fiber4);
|
|
11719
11621
|
}
|
|
11720
|
-
const fiber3 = yield* childPull.pipe(
|
|
11622
|
+
const fiber3 = yield* childPull.pipe(tap5(() => yieldNow2), flatMap5((value) => offer(queue, value)), forever4({
|
|
11721
11623
|
disableYield: true
|
|
11722
11624
|
}), onError2(fnUntraced2(function* (cause) {
|
|
11723
11625
|
const halt = filterDone(cause);
|
|
@@ -11757,18 +11659,18 @@ var merge4 = /* @__PURE__ */ dual((args2) => isChannel(args2[0]) && isChannel(ar
|
|
|
11757
11659
|
}
|
|
11758
11660
|
switch (strategy) {
|
|
11759
11661
|
case "both": {
|
|
11760
|
-
return done4 === 2 ? failCause5(queue, cause) :
|
|
11662
|
+
return done4 === 2 ? failCause5(queue, cause) : void_4;
|
|
11761
11663
|
}
|
|
11762
11664
|
case "left":
|
|
11763
11665
|
case "right": {
|
|
11764
|
-
return side === strategy ? failCause5(queue, cause) :
|
|
11666
|
+
return side === strategy ? failCause5(queue, cause) : void_4;
|
|
11765
11667
|
}
|
|
11766
11668
|
case "either": {
|
|
11767
11669
|
return failCause5(queue, cause);
|
|
11768
11670
|
}
|
|
11769
11671
|
}
|
|
11770
11672
|
}
|
|
11771
|
-
const runSide = (side, channel, scope3) => toTransform(channel)(upstream, scope3).pipe(flatMap5((pull) => pull.pipe(flatMap5((value) => offer(queue, value)), forever4)), onError2((cause) =>
|
|
11673
|
+
const runSide = (side, channel, scope3) => toTransform(channel)(upstream, scope3).pipe(flatMap5((pull) => pull.pipe(flatMap5((value) => offer(queue, value)), forever4)), onError2((cause) => andThen3(close(scope3, doneExitFromCause(cause)), onExit3(side, cause))), forkIn2(forkedScope));
|
|
11772
11674
|
yield* runSide("left", left, forkUnsafe2(forkedScope));
|
|
11773
11675
|
yield* runSide("right", right, forkUnsafe2(forkedScope));
|
|
11774
11676
|
return take3(queue);
|
|
@@ -11911,12 +11813,12 @@ var haltWhen = /* @__PURE__ */ dual(2, (self, effect2) => fromTransformBracket(f
|
|
|
11911
11813
|
});
|
|
11912
11814
|
});
|
|
11913
11815
|
})));
|
|
11914
|
-
var onError3 = /* @__PURE__ */ dual(2, (self, finalizer) => onExit3(self, (exit3) => isFailure4(exit3) ? finalizer(exit3.cause) :
|
|
11915
|
-
var onExit3 = /* @__PURE__ */ dual(2, (self, finalizer) => fromTransformBracket((upstream, scope3, forkedScope) => addFinalizerExit(forkedScope, finalizer).pipe(
|
|
11816
|
+
var onError3 = /* @__PURE__ */ dual(2, (self, finalizer) => onExit3(self, (exit3) => isFailure4(exit3) ? finalizer(exit3.cause) : void_4));
|
|
11817
|
+
var onExit3 = /* @__PURE__ */ dual(2, (self, finalizer) => fromTransformBracket((upstream, scope3, forkedScope) => addFinalizerExit(forkedScope, finalizer).pipe(andThen3(toTransform(self)(upstream, scope3)))));
|
|
11916
11818
|
var onStart = /* @__PURE__ */ dual(2, (self, onStart2) => unwrap2(as3(onStart2, self)));
|
|
11917
11819
|
var onFirst = /* @__PURE__ */ dual(2, (self, onFirst2) => transformPull(self, (pull) => sync3(() => {
|
|
11918
11820
|
let isFirst = true;
|
|
11919
|
-
const pullFirst =
|
|
11821
|
+
const pullFirst = tap5(pull, (element) => {
|
|
11920
11822
|
isFirst = false;
|
|
11921
11823
|
return onFirst2(element);
|
|
11922
11824
|
});
|
|
@@ -11958,7 +11860,7 @@ var runDrain = (self) => runWith(self, (pull) => forever4(pull, {
|
|
|
11958
11860
|
var runForEach = /* @__PURE__ */ dual(2, (self, f) => runWith(self, (pull) => forever4(flatMap5(pull, f), {
|
|
11959
11861
|
disableYield: true
|
|
11960
11862
|
})));
|
|
11961
|
-
var runForEachWhile = /* @__PURE__ */ dual(2, (self, f) => runWith(self, (pull) => pull.pipe(flatMap5(f), flatMap5((cont) => cont ?
|
|
11863
|
+
var runForEachWhile = /* @__PURE__ */ dual(2, (self, f) => runWith(self, (pull) => pull.pipe(flatMap5(f), flatMap5((cont) => cont ? void_4 : done2()), forever4({
|
|
11962
11864
|
disableYield: true
|
|
11963
11865
|
}))));
|
|
11964
11866
|
var mkUint8Array = (self) => map8(runFold(self, () => ({
|
|
@@ -11995,10 +11897,10 @@ var runLast = (self) => suspend3(() => {
|
|
|
11995
11897
|
let last = absent;
|
|
11996
11898
|
return runWith(self, (pull) => forever4(flatMap5(pull, (item) => {
|
|
11997
11899
|
last = item;
|
|
11998
|
-
return
|
|
11900
|
+
return void_4;
|
|
11999
11901
|
}), {
|
|
12000
11902
|
disableYield: true
|
|
12001
|
-
}), () => last === absent ?
|
|
11903
|
+
}), () => last === absent ? succeedNone2 : succeedSome2(last));
|
|
12002
11904
|
});
|
|
12003
11905
|
var runFold = /* @__PURE__ */ dual(3, (self, initial, f) => suspend3(() => {
|
|
12004
11906
|
let state = initial();
|
|
@@ -12034,7 +11936,7 @@ var runIntoQueueArray = /* @__PURE__ */ dual((args2) => isChannel(args2[0]), (se
|
|
|
12034
11936
|
} else {
|
|
12035
11937
|
failCauseUnsafe(queue, exit3.cause);
|
|
12036
11938
|
}
|
|
12037
|
-
return
|
|
11939
|
+
return void_4;
|
|
12038
11940
|
}))));
|
|
12039
11941
|
var toQueueArray = /* @__PURE__ */ dual((args2) => isChannel(args2[0]), /* @__PURE__ */ fnUntraced2(function* (self, options) {
|
|
12040
11942
|
const scope3 = yield* scope2;
|
|
@@ -12121,7 +12023,7 @@ var take4 = (n) => fromTransform2((upstream) => {
|
|
|
12121
12023
|
if (taken.length === n) {
|
|
12122
12024
|
return done2();
|
|
12123
12025
|
}
|
|
12124
|
-
return
|
|
12026
|
+
return void_4;
|
|
12125
12027
|
}
|
|
12126
12028
|
for (let i = 0;i < arr.length; i++) {
|
|
12127
12029
|
taken.push(arr[i]);
|
|
@@ -12132,7 +12034,7 @@ var take4 = (n) => fromTransform2((upstream) => {
|
|
|
12132
12034
|
return done2();
|
|
12133
12035
|
}
|
|
12134
12036
|
}
|
|
12135
|
-
return
|
|
12037
|
+
return void_4;
|
|
12136
12038
|
}), forever4({
|
|
12137
12039
|
disableYield: true
|
|
12138
12040
|
}), catchDone(() => succeed6([taken, leftover])));
|
|
@@ -12149,14 +12051,14 @@ var unwrap3 = (effect2) => fromChannel2(unwrap2(map8(effect2, toChannel)));
|
|
|
12149
12051
|
var exports_Stream = {};
|
|
12150
12052
|
__export(exports_Stream, {
|
|
12151
12053
|
DefaultChunkSize: () => DefaultChunkSize2,
|
|
12152
|
-
Do: () =>
|
|
12054
|
+
Do: () => Do4,
|
|
12153
12055
|
TypeId: () => TypeId25,
|
|
12154
12056
|
accumulate: () => accumulate,
|
|
12155
12057
|
aggregate: () => aggregate,
|
|
12156
12058
|
aggregateWithin: () => aggregateWithin,
|
|
12157
|
-
bind: () =>
|
|
12059
|
+
bind: () => bind5,
|
|
12158
12060
|
bindEffect: () => bindEffect,
|
|
12159
|
-
bindTo: () =>
|
|
12061
|
+
bindTo: () => bindTo5,
|
|
12160
12062
|
broadcast: () => broadcast,
|
|
12161
12063
|
broadcastN: () => broadcastN,
|
|
12162
12064
|
buffer: () => buffer2,
|
|
@@ -12248,7 +12150,7 @@ __export(exports_Stream, {
|
|
|
12248
12150
|
intersperseAffixes: () => intersperseAffixes,
|
|
12249
12151
|
isStream: () => isStream,
|
|
12250
12152
|
iterate: () => iterate,
|
|
12251
|
-
let: () =>
|
|
12153
|
+
let: () => let_5,
|
|
12252
12154
|
limitBytes: () => limitBytes,
|
|
12253
12155
|
make: () => make18,
|
|
12254
12156
|
map: () => map10,
|
|
@@ -12258,7 +12160,7 @@ __export(exports_Stream, {
|
|
|
12258
12160
|
mapAccumEffect: () => mapAccumEffect,
|
|
12259
12161
|
mapArray: () => mapArray,
|
|
12260
12162
|
mapArrayEffect: () => mapArrayEffect,
|
|
12261
|
-
mapBoth: () =>
|
|
12163
|
+
mapBoth: () => mapBoth3,
|
|
12262
12164
|
mapEffect: () => mapEffect2,
|
|
12263
12165
|
mapError: () => mapError5,
|
|
12264
12166
|
merge: () => merge5,
|
|
@@ -12336,7 +12238,7 @@ __export(exports_Stream, {
|
|
|
12336
12238
|
takeWhile: () => takeWhile2,
|
|
12337
12239
|
takeWhileEffect: () => takeWhileEffect,
|
|
12338
12240
|
takeWhileFilter: () => takeWhileFilter,
|
|
12339
|
-
tap: () =>
|
|
12241
|
+
tap: () => tap6,
|
|
12340
12242
|
tapBoth: () => tapBoth,
|
|
12341
12243
|
tapCause: () => tapCause5,
|
|
12342
12244
|
tapError: () => tapError5,
|
|
@@ -12534,13 +12436,13 @@ var make15 = (options) => withFiber2((fiber3) => {
|
|
|
12534
12436
|
});
|
|
12535
12437
|
return as3(addFinalizerExit(scope3, () => {
|
|
12536
12438
|
if (self.state._tag === "Closed") {
|
|
12537
|
-
return
|
|
12439
|
+
return void_4;
|
|
12538
12440
|
}
|
|
12539
12441
|
const map10 = self.state.map;
|
|
12540
12442
|
self.state = {
|
|
12541
12443
|
_tag: "Closed"
|
|
12542
12444
|
};
|
|
12543
|
-
return forEach2(map10, ([, entry]) => exit2(close(entry.scope,
|
|
12445
|
+
return forEach2(map10, ([, entry]) => exit2(close(entry.scope, void_3))).pipe(tap5(() => sync3(() => {
|
|
12544
12446
|
clear2(map10);
|
|
12545
12447
|
})));
|
|
12546
12448
|
}), self);
|
|
@@ -12578,50 +12480,50 @@ var get4 = /* @__PURE__ */ dual(2, (self, key) => uninterruptibleMask2((restore)
|
|
|
12578
12480
|
self.lookup(key).pipe(runForkWith2(makeUnsafe(context3)), runIn(entry.scope)).addObserver((exit3) => doneUnsafe(entry.deferred, exit3));
|
|
12579
12481
|
}
|
|
12580
12482
|
const scope3 = getUnsafe(parent.context, Scope);
|
|
12581
|
-
return addFinalizer2(scope3, entry.finalizer).pipe(
|
|
12483
|
+
return addFinalizer2(scope3, entry.finalizer).pipe(andThen3(restore(_await(entry.deferred))));
|
|
12582
12484
|
}));
|
|
12583
12485
|
var release = (self, key, entry) => withFiber2((fiber3) => {
|
|
12584
12486
|
entry.refCount--;
|
|
12585
12487
|
if (entry.refCount > 0) {
|
|
12586
|
-
return
|
|
12488
|
+
return void_4;
|
|
12587
12489
|
} else if (self.state._tag === "Closed" || !has2(self.state.map, key) || isZero(entry.idleTimeToLive)) {
|
|
12588
12490
|
if (self.state._tag === "Open") {
|
|
12589
12491
|
remove3(self.state.map, key);
|
|
12590
12492
|
}
|
|
12591
|
-
return close(entry.scope,
|
|
12493
|
+
return close(entry.scope, void_3);
|
|
12592
12494
|
} else if (!isFinite(entry.idleTimeToLive)) {
|
|
12593
|
-
return
|
|
12495
|
+
return void_4;
|
|
12594
12496
|
}
|
|
12595
12497
|
const clock = fiber3.getRef(Clock);
|
|
12596
12498
|
entry.expiresAt = clock.currentTimeMillisUnsafe() + toMillis(entry.idleTimeToLive);
|
|
12597
12499
|
if (entry.fiber)
|
|
12598
|
-
return
|
|
12500
|
+
return void_4;
|
|
12599
12501
|
entry.fiber = interruptibleMask2(function loop(restore) {
|
|
12600
12502
|
const now = clock.currentTimeMillisUnsafe();
|
|
12601
12503
|
const remaining = entry.expiresAt - now;
|
|
12602
12504
|
if (remaining <= 0) {
|
|
12603
12505
|
if (self.state._tag === "Closed" || entry.refCount > 0)
|
|
12604
|
-
return
|
|
12506
|
+
return void_4;
|
|
12605
12507
|
remove3(self.state.map, key);
|
|
12606
|
-
return restore(close(entry.scope,
|
|
12508
|
+
return restore(close(entry.scope, void_3));
|
|
12607
12509
|
}
|
|
12608
12510
|
return flatMap5(clock.sleep(millis(remaining)), () => loop(restore));
|
|
12609
12511
|
}).pipe(ensuring2(sync3(() => {
|
|
12610
12512
|
entry.fiber = undefined;
|
|
12611
12513
|
})), runForkWith2(fiber3.context), runIn(self.scope));
|
|
12612
|
-
return
|
|
12514
|
+
return void_4;
|
|
12613
12515
|
});
|
|
12614
12516
|
var touch = /* @__PURE__ */ dual(2, (self, key) => clockWith2((clock) => {
|
|
12615
12517
|
if (self.state._tag === "Closed") {
|
|
12616
|
-
return
|
|
12518
|
+
return void_4;
|
|
12617
12519
|
}
|
|
12618
12520
|
const o = get3(self.state.map, key);
|
|
12619
12521
|
if (o._tag === "None" || isZero(o.value.idleTimeToLive)) {
|
|
12620
|
-
return
|
|
12522
|
+
return void_4;
|
|
12621
12523
|
}
|
|
12622
12524
|
const entry = o.value;
|
|
12623
12525
|
entry.expiresAt = clock.currentTimeMillisUnsafe() + toMillis(entry.idleTimeToLive);
|
|
12624
|
-
return
|
|
12526
|
+
return void_4;
|
|
12625
12527
|
}));
|
|
12626
12528
|
|
|
12627
12529
|
// ../../node_modules/.bun/effect@4.0.0-rc.112/node_modules/effect/dist/internal/rcRef.js
|
|
@@ -12660,7 +12562,7 @@ var make16 = (options) => withFiber2((fiber3) => {
|
|
|
12660
12562
|
const scope3 = get(context3, Scope);
|
|
12661
12563
|
const ref = new RcRefImpl(options.acquire, context3, scope3, options.idleTimeToLive ? fromInputUnsafe(options.idleTimeToLive) : undefined);
|
|
12662
12564
|
return as3(addFinalizerExit(scope3, () => {
|
|
12663
|
-
const close2 = ref.state._tag === "Acquired" ? close(ref.state.scope,
|
|
12565
|
+
const close2 = ref.state._tag === "Acquired" ? close(ref.state.scope, void_3) : void_4;
|
|
12664
12566
|
ref.state = stateClosed;
|
|
12665
12567
|
return close2;
|
|
12666
12568
|
}), ref);
|
|
@@ -12691,7 +12593,7 @@ var getState = (self) => uninterruptibleMask2(function loop(restore) {
|
|
|
12691
12593
|
};
|
|
12692
12594
|
self.state = state;
|
|
12693
12595
|
return state;
|
|
12694
|
-
}), onExit2((exit3) => isFailure4(exit3) ? close(scope3, exit3) :
|
|
12596
|
+
}), onExit2((exit3) => isFailure4(exit3) ? close(scope3, exit3) : void_4));
|
|
12695
12597
|
}));
|
|
12696
12598
|
}
|
|
12697
12599
|
}
|
|
@@ -12704,26 +12606,26 @@ var get5 = /* @__PURE__ */ fnUntraced2(function* (self_) {
|
|
|
12704
12606
|
yield* addFinalizerExit(scope3, () => {
|
|
12705
12607
|
state.refCount--;
|
|
12706
12608
|
if (state.refCount > 0) {
|
|
12707
|
-
return
|
|
12609
|
+
return void_4;
|
|
12708
12610
|
}
|
|
12709
12611
|
if (self.idleTimeToLive === undefined) {
|
|
12710
12612
|
self.state = stateEmpty;
|
|
12711
|
-
return close(state.scope,
|
|
12613
|
+
return close(state.scope, void_3);
|
|
12712
12614
|
} else if (state.invalidated) {
|
|
12713
|
-
return close(state.scope,
|
|
12615
|
+
return close(state.scope, void_3);
|
|
12714
12616
|
} else if (!isFinite2) {
|
|
12715
|
-
return
|
|
12617
|
+
return void_4;
|
|
12716
12618
|
}
|
|
12717
12619
|
state.fiber = sleep2(self.idleTimeToLive).pipe(flatMap5(() => {
|
|
12718
12620
|
if (self.state._tag === "Acquired" && self.state.refCount === 0) {
|
|
12719
12621
|
self.state = stateEmpty;
|
|
12720
|
-
return close(state.scope,
|
|
12622
|
+
return close(state.scope, void_3);
|
|
12721
12623
|
}
|
|
12722
|
-
return
|
|
12624
|
+
return void_4;
|
|
12723
12625
|
}), ensuring2(sync3(() => {
|
|
12724
12626
|
state.fiber = undefined;
|
|
12725
12627
|
})), runForkWith2(self.context), runIn(self.scope));
|
|
12726
|
-
return
|
|
12628
|
+
return void_4;
|
|
12727
12629
|
});
|
|
12728
12630
|
return state.value;
|
|
12729
12631
|
});
|
|
@@ -12742,7 +12644,7 @@ var service3 = (service4) => fromEffect2(service2(service4));
|
|
|
12742
12644
|
var serviceOption3 = (service4) => fromEffect2(serviceOption2(service4));
|
|
12743
12645
|
var fromEffectDrain2 = (effect2) => fromPull2(succeed6(flatMap5(effect2, () => done2())));
|
|
12744
12646
|
var fromEffectRepeat = (effect2) => fromPull2(succeed6(map8(effect2, of)));
|
|
12745
|
-
var fromEffectSchedule = (effect2, schedule3) => fromPull2(
|
|
12647
|
+
var fromEffectSchedule = (effect2, schedule3) => fromPull2(gen3(function* () {
|
|
12746
12648
|
const step = yield* toStepWithMetadata(schedule3);
|
|
12747
12649
|
let s = yield* provideService2(effect2, CurrentMetadata2, CurrentMetadata2.defaultValue());
|
|
12748
12650
|
let initial = true;
|
|
@@ -12860,14 +12762,14 @@ var map10 = /* @__PURE__ */ dual(2, (self, f) => suspend5(() => {
|
|
|
12860
12762
|
let i = 0;
|
|
12861
12763
|
return fromChannel3(map9(self.channel, map4((o) => f(o, i++))));
|
|
12862
12764
|
}));
|
|
12863
|
-
var
|
|
12765
|
+
var mapBoth3 = /* @__PURE__ */ dual(2, (self, options) => self.pipe(map10(options.onSuccess), mapError5(options.onFailure)));
|
|
12864
12766
|
var mapArray = /* @__PURE__ */ dual(2, (self, f) => fromChannel3(map9(self.channel, f)));
|
|
12865
12767
|
var mapEffect2 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, f, options) => self.channel.pipe(flattenArray, mapEffect(f, options), map9(of), fromChannel3));
|
|
12866
12768
|
var flattenEffect = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, options) => mapEffect2(self, identity, options));
|
|
12867
12769
|
var mapArrayEffect = /* @__PURE__ */ dual(2, (self, f) => fromChannel3(mapEffect(self.channel, f)));
|
|
12868
12770
|
var result3 = (self) => self.pipe(map10(succeed2), catch_5((e) => succeed8(fail2(e))));
|
|
12869
|
-
var
|
|
12870
|
-
var tapBoth = /* @__PURE__ */ dual(2, (self, options) => self.pipe(tapError5(options.onError),
|
|
12771
|
+
var tap6 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, f, options) => mapEffect2(self, (a) => as3(f(a), a), options));
|
|
12772
|
+
var tapBoth = /* @__PURE__ */ dual(2, (self, options) => self.pipe(tapError5(options.onError), tap6(options.onElement, {
|
|
12871
12773
|
concurrency: options.concurrency
|
|
12872
12774
|
})));
|
|
12873
12775
|
var tapSink = /* @__PURE__ */ dual(2, (self, sink) => transformPullBracket(self, fnUntraced2(function* (pull, _, scope3) {
|
|
@@ -12947,7 +12849,7 @@ var timeoutOrElse3 = /* @__PURE__ */ dual(2, (self, options) => {
|
|
|
12947
12849
|
latch.closeUnsafe();
|
|
12948
12850
|
deadline = undefined;
|
|
12949
12851
|
return arr;
|
|
12950
|
-
}), succeed6)), fromEffectDrain2(
|
|
12852
|
+
}), succeed6)), fromEffectDrain2(gen3(function* () {
|
|
12951
12853
|
while (true) {
|
|
12952
12854
|
yield* latch.await;
|
|
12953
12855
|
if (deadline === undefined)
|
|
@@ -12972,7 +12874,7 @@ var timeoutOrElse3 = /* @__PURE__ */ dual(2, (self, options) => {
|
|
|
12972
12874
|
});
|
|
12973
12875
|
var repeatElements = /* @__PURE__ */ dual(2, (self, schedule4) => fromChannel3(fromTransform((upstream, scope3) => map8(toTransform(flattenArray(self.channel))(upstream, scope3), (pullElement) => {
|
|
12974
12876
|
let pullRepeat = undefined;
|
|
12975
|
-
const pull =
|
|
12877
|
+
const pull = gen3(function* () {
|
|
12976
12878
|
const element = yield* pullElement;
|
|
12977
12879
|
const chunk = of(element);
|
|
12978
12880
|
const step = yield* toStepWithSleep(schedule4);
|
|
@@ -13009,7 +12911,7 @@ var zipArrays = (f) => (leftArr, rightArr) => {
|
|
|
13009
12911
|
var zipWithArray = /* @__PURE__ */ dual(3, (left, right, f) => fromChannel3(fromTransformBracket(fnUntraced2(function* (_, scope3) {
|
|
13010
12912
|
const pullLeft = yield* toPullScoped(left.channel, scope3);
|
|
13011
12913
|
const pullRight = yield* toPullScoped(right.channel, scope3);
|
|
13012
|
-
const pullBoth =
|
|
12914
|
+
const pullBoth = gen3(function* () {
|
|
13013
12915
|
const fiberLeft = yield* forkIn2(pullLeft, scope3);
|
|
13014
12916
|
const fiberRight = yield* forkIn2(pullRight, scope3);
|
|
13015
12917
|
return yield* joinAll([fiberLeft, fiberRight]);
|
|
@@ -13017,7 +12919,7 @@ var zipWithArray = /* @__PURE__ */ dual(3, (left, right, f) => fromChannel3(from
|
|
|
13017
12919
|
let state = {
|
|
13018
12920
|
_tag: "PullBoth"
|
|
13019
12921
|
};
|
|
13020
|
-
const pull =
|
|
12922
|
+
const pull = gen3(function* () {
|
|
13021
12923
|
const [left2, right2] = state._tag === "PullBoth" ? yield* pullBoth : state._tag === "PullLeft" ? [yield* pullLeft, state.rightArray] : [state.leftArray, yield* pullRight];
|
|
13022
12924
|
const result4 = f(left2, right2);
|
|
13023
12925
|
if (isReadonlyArrayNonEmpty(result4[1])) {
|
|
@@ -13141,7 +13043,7 @@ var raceAll3 = (...streams) => fromChannel3(fromTransform((_, scope3) => sync3((
|
|
|
13141
13043
|
return close(childScope, exit3);
|
|
13142
13044
|
}
|
|
13143
13045
|
winner = exit3.value[0];
|
|
13144
|
-
return
|
|
13046
|
+
return void_4;
|
|
13145
13047
|
}
|
|
13146
13048
|
return close(childScope, exit3);
|
|
13147
13049
|
}), map8(([, chunk]) => chunk));
|
|
@@ -13163,7 +13065,7 @@ var partitionQueue = /* @__PURE__ */ dual((args2) => isStream(args2[0]), /* @__P
|
|
|
13163
13065
|
const fails = yield* make14({
|
|
13164
13066
|
capacity
|
|
13165
13067
|
});
|
|
13166
|
-
yield*
|
|
13068
|
+
yield* gen3(function* () {
|
|
13167
13069
|
while (true) {
|
|
13168
13070
|
const chunk = yield* pull;
|
|
13169
13071
|
const excluded = [];
|
|
@@ -13195,7 +13097,7 @@ var partitionQueue = /* @__PURE__ */ dual((args2) => isStream(args2[0]), /* @__P
|
|
|
13195
13097
|
}).pipe(onError2((cause) => {
|
|
13196
13098
|
failCauseUnsafe(passes, cause);
|
|
13197
13099
|
failCauseUnsafe(fails, cause);
|
|
13198
|
-
return
|
|
13100
|
+
return void_4;
|
|
13199
13101
|
}), forkIn2(scope3));
|
|
13200
13102
|
return [passes, fails];
|
|
13201
13103
|
}));
|
|
@@ -13224,33 +13126,33 @@ var catchCause5 = /* @__PURE__ */ dual(2, (self, f) => self.channel.pipe(catchCa
|
|
|
13224
13126
|
var tapCause5 = /* @__PURE__ */ dual(2, (self, f) => self.channel.pipe(tapCause4(f), fromChannel3));
|
|
13225
13127
|
var catch_5 = /* @__PURE__ */ dual(2, (self, f) => fromChannel3(catch_4(self.channel, (error) => f(error).channel)));
|
|
13226
13128
|
var tapError5 = /* @__PURE__ */ dual(2, (self, f) => self.channel.pipe(tapError4(f), fromChannel3));
|
|
13227
|
-
var catchIf4 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, predicate, f,
|
|
13228
|
-
var catchFilter4 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, filter9, f,
|
|
13229
|
-
var catchTag4 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, k, f,
|
|
13129
|
+
var catchIf4 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, predicate, f, orElse2) => fromChannel3(catchIf3(toChannel2(self), predicate, (e) => f(e).channel, orElse2 && ((e) => orElse2(e).channel))));
|
|
13130
|
+
var catchFilter4 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, filter9, f, orElse2) => fromChannel3(catchFilter3(toChannel2(self), filter9, (e) => f(e).channel, orElse2 && ((e) => orElse2(e).channel))));
|
|
13131
|
+
var catchTag4 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, k, f, orElse2) => {
|
|
13230
13132
|
const pred = Array.isArray(k) ? (e) => hasProperty(e, "_tag") && k.includes(e._tag) : isTagged(k);
|
|
13231
|
-
return catchIf4(self, pred, f,
|
|
13133
|
+
return catchIf4(self, pred, f, orElse2);
|
|
13232
13134
|
});
|
|
13233
|
-
var catchTags3 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, cases,
|
|
13135
|
+
var catchTags3 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, cases, orElse2) => {
|
|
13234
13136
|
let keys3;
|
|
13235
13137
|
return catchFilter4(self, (e) => {
|
|
13236
13138
|
keys3 ??= Object.keys(cases);
|
|
13237
13139
|
return hasProperty(e, "_tag") && isString2(e["_tag"]) && keys3.includes(e["_tag"]) ? succeed2(e) : fail2(e);
|
|
13238
|
-
}, (e) => cases[e["_tag"]](e),
|
|
13140
|
+
}, (e) => cases[e["_tag"]](e), orElse2);
|
|
13239
13141
|
});
|
|
13240
|
-
var catchReason4 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, errorTag, reasonTag, f,
|
|
13241
|
-
var catchReasons4 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, errorTag, cases,
|
|
13142
|
+
var catchReason4 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, errorTag, reasonTag, f, orElse2) => fromChannel3(catchReason3(toChannel2(self), errorTag, reasonTag, (reason, error) => f(reason, error).channel, orElse2 && ((reason, error) => orElse2(reason, error).channel))));
|
|
13143
|
+
var catchReasons4 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, errorTag, cases, orElse2) => {
|
|
13242
13144
|
const handlers = Object.create(null);
|
|
13243
13145
|
for (const key of Object.keys(cases)) {
|
|
13244
13146
|
const handler = cases[key];
|
|
13245
13147
|
handlers[key] = (reason, error) => handler(reason, error).channel;
|
|
13246
13148
|
}
|
|
13247
|
-
const orElseHandler =
|
|
13149
|
+
const orElseHandler = orElse2 && ((reason, error) => orElse2(reason, error).channel);
|
|
13248
13150
|
return fromChannel3(catchReasons3(self.channel, errorTag, handlers, orElseHandler));
|
|
13249
13151
|
});
|
|
13250
13152
|
var mapError5 = /* @__PURE__ */ dual(2, (self, f) => fromChannel3(mapError4(self.channel, f)));
|
|
13251
13153
|
var catchCauseIf4 = /* @__PURE__ */ dual(3, (self, predicate, f) => fromChannel3(catchCauseIf3(self.channel, predicate, (cause) => f(cause).channel)));
|
|
13252
13154
|
var catchCauseFilter4 = /* @__PURE__ */ dual(3, (self, filter9, f) => fromChannel3(catchCauseFilter3(self.channel, filter9, (failure, cause) => f(failure, cause).channel)));
|
|
13253
|
-
var orElseIfEmpty2 = /* @__PURE__ */ dual(2, (self,
|
|
13155
|
+
var orElseIfEmpty2 = /* @__PURE__ */ dual(2, (self, orElse2) => fromChannel3(orElseIfEmpty(self.channel, (_) => toChannel2(orElse2()))));
|
|
13254
13156
|
var orElseSucceed3 = /* @__PURE__ */ dual(2, (self, f) => catch_5(self, (e) => succeed8(f(e))));
|
|
13255
13157
|
var orDie5 = (self) => fromChannel3(orDie4(self.channel));
|
|
13256
13158
|
var ignore4 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, options) => fromChannel3(ignore3(self.channel, options)));
|
|
@@ -13284,7 +13186,7 @@ var withExecutionPlan3 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (se
|
|
|
13284
13186
|
attemptState = state;
|
|
13285
13187
|
})), (exit3) => suspend3(() => {
|
|
13286
13188
|
if (attemptState === undefined)
|
|
13287
|
-
return
|
|
13189
|
+
return void_4;
|
|
13288
13190
|
const state = attemptState;
|
|
13289
13191
|
attemptState = undefined;
|
|
13290
13192
|
return emitter.end(state, exit3);
|
|
@@ -13314,7 +13216,7 @@ var withExecutionPlan3 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (se
|
|
|
13314
13216
|
}
|
|
13315
13217
|
return catch_5(preventFallbackOnPartialStream ? onFirst2(nextStream, (_) => {
|
|
13316
13218
|
receivedElements = true;
|
|
13317
|
-
return
|
|
13219
|
+
return void_4;
|
|
13318
13220
|
}) : nextStream, (error) => {
|
|
13319
13221
|
i++;
|
|
13320
13222
|
if (preventFallbackOnPartialStream && receivedElements) {
|
|
@@ -13369,7 +13271,7 @@ var takeUntil = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, predi
|
|
|
13369
13271
|
var takeUntilEffect = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, predicate, options) => transformPull2(self, (pull, _scope) => sync3(() => {
|
|
13370
13272
|
let i = 0;
|
|
13371
13273
|
let done4 = false;
|
|
13372
|
-
return
|
|
13274
|
+
return gen3(function* () {
|
|
13373
13275
|
if (done4)
|
|
13374
13276
|
return yield* done2();
|
|
13375
13277
|
const chunk = yield* pull;
|
|
@@ -13458,7 +13360,7 @@ var dropWhileFilter = /* @__PURE__ */ dual(2, (self, filter9) => transformPull2(
|
|
|
13458
13360
|
var dropWhileEffect = /* @__PURE__ */ dual(2, (self, predicate) => transformPull2(self, (pull, _scope) => sync3(() => {
|
|
13459
13361
|
let dropping2 = true;
|
|
13460
13362
|
let index = 0;
|
|
13461
|
-
const filtered =
|
|
13363
|
+
const filtered = gen3(function* () {
|
|
13462
13364
|
while (true) {
|
|
13463
13365
|
const arr = yield* pull;
|
|
13464
13366
|
for (let i = 0;i < arr.length; i++) {
|
|
@@ -13661,7 +13563,7 @@ var debounce = /* @__PURE__ */ dual(2, (self, duration2) => transformPull2(self,
|
|
|
13661
13563
|
emitLatch.openUnsafe();
|
|
13662
13564
|
lastArr = arr;
|
|
13663
13565
|
emitAtMs = clock.currentTimeMillisUnsafe() + durationMs;
|
|
13664
|
-
return
|
|
13566
|
+
return void_4;
|
|
13665
13567
|
}), forever4({
|
|
13666
13568
|
disableYield: true
|
|
13667
13569
|
}), onError2((cause_) => {
|
|
@@ -13669,7 +13571,7 @@ var debounce = /* @__PURE__ */ dual(2, (self, duration2) => transformPull2(self,
|
|
|
13669
13571
|
emitAtMs = clock.currentTimeMillisUnsafe();
|
|
13670
13572
|
emitLatch.openUnsafe();
|
|
13671
13573
|
endLatch.openUnsafe();
|
|
13672
|
-
return
|
|
13574
|
+
return void_4;
|
|
13673
13575
|
}), forkIn2(scope3));
|
|
13674
13576
|
const sleepLoop = suspend3(function loop() {
|
|
13675
13577
|
const now = clock.currentTimeMillisUnsafe();
|
|
@@ -13805,7 +13707,7 @@ var groupByImpl = (self, f, options) => transformPullBracket(self, fnUntraced2(f
|
|
|
13805
13707
|
const queues = yield* make15({
|
|
13806
13708
|
lookup: (key) => acquireRelease2(make14({
|
|
13807
13709
|
capacity: options?.bufferSize ?? 4096
|
|
13808
|
-
}).pipe(
|
|
13710
|
+
}).pipe(tap5((queue) => {
|
|
13809
13711
|
set2(queueMap, key, queue);
|
|
13810
13712
|
return offer(out, [key, fromQueue(queue)]);
|
|
13811
13713
|
})), (queue) => {
|
|
@@ -14037,7 +13939,7 @@ var interleaveWith = /* @__PURE__ */ dual(3, (self, that, decider) => fromChanne
|
|
|
14037
13939
|
rightDone = true;
|
|
14038
13940
|
return succeed6(retry5);
|
|
14039
13941
|
}));
|
|
14040
|
-
return
|
|
13942
|
+
return gen3(function* () {
|
|
14041
13943
|
while (true) {
|
|
14042
13944
|
if (leftDone && rightDone) {
|
|
14043
13945
|
return yield* done2();
|
|
@@ -14078,12 +13980,12 @@ var withSpan5 = function() {
|
|
|
14078
13980
|
}
|
|
14079
13981
|
return (self) => fromChannel3(withSpan4(self.channel, name, options));
|
|
14080
13982
|
};
|
|
14081
|
-
var
|
|
14082
|
-
var
|
|
13983
|
+
var Do4 = /* @__PURE__ */ succeed8({});
|
|
13984
|
+
var let_5 = /* @__PURE__ */ dual(3, (self, name, f) => map10(self, (a) => ({
|
|
14083
13985
|
...a,
|
|
14084
13986
|
[name]: f(a)
|
|
14085
13987
|
})));
|
|
14086
|
-
var
|
|
13988
|
+
var bind5 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, tag, f, options) => flatMap7(self, (a) => map10(f(a), (b) => ({
|
|
14087
13989
|
...a,
|
|
14088
13990
|
[tag]: b
|
|
14089
13991
|
})), options));
|
|
@@ -14091,7 +13993,7 @@ var bindEffect = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self, tag,
|
|
|
14091
13993
|
...a,
|
|
14092
13994
|
[tag]: b
|
|
14093
13995
|
})), options));
|
|
14094
|
-
var
|
|
13996
|
+
var bindTo5 = /* @__PURE__ */ dual(2, (self, name) => map10(self, (a) => ({
|
|
14095
13997
|
[name]: a
|
|
14096
13998
|
})));
|
|
14097
13999
|
var run = /* @__PURE__ */ dual(2, (self, sink) => scopedWith2((scope3) => toPullScoped(self.channel, scope3).pipe(flatMap5((upstream) => sink.transform(upstream, scope3)), map8(([a]) => a))));
|
|
@@ -14205,7 +14107,7 @@ var toAsyncIterableWith = /* @__PURE__ */ dual(2, (self, context3) => ({
|
|
|
14205
14107
|
if (closePromise)
|
|
14206
14108
|
return closePromise;
|
|
14207
14109
|
const fiber3 = currentFiber;
|
|
14208
|
-
closePromise = runPromise3(as3(
|
|
14110
|
+
closePromise = runPromise3(as3(andThen3(fiber3 ? interrupt4(fiber3) : void_4, close(scope3, exit3)), {
|
|
14209
14111
|
done: true,
|
|
14210
14112
|
value: undefined
|
|
14211
14113
|
}));
|
|
@@ -14241,7 +14143,7 @@ var toAsyncIterableWith = /* @__PURE__ */ dual(2, (self, context3) => ({
|
|
|
14241
14143
|
currentIter = exit3.value[Symbol.iterator]();
|
|
14242
14144
|
return currentIter.next();
|
|
14243
14145
|
} else if (isDoneCause(exit3.cause)) {
|
|
14244
|
-
return close2(
|
|
14146
|
+
return close2(void_3);
|
|
14245
14147
|
}
|
|
14246
14148
|
if (closePromise && hasInterruptsOnly2(exit3.cause)) {
|
|
14247
14149
|
return closePromise;
|
|
@@ -14250,7 +14152,7 @@ var toAsyncIterableWith = /* @__PURE__ */ dual(2, (self, context3) => ({
|
|
|
14250
14152
|
throw squash(exit3.cause);
|
|
14251
14153
|
},
|
|
14252
14154
|
return() {
|
|
14253
|
-
return close2(
|
|
14155
|
+
return close2(void_3);
|
|
14254
14156
|
},
|
|
14255
14157
|
async throw(error) {
|
|
14256
14158
|
await closeAndReportError(die3(error));
|
|
@@ -15240,7 +15142,7 @@ function passthrough2() {
|
|
|
15240
15142
|
return passthrough_;
|
|
15241
15143
|
}
|
|
15242
15144
|
function onSome(f) {
|
|
15243
|
-
return new Getter((oe, options) => isNone2(oe) ?
|
|
15145
|
+
return new Getter((oe, options) => isNone2(oe) ? succeedNone2 : f(oe.value, options));
|
|
15244
15146
|
}
|
|
15245
15147
|
function transform(f) {
|
|
15246
15148
|
return transformOptional(map(f));
|
|
@@ -15252,7 +15154,7 @@ function transformOptional(f) {
|
|
|
15252
15154
|
return new Getter((oe) => succeed6(f(oe)));
|
|
15253
15155
|
}
|
|
15254
15156
|
function omit2() {
|
|
15255
|
-
return new Getter(() =>
|
|
15157
|
+
return new Getter(() => succeedNone2);
|
|
15256
15158
|
}
|
|
15257
15159
|
function withDefault(defaultValue) {
|
|
15258
15160
|
return new Getter((o) => {
|
|
@@ -16204,7 +16106,7 @@ class Void extends Base2 {
|
|
|
16204
16106
|
return "void";
|
|
16205
16107
|
}
|
|
16206
16108
|
}
|
|
16207
|
-
var
|
|
16109
|
+
var void_5 = /* @__PURE__ */ new Void;
|
|
16208
16110
|
class Never extends Base2 {
|
|
16209
16111
|
_tag = "Never";
|
|
16210
16112
|
getParser() {
|
|
@@ -16764,15 +16666,15 @@ class Objects extends Base2 {
|
|
|
16764
16666
|
let indexes;
|
|
16765
16667
|
const finishIndex = (s, key, k2, inputValue, exitValue) => {
|
|
16766
16668
|
if (exitValue._tag === "Failure") {
|
|
16767
|
-
return wrapPropertyKeyIssue(s, ast, key, exitValue) ??
|
|
16669
|
+
return wrapPropertyKeyIssue(s, ast, key, exitValue) ?? void_3;
|
|
16768
16670
|
}
|
|
16769
16671
|
const value = exitValue === sameExit ? inputValue : exitValue[args];
|
|
16770
16672
|
if (k2 !== missing && value !== missing) {
|
|
16771
16673
|
if (hasProperties && (expectedKeysSet.has(key) || expectedKeysSet.has(k2)))
|
|
16772
|
-
return
|
|
16674
|
+
return void_3;
|
|
16773
16675
|
assignProperty(s.out, k2, value);
|
|
16774
16676
|
}
|
|
16775
|
-
return
|
|
16677
|
+
return void_3;
|
|
16776
16678
|
};
|
|
16777
16679
|
const parseIndex = (s, key, index, exitKey) => {
|
|
16778
16680
|
if (!exitKey) {
|
|
@@ -16783,7 +16685,7 @@ class Objects extends Base2 {
|
|
|
16783
16685
|
exitKey = eff;
|
|
16784
16686
|
}
|
|
16785
16687
|
if (exitKey._tag === "Failure") {
|
|
16786
|
-
return wrapPropertyKeyIssue(s, ast, key, exitKey) ??
|
|
16688
|
+
return wrapPropertyKeyIssue(s, ast, key, exitKey) ?? void_3;
|
|
16787
16689
|
}
|
|
16788
16690
|
const k2 = exitKey === sameExit ? key : exitKey[args];
|
|
16789
16691
|
const inputValue = s.input[key];
|
|
@@ -17444,7 +17346,7 @@ var parseUnion = /* @__PURE__ */ iterateEager()({
|
|
|
17444
17346
|
if (s.successes) {
|
|
17445
17347
|
s.successes.push(candidate);
|
|
17446
17348
|
} else {
|
|
17447
|
-
return
|
|
17349
|
+
return void_3;
|
|
17448
17350
|
}
|
|
17449
17351
|
}
|
|
17450
17352
|
}
|
|
@@ -17806,29 +17708,29 @@ var toType = /* @__PURE__ */ memoizeIdempotent((ast) => {
|
|
|
17806
17708
|
return type;
|
|
17807
17709
|
});
|
|
17808
17710
|
var toEncoded = /* @__PURE__ */ memoizeIdempotent((ast) => {
|
|
17809
|
-
return toType(
|
|
17711
|
+
return toType(flip3(ast));
|
|
17810
17712
|
});
|
|
17811
17713
|
function flipEncoding(ast, encoding) {
|
|
17812
17714
|
const links = encoding;
|
|
17813
17715
|
const len = links.length;
|
|
17814
17716
|
const last = links[len - 1];
|
|
17815
|
-
const ls = [new Link(
|
|
17717
|
+
const ls = [new Link(flip3(replaceEncoding(ast, undefined)), links[0].transformation.flip())];
|
|
17816
17718
|
for (let i = 1;i < len; i++) {
|
|
17817
|
-
ls.unshift(new Link(
|
|
17719
|
+
ls.unshift(new Link(flip3(links[i - 1].to), links[i].transformation.flip()));
|
|
17818
17720
|
}
|
|
17819
|
-
const to =
|
|
17721
|
+
const to = flip3(last.to);
|
|
17820
17722
|
if (to.encoding) {
|
|
17821
17723
|
return replaceEncoding(to, [...to.encoding, ...ls]);
|
|
17822
17724
|
} else {
|
|
17823
17725
|
return replaceEncoding(to, ls);
|
|
17824
17726
|
}
|
|
17825
17727
|
}
|
|
17826
|
-
var
|
|
17728
|
+
var flip3 = /* @__PURE__ */ memoize((ast) => {
|
|
17827
17729
|
if (ast.encoding) {
|
|
17828
17730
|
return flipEncoding(ast, ast.encoding);
|
|
17829
17731
|
}
|
|
17830
17732
|
const out = ast;
|
|
17831
|
-
return out.flip?.(
|
|
17733
|
+
return out.flip?.(flip3) ?? out.recur?.(flip3) ?? out;
|
|
17832
17734
|
});
|
|
17833
17735
|
function containsUndefined(ast) {
|
|
17834
17736
|
switch (ast._tag) {
|
|
@@ -18384,7 +18286,7 @@ var pullIntoWritable = (options) => options.pull.pipe(flatMap5((chunk) => {
|
|
|
18384
18286
|
return;
|
|
18385
18287
|
}
|
|
18386
18288
|
}
|
|
18387
|
-
resume(
|
|
18289
|
+
resume(void_4);
|
|
18388
18290
|
});
|
|
18389
18291
|
}), forever4({
|
|
18390
18292
|
disableYield: true
|
|
@@ -18479,7 +18381,7 @@ var toPlatformError = (method, error, command) => {
|
|
|
18479
18381
|
var taskkill = (childProcess, onExit5 = () => {}) => NodeChildProcess.execFile("taskkill", ["/pid", String(childProcess.pid), "/T", "/F"], {
|
|
18480
18382
|
windowsHide: true
|
|
18481
18383
|
}, onExit5);
|
|
18482
|
-
var make26 = /* @__PURE__ */
|
|
18384
|
+
var make26 = /* @__PURE__ */ gen3(function* () {
|
|
18483
18385
|
const fs = yield* FileSystem;
|
|
18484
18386
|
const path = yield* Path;
|
|
18485
18387
|
const resolveWorkingDirectory = fnUntraced2(function* (options) {
|
|
@@ -18701,7 +18603,7 @@ var make26 = /* @__PURE__ */ gen4(function* () {
|
|
|
18701
18603
|
if (error) {
|
|
18702
18604
|
resume(fail6(toPlatformError("kill", toError(error), command)));
|
|
18703
18605
|
} else {
|
|
18704
|
-
resume(
|
|
18606
|
+
resume(void_4);
|
|
18705
18607
|
}
|
|
18706
18608
|
});
|
|
18707
18609
|
});
|
|
@@ -18728,7 +18630,7 @@ var make26 = /* @__PURE__ */ gen4(function* () {
|
|
|
18728
18630
|
const error = new globalThis.Error("Failed to kill child process");
|
|
18729
18631
|
return fail6(toPlatformError("kill", error, command));
|
|
18730
18632
|
}
|
|
18731
|
-
return
|
|
18633
|
+
return void_4;
|
|
18732
18634
|
});
|
|
18733
18635
|
const withTimeout = (childProcess, command, options) => (kill) => {
|
|
18734
18636
|
const killSignal = options?.killSignal ?? "SIGTERM";
|
|
@@ -18778,12 +18680,12 @@ var make26 = /* @__PURE__ */ gen4(function* () {
|
|
|
18778
18680
|
if (code !== 0 && isNotNull(code)) {
|
|
18779
18681
|
return yield* ignore2(killWithTimeout(killProcessGroup));
|
|
18780
18682
|
}
|
|
18781
|
-
return yield*
|
|
18683
|
+
return yield* void_4;
|
|
18782
18684
|
}
|
|
18783
18685
|
if (!isReferenced) {
|
|
18784
|
-
return yield*
|
|
18686
|
+
return yield* void_4;
|
|
18785
18687
|
}
|
|
18786
|
-
return yield* killWithTimeout((command, childProcess3, signal) => killProcessGroup(command, childProcess3, signal).pipe(catch_3(() => killProcess(command, childProcess3, signal)),
|
|
18688
|
+
return yield* killWithTimeout((command, childProcess3, signal) => killProcessGroup(command, childProcess3, signal).pipe(catch_3(() => killProcess(command, childProcess3, signal)), andThen3(_await(exitSignal2)))).pipe(ignore2);
|
|
18787
18689
|
}));
|
|
18788
18690
|
const pid = ProcessId(childProcess.pid);
|
|
18789
18691
|
childProcess.on("exit", (code) => {
|
|
@@ -18824,7 +18726,7 @@ var make26 = /* @__PURE__ */ gen4(function* () {
|
|
|
18824
18726
|
});
|
|
18825
18727
|
const kill = (options) => {
|
|
18826
18728
|
const killWithTimeout = withTimeout(childProcess, cmd, options);
|
|
18827
|
-
return killWithTimeout((command, childProcess2, signal) => killProcessGroup(command, childProcess2, signal).pipe(catch_3(() => killProcess(command, childProcess2, signal)),
|
|
18729
|
+
return killWithTimeout((command, childProcess2, signal) => killProcessGroup(command, childProcess2, signal).pipe(catch_3(() => killProcess(command, childProcess2, signal)), andThen3(_await(exitSignal)))).pipe(asVoid3);
|
|
18828
18730
|
};
|
|
18829
18731
|
return makeHandle({
|
|
18830
18732
|
pid,
|
|
@@ -18891,7 +18793,7 @@ var make26 = /* @__PURE__ */ gen4(function* () {
|
|
|
18891
18793
|
const kill = (options) => forEach2([...handles].reverse(), (handle2) => ignore2(handle2.kill(options)), {
|
|
18892
18794
|
discard: true
|
|
18893
18795
|
});
|
|
18894
|
-
const unref =
|
|
18796
|
+
const unref = gen3(function* () {
|
|
18895
18797
|
const rerefs = [];
|
|
18896
18798
|
for (const handle2 of handles) {
|
|
18897
18799
|
rerefs.push(yield* handle2.unref);
|
|
@@ -19269,7 +19171,7 @@ var makeFile = /* @__PURE__ */ (() => {
|
|
|
19269
19171
|
if (!this.append) {
|
|
19270
19172
|
this.position = position + BigInt(bytesWritten);
|
|
19271
19173
|
}
|
|
19272
|
-
return bytesWritten < buffer3.length ? this.writeAllChunk(buffer3.subarray(bytesWritten)) :
|
|
19174
|
+
return bytesWritten < buffer3.length ? this.writeAllChunk(buffer3.subarray(bytesWritten)) : void_4;
|
|
19273
19175
|
});
|
|
19274
19176
|
});
|
|
19275
19177
|
}
|
|
@@ -19414,7 +19316,7 @@ var writeFile2 = (path, data, options) => callback2((resume, signal) => {
|
|
|
19414
19316
|
if (err) {
|
|
19415
19317
|
resume(fail6(handleErrnoException("FileSystem", "writeFile")(err, [path])));
|
|
19416
19318
|
} else {
|
|
19417
|
-
resume(
|
|
19319
|
+
resume(void_4);
|
|
19418
19320
|
}
|
|
19419
19321
|
});
|
|
19420
19322
|
} catch (err) {
|
|
@@ -19736,7 +19638,7 @@ __export(exports_Schema, {
|
|
|
19736
19638
|
encodeUnknownSync: () => encodeUnknownSync2,
|
|
19737
19639
|
extendTo: () => extendTo,
|
|
19738
19640
|
fieldsAssign: () => fieldsAssign,
|
|
19739
|
-
flip: () =>
|
|
19641
|
+
flip: () => flip4,
|
|
19740
19642
|
fromBrand: () => fromBrand,
|
|
19741
19643
|
fromFormData: () => fromFormData2,
|
|
19742
19644
|
fromJsonString: () => fromJsonString2,
|
|
@@ -20865,7 +20767,7 @@ function decodeUnknownSync(schema, options) {
|
|
|
20865
20767
|
}
|
|
20866
20768
|
var decodeSync = decodeUnknownSync;
|
|
20867
20769
|
function encodeUnknownEffect(schema, options) {
|
|
20868
|
-
const parser = run2(
|
|
20770
|
+
const parser = run2(flip3(schema.ast));
|
|
20869
20771
|
return options === undefined ? parser : (input, overrideOptions) => parser(input, mergeParseOptions(options, overrideOptions));
|
|
20870
20772
|
}
|
|
20871
20773
|
function encodeUnknownExit(schema, options) {
|
|
@@ -24013,7 +23915,7 @@ function annotate2(annotations) {
|
|
|
24013
23915
|
return (self) => self.annotate(annotations);
|
|
24014
23916
|
}
|
|
24015
23917
|
function annotateEncoded(annotations) {
|
|
24016
|
-
return (self) =>
|
|
23918
|
+
return (self) => flip4(flip4(self).annotate(annotations));
|
|
24017
23919
|
}
|
|
24018
23920
|
function annotateKey2(annotations) {
|
|
24019
23921
|
return (self) => {
|
|
@@ -24292,11 +24194,11 @@ var FlipTypeId = "~effect/Schema/flip";
|
|
|
24292
24194
|
function isFlip$(schema) {
|
|
24293
24195
|
return hasProperty(schema, FlipTypeId) && schema[FlipTypeId] === FlipTypeId;
|
|
24294
24196
|
}
|
|
24295
|
-
function
|
|
24197
|
+
function flip4(schema) {
|
|
24296
24198
|
if (isFlip$(schema)) {
|
|
24297
|
-
return schema.schema.rebuild(
|
|
24199
|
+
return schema.schema.rebuild(flip3(schema.ast));
|
|
24298
24200
|
}
|
|
24299
|
-
return make37(
|
|
24201
|
+
return make37(flip3(schema.ast), {
|
|
24300
24202
|
[FlipTypeId]: FlipTypeId,
|
|
24301
24203
|
schema
|
|
24302
24204
|
});
|
|
@@ -24341,7 +24243,7 @@ var Number6 = /* @__PURE__ */ make37(number2);
|
|
|
24341
24243
|
var Boolean4 = /* @__PURE__ */ make37(boolean);
|
|
24342
24244
|
var Symbol3 = /* @__PURE__ */ make37(symbol3);
|
|
24343
24245
|
var BigInt5 = /* @__PURE__ */ make37(bigInt);
|
|
24344
|
-
var Void2 = /* @__PURE__ */ make37(
|
|
24246
|
+
var Void2 = /* @__PURE__ */ make37(void_5);
|
|
24345
24247
|
var ObjectKeyword2 = /* @__PURE__ */ make37(objectKeyword);
|
|
24346
24248
|
function UniqueSymbol2(symbol4) {
|
|
24347
24249
|
return make37(new UniqueSymbol(symbol4));
|
|
@@ -24676,18 +24578,18 @@ function toTaggedUnion(tag2) {
|
|
|
24676
24578
|
function matchOrElse() {
|
|
24677
24579
|
if (arguments.length === 2) {
|
|
24678
24580
|
const cases3 = arguments[0];
|
|
24679
|
-
const
|
|
24581
|
+
const orElse3 = arguments[1];
|
|
24680
24582
|
return function(value4) {
|
|
24681
24583
|
const key2 = value4[tag2];
|
|
24682
|
-
const handler2 = Object.hasOwn(cases3, key2) ? cases3[key2] ??
|
|
24584
|
+
const handler2 = Object.hasOwn(cases3, key2) ? cases3[key2] ?? orElse3 : orElse3;
|
|
24683
24585
|
return handler2(value4);
|
|
24684
24586
|
};
|
|
24685
24587
|
}
|
|
24686
24588
|
const value3 = arguments[0];
|
|
24687
24589
|
const cases2 = arguments[1];
|
|
24688
|
-
const
|
|
24590
|
+
const orElse2 = arguments[2];
|
|
24689
24591
|
const key = value3[tag2];
|
|
24690
|
-
const handler = Object.hasOwn(cases2, key) ? cases2[key] ??
|
|
24592
|
+
const handler = Object.hasOwn(cases2, key) ? cases2[key] ?? orElse2 : orElse2;
|
|
24691
24593
|
return handler(value3);
|
|
24692
24594
|
}
|
|
24693
24595
|
};
|
|
@@ -26069,7 +25971,7 @@ function Option(value3) {
|
|
|
26069
25971
|
const schema = declareConstructor()([value3], ([value4]) => (input, ast, options) => {
|
|
26070
25972
|
if (isOption2(input)) {
|
|
26071
25973
|
if (isNone2(input)) {
|
|
26072
|
-
return
|
|
25974
|
+
return succeedNone2;
|
|
26073
25975
|
}
|
|
26074
25976
|
return mapBothEager2(decodeUnknownEffect(value4)(input.value, options), {
|
|
26075
25977
|
onSuccess: some3,
|
|
@@ -26249,7 +26151,7 @@ function Redacted(value3, options) {
|
|
|
26249
26151
|
const decodeLabel = label !== undefined ? decodeUnknownEffect(Literal2(label)) : undefined;
|
|
26250
26152
|
const schema = declareConstructor()([value3], ([value4]) => (input, ast, poptions) => {
|
|
26251
26153
|
if (isRedacted(input)) {
|
|
26252
|
-
const label2 = decodeLabel !== undefined ? mapErrorEager2(decodeLabel(input.label, poptions), (issue) => new Pointer(["label"], issue)) :
|
|
26154
|
+
const label2 = decodeLabel !== undefined ? mapErrorEager2(decodeLabel(input.label, poptions), (issue) => new Pointer(["label"], issue)) : void_4;
|
|
26253
26155
|
return flatMapEager2(label2, () => mapBothEager2(decodeUnknownEffect(value4)(value2(input), poptions), {
|
|
26254
26156
|
onSuccess: () => input,
|
|
26255
26157
|
onFailure: () => {
|
|
@@ -28460,7 +28362,7 @@ var make39 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
|
|
|
28460
28362
|
});
|
|
28461
28363
|
const columns = sync3(() => stdout.columns ?? 0);
|
|
28462
28364
|
const rows = sync3(() => stdout.rows ?? 0);
|
|
28463
|
-
const readInput =
|
|
28365
|
+
const readInput = gen3(function* () {
|
|
28464
28366
|
const queue = yield* make14();
|
|
28465
28367
|
const handleKeypress = (s, k) => {
|
|
28466
28368
|
const userInput = {
|
|
@@ -28497,11 +28399,11 @@ var make39 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
|
|
|
28497
28399
|
return queue;
|
|
28498
28400
|
});
|
|
28499
28401
|
const readLine = suspend3(() => poll(lines).pipe(flatMap5(match({
|
|
28500
|
-
onNone: () => scoped2(
|
|
28402
|
+
onNone: () => scoped2(andThen3(get6(rlRef), take3(lines))),
|
|
28501
28403
|
onSome: succeed6
|
|
28502
28404
|
})), mapError3(() => new QuitError({}))));
|
|
28503
28405
|
const display = (prompt) => uninterruptible2(callback2((resume) => {
|
|
28504
|
-
stdout.write(prompt, (err) => isNullish(err) ? resume(
|
|
28406
|
+
stdout.write(prompt, (err) => isNullish(err) ? resume(void_4) : resume(fail6(badArgument({
|
|
28505
28407
|
module: "Terminal",
|
|
28506
28408
|
method: "display",
|
|
28507
28409
|
description: "Failed to write prompt to stdout",
|
|
@@ -28529,7 +28431,7 @@ var layer12 = /* @__PURE__ */ layer.pipe(/* @__PURE__ */ provideMerge(/* @__PURE
|
|
|
28529
28431
|
// package.json
|
|
28530
28432
|
var package_default = {
|
|
28531
28433
|
name: "@samva/cli",
|
|
28532
|
-
version: "0.2.
|
|
28434
|
+
version: "0.2.1",
|
|
28533
28435
|
description: "Samva CLI \u2014 email and platform operations from your terminal",
|
|
28534
28436
|
keywords: [
|
|
28535
28437
|
"cli",
|
|
@@ -28577,19 +28479,20 @@ var package_default = {
|
|
|
28577
28479
|
devDependencies: {
|
|
28578
28480
|
"@effect/platform-bun": "catalog:effect",
|
|
28579
28481
|
"@effect/vitest": "catalog:effect",
|
|
28580
|
-
"@samva/markup": "workspace:0.
|
|
28581
|
-
"@samva/vite": "workspace:0.
|
|
28482
|
+
"@samva/markup": "workspace:0.5.0",
|
|
28483
|
+
"@samva/vite": "workspace:0.5.0",
|
|
28582
28484
|
"@types/node": "catalog:",
|
|
28485
|
+
"better-result": "catalog:",
|
|
28583
28486
|
effect: "catalog:effect",
|
|
28584
28487
|
samva: "workspace:0.4.0",
|
|
28585
28488
|
typescript: "catalog:",
|
|
28586
28489
|
vitest: "catalog:"
|
|
28587
28490
|
},
|
|
28588
28491
|
optionalDependencies: {
|
|
28589
|
-
"@samva/cli-darwin-arm64": "workspace:0.2.
|
|
28590
|
-
"@samva/cli-darwin-x64": "workspace:0.2.
|
|
28591
|
-
"@samva/cli-linux-arm64": "workspace:0.2.
|
|
28592
|
-
"@samva/cli-linux-x64": "workspace:0.2.
|
|
28492
|
+
"@samva/cli-darwin-arm64": "workspace:0.2.1",
|
|
28493
|
+
"@samva/cli-darwin-x64": "workspace:0.2.1",
|
|
28494
|
+
"@samva/cli-linux-arm64": "workspace:0.2.1",
|
|
28495
|
+
"@samva/cli-linux-x64": "workspace:0.2.1"
|
|
28593
28496
|
},
|
|
28594
28497
|
engines: {
|
|
28595
28498
|
node: ">=18"
|
|
@@ -32350,7 +32253,7 @@ var getSharedFlagsForCommandPath = (commands, currentFlags) => {
|
|
|
32350
32253
|
return sharedFlags;
|
|
32351
32254
|
};
|
|
32352
32255
|
var getGlobalFlagsForCommandTree = (command, builtIns) => dedupeGlobalFlags([...builtIns, ...collectDeclaredGlobalFlags(command)]);
|
|
32353
|
-
var getHelpForCommandPath = (command, commandPath, builtIns) =>
|
|
32256
|
+
var getHelpForCommandPath = (command, commandPath, builtIns) => gen3(function* () {
|
|
32354
32257
|
const commands = getCommandsForCommandPath(command, commandPath);
|
|
32355
32258
|
const currentCommand = commands.length > 0 ? commands[commands.length - 1] : command;
|
|
32356
32259
|
const baseDoc = toImpl2(currentCommand).buildHelpDoc(commandPath);
|
|
@@ -32416,7 +32319,7 @@ var Version = /* @__PURE__ */ action({
|
|
|
32416
32319
|
});
|
|
32417
32320
|
var Wizard = /* @__PURE__ */ action({
|
|
32418
32321
|
flag: /* @__PURE__ */ boolean4("wizard").pipe(/* @__PURE__ */ withDescription2("Start wizard mode for a command"), /* @__PURE__ */ withDefault3(false)),
|
|
32419
|
-
run: () =>
|
|
32322
|
+
run: () => void_4
|
|
32420
32323
|
});
|
|
32421
32324
|
var Completions = /* @__PURE__ */ action({
|
|
32422
32325
|
flag: /* @__PURE__ */ choice3("completions", ["bash", "zsh", "fish", "sh"]).pipe(optional4, /* @__PURE__ */ map16((v) => map(v, (s) => s === "sh" ? "bash" : s)), /* @__PURE__ */ withMetavar2("<bash|zsh|fish|sh>"), /* @__PURE__ */ withDescription2("Print shell completion script")),
|
|
@@ -32546,7 +32449,7 @@ var getCommandPath = (parsedInput) => match(parsedInput.subcommand, {
|
|
|
32546
32449
|
onNone: () => [],
|
|
32547
32450
|
onSome: (subcommand) => [subcommand.name, ...getCommandPath(subcommand.parsedInput)]
|
|
32548
32451
|
});
|
|
32549
|
-
var parseArgs = (lexResult, command, commandPath = []) =>
|
|
32452
|
+
var parseArgs = (lexResult, command, commandPath = []) => gen3(function* () {
|
|
32550
32453
|
const {
|
|
32551
32454
|
tokens,
|
|
32552
32455
|
trailingOperands: afterEndOfOptions
|
|
@@ -33426,7 +33329,7 @@ var getOutOfScopeGlobalFlagErrors = (allFlags, activeFlags, flagMap, commandPath
|
|
|
33426
33329
|
}
|
|
33427
33330
|
return errors;
|
|
33428
33331
|
};
|
|
33429
|
-
var showHelp = (command, error2, renderErrors) =>
|
|
33332
|
+
var showHelp = (command, error2, renderErrors) => gen3(function* () {
|
|
33430
33333
|
const {
|
|
33431
33334
|
builtIns
|
|
33432
33335
|
} = yield* CliConfig;
|
|
@@ -33437,7 +33340,7 @@ var showHelp = (command, error2, renderErrors) => gen4(function* () {
|
|
|
33437
33340
|
yield* error(formatter.formatErrors(error2.errors));
|
|
33438
33341
|
}
|
|
33439
33342
|
});
|
|
33440
|
-
var showUserError = (error2) =>
|
|
33343
|
+
var showUserError = (error2) => gen3(function* () {
|
|
33441
33344
|
const formatter = yield* Formatter;
|
|
33442
33345
|
yield* error(formatter.formatError(error2));
|
|
33443
33346
|
error2[errorReported] = false;
|
|
@@ -33499,7 +33402,7 @@ var runWith2 = (command, config) => {
|
|
|
33499
33402
|
continue;
|
|
33500
33403
|
const [, value3] = yield* flag.flag.parse(emptyArgs);
|
|
33501
33404
|
if (flag === Wizard) {
|
|
33502
|
-
return yield*
|
|
33405
|
+
return yield* gen3(function* () {
|
|
33503
33406
|
yield* log2(renderIntroduction(command.name, config.version, command.description));
|
|
33504
33407
|
const prefix = [command.name, ...args2.filter((arg) => arg !== "--wizard" && !arg.startsWith("--wizard="))];
|
|
33505
33408
|
const wizardResult = yield* run4(command, {
|
|
@@ -33552,7 +33455,7 @@ var runWith2 = (command, config) => {
|
|
|
33552
33455
|
onSome: (level) => make5(MinimumLogLevel2, level)
|
|
33553
33456
|
});
|
|
33554
33457
|
yield* provideContext2(program, services);
|
|
33555
|
-
}, catchFilter2((error2) => isCliError(error2) && error2._tag === "ShowHelp" ? succeed2(error2) : fail2(error2), (error2) =>
|
|
33458
|
+
}, catchFilter2((error2) => isCliError(error2) && error2._tag === "ShowHelp" ? succeed2(error2) : fail2(error2), (error2) => andThen3(showHelp(command, error2, config.renderErrors !== false), fail6(error2))), catchFilter2((error2) => config.renderErrors !== false && isCliError(error2) && error2._tag === "UserError" ? succeed2(error2) : fail2(error2), (error2) => andThen3(showUserError(error2), fail6(error2))), catchFilter2((e) => isQuitError(e) ? succeed2(e) : fail2(e), (_) => interrupt3));
|
|
33556
33459
|
};
|
|
33557
33460
|
|
|
33558
33461
|
// ../../node_modules/.bun/effect@4.0.0-rc.112/node_modules/effect/dist/unstable/cli/Argument.js
|
|
@@ -35853,14 +35756,14 @@ var makeChannel = (headers) => fromTransform((upstream) => map8(makeConfig(heade
|
|
|
35853
35756
|
for (let i = 0;i < chunk.length; i++) {
|
|
35854
35757
|
parser.write(chunk[i]);
|
|
35855
35758
|
}
|
|
35856
|
-
return
|
|
35759
|
+
return void_4;
|
|
35857
35760
|
}), catchCause3((cause) => {
|
|
35858
35761
|
if (isDoneCause(cause)) {
|
|
35859
35762
|
parser.end();
|
|
35860
35763
|
} else {
|
|
35861
35764
|
exit3 = some3(failCause2(cause));
|
|
35862
35765
|
}
|
|
35863
|
-
return
|
|
35766
|
+
return void_4;
|
|
35864
35767
|
}));
|
|
35865
35768
|
return pump.pipe(flatMap5(function loop() {
|
|
35866
35769
|
if (!isReadonlyArrayNonEmpty(partsBuffer)) {
|
|
@@ -35954,7 +35857,7 @@ class FileImpl extends PartBase {
|
|
|
35954
35857
|
}
|
|
35955
35858
|
}
|
|
35956
35859
|
var defaultWriteFile = (path3, file4) => flatMap5(FileSystem, (fs) => mapError3(run(file4.content, fs.sink(path3)), (cause) => MultipartError.fromReason("InternalError", cause)));
|
|
35957
|
-
var toPersisted = (stream2, writeFile3 = defaultWriteFile) =>
|
|
35860
|
+
var toPersisted = (stream2, writeFile3 = defaultWriteFile) => gen3(function* () {
|
|
35958
35861
|
const fs = yield* FileSystem;
|
|
35959
35862
|
const path_ = yield* Path;
|
|
35960
35863
|
const dir = yield* fs.makeTempDirectoryScoped();
|
|
@@ -35970,9 +35873,9 @@ var toPersisted = (stream2, writeFile3 = defaultWriteFile) => gen4(function* ()
|
|
|
35970
35873
|
} else {
|
|
35971
35874
|
persisted[part.key].push(part.value);
|
|
35972
35875
|
}
|
|
35973
|
-
return
|
|
35876
|
+
return void_4;
|
|
35974
35877
|
} else if (part.name === "") {
|
|
35975
|
-
return
|
|
35878
|
+
return void_4;
|
|
35976
35879
|
}
|
|
35977
35880
|
const file4 = part;
|
|
35978
35881
|
const fileName = path_.basename(file4.name).slice(-128);
|
|
@@ -36705,7 +36608,7 @@ var middleware = function() {
|
|
|
36705
36608
|
}
|
|
36706
36609
|
return makeMiddleware(arguments[0], arguments[1]);
|
|
36707
36610
|
};
|
|
36708
|
-
var makeMiddleware = (middleware2, options) => options?.global ? effectDiscard(
|
|
36611
|
+
var makeMiddleware = (middleware2, options) => options?.global ? effectDiscard(gen3(function* () {
|
|
36709
36612
|
const router = yield* HttpRouter;
|
|
36710
36613
|
const fn3 = isEffect2(middleware2) ? yield* middleware2 : middleware2;
|
|
36711
36614
|
yield* router.addGlobalMiddleware(fn3);
|
|
@@ -36721,7 +36624,7 @@ class MiddlewareImpl {
|
|
|
36721
36624
|
this.layerFn = layerFn;
|
|
36722
36625
|
this.dependencies = dependencies;
|
|
36723
36626
|
const contextKey = `effect/http/HttpRouter/Middleware-${++middlewareId}`;
|
|
36724
|
-
this.layer = effectContext(
|
|
36627
|
+
this.layer = effectContext(gen3({
|
|
36725
36628
|
self: this
|
|
36726
36629
|
}, function* () {
|
|
36727
36630
|
const context3 = yield* context2();
|
|
@@ -37637,7 +37540,7 @@ var decode3 = (options2) => fromTransform((upstream, _scope) => sync3(() => {
|
|
|
37637
37540
|
return fail6(error2);
|
|
37638
37541
|
}
|
|
37639
37542
|
}
|
|
37640
|
-
return
|
|
37543
|
+
return void_4;
|
|
37641
37544
|
});
|
|
37642
37545
|
return suspend3(function loop() {
|
|
37643
37546
|
if (isArrayNonEmpty2(buffer3)) {
|
|
@@ -37796,7 +37699,7 @@ class Retry extends (/* @__PURE__ */ TaggedClass("Retry")) {
|
|
|
37796
37699
|
}
|
|
37797
37700
|
|
|
37798
37701
|
// ../../node_modules/.bun/effect@4.0.0-rc.112/node_modules/effect/dist/unstable/httpapi/HttpApiClient.js
|
|
37799
|
-
var makeClient = (api, options2) =>
|
|
37702
|
+
var makeClient = (api, options2) => gen3(function* () {
|
|
37800
37703
|
const services = yield* context2();
|
|
37801
37704
|
const httpClient = options2.httpClient.pipe(options2?.baseUrl === undefined ? identity : mapRequest(prependUrl(options2.baseUrl.toString())));
|
|
37802
37705
|
function executeMiddleware(group, endpoint, request3, middlewareKeys, index2) {
|
|
@@ -38611,7 +38514,7 @@ function getError(error2) {
|
|
|
38611
38514
|
return new Set(Array.isArray(error2) ? error2 : [error2]);
|
|
38612
38515
|
}
|
|
38613
38516
|
var layerSchemaErrorTransform = (service4, transform5) => succeed5(service4, (httpEffect, options2) => catch_3(httpEffect, (e) => HttpApiSchemaError.is(e) ? transform5(e, options2) : fail6(e)));
|
|
38614
|
-
var layerClient = (tag2, service4) => effectContext(
|
|
38517
|
+
var layerClient = (tag2, service4) => effectContext(gen3(function* () {
|
|
38615
38518
|
const services = (yield* context2()).pipe(omit(Scope));
|
|
38616
38519
|
const middleware2 = isEffect2(service4) ? yield* service4 : service4;
|
|
38617
38520
|
return makeUnsafe(new Map([[`${tag2.key}/Client`, (options2) => updateContext2(middleware2(options2), (requestContext) => merge(services, requestContext))]]));
|
|
@@ -39344,7 +39247,7 @@ var fetch2 = /* @__PURE__ */ make52((request3, url, signal, fiber3) => {
|
|
|
39344
39247
|
});
|
|
39345
39248
|
var layer15 = /* @__PURE__ */ layerMergedContext(/* @__PURE__ */ succeed6(fetch2));
|
|
39346
39249
|
|
|
39347
|
-
// ../sdk/dist/client-
|
|
39250
|
+
// ../sdk/dist/client-oU7xZvu1.js
|
|
39348
39251
|
var Sensitive = (schema) => exports_Schema.RedactedFromValue(schema);
|
|
39349
39252
|
var SensitiveString = Sensitive(exports_Schema.String);
|
|
39350
39253
|
var ABSOLUTE_ISO_INSTANT_PATTERN = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(Z|([+-])(\d{2}):(\d{2}))$/;
|
|
@@ -39704,6 +39607,7 @@ var ScheduledMessageId = String5.pipe(brand2("ScheduledMessageId")).check(isPatt
|
|
|
39704
39607
|
expected: "a string matching the RegExp ^sched_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
39705
39608
|
identifier: "ScheduledMessageId"
|
|
39706
39609
|
}));
|
|
39610
|
+
var IanaTimezone = String5.annotate({ identifier: "IanaTimezone" });
|
|
39707
39611
|
var OperationResource = Struct2({
|
|
39708
39612
|
type: String5.check(isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(isMaxLength(80).annotate({ expected: "a value with a length of at most 80" })),
|
|
39709
39613
|
id: String5.check(isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(isMaxLength(255).annotate({ expected: "a value with a length of at most 255" }))
|
|
@@ -39724,6 +39628,13 @@ var UserId = String5.pipe(brand2("UserId")).check(isPattern2(/* @__PURE__ */ new
|
|
|
39724
39628
|
expected: "a string matching the RegExp ^user_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
39725
39629
|
identifier: "UserId"
|
|
39726
39630
|
}));
|
|
39631
|
+
var WebhookDeliveryCounts = Struct2({
|
|
39632
|
+
total: Finite.check(isInt().annotate({ expected: "an integer" })).check(isGreaterThanOrEqualTo4(0).annotate({ expected: "a value greater than or equal to 0" })),
|
|
39633
|
+
pending: Finite.check(isInt().annotate({ expected: "an integer" })).check(isGreaterThanOrEqualTo4(0).annotate({ expected: "a value greater than or equal to 0" })),
|
|
39634
|
+
delivered: Finite.check(isInt().annotate({ expected: "an integer" })).check(isGreaterThanOrEqualTo4(0).annotate({ expected: "a value greater than or equal to 0" })),
|
|
39635
|
+
exhausted: Finite.check(isInt().annotate({ expected: "an integer" })).check(isGreaterThanOrEqualTo4(0).annotate({ expected: "a value greater than or equal to 0" })),
|
|
39636
|
+
cancelled: Finite.check(isInt().annotate({ expected: "an integer" })).check(isGreaterThanOrEqualTo4(0).annotate({ expected: "a value greater than or equal to 0" }))
|
|
39637
|
+
}).annotate({ identifier: "WebhookDeliveryCounts" });
|
|
39727
39638
|
var WebhookEventId = String5.pipe(brand2("WebhookEventId")).check(isPattern2(/* @__PURE__ */ new RegExp("^whevt_[0-9a-hjkmnp-tv-z]{16,24}$")).annotate({
|
|
39728
39639
|
expected: "a string matching the RegExp ^whevt_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
39729
39640
|
identifier: "WebhookEventId"
|
|
@@ -39736,6 +39647,13 @@ var WebhookAttemptId = String5.pipe(brand2("WebhookAttemptId")).check(isPattern2
|
|
|
39736
39647
|
expected: "a string matching the RegExp ^whatt_[0-9a-hjkmnp-tv-z]{16,24}$",
|
|
39737
39648
|
identifier: "WebhookAttemptId"
|
|
39738
39649
|
}));
|
|
39650
|
+
var WebhookDailyDeliveries = Struct2({
|
|
39651
|
+
date: String5,
|
|
39652
|
+
pending: Finite.check(isInt().annotate({ expected: "an integer" })).check(isGreaterThanOrEqualTo4(0).annotate({ expected: "a value greater than or equal to 0" })),
|
|
39653
|
+
delivered: Finite.check(isInt().annotate({ expected: "an integer" })).check(isGreaterThanOrEqualTo4(0).annotate({ expected: "a value greater than or equal to 0" })),
|
|
39654
|
+
exhausted: Finite.check(isInt().annotate({ expected: "an integer" })).check(isGreaterThanOrEqualTo4(0).annotate({ expected: "a value greater than or equal to 0" })),
|
|
39655
|
+
cancelled: Finite.check(isInt().annotate({ expected: "an integer" })).check(isGreaterThanOrEqualTo4(0).annotate({ expected: "a value greater than or equal to 0" }))
|
|
39656
|
+
}).annotate({ identifier: "WebhookDailyDeliveries" });
|
|
39739
39657
|
Struct2({
|
|
39740
39658
|
filename: String5.check(isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(isMaxLength(255).annotate({ expected: "a value with a length of at most 255" })),
|
|
39741
39659
|
contentType: String5.check(isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(isMaxLength(127).annotate({ expected: "a value with a length of at most 127" })),
|
|
@@ -40118,6 +40036,19 @@ var Message = Struct2({
|
|
|
40118
40036
|
contact: Union2([MessageContact, Null2])
|
|
40119
40037
|
})),
|
|
40120
40038
|
deliveries: ArraySchema(Struct2({
|
|
40039
|
+
scheduling: Union2([Struct2({
|
|
40040
|
+
dueAt: String5,
|
|
40041
|
+
expiresAt: String5,
|
|
40042
|
+
waitReason: Union2([Literals([
|
|
40043
|
+
"rate",
|
|
40044
|
+
"daily-quota",
|
|
40045
|
+
"domain-health",
|
|
40046
|
+
"tenant-health",
|
|
40047
|
+
"provider-unavailable",
|
|
40048
|
+
"retry",
|
|
40049
|
+
"campaign-paused"
|
|
40050
|
+
]), Null2])
|
|
40051
|
+
}), Null2]),
|
|
40121
40052
|
id: String5,
|
|
40122
40053
|
messageId: String5,
|
|
40123
40054
|
recipientId: Union2([String5, Null2]),
|
|
@@ -40247,6 +40178,28 @@ var Design = Struct2({
|
|
|
40247
40178
|
customHtml: optionalKey2(Union2([String5, Null2]))
|
|
40248
40179
|
}), Null2]))
|
|
40249
40180
|
}).annotate({ identifier: "Design" });
|
|
40181
|
+
var EmailDkimRotation = Struct2({
|
|
40182
|
+
id: String5,
|
|
40183
|
+
domainId: EmailDomainId,
|
|
40184
|
+
phase: Literals([
|
|
40185
|
+
"staged",
|
|
40186
|
+
"cutover",
|
|
40187
|
+
"complete"
|
|
40188
|
+
]),
|
|
40189
|
+
selector: String5,
|
|
40190
|
+
record: Struct2({
|
|
40191
|
+
name: String5,
|
|
40192
|
+
type: Literal2("TXT"),
|
|
40193
|
+
value: String5,
|
|
40194
|
+
ttl: String5
|
|
40195
|
+
}),
|
|
40196
|
+
formerRecord: Struct2({
|
|
40197
|
+
name: String5,
|
|
40198
|
+
type: Literal2("TXT"),
|
|
40199
|
+
value: String5
|
|
40200
|
+
}),
|
|
40201
|
+
minimumRetainUntil: Union2([String5, Null2]).annotate({ description: "Earliest minimum retention horizon only. The former public key remains published indefinitely until a separately approved retirement verifies at least two actual former-record TTLs have elapsed." })
|
|
40202
|
+
}).annotate({ identifier: "EmailDkimRotation" });
|
|
40250
40203
|
var WebhookEndpoint = Struct2({
|
|
40251
40204
|
id: WebhookEndpointId,
|
|
40252
40205
|
name: String5,
|
|
@@ -40348,79 +40301,6 @@ var CustomTrackingStatus = Struct2({
|
|
|
40348
40301
|
teardownScheduledAt: Union2([String5, Null2])
|
|
40349
40302
|
}), Null2])
|
|
40350
40303
|
}).annotate({ identifier: "CustomTrackingStatus" });
|
|
40351
|
-
var EmailDomainVerification = Struct2({
|
|
40352
|
-
domainId: EmailDomainId,
|
|
40353
|
-
domain: String5,
|
|
40354
|
-
phase: Literals([
|
|
40355
|
-
"dns-setup",
|
|
40356
|
-
"provider-setup",
|
|
40357
|
-
"provider-verification",
|
|
40358
|
-
"ready",
|
|
40359
|
-
"degraded",
|
|
40360
|
-
"failed"
|
|
40361
|
-
]),
|
|
40362
|
-
records: ArraySchema(Struct2({
|
|
40363
|
-
record: Struct2({
|
|
40364
|
-
type: Literals([
|
|
40365
|
-
"A",
|
|
40366
|
-
"AAAA",
|
|
40367
|
-
"CNAME",
|
|
40368
|
-
"MX",
|
|
40369
|
-
"NS",
|
|
40370
|
-
"SOA",
|
|
40371
|
-
"PTR",
|
|
40372
|
-
"SRV",
|
|
40373
|
-
"TXT",
|
|
40374
|
-
"CAA"
|
|
40375
|
-
]),
|
|
40376
|
-
name: String5,
|
|
40377
|
-
value: String5,
|
|
40378
|
-
ttl: optionalKey2(Union2([String5, Null2])),
|
|
40379
|
-
description: optionalKey2(Union2([String5, Null2])),
|
|
40380
|
-
priority: optionalKey2(Union2([Finite.check(isInt().annotate({ expected: "an integer" })).check(isGreaterThanOrEqualTo4(0).annotate({ expected: "a value greater than or equal to 0" })), Null2]))
|
|
40381
|
-
}),
|
|
40382
|
-
status: Literals([
|
|
40383
|
-
"unchecked",
|
|
40384
|
-
"missing",
|
|
40385
|
-
"mismatch",
|
|
40386
|
-
"found"
|
|
40387
|
-
]),
|
|
40388
|
-
observedValues: ArraySchema(String5),
|
|
40389
|
-
checkedAt: optionalKey2(Union2([String5, Null2])),
|
|
40390
|
-
resolutionFailure: optionalKey2(Union2([Struct2({
|
|
40391
|
-
code: optionalKey2(Union2([String5, Null2])),
|
|
40392
|
-
message: String5
|
|
40393
|
-
}), Null2]))
|
|
40394
|
-
})),
|
|
40395
|
-
provider: Union2([Struct2({
|
|
40396
|
-
identity: Literals([
|
|
40397
|
-
"pending",
|
|
40398
|
-
"verified",
|
|
40399
|
-
"failed",
|
|
40400
|
-
"unknown"
|
|
40401
|
-
]),
|
|
40402
|
-
dkim: optionalKey2(Union2([Literals([
|
|
40403
|
-
"pending",
|
|
40404
|
-
"verified",
|
|
40405
|
-
"failed",
|
|
40406
|
-
"unknown"
|
|
40407
|
-
]), Null2])),
|
|
40408
|
-
mailFrom: optionalKey2(Union2([Literals([
|
|
40409
|
-
"pending",
|
|
40410
|
-
"verified",
|
|
40411
|
-
"failed",
|
|
40412
|
-
"unknown"
|
|
40413
|
-
]), Null2]))
|
|
40414
|
-
}), Null2]),
|
|
40415
|
-
operationId: Union2([OperationId, Null2]),
|
|
40416
|
-
checkedAt: Union2([String5, Null2]),
|
|
40417
|
-
nextCheckAt: Union2([String5, Null2]),
|
|
40418
|
-
failure: Union2([Struct2({
|
|
40419
|
-
code: String5,
|
|
40420
|
-
message: String5,
|
|
40421
|
-
failedAt: String5
|
|
40422
|
-
}), Null2])
|
|
40423
|
-
}).annotate({ identifier: "EmailDomainVerification" });
|
|
40424
40304
|
var SuppressionEntry = Struct2({
|
|
40425
40305
|
id: SuppressionId,
|
|
40426
40306
|
email: String5,
|
|
@@ -40586,6 +40466,54 @@ var TemplateCompliance = Struct2({
|
|
|
40586
40466
|
notes: optionalKey2(Union2([String5, Null2]))
|
|
40587
40467
|
})), Null2]))
|
|
40588
40468
|
}).annotate({ identifier: "TemplateCompliance" });
|
|
40469
|
+
var WebhookEndpointListItem = Struct2({
|
|
40470
|
+
id: WebhookEndpointId,
|
|
40471
|
+
name: String5,
|
|
40472
|
+
url: String5,
|
|
40473
|
+
eventTypes: ArraySchema(Literals([
|
|
40474
|
+
"message.sent",
|
|
40475
|
+
"message.delivered",
|
|
40476
|
+
"message.read",
|
|
40477
|
+
"message.failed",
|
|
40478
|
+
"message.bounced",
|
|
40479
|
+
"message.complained",
|
|
40480
|
+
"message.received",
|
|
40481
|
+
"contact.created",
|
|
40482
|
+
"contact.updated",
|
|
40483
|
+
"contact.deleted",
|
|
40484
|
+
"conversation.started",
|
|
40485
|
+
"conversation.ended",
|
|
40486
|
+
"conversation.created",
|
|
40487
|
+
"conversation.updated",
|
|
40488
|
+
"conversation.archived",
|
|
40489
|
+
"template.created",
|
|
40490
|
+
"template.updated",
|
|
40491
|
+
"template.deleted",
|
|
40492
|
+
"template.approved",
|
|
40493
|
+
"template.rejected",
|
|
40494
|
+
"webhook.created",
|
|
40495
|
+
"webhook.updated",
|
|
40496
|
+
"webhook.deleted",
|
|
40497
|
+
"webhook.test",
|
|
40498
|
+
"domain.updated"
|
|
40499
|
+
])),
|
|
40500
|
+
channels: Union2([ArraySchema(Literal2("email")), Null2]),
|
|
40501
|
+
status: Literals(["active", "disabled"]),
|
|
40502
|
+
hasCustomHeaders: Boolean4,
|
|
40503
|
+
failureStartedAt: Union2([String5, Null2]),
|
|
40504
|
+
lastSucceededAt: Union2([String5, Null2]),
|
|
40505
|
+
createdAt: String5,
|
|
40506
|
+
updatedAt: String5,
|
|
40507
|
+
deliveries: WebhookDeliveryCounts
|
|
40508
|
+
}).annotate({ identifier: "WebhookEndpointListItem" });
|
|
40509
|
+
var WebhookStatsResponse = Struct2({
|
|
40510
|
+
total: Finite.check(isInt().annotate({ expected: "an integer" })).check(isGreaterThanOrEqualTo4(0).annotate({ expected: "a value greater than or equal to 0" })),
|
|
40511
|
+
pending: Finite.check(isInt().annotate({ expected: "an integer" })).check(isGreaterThanOrEqualTo4(0).annotate({ expected: "a value greater than or equal to 0" })),
|
|
40512
|
+
delivered: Finite.check(isInt().annotate({ expected: "an integer" })).check(isGreaterThanOrEqualTo4(0).annotate({ expected: "a value greater than or equal to 0" })),
|
|
40513
|
+
exhausted: Finite.check(isInt().annotate({ expected: "an integer" })).check(isGreaterThanOrEqualTo4(0).annotate({ expected: "a value greater than or equal to 0" })),
|
|
40514
|
+
cancelled: Finite.check(isInt().annotate({ expected: "an integer" })).check(isGreaterThanOrEqualTo4(0).annotate({ expected: "a value greater than or equal to 0" })),
|
|
40515
|
+
daily: ArraySchema(WebhookDailyDeliveries)
|
|
40516
|
+
}).annotate({ identifier: "WebhookStatsResponse" });
|
|
40589
40517
|
var EmailAttachments = Union2([ArraySchema(EmailAttachment).check(isMaxLength(10).annotate({ expected: "a value with a length of at most 10" })), Null2]).annotate({ identifier: "EmailAttachments" });
|
|
40590
40518
|
var EmailRecipients = ArraySchema(EmailRecipient).check(isMinLength(1).annotate({
|
|
40591
40519
|
expected: "a value with a length of at least 1",
|
|
@@ -40808,6 +40736,174 @@ var Organization = Struct2({
|
|
|
40808
40736
|
teamMembersUsed: Finite.check(isFinite3().annotate({ expected: "a finite number" })),
|
|
40809
40737
|
messagesResetAt: Union2([String5, Null2])
|
|
40810
40738
|
}).annotate({ identifier: "Organization" });
|
|
40739
|
+
var EmailDomainVerification = Struct2({
|
|
40740
|
+
domainId: EmailDomainId,
|
|
40741
|
+
domain: String5,
|
|
40742
|
+
phase: Literals([
|
|
40743
|
+
"dns-setup",
|
|
40744
|
+
"provider-setup",
|
|
40745
|
+
"provider-verification",
|
|
40746
|
+
"ready",
|
|
40747
|
+
"degraded",
|
|
40748
|
+
"failed"
|
|
40749
|
+
]),
|
|
40750
|
+
records: ArraySchema(Struct2({
|
|
40751
|
+
record: Struct2({
|
|
40752
|
+
type: Literals([
|
|
40753
|
+
"A",
|
|
40754
|
+
"AAAA",
|
|
40755
|
+
"CNAME",
|
|
40756
|
+
"MX",
|
|
40757
|
+
"NS",
|
|
40758
|
+
"SOA",
|
|
40759
|
+
"PTR",
|
|
40760
|
+
"SRV",
|
|
40761
|
+
"TXT",
|
|
40762
|
+
"CAA"
|
|
40763
|
+
]),
|
|
40764
|
+
name: String5,
|
|
40765
|
+
value: String5,
|
|
40766
|
+
ttl: optionalKey2(Union2([String5, Null2])),
|
|
40767
|
+
description: optionalKey2(Union2([String5, Null2])),
|
|
40768
|
+
priority: optionalKey2(Union2([Finite.check(isInt().annotate({ expected: "an integer" })).check(isGreaterThanOrEqualTo4(0).annotate({ expected: "a value greater than or equal to 0" })), Null2]))
|
|
40769
|
+
}),
|
|
40770
|
+
status: Literals([
|
|
40771
|
+
"unchecked",
|
|
40772
|
+
"missing",
|
|
40773
|
+
"mismatch",
|
|
40774
|
+
"found"
|
|
40775
|
+
]),
|
|
40776
|
+
observedValues: ArraySchema(String5),
|
|
40777
|
+
checkedAt: optionalKey2(Union2([String5, Null2])),
|
|
40778
|
+
resolutionFailure: optionalKey2(Union2([Struct2({
|
|
40779
|
+
code: optionalKey2(Union2([String5, Null2])),
|
|
40780
|
+
message: String5
|
|
40781
|
+
}), Null2]))
|
|
40782
|
+
})),
|
|
40783
|
+
provider: Union2([Struct2({
|
|
40784
|
+
identity: Literals([
|
|
40785
|
+
"pending",
|
|
40786
|
+
"verified",
|
|
40787
|
+
"failed",
|
|
40788
|
+
"unknown"
|
|
40789
|
+
]),
|
|
40790
|
+
dkim: optionalKey2(Union2([Literals([
|
|
40791
|
+
"pending",
|
|
40792
|
+
"verified",
|
|
40793
|
+
"failed",
|
|
40794
|
+
"unknown"
|
|
40795
|
+
]), Null2])),
|
|
40796
|
+
mailFrom: optionalKey2(Union2([Literals([
|
|
40797
|
+
"pending",
|
|
40798
|
+
"verified",
|
|
40799
|
+
"failed",
|
|
40800
|
+
"unknown"
|
|
40801
|
+
]), Null2]))
|
|
40802
|
+
}), Null2]),
|
|
40803
|
+
operationId: Union2([OperationId, Null2]),
|
|
40804
|
+
checkedAt: Union2([String5, Null2]),
|
|
40805
|
+
nextCheckAt: Union2([String5, Null2]),
|
|
40806
|
+
failure: Union2([Struct2({
|
|
40807
|
+
code: String5,
|
|
40808
|
+
message: String5,
|
|
40809
|
+
failedAt: String5
|
|
40810
|
+
}), Null2]),
|
|
40811
|
+
health: Struct2({
|
|
40812
|
+
actionOwner: Literals([
|
|
40813
|
+
"customer",
|
|
40814
|
+
"samva",
|
|
40815
|
+
"provider",
|
|
40816
|
+
"none"
|
|
40817
|
+
]),
|
|
40818
|
+
action: String5,
|
|
40819
|
+
freshness: Literals([
|
|
40820
|
+
"current",
|
|
40821
|
+
"stale",
|
|
40822
|
+
"unknown"
|
|
40823
|
+
]),
|
|
40824
|
+
observedAt: Union2([String5, Null2]),
|
|
40825
|
+
staleAt: Union2([String5, Null2]),
|
|
40826
|
+
nextRetryAt: Union2([String5, Null2]),
|
|
40827
|
+
reason: Literals([
|
|
40828
|
+
"ready",
|
|
40829
|
+
"dns-action-required",
|
|
40830
|
+
"dns-unavailable",
|
|
40831
|
+
"provider-pending",
|
|
40832
|
+
"provider-failed",
|
|
40833
|
+
"samva-repair",
|
|
40834
|
+
"signing-custody-action-required",
|
|
40835
|
+
"provider-ownership-action-required",
|
|
40836
|
+
"inactive",
|
|
40837
|
+
"observation-stale",
|
|
40838
|
+
"observation-unknown"
|
|
40839
|
+
])
|
|
40840
|
+
}),
|
|
40841
|
+
sending: Struct2({
|
|
40842
|
+
actionOwner: Literals([
|
|
40843
|
+
"customer",
|
|
40844
|
+
"samva",
|
|
40845
|
+
"provider",
|
|
40846
|
+
"none"
|
|
40847
|
+
]),
|
|
40848
|
+
action: String5,
|
|
40849
|
+
freshness: Literals([
|
|
40850
|
+
"current",
|
|
40851
|
+
"stale",
|
|
40852
|
+
"unknown"
|
|
40853
|
+
]),
|
|
40854
|
+
observedAt: Union2([String5, Null2]),
|
|
40855
|
+
staleAt: Union2([String5, Null2]),
|
|
40856
|
+
nextRetryAt: Union2([String5, Null2]),
|
|
40857
|
+
status: Literals([
|
|
40858
|
+
"ready",
|
|
40859
|
+
"blocked",
|
|
40860
|
+
"unknown"
|
|
40861
|
+
]),
|
|
40862
|
+
reason: Literals([
|
|
40863
|
+
"domain-not-ready",
|
|
40864
|
+
"domain-observation-stale",
|
|
40865
|
+
"operator-paused",
|
|
40866
|
+
"provider-paused",
|
|
40867
|
+
"tenant-health-stale",
|
|
40868
|
+
"tenant-health-unknown",
|
|
40869
|
+
"ready"
|
|
40870
|
+
])
|
|
40871
|
+
}).annotate({ description: "Stored domain, tenant and workspace health. Ready does not guarantee send acceptance or report configuration-set/account pauses." }),
|
|
40872
|
+
dmarc: Struct2({
|
|
40873
|
+
status: Literals([
|
|
40874
|
+
"valid",
|
|
40875
|
+
"missing",
|
|
40876
|
+
"invalid",
|
|
40877
|
+
"multiple",
|
|
40878
|
+
"unknown"
|
|
40879
|
+
]),
|
|
40880
|
+
source: Literals([
|
|
40881
|
+
"direct",
|
|
40882
|
+
"organizational",
|
|
40883
|
+
"none"
|
|
40884
|
+
]),
|
|
40885
|
+
policyDomain: Union2([String5, Null2]),
|
|
40886
|
+
policy: Union2([Literals([
|
|
40887
|
+
"none",
|
|
40888
|
+
"quarantine",
|
|
40889
|
+
"reject"
|
|
40890
|
+
]), Null2]),
|
|
40891
|
+
subdomainPolicy: Union2([Literals([
|
|
40892
|
+
"none",
|
|
40893
|
+
"quarantine",
|
|
40894
|
+
"reject"
|
|
40895
|
+
]), Null2]),
|
|
40896
|
+
effectivePolicy: Union2([Literals([
|
|
40897
|
+
"none",
|
|
40898
|
+
"quarantine",
|
|
40899
|
+
"reject"
|
|
40900
|
+
]), Null2]),
|
|
40901
|
+
observedAt: Union2([String5, Null2]),
|
|
40902
|
+
staleAt: Union2([String5, Null2]),
|
|
40903
|
+
guidance: String5
|
|
40904
|
+
}),
|
|
40905
|
+
rotation: Union2([EmailDkimRotation, Null2])
|
|
40906
|
+
}).annotate({ identifier: "EmailDomainVerification" });
|
|
40811
40907
|
var OperationAccepted = Struct2({
|
|
40812
40908
|
operation: Operation,
|
|
40813
40909
|
links: Struct2({
|
|
@@ -42031,6 +42127,15 @@ var EmailClearDomainDefaultSender401 = UnauthorizedError;
|
|
|
42031
42127
|
var EmailClearDomainDefaultSender403 = ForbiddenError;
|
|
42032
42128
|
var EmailClearDomainDefaultSender404 = ResourceNotFoundError;
|
|
42033
42129
|
var EmailClearDomainDefaultSender500 = InternalError2;
|
|
42130
|
+
var EmailRotateDomainDkimPathParams = Struct2({ id: EmailDomainId });
|
|
42131
|
+
var EmailRotateDomainDkimHeaders = Struct2({ "idempotency-key": String5.check(isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(isMaxLength(255).annotate({ expected: "a value with a length of at most 255" })) });
|
|
42132
|
+
var EmailRotateDomainDkim200 = EmailDkimRotation;
|
|
42133
|
+
var EmailRotateDomainDkim401 = UnauthorizedError;
|
|
42134
|
+
var EmailRotateDomainDkim403 = ForbiddenError;
|
|
42135
|
+
var EmailRotateDomainDkim404 = ResourceNotFoundError;
|
|
42136
|
+
var EmailRotateDomainDkim409 = ConflictError;
|
|
42137
|
+
var EmailRotateDomainDkim500 = InternalError2;
|
|
42138
|
+
var EmailRotateDomainDkim502 = EmailChannelError;
|
|
42034
42139
|
var EmailGetDomainConnectPathParams = Struct2({ id: EmailDomainId });
|
|
42035
42140
|
var EmailGetDomainConnectQuery = Struct2({ mode: Literals(["send-only", "send-and-receive"]) });
|
|
42036
42141
|
var EmailGetDomainConnect200 = DomainConnectEligibility;
|
|
@@ -42502,6 +42607,57 @@ var MessagesGetEmailQuery = Struct2({
|
|
|
42502
42607
|
urlExpiresIn: optionalKey2(Union2([String5, Null2]))
|
|
42503
42608
|
});
|
|
42504
42609
|
var MessagesGetEmail200 = Struct2({
|
|
42610
|
+
deliveries: ArraySchema(Struct2({
|
|
42611
|
+
scheduling: Union2([Struct2({
|
|
42612
|
+
dueAt: String5,
|
|
42613
|
+
expiresAt: String5,
|
|
42614
|
+
waitReason: Union2([Literals([
|
|
42615
|
+
"rate",
|
|
42616
|
+
"daily-quota",
|
|
42617
|
+
"domain-health",
|
|
42618
|
+
"tenant-health",
|
|
42619
|
+
"provider-unavailable",
|
|
42620
|
+
"retry",
|
|
42621
|
+
"campaign-paused"
|
|
42622
|
+
]), Null2])
|
|
42623
|
+
}), Null2]),
|
|
42624
|
+
id: String5,
|
|
42625
|
+
messageId: String5,
|
|
42626
|
+
recipientId: Union2([String5, Null2]),
|
|
42627
|
+
channel: Literal2("email"),
|
|
42628
|
+
status: Literals([
|
|
42629
|
+
"pending",
|
|
42630
|
+
"scheduled",
|
|
42631
|
+
"queued",
|
|
42632
|
+
"processing",
|
|
42633
|
+
"sent",
|
|
42634
|
+
"delivered",
|
|
42635
|
+
"read",
|
|
42636
|
+
"failed",
|
|
42637
|
+
"bounced",
|
|
42638
|
+
"complained"
|
|
42639
|
+
]),
|
|
42640
|
+
attemptCount: Finite.check(isFinite3().annotate({ expected: "a finite number" })),
|
|
42641
|
+
maxAttempts: Finite.check(isFinite3().annotate({ expected: "a finite number" })),
|
|
42642
|
+
queuedAt: Union2([String5, Null2]),
|
|
42643
|
+
claimedAt: Union2([String5, Null2]),
|
|
42644
|
+
lastAttemptAt: Union2([String5, Null2]),
|
|
42645
|
+
nextRetryAt: Union2([String5, Null2]),
|
|
42646
|
+
sentAt: Union2([String5, Null2]),
|
|
42647
|
+
deliveredAt: Union2([String5, Null2]),
|
|
42648
|
+
readAt: Union2([String5, Null2]),
|
|
42649
|
+
failedAt: Union2([String5, Null2]),
|
|
42650
|
+
terminalAt: Union2([String5, Null2]),
|
|
42651
|
+
errorCode: Union2([String5, Null2]),
|
|
42652
|
+
errorMessage: Union2([String5, Null2]),
|
|
42653
|
+
errorDetails: Union2([JsonValue, Null2]),
|
|
42654
|
+
cost: String5,
|
|
42655
|
+
currency: String5,
|
|
42656
|
+
idempotencyKey: Union2([String5, Null2]),
|
|
42657
|
+
metadata: Union2([JsonValue, Null2]),
|
|
42658
|
+
createdAt: String5,
|
|
42659
|
+
updatedAt: String5
|
|
42660
|
+
})),
|
|
42505
42661
|
id: MessageId,
|
|
42506
42662
|
organizationId: String5,
|
|
42507
42663
|
conversationId: Union2([ConversationId, Null2]),
|
|
@@ -42658,7 +42814,7 @@ var ScheduledMessagesList500 = InternalError2;
|
|
|
42658
42814
|
var ScheduledMessagesCreateRequestJson = Struct2({
|
|
42659
42815
|
send: DispatchSendMessagePayload,
|
|
42660
42816
|
scheduledFor: AbsoluteInstant,
|
|
42661
|
-
timezone: optionalKey2(Union2([
|
|
42817
|
+
timezone: optionalKey2(Union2([IanaTimezone, Null2])),
|
|
42662
42818
|
idempotencyKey: optionalKey2(Union2([String5, Null2])),
|
|
42663
42819
|
referenceId: optionalKey2(Union2([String5, Null2]))
|
|
42664
42820
|
});
|
|
@@ -42746,7 +42902,7 @@ var OrganizationsUpdateRequestJson = Struct2({
|
|
|
42746
42902
|
billingEmail: optionalKey2(Union2([String5, Null2])),
|
|
42747
42903
|
countryCode: optionalKey2(Union2([String5, Null2])),
|
|
42748
42904
|
currency: optionalKey2(Union2([String5, Null2])),
|
|
42749
|
-
timezone: optionalKey2(Union2([
|
|
42905
|
+
timezone: optionalKey2(Union2([IanaTimezone, Null2])),
|
|
42750
42906
|
isActive: optionalKey2(Union2([Boolean4, Null2])),
|
|
42751
42907
|
metadata: optionalKey2(Union2([Record(String5, JsonValue), Null2])),
|
|
42752
42908
|
design: optionalKey2(Union2([Union2([Design, Null2]), Null2])),
|
|
@@ -44429,7 +44585,7 @@ var WebhooksListQuery = Struct2({
|
|
|
44429
44585
|
search: optionalKey2(Union2([String5, Null2]))
|
|
44430
44586
|
});
|
|
44431
44587
|
var WebhooksList200 = Struct2({
|
|
44432
|
-
items: ArraySchema(
|
|
44588
|
+
items: ArraySchema(WebhookEndpointListItem),
|
|
44433
44589
|
pagination: PaginationMeta
|
|
44434
44590
|
});
|
|
44435
44591
|
var WebhooksList401 = UnauthorizedError;
|
|
@@ -44567,6 +44723,8 @@ var WebhooksGetLogs200 = Struct2({
|
|
|
44567
44723
|
data: ArraySchema(Struct2({
|
|
44568
44724
|
id: WebhookDeliveryId,
|
|
44569
44725
|
eventId: WebhookEventId,
|
|
44726
|
+
eventType: String5,
|
|
44727
|
+
occurredAt: String5,
|
|
44570
44728
|
endpointId: WebhookEndpointId,
|
|
44571
44729
|
status: Literals([
|
|
44572
44730
|
"pending",
|
|
@@ -44614,13 +44772,12 @@ var WebhooksRegenerateSecret404 = ResourceNotFoundError;
|
|
|
44614
44772
|
var WebhooksRegenerateSecret422 = ValidationError;
|
|
44615
44773
|
var WebhooksRegenerateSecret500 = InternalError2;
|
|
44616
44774
|
var WebhooksGetStatsPathParams = Struct2({ webhookId: WebhookEndpointId });
|
|
44617
|
-
var
|
|
44618
|
-
|
|
44619
|
-
|
|
44620
|
-
|
|
44621
|
-
|
|
44622
|
-
|
|
44623
|
-
});
|
|
44775
|
+
var WebhooksGetStatsQuery = Struct2({ period: optionalKey2(Union2([Literals([
|
|
44776
|
+
"7d",
|
|
44777
|
+
"30d",
|
|
44778
|
+
"90d"
|
|
44779
|
+
]), Null2])) });
|
|
44780
|
+
var WebhooksGetStats200 = WebhookStatsResponse;
|
|
44624
44781
|
var WebhooksGetStats401 = UnauthorizedError;
|
|
44625
44782
|
var WebhooksGetStats403 = ForbiddenError;
|
|
44626
44783
|
var WebhooksGetStats404 = ResourceNotFoundError;
|
|
@@ -45323,7 +45480,19 @@ var EmailGroup = class extends exports_HttpApiGroup.make("Email").add(exports_Ht
|
|
|
45323
45480
|
EmailClearDomainDefaultSender404.pipe(exports_HttpApiSchema.status(404)),
|
|
45324
45481
|
EmailClearDomainDefaultSender500
|
|
45325
45482
|
]
|
|
45326
|
-
}).middleware(ApiKeySecurityMiddleware).annotate(exports_OpenApi.Identifier, "email.clearDomainDefaultSender").annotate(exports_OpenApi.Summary, "Clear a domain's default sender").annotate(exports_OpenApi.Description, "Removes the domain's default sender so omitted-`from` sends fall through to the organization default sender."), exports_HttpApiEndpoint.
|
|
45483
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(exports_OpenApi.Identifier, "email.clearDomainDefaultSender").annotate(exports_OpenApi.Summary, "Clear a domain's default sender").annotate(exports_OpenApi.Description, "Removes the domain's default sender so omitted-`from` sends fall through to the organization default sender."), exports_HttpApiEndpoint.post("emailRotateDomainDkim", "/v1/email/domains/:id/dkim-rotation", {
|
|
45484
|
+
params: EmailRotateDomainDkimPathParams,
|
|
45485
|
+
headers: EmailRotateDomainDkimHeaders,
|
|
45486
|
+
success: EmailRotateDomainDkim200,
|
|
45487
|
+
error: [
|
|
45488
|
+
EmailRotateDomainDkim401.pipe(exports_HttpApiSchema.status(401)),
|
|
45489
|
+
EmailRotateDomainDkim403.pipe(exports_HttpApiSchema.status(403)),
|
|
45490
|
+
EmailRotateDomainDkim404.pipe(exports_HttpApiSchema.status(404)),
|
|
45491
|
+
EmailRotateDomainDkim409.pipe(exports_HttpApiSchema.status(409)),
|
|
45492
|
+
EmailRotateDomainDkim500,
|
|
45493
|
+
EmailRotateDomainDkim502.pipe(exports_HttpApiSchema.status(502))
|
|
45494
|
+
]
|
|
45495
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(exports_OpenApi.Identifier, "email.rotateDomainDkim").annotate(exports_OpenApi.Summary, "Stage a DKIM selector rotation").annotate(exports_OpenApi.Description, "Creates encrypted signing custody and returns a new public DKIM record. Publish it, then advance domain verification to cut over. Retain the former record until separately approved retirement."), exports_HttpApiEndpoint.get("emailGetDomainConnect", "/v1/email/domains/:id/domain-connect", {
|
|
45327
45496
|
params: EmailGetDomainConnectPathParams,
|
|
45328
45497
|
query: EmailGetDomainConnectQuery,
|
|
45329
45498
|
success: EmailGetDomainConnect200,
|
|
@@ -46142,7 +46311,7 @@ var WebhooksGroup = class extends exports_HttpApiGroup.make("Webhooks").add(expo
|
|
|
46142
46311
|
WebhooksList403.pipe(exports_HttpApiSchema.status(403)),
|
|
46143
46312
|
WebhooksList500
|
|
46144
46313
|
]
|
|
46145
|
-
}).middleware(ApiKeySecurityMiddleware).annotate(exports_OpenApi.Identifier, "webhooks.list").annotate(exports_OpenApi.Summary, "List webhooks").annotate(exports_OpenApi.Description, "Returns a paginated list of the organization's webhook endpoints, optionally filtered by a name search."), exports_HttpApiEndpoint.post("webhooksCreate", "/v1/webhooks", {
|
|
46314
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(exports_OpenApi.Identifier, "webhooks.list").annotate(exports_OpenApi.Summary, "List webhooks").annotate(exports_OpenApi.Description, "Returns a paginated list of the organization's webhook endpoints with each endpoint's delivery counts, optionally filtered by a name search."), exports_HttpApiEndpoint.post("webhooksCreate", "/v1/webhooks", {
|
|
46146
46315
|
payload: WebhooksCreateRequestJson,
|
|
46147
46316
|
success: WebhooksCreate201.pipe(exports_HttpApiSchema.status(201)),
|
|
46148
46317
|
error: [
|
|
@@ -46215,7 +46384,7 @@ var WebhooksGroup = class extends exports_HttpApiGroup.make("Webhooks").add(expo
|
|
|
46215
46384
|
WebhooksGetLogs404.pipe(exports_HttpApiSchema.status(404)),
|
|
46216
46385
|
WebhooksGetLogs500
|
|
46217
46386
|
]
|
|
46218
|
-
}).middleware(ApiKeySecurityMiddleware).annotate(exports_OpenApi.Identifier, "webhooks.getLogs").annotate(exports_OpenApi.Summary, "List webhook delivery logs").annotate(exports_OpenApi.Description, "Returns recent deliveries and
|
|
46387
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(exports_OpenApi.Identifier, "webhooks.getLogs").annotate(exports_OpenApi.Summary, "List webhook delivery logs").annotate(exports_OpenApi.Description, "Returns recent deliveries for a webhook endpoint, each naming the event type and time it was made for, with its nested attempt diagnostics."), exports_HttpApiEndpoint.post("webhooksRegenerateSecret", "/v1/webhooks/:webhookId/rotate-secret", {
|
|
46219
46388
|
params: WebhooksRegenerateSecretPathParams,
|
|
46220
46389
|
success: WebhooksRegenerateSecret200,
|
|
46221
46390
|
error: [
|
|
@@ -46227,6 +46396,7 @@ var WebhooksGroup = class extends exports_HttpApiGroup.make("Webhooks").add(expo
|
|
|
46227
46396
|
]
|
|
46228
46397
|
}).middleware(ApiKeySecurityMiddleware).annotate(exports_OpenApi.Identifier, "webhooks.regenerateSecret").annotate(exports_OpenApi.Summary, "Rotate a webhook signing secret").annotate(exports_OpenApi.Description, "Generates and returns a new signing secret. The previous secret remains valid for a 24-hour rotation overlap."), exports_HttpApiEndpoint.get("webhooksGetStats", "/v1/webhooks/:webhookId/stats", {
|
|
46229
46398
|
params: WebhooksGetStatsPathParams,
|
|
46399
|
+
query: WebhooksGetStatsQuery,
|
|
46230
46400
|
success: WebhooksGetStats200,
|
|
46231
46401
|
error: [
|
|
46232
46402
|
WebhooksGetStats401.pipe(exports_HttpApiSchema.status(401)),
|
|
@@ -46234,7 +46404,7 @@ var WebhooksGroup = class extends exports_HttpApiGroup.make("Webhooks").add(expo
|
|
|
46234
46404
|
WebhooksGetStats404.pipe(exports_HttpApiSchema.status(404)),
|
|
46235
46405
|
WebhooksGetStats500
|
|
46236
46406
|
]
|
|
46237
|
-
}).middleware(ApiKeySecurityMiddleware).annotate(exports_OpenApi.Identifier, "webhooks.getStats").annotate(exports_OpenApi.Summary, "Get webhook delivery statistics").annotate(exports_OpenApi.Description, "Returns aggregate pending, delivered, exhausted, and cancelled delivery counts for a webhook endpoint.")).annotate(exports_OpenApi.Description, "Customer event webhook management, testing, and delivery logs") {
|
|
46407
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(exports_OpenApi.Identifier, "webhooks.getStats").annotate(exports_OpenApi.Summary, "Get webhook delivery statistics").annotate(exports_OpenApi.Description, "Returns aggregate pending, delivered, exhausted, and cancelled delivery counts for a webhook endpoint, plus the same counts per workspace-local calendar day over the selected period of 7, 30, or 90 days. Deliveries are retained for 90 days, so 90d is the whole history.")).annotate(exports_OpenApi.Description, "Customer event webhook management, testing, and delivery logs") {
|
|
46238
46408
|
};
|
|
46239
46409
|
var SamvaApi = class extends exports_HttpApi.make("SamvaApi").annotate(exports_OpenApi.Title, "Samva SDK").annotate(exports_OpenApi.Version, "1.0.0").annotate(exports_OpenApi.Description, "Samva email API for programmatic email delivery").add(APIKeysGroup, CampaignsGroup, ContactsGroup, ConversationsGroup, DesignGroup, EmailGroup, MediaGroup, MessagesGroup, ScheduledMessagesGroup, OperationsGroup, OrganizationsGroup, TemplatesGroup, WebhooksGroup) {
|
|
46240
46410
|
};
|
|
@@ -46415,7 +46585,7 @@ var generateIdempotencyKey = exports_Effect.gen(function* () {
|
|
|
46415
46585
|
return `${hex2.slice(0, 8)}-${hex2.slice(8, 12)}-${hex2.slice(12, 16)}-${hex2.slice(16, 20)}-${hex2.slice(20)}`;
|
|
46416
46586
|
});
|
|
46417
46587
|
|
|
46418
|
-
// ../sdk/dist/operation-
|
|
46588
|
+
// ../sdk/dist/operation-DY-fe2px.js
|
|
46419
46589
|
var SDK_OPERATION_CALLS = {
|
|
46420
46590
|
designGet: { kind: "none" },
|
|
46421
46591
|
designUpdate: { kind: "payload" },
|
|
@@ -46525,6 +46695,10 @@ var SDK_OPERATION_CALLS = {
|
|
|
46525
46695
|
emailGetRecipientTrackingPreference: { kind: "params" },
|
|
46526
46696
|
emailUpdateRecipientTrackingPreference: { kind: "payload" },
|
|
46527
46697
|
emailAddDomain: { kind: "payload" },
|
|
46698
|
+
emailRotateDomainDkim: {
|
|
46699
|
+
kind: "idempotentPath",
|
|
46700
|
+
paths: ["id"]
|
|
46701
|
+
},
|
|
46528
46702
|
emailGetDomainVerification: {
|
|
46529
46703
|
kind: "path",
|
|
46530
46704
|
paths: ["id"]
|
|
@@ -46995,6 +47169,11 @@ var adapt = (operationName, rawCall, input) => {
|
|
|
46995
47169
|
}
|
|
46996
47170
|
if (pathDescriptor.kind === "path")
|
|
46997
47171
|
return call({ params });
|
|
47172
|
+
if (pathDescriptor.kind === "idempotentPath")
|
|
47173
|
+
return call({
|
|
47174
|
+
params,
|
|
47175
|
+
headers: { "idempotency-key": inputRecord.idempotencyKey }
|
|
47176
|
+
});
|
|
46998
47177
|
const remainingInput = stripUndefined(Object.fromEntries(Object.entries(inputRecord).filter(([key]) => !pathDescriptor.paths.includes(key))));
|
|
46999
47178
|
return call({
|
|
47000
47179
|
params,
|
|
@@ -47102,6 +47281,7 @@ var getRecipientTrackingPreference = make58("emailGetRecipientTrackingPreference
|
|
|
47102
47281
|
var updateRecipientTrackingPreference = make58("emailUpdateRecipientTrackingPreference");
|
|
47103
47282
|
var listDomains = make58("emailListDomains");
|
|
47104
47283
|
var addDomain = make58("emailAddDomain");
|
|
47284
|
+
var rotateDomainDkim = make58("emailRotateDomainDkim");
|
|
47105
47285
|
var getDomainVerification = make58("emailGetDomainVerification");
|
|
47106
47286
|
var advanceDomainVerification = make58("emailAdvanceDomainVerification");
|
|
47107
47287
|
var getDomainById = make58("emailGetDomainById");
|
|
@@ -47309,13 +47489,11 @@ var formatApiError = (prefix, error2) => {
|
|
|
47309
47489
|
if (error2 instanceof ResourceNotFoundError) {
|
|
47310
47490
|
return `${prefix}: ${error2.resource} '${error2.id}' not found`;
|
|
47311
47491
|
}
|
|
47312
|
-
if (
|
|
47313
|
-
|
|
47314
|
-
|
|
47315
|
-
|
|
47316
|
-
|
|
47317
|
-
return `${prefix}: ${error2["errorMessage"]}`;
|
|
47318
|
-
}
|
|
47492
|
+
if (error2 instanceof FlagDisabledError) {
|
|
47493
|
+
return `${prefix}: feature flag '${error2.flag}' is disabled`;
|
|
47494
|
+
}
|
|
47495
|
+
if (isObject(error2) && hasProperty(error2, "message") && typeof error2["message"] === "string" && error2["message"].length > 0) {
|
|
47496
|
+
return `${prefix}: ${error2["message"]}`;
|
|
47319
47497
|
}
|
|
47320
47498
|
return prefix;
|
|
47321
47499
|
};
|
|
@@ -47450,7 +47628,7 @@ var commandNameFromArgv = (argv) => {
|
|
|
47450
47628
|
}
|
|
47451
47629
|
return path3.length === 0 ? "samva" : path3.join(".");
|
|
47452
47630
|
};
|
|
47453
|
-
var validateProcessArgs = (argv) =>
|
|
47631
|
+
var validateProcessArgs = (argv) => gen3(function* () {
|
|
47454
47632
|
const selected = new Set;
|
|
47455
47633
|
for (const token of argv) {
|
|
47456
47634
|
if (token === "--")
|
|
@@ -47599,14 +47777,14 @@ var layer17 = succeed5(Service5, {
|
|
|
47599
47777
|
});
|
|
47600
47778
|
|
|
47601
47779
|
// src/config/paths.ts
|
|
47602
|
-
var configDir =
|
|
47780
|
+
var configDir = gen3(function* () {
|
|
47603
47781
|
const path3 = yield* Path;
|
|
47604
47782
|
const base2 = XDG_CONFIG_HOME && XDG_CONFIG_HOME.length > 0 ? XDG_CONFIG_HOME : HOME && HOME.length > 0 ? path3.join(HOME, ".config") : yield* new SamvaCliError({
|
|
47605
47783
|
message: "Could not resolve config directory. Set XDG_CONFIG_HOME, HOME, or USERPROFILE."
|
|
47606
47784
|
});
|
|
47607
47785
|
return path3.join(base2, "samva");
|
|
47608
47786
|
});
|
|
47609
|
-
var configFilePath =
|
|
47787
|
+
var configFilePath = gen3(function* () {
|
|
47610
47788
|
const path3 = yield* Path;
|
|
47611
47789
|
const dir = yield* configDir;
|
|
47612
47790
|
return path3.join(dir, "config.json");
|
|
@@ -47637,7 +47815,7 @@ var validateProfileName = (name) => decodeEffect2(ProfileNameSchema)(name).pipe(
|
|
|
47637
47815
|
code: "invalid_profile_name",
|
|
47638
47816
|
message: "Profile names must be 1-64 characters and contain only letters, numbers, dots, underscores, or hyphens."
|
|
47639
47817
|
})));
|
|
47640
|
-
var parseConfig2 = (raw3, file4) =>
|
|
47818
|
+
var parseConfig2 = (raw3, file4) => gen3(function* () {
|
|
47641
47819
|
const rawValue = yield* try_3({
|
|
47642
47820
|
try: () => JSON.parse(raw3),
|
|
47643
47821
|
catch: () => new CliConfigError({
|
|
@@ -47650,7 +47828,7 @@ var parseConfig2 = (raw3, file4) => gen4(function* () {
|
|
|
47650
47828
|
message: `Could not parse CLI config at ${file4}. Fix or delete it.`
|
|
47651
47829
|
})));
|
|
47652
47830
|
});
|
|
47653
|
-
var readConfig =
|
|
47831
|
+
var readConfig = gen3(function* () {
|
|
47654
47832
|
const fs = yield* FileSystem;
|
|
47655
47833
|
const file4 = yield* configFilePath;
|
|
47656
47834
|
if (!(yield* fs.exists(file4)))
|
|
@@ -47663,7 +47841,7 @@ var writeConfig = fn2("CliConfig.writeConfig")(function* (config) {
|
|
|
47663
47841
|
yield* fs.writeFileString(yield* configFilePath, `${JSON.stringify(config, null, 2)}
|
|
47664
47842
|
`);
|
|
47665
47843
|
});
|
|
47666
|
-
var resolveExecutionSelection =
|
|
47844
|
+
var resolveExecutionSelection = gen3(function* () {
|
|
47667
47845
|
const profileFlag = getOrUndefined(yield* Profile);
|
|
47668
47846
|
const apiUrlFlag = getOrUndefined(yield* ApiUrl);
|
|
47669
47847
|
const orgFlag = getOrUndefined(yield* Org);
|
|
@@ -47705,7 +47883,7 @@ var resolveExecutionSelection = gen4(function* () {
|
|
|
47705
47883
|
apiKey: apiKey2
|
|
47706
47884
|
};
|
|
47707
47885
|
});
|
|
47708
|
-
var resolveExecutionContext =
|
|
47886
|
+
var resolveExecutionContext = gen3(function* () {
|
|
47709
47887
|
const selection = yield* resolveExecutionSelection;
|
|
47710
47888
|
if (selection.apiKey) {
|
|
47711
47889
|
return { ...selection, credentials: undefined };
|
|
@@ -47734,7 +47912,7 @@ var decodeStoredCredentials = (profile, rawCredentials) => try_3({
|
|
|
47734
47912
|
})));
|
|
47735
47913
|
var resolveApiUrl = map8(resolveExecutionSelection, (selection) => selection.apiUrl);
|
|
47736
47914
|
var isCredentialExpired = (credentials, nowMillis) => credentials.expiresAt <= Math.floor(nowMillis / 1000);
|
|
47737
|
-
var resolveAuthToken =
|
|
47915
|
+
var resolveAuthToken = gen3(function* () {
|
|
47738
47916
|
const context3 = yield* resolveExecutionContext;
|
|
47739
47917
|
if (!context3.credentials)
|
|
47740
47918
|
return;
|
|
@@ -47763,7 +47941,7 @@ var writeCredentials = fn2("CliConfig.writeCredentials")(function* (credentials)
|
|
|
47763
47941
|
yield* (yield* exports_credential_store.Service).write(context3.profile, JSON.stringify(credentials));
|
|
47764
47942
|
});
|
|
47765
47943
|
var readCredentials = map8(resolveExecutionContext, (context3) => context3.credentials);
|
|
47766
|
-
var clearCredentials =
|
|
47944
|
+
var clearCredentials = gen3(function* () {
|
|
47767
47945
|
const context3 = yield* resolveExecutionSelection;
|
|
47768
47946
|
const config = yield* readConfig;
|
|
47769
47947
|
const current = config.profiles[context3.profile];
|
|
@@ -47790,7 +47968,7 @@ var missingOrgMessage = "No active organization. Run `samva org use <slug>` afte
|
|
|
47790
47968
|
var provider = (config) => ({
|
|
47791
47969
|
provide: (effect2) => provide4(effect2, layerFetch(config))
|
|
47792
47970
|
});
|
|
47793
|
-
var getClientProviderForContext = (context3, baseUrl2) =>
|
|
47971
|
+
var getClientProviderForContext = (context3, baseUrl2) => gen3(function* () {
|
|
47794
47972
|
if (context3.apiKey) {
|
|
47795
47973
|
return provider({ apiKey: context3.apiKey, baseUrl: baseUrl2, headers: CLI_CLIENT_HEADERS });
|
|
47796
47974
|
}
|
|
@@ -47824,7 +48002,7 @@ var getClientProvider = flatMap5(resolveExecutionContext, (context3) => getClien
|
|
|
47824
48002
|
|
|
47825
48003
|
// src/lib/confirm.ts
|
|
47826
48004
|
import { isatty } from "tty";
|
|
47827
|
-
var confirmDestructive = (options2) =>
|
|
48005
|
+
var confirmDestructive = (options2) => gen3(function* () {
|
|
47828
48006
|
if (options2.yes)
|
|
47829
48007
|
return;
|
|
47830
48008
|
if ((yield* NoInput) || options2.json || !isatty(0) || !isatty(1)) {
|
|
@@ -48051,7 +48229,7 @@ var create10 = make42("create", {
|
|
|
48051
48229
|
trackClicks,
|
|
48052
48230
|
dryRun,
|
|
48053
48231
|
json: json2
|
|
48054
|
-
}) =>
|
|
48232
|
+
}) => gen3(function* () {
|
|
48055
48233
|
const htmlValue = getOrUndefined(html);
|
|
48056
48234
|
const textValue = getOrUndefined(text3);
|
|
48057
48235
|
const templateIdValue = getOrUndefined(templateId);
|
|
@@ -48151,7 +48329,7 @@ var list10 = make42("list", {
|
|
|
48151
48329
|
{ command: "samva campaigns list" },
|
|
48152
48330
|
{ command: "samva campaigns list --status draft --json" },
|
|
48153
48331
|
{ command: "samva campaigns list --all --jsonl", description: "Stream every page as JSONL" }
|
|
48154
|
-
]), withHandler(({ status: status2, page, limit, all: all5, json: json2 }) =>
|
|
48332
|
+
]), withHandler(({ status: status2, page, limit, all: all5, json: json2 }) => gen3(function* () {
|
|
48155
48333
|
if (all5 && !isJsonLinesRequested())
|
|
48156
48334
|
return yield* new CliUsageError({
|
|
48157
48335
|
code: "all_requires_jsonl",
|
|
@@ -48209,7 +48387,7 @@ var printCampaign = (campaign) => printFields([
|
|
|
48209
48387
|
["Created", campaign.createdAt],
|
|
48210
48388
|
["Updated", campaign.updatedAt]
|
|
48211
48389
|
]);
|
|
48212
|
-
var get21 = make42("get", { id: string6("id"), json: jsonFlag }).pipe(withDescription3("Show a campaign by id"), withExamples([{ command: "samva campaigns get camp_abc123" }]), withHandler(({ id: id2, json: json2 }) =>
|
|
48390
|
+
var get21 = make42("get", { id: string6("id"), json: jsonFlag }).pipe(withDescription3("Show a campaign by id"), withExamples([{ command: "samva campaigns get camp_abc123" }]), withHandler(({ id: id2, json: json2 }) => gen3(function* () {
|
|
48213
48391
|
const client = yield* getClientProvider;
|
|
48214
48392
|
const data = yield* get12({ id: id2 }).pipe(client.provide, mapError3((error2) => new SamvaCliError({ message: formatApiError("Could not fetch campaign", error2) })));
|
|
48215
48393
|
if (json2)
|
|
@@ -48260,7 +48438,7 @@ var update11 = make42("update", {
|
|
|
48260
48438
|
trackOpens,
|
|
48261
48439
|
trackClicks,
|
|
48262
48440
|
json: json2
|
|
48263
|
-
}) =>
|
|
48441
|
+
}) => gen3(function* () {
|
|
48264
48442
|
const htmlValue = getOrUndefined(html);
|
|
48265
48443
|
const textValue = getOrUndefined(text3);
|
|
48266
48444
|
const templateIdValue = getOrUndefined(templateId);
|
|
@@ -48354,7 +48532,7 @@ var archive2 = make42("archive", {
|
|
|
48354
48532
|
}).pipe(withDescription3("Archive a campaign"), withExamples([
|
|
48355
48533
|
{ command: "samva campaigns archive camp_abc123 --dry-run" },
|
|
48356
48534
|
{ command: "samva campaigns archive camp_abc123 --yes" }
|
|
48357
|
-
]), withHandler(({ id: id2, dryRun, yes, json: json2 }) =>
|
|
48535
|
+
]), withHandler(({ id: id2, dryRun, yes, json: json2 }) => gen3(function* () {
|
|
48358
48536
|
if (dryRun) {
|
|
48359
48537
|
return yield* json2 ? printJson({ dryRun: true, action: "campaigns.archive", id: id2 }) : log2(`[dry-run] Would archive campaign ${id2}.`);
|
|
48360
48538
|
}
|
|
@@ -48401,7 +48579,7 @@ var runCreate = make42("create", {
|
|
|
48401
48579
|
command: "samva campaigns runs create camp_abc123 --at 2026-08-01T09:00:00Z",
|
|
48402
48580
|
description: "Start at a future time"
|
|
48403
48581
|
}
|
|
48404
|
-
]), withHandler(({ campaignId, at, idempotencyKey, dryRun, json: json2 }) =>
|
|
48582
|
+
]), withHandler(({ campaignId, at, idempotencyKey, dryRun, json: json2 }) => gen3(function* () {
|
|
48405
48583
|
const atValue = getOrUndefined(at);
|
|
48406
48584
|
if (atValue !== undefined && !isAbsoluteInstant(atValue)) {
|
|
48407
48585
|
return yield* new SamvaCliError({
|
|
@@ -48436,7 +48614,7 @@ var runList = make42("list", {
|
|
|
48436
48614
|
limit: limitFlag,
|
|
48437
48615
|
all: allFlag,
|
|
48438
48616
|
json: jsonFlag
|
|
48439
|
-
}).pipe(withDescription3("List runs for a campaign"), withExamples([{ command: "samva campaigns runs list camp_abc123" }]), withHandler(({ campaignId, status: status2, page, limit, all: all5, json: json2 }) =>
|
|
48617
|
+
}).pipe(withDescription3("List runs for a campaign"), withExamples([{ command: "samva campaigns runs list camp_abc123" }]), withHandler(({ campaignId, status: status2, page, limit, all: all5, json: json2 }) => gen3(function* () {
|
|
48440
48618
|
if (all5 && !isJsonLinesRequested())
|
|
48441
48619
|
return yield* new CliUsageError({
|
|
48442
48620
|
code: "all_requires_jsonl",
|
|
@@ -48490,7 +48668,7 @@ var runGet = make42("get", {
|
|
|
48490
48668
|
campaignId: string6("campaignId"),
|
|
48491
48669
|
runId: string6("runId"),
|
|
48492
48670
|
json: jsonFlag
|
|
48493
|
-
}).pipe(withDescription3("Show a campaign run"), withExamples([{ command: "samva campaigns runs get camp_abc123 run_def456" }]), withHandler(({ campaignId, runId, json: json2 }) =>
|
|
48671
|
+
}).pipe(withDescription3("Show a campaign run"), withExamples([{ command: "samva campaigns runs get camp_abc123 run_def456" }]), withHandler(({ campaignId, runId, json: json2 }) => gen3(function* () {
|
|
48494
48672
|
const client = yield* getClientProvider;
|
|
48495
48673
|
const data = yield* getRun({ id: campaignId, runId }).pipe(client.provide, mapError3((error2) => new SamvaCliError({ message: formatApiError("Could not fetch run", error2) })));
|
|
48496
48674
|
if (json2)
|
|
@@ -48502,7 +48680,7 @@ var runPause = make42("pause", {
|
|
|
48502
48680
|
runId: string6("runId"),
|
|
48503
48681
|
dryRun: dryRunFlag,
|
|
48504
48682
|
json: jsonFlag
|
|
48505
|
-
}).pipe(withDescription3("Pause a running campaign run"), withExamples([{ command: "samva campaigns runs pause camp_abc123 run_def456" }]), withHandler(({ campaignId, runId, dryRun, json: json2 }) =>
|
|
48683
|
+
}).pipe(withDescription3("Pause a running campaign run"), withExamples([{ command: "samva campaigns runs pause camp_abc123 run_def456" }]), withHandler(({ campaignId, runId, dryRun, json: json2 }) => gen3(function* () {
|
|
48506
48684
|
if (dryRun)
|
|
48507
48685
|
return yield* json2 ? printJson({ dryRun: true, action: "campaigns.runs.pause", campaignId, runId }) : log2(`[dry-run] Would pause campaign run ${runId}.`);
|
|
48508
48686
|
const client = yield* getClientProvider;
|
|
@@ -48518,7 +48696,7 @@ var runResume = make42("resume", {
|
|
|
48518
48696
|
runId: string6("runId"),
|
|
48519
48697
|
dryRun: dryRunFlag,
|
|
48520
48698
|
json: jsonFlag
|
|
48521
|
-
}).pipe(withDescription3("Resume a paused campaign run"), withExamples([{ command: "samva campaigns runs resume camp_abc123 run_def456" }]), withHandler(({ campaignId, runId, dryRun, json: json2 }) =>
|
|
48699
|
+
}).pipe(withDescription3("Resume a paused campaign run"), withExamples([{ command: "samva campaigns runs resume camp_abc123 run_def456" }]), withHandler(({ campaignId, runId, dryRun, json: json2 }) => gen3(function* () {
|
|
48522
48700
|
if (dryRun)
|
|
48523
48701
|
return yield* json2 ? printJson({ dryRun: true, action: "campaigns.runs.resume", campaignId, runId }) : log2(`[dry-run] Would resume campaign run ${runId}.`);
|
|
48524
48702
|
const client = yield* getClientProvider;
|
|
@@ -48538,7 +48716,7 @@ var runCancel = make42("cancel", {
|
|
|
48538
48716
|
}).pipe(withDescription3("Cancel a campaign run (best effort once dispatch has started; terminal when scheduled)"), withExamples([
|
|
48539
48717
|
{ command: "samva campaigns runs cancel camp_abc123 run_def456 --dry-run" },
|
|
48540
48718
|
{ command: "samva campaigns runs cancel camp_abc123 run_def456 --yes" }
|
|
48541
|
-
]), withHandler(({ campaignId, runId, dryRun, yes, json: json2 }) =>
|
|
48719
|
+
]), withHandler(({ campaignId, runId, dryRun, yes, json: json2 }) => gen3(function* () {
|
|
48542
48720
|
if (dryRun) {
|
|
48543
48721
|
return yield* json2 ? printJson({ dryRun: true, action: "campaigns.runs.cancel", campaignId, runId }) : log2(`[dry-run] Would cancel campaign run ${runId}.`);
|
|
48544
48722
|
}
|
|
@@ -48570,7 +48748,7 @@ var runRecipients = make42("recipients", {
|
|
|
48570
48748
|
command: "samva campaigns runs recipients camp_abc123 run_def456 --status failed",
|
|
48571
48749
|
description: "Only failed recipients"
|
|
48572
48750
|
}
|
|
48573
|
-
]), withHandler(({ campaignId, runId, status: status2, page, limit, all: all5, json: json2 }) =>
|
|
48751
|
+
]), withHandler(({ campaignId, runId, status: status2, page, limit, all: all5, json: json2 }) => gen3(function* () {
|
|
48574
48752
|
if (all5 && !isJsonLinesRequested())
|
|
48575
48753
|
return yield* new CliUsageError({
|
|
48576
48754
|
code: "all_requires_jsonl",
|
|
@@ -48648,38 +48826,462 @@ var campaignsCommand = make42("campaigns").pipe(withDescription3("Create and ope
|
|
|
48648
48826
|
// src/commands/design.ts
|
|
48649
48827
|
import { dirname as dirname2, resolve as resolve4 } from "path";
|
|
48650
48828
|
|
|
48651
|
-
//
|
|
48652
|
-
|
|
48653
|
-
|
|
48654
|
-
|
|
48655
|
-
}
|
|
48656
|
-
var
|
|
48657
|
-
|
|
48658
|
-
|
|
48659
|
-
|
|
48660
|
-
|
|
48661
|
-
|
|
48662
|
-
|
|
48663
|
-
|
|
48664
|
-
|
|
48665
|
-
|
|
48666
|
-
}
|
|
48667
|
-
|
|
48668
|
-
|
|
48669
|
-
|
|
48670
|
-
|
|
48671
|
-
|
|
48829
|
+
// ../../node_modules/.bun/better-result@3.0.1/node_modules/better-result/dist/index.mjs
|
|
48830
|
+
function e(e2, t) {
|
|
48831
|
+
return e2 === 2 ? (...e3) => e3.length >= 2 ? t(e3[0], e3[1]) : (n) => t(n, e3[0]) : e2 === 3 ? (...e3) => e3.length >= 3 ? t(e3[0], e3[1], e3[2]) : (n) => t(n, e3[0], e3[1]) : e2 === 4 ? (...e3) => e3.length >= 4 ? t(e3[0], e3[1], e3[2], e3[3]) : (n) => t(n, e3[0], e3[1], e3[2]) : (...n) => n.length >= e2 ? t(...n) : (e3) => t(e3, ...n);
|
|
48832
|
+
}
|
|
48833
|
+
var t = (e2) => e2 instanceof Error ? { name: e2.name, message: e2.message, stack: e2.stack } : e2;
|
|
48834
|
+
var n = class e2 extends Error {
|
|
48835
|
+
_tag = `Panic`;
|
|
48836
|
+
static is(t2) {
|
|
48837
|
+
return t2 instanceof e2;
|
|
48838
|
+
}
|
|
48839
|
+
constructor(e3) {
|
|
48840
|
+
if (super(e3.message, e3.cause === undefined ? undefined : { cause: e3.cause }), Object.assign(this, e3), Object.setPrototypeOf(this, new.target.prototype), this.name = `Panic`, e3.cause instanceof Error && e3.cause.stack) {
|
|
48841
|
+
let t2 = e3.cause.stack.replace(/\n/g, `
|
|
48842
|
+
`);
|
|
48843
|
+
this.stack = `${this.stack}
|
|
48844
|
+
Caused by: ${t2}`;
|
|
48845
|
+
}
|
|
48846
|
+
}
|
|
48847
|
+
toJSON() {
|
|
48848
|
+
return { ...this, _tag: this._tag, name: this.name, message: this.message, cause: t(this.cause), stack: this.stack };
|
|
48849
|
+
}
|
|
48850
|
+
*[Symbol.iterator]() {
|
|
48851
|
+
return yield* d(this), i(`Unreachable: Err yielded in Panic but generator continued`, this);
|
|
48852
|
+
}
|
|
48853
|
+
};
|
|
48854
|
+
var i = (e3, t2) => {
|
|
48855
|
+
throw new n({ message: e3, cause: t2 });
|
|
48856
|
+
};
|
|
48857
|
+
var a = (e3, t2) => {
|
|
48858
|
+
try {
|
|
48859
|
+
return e3();
|
|
48860
|
+
} catch (e4) {
|
|
48861
|
+
throw i(t2, e4);
|
|
48862
|
+
}
|
|
48863
|
+
};
|
|
48864
|
+
var o = async (e3, t2) => {
|
|
48865
|
+
try {
|
|
48866
|
+
return await e3();
|
|
48867
|
+
} catch (e4) {
|
|
48868
|
+
throw i(t2, e4);
|
|
48869
|
+
}
|
|
48870
|
+
};
|
|
48871
|
+
var s = class e3 {
|
|
48872
|
+
status = `ok`;
|
|
48873
|
+
constructor(e4) {
|
|
48874
|
+
this.value = e4;
|
|
48875
|
+
}
|
|
48876
|
+
isOk() {
|
|
48877
|
+
return true;
|
|
48878
|
+
}
|
|
48879
|
+
isErr() {
|
|
48880
|
+
return false;
|
|
48881
|
+
}
|
|
48882
|
+
map(t2) {
|
|
48883
|
+
return a(() => new e3(t2(this.value)), `map callback threw`);
|
|
48884
|
+
}
|
|
48885
|
+
mapError(e4) {
|
|
48886
|
+
return this;
|
|
48887
|
+
}
|
|
48888
|
+
tryRecover(e4) {
|
|
48889
|
+
return this;
|
|
48890
|
+
}
|
|
48891
|
+
tryRecoverAsync(e4) {
|
|
48892
|
+
return Promise.resolve(this);
|
|
48893
|
+
}
|
|
48894
|
+
andThen(e4) {
|
|
48895
|
+
return a(() => e4(this.value), `andThen callback threw`);
|
|
48896
|
+
}
|
|
48897
|
+
andThenAsync(e4) {
|
|
48898
|
+
return o(() => e4(this.value), `andThenAsync callback threw`);
|
|
48899
|
+
}
|
|
48900
|
+
match(e4) {
|
|
48901
|
+
return a(() => e4.ok(this.value), `match ok handler threw`);
|
|
48902
|
+
}
|
|
48903
|
+
unwrap(e4) {
|
|
48904
|
+
return this.value;
|
|
48905
|
+
}
|
|
48906
|
+
unwrapOr(e4) {
|
|
48907
|
+
return this.value;
|
|
48908
|
+
}
|
|
48909
|
+
tap(e4) {
|
|
48910
|
+
return a(() => (e4(this.value), this), `tap callback threw`);
|
|
48911
|
+
}
|
|
48912
|
+
tapAsync(e4) {
|
|
48913
|
+
return o(async () => (await e4(this.value), this), `tapAsync callback threw`);
|
|
48914
|
+
}
|
|
48915
|
+
tapError(e4) {
|
|
48916
|
+
return this;
|
|
48917
|
+
}
|
|
48918
|
+
tapErrorAsync(e4) {
|
|
48919
|
+
return Promise.resolve(this);
|
|
48920
|
+
}
|
|
48921
|
+
tapBoth(e4) {
|
|
48922
|
+
return a(() => (e4.ok(this.value), this), `tapBoth ok callback threw`);
|
|
48923
|
+
}
|
|
48924
|
+
tapBothAsync(e4) {
|
|
48925
|
+
return o(async () => (await e4.ok(this.value), this), `tapBothAsync ok callback threw`);
|
|
48926
|
+
}
|
|
48927
|
+
*[Symbol.iterator]() {
|
|
48928
|
+
return this.value;
|
|
48929
|
+
}
|
|
48930
|
+
};
|
|
48931
|
+
var c = class e4 {
|
|
48932
|
+
status = `error`;
|
|
48933
|
+
constructor(e5) {
|
|
48934
|
+
this.error = e5;
|
|
48935
|
+
}
|
|
48936
|
+
isOk() {
|
|
48937
|
+
return false;
|
|
48938
|
+
}
|
|
48939
|
+
isErr() {
|
|
48940
|
+
return true;
|
|
48941
|
+
}
|
|
48942
|
+
map(e5) {
|
|
48943
|
+
return this;
|
|
48944
|
+
}
|
|
48945
|
+
mapError(t2) {
|
|
48946
|
+
return a(() => new e4(t2(this.error)), `mapError callback threw`);
|
|
48947
|
+
}
|
|
48948
|
+
tryRecover(e5) {
|
|
48949
|
+
return a(() => e5(this.error), `tryRecover callback threw`);
|
|
48950
|
+
}
|
|
48951
|
+
tryRecoverAsync(e5) {
|
|
48952
|
+
return o(() => e5(this.error), `tryRecoverAsync callback threw`);
|
|
48953
|
+
}
|
|
48954
|
+
andThen(e5) {
|
|
48955
|
+
return this;
|
|
48956
|
+
}
|
|
48957
|
+
andThenAsync(e5) {
|
|
48958
|
+
return Promise.resolve(this);
|
|
48959
|
+
}
|
|
48960
|
+
match(e5) {
|
|
48961
|
+
return a(() => e5.err(this.error), `match err handler threw`);
|
|
48962
|
+
}
|
|
48963
|
+
unwrap(e5) {
|
|
48964
|
+
return i(e5 ?? `Unwrap called on Err: ${String(this.error)}`, this.error);
|
|
48965
|
+
}
|
|
48966
|
+
unwrapOr(e5) {
|
|
48967
|
+
return e5;
|
|
48968
|
+
}
|
|
48969
|
+
tap(e5) {
|
|
48970
|
+
return this;
|
|
48971
|
+
}
|
|
48972
|
+
tapError(e5) {
|
|
48973
|
+
return a(() => (e5(this.error), this), `tapError callback threw`);
|
|
48974
|
+
}
|
|
48975
|
+
tapAsync(e5) {
|
|
48976
|
+
return Promise.resolve(this);
|
|
48977
|
+
}
|
|
48978
|
+
tapErrorAsync(e5) {
|
|
48979
|
+
return o(async () => (await e5(this.error), this), `tapErrorAsync callback threw`);
|
|
48980
|
+
}
|
|
48981
|
+
tapBoth(e5) {
|
|
48982
|
+
return a(() => (e5.err(this.error), this), `tapBoth err callback threw`);
|
|
48983
|
+
}
|
|
48984
|
+
tapBothAsync(e5) {
|
|
48985
|
+
return o(async () => (await e5.err(this.error), this), `tapBothAsync err callback threw`);
|
|
48986
|
+
}
|
|
48987
|
+
*[Symbol.iterator]() {
|
|
48988
|
+
return yield this, i(`Unreachable: Err yielded in Result.gen but generator continued`, this.error);
|
|
48989
|
+
}
|
|
48990
|
+
};
|
|
48991
|
+
function l(e5) {
|
|
48992
|
+
return new s(e5);
|
|
48993
|
+
}
|
|
48994
|
+
var u = (e5) => e5.status === `ok`;
|
|
48995
|
+
var d = (e5) => new c(e5);
|
|
48996
|
+
var f = (e5) => e5.status === `error`;
|
|
48997
|
+
var p = (e5) => e5 instanceof Error ? { name: e5.name, message: e5.message, stack: e5.stack } : e5;
|
|
48998
|
+
var m = (e5) => e5 instanceof Error && (`_tag` in e5) && typeof e5._tag == `string` && (`toJSON` in e5) && typeof e5.toJSON == `function`;
|
|
48999
|
+
var h = (e5) => {
|
|
49000
|
+
|
|
49001
|
+
class t2 extends Error {
|
|
49002
|
+
_tag = e5;
|
|
49003
|
+
constructor(t3) {
|
|
49004
|
+
let n2 = t3 && `message` in t3 && typeof t3.message == `string` ? t3.message : undefined, r = t3 && `cause` in t3 ? t3.cause : undefined;
|
|
49005
|
+
if (super(n2, r === undefined ? undefined : { cause: r }), t3 && Object.assign(this, t3), Object.setPrototypeOf(this, new.target.prototype), this.name = e5, r instanceof Error && r.stack) {
|
|
49006
|
+
let e6 = r.stack.replace(/\n/g, `
|
|
49007
|
+
`);
|
|
49008
|
+
this.stack = `${this.stack}
|
|
49009
|
+
Caused by: ${e6}`;
|
|
49010
|
+
}
|
|
49011
|
+
}
|
|
49012
|
+
toJSON() {
|
|
49013
|
+
return { ...this, _tag: this._tag, name: this.name, message: this.message, cause: p(this.cause), stack: this.stack };
|
|
49014
|
+
}
|
|
49015
|
+
match(e6) {
|
|
49016
|
+
return g(this, e6);
|
|
49017
|
+
}
|
|
49018
|
+
*[Symbol.iterator]() {
|
|
49019
|
+
return yield* d(this), i(`Unreachable: Err yielded in TaggedError but generator continued`, this);
|
|
49020
|
+
}
|
|
49021
|
+
static is(e6) {
|
|
49022
|
+
return e6 instanceof this;
|
|
49023
|
+
}
|
|
49024
|
+
}
|
|
49025
|
+
return t2;
|
|
49026
|
+
};
|
|
49027
|
+
h.is = m;
|
|
49028
|
+
var g = e(2, (e5, t2) => {
|
|
49029
|
+
let n2 = t2[e5._tag];
|
|
49030
|
+
try {
|
|
49031
|
+
return n2(e5);
|
|
49032
|
+
} catch (e6) {
|
|
49033
|
+
return i(`matchError handler threw`, e6);
|
|
49034
|
+
}
|
|
48672
49035
|
});
|
|
48673
|
-
var
|
|
48674
|
-
|
|
48675
|
-
|
|
48676
|
-
|
|
49036
|
+
var x = class extends h(`UnhandledException`) {
|
|
49037
|
+
constructor(e5) {
|
|
49038
|
+
let t2 = e5.cause instanceof Error ? `Unhandled exception: ${e5.cause.message}` : `Unhandled exception: ${String(e5.cause)}`;
|
|
49039
|
+
super({ message: t2, cause: e5.cause });
|
|
48677
49040
|
}
|
|
48678
49041
|
};
|
|
48679
|
-
var
|
|
48680
|
-
|
|
48681
|
-
|
|
49042
|
+
var S = class extends h(`ResultDeserializationError`) {
|
|
49043
|
+
constructor(e5) {
|
|
49044
|
+
super({ message: e5.issues ? `Failed to deserialize Result payload` : `Failed to deserialize value as Result: expected { status: "ok", value } or { status: "error", error }`, value: e5.value, issues: e5.issues });
|
|
49045
|
+
}
|
|
49046
|
+
};
|
|
49047
|
+
var C = class extends h(`ResultSerializationError`) {
|
|
49048
|
+
constructor(e5) {
|
|
49049
|
+
super({ message: `Failed to serialize Result payload`, value: e5.value, issues: e5.issues });
|
|
49050
|
+
}
|
|
49051
|
+
};
|
|
49052
|
+
var w = (e5, t2) => {
|
|
49053
|
+
try {
|
|
49054
|
+
return e5();
|
|
49055
|
+
} catch (e6) {
|
|
49056
|
+
throw i(t2, e6);
|
|
49057
|
+
}
|
|
49058
|
+
};
|
|
49059
|
+
var T = (e5, t2) => {
|
|
49060
|
+
let n2 = (t3) => {
|
|
49061
|
+
if (typeof e5 == `function`)
|
|
49062
|
+
try {
|
|
49063
|
+
return l(e5(t3));
|
|
49064
|
+
} catch (e6) {
|
|
49065
|
+
return d(new x({ cause: e6 }));
|
|
49066
|
+
}
|
|
49067
|
+
try {
|
|
49068
|
+
return l(e5.try(t3));
|
|
49069
|
+
} catch (t4) {
|
|
49070
|
+
try {
|
|
49071
|
+
return d(e5.catch(t4));
|
|
49072
|
+
} catch (e6) {
|
|
49073
|
+
throw i(`Result.try catch handler threw`, e6);
|
|
49074
|
+
}
|
|
49075
|
+
}
|
|
49076
|
+
}, r = t2?.retry?.times ?? 0, a2 = 1, o2 = n2({ attempt: a2 });
|
|
49077
|
+
for (let e6 = 0;e6 < r && o2.status === `error`; e6++)
|
|
49078
|
+
a2++, o2 = n2({ attempt: a2 });
|
|
49079
|
+
return o2;
|
|
49080
|
+
};
|
|
49081
|
+
var E = async (e5, t2) => {
|
|
49082
|
+
let n2 = async (t3) => {
|
|
49083
|
+
if (typeof e5 == `function`)
|
|
49084
|
+
try {
|
|
49085
|
+
return l(await e5(t3));
|
|
49086
|
+
} catch (e6) {
|
|
49087
|
+
return d(new x({ cause: e6 }));
|
|
49088
|
+
}
|
|
49089
|
+
try {
|
|
49090
|
+
return l(await e5.try(t3));
|
|
49091
|
+
} catch (t4) {
|
|
49092
|
+
try {
|
|
49093
|
+
return d(await e5.catch(t4));
|
|
49094
|
+
} catch (e6) {
|
|
49095
|
+
throw i(`Result.tryPromise catch handler threw`, e6);
|
|
49096
|
+
}
|
|
49097
|
+
}
|
|
49098
|
+
}, r = t2?.retry;
|
|
49099
|
+
if (!r)
|
|
49100
|
+
return n2({ attempt: 1, signal: t2?.signal });
|
|
49101
|
+
let a2 = (e6, t3, n3) => {
|
|
49102
|
+
switch (t3) {
|
|
49103
|
+
case `constant`:
|
|
49104
|
+
return e6;
|
|
49105
|
+
case `linear`:
|
|
49106
|
+
return e6 * (n3 + 1);
|
|
49107
|
+
case `exponential`:
|
|
49108
|
+
return e6 * 2 ** n3;
|
|
49109
|
+
}
|
|
49110
|
+
}, o2 = r.jitter ?? false;
|
|
49111
|
+
if (typeof o2 == `number` && (!Number.isFinite(o2) || o2 < 0 || o2 > 1))
|
|
49112
|
+
throw i(`Result.tryPromise retry jitter must be a finite number between 0 and 1`);
|
|
49113
|
+
let s2 = o2 === true ? 1 : o2 === false ? 0 : o2, c2 = (e6) => s2 === 0 ? e6 : e6 * (1 - s2 + Math.random() * s2), u2 = (e6, t3) => new Promise((n3) => {
|
|
49114
|
+
if (t3?.aborted) {
|
|
49115
|
+
n3(false);
|
|
49116
|
+
return;
|
|
49117
|
+
}
|
|
49118
|
+
let r2 = () => {
|
|
49119
|
+
clearTimeout(i2), n3(false);
|
|
49120
|
+
}, i2 = setTimeout(() => {
|
|
49121
|
+
t3?.removeEventListener(`abort`, r2), n3(true);
|
|
49122
|
+
}, e6);
|
|
49123
|
+
t3?.addEventListener(`abort`, r2, { once: true });
|
|
49124
|
+
}), f2 = { attempt: 1, signal: t2.signal }, p2 = await n2(f2), m2 = r.shouldRetry ?? (() => true);
|
|
49125
|
+
for (let e6 = 0;e6 < r.times && !(p2.status !== `error` || f2.signal?.aborted); e6++) {
|
|
49126
|
+
let o3 = p2.error;
|
|
49127
|
+
if (!w(() => m2(o3, f2), `shouldRetry predicate threw`))
|
|
49128
|
+
break;
|
|
49129
|
+
let s3;
|
|
49130
|
+
if (typeof r.delayMs == `function`) {
|
|
49131
|
+
let e7 = r.delayMs;
|
|
49132
|
+
s3 = w(() => e7(o3, f2), `Result.tryPromise delayMs callback threw`);
|
|
49133
|
+
} else {
|
|
49134
|
+
if (r.backoff === undefined)
|
|
49135
|
+
throw i(`Result.tryPromise static retry delay requires backoff`);
|
|
49136
|
+
s3 = c2(a2(r.delayMs, r.backoff, e6));
|
|
49137
|
+
}
|
|
49138
|
+
if (!await u2(s3, f2.signal) || f2.signal?.aborted)
|
|
49139
|
+
break;
|
|
49140
|
+
f2 = { attempt: f2.attempt + 1, signal: t2.signal }, p2 = await n2(f2);
|
|
49141
|
+
}
|
|
49142
|
+
return p2;
|
|
49143
|
+
};
|
|
49144
|
+
var D = e(2, (e5, t2) => e5.map(t2));
|
|
49145
|
+
var O = e(2, (e5, t2) => e5.mapError(t2));
|
|
49146
|
+
var k = e(2, (e5, t2) => e5.tryRecover(t2));
|
|
49147
|
+
var A = e(2, (e5, t2) => e5.andThen(t2));
|
|
49148
|
+
var ee = e(2, (e5, t2) => e5.tryRecoverAsync(t2));
|
|
49149
|
+
var te = e(2, (e5, t2) => e5.andThenAsync(t2));
|
|
49150
|
+
var ne = e(2, (e5, t2) => e5.match(t2));
|
|
49151
|
+
var j = e(2, (e5, t2) => e5.tap(t2));
|
|
49152
|
+
var M = e(2, (e5, t2) => e5.tapAsync(t2));
|
|
49153
|
+
var N = e(2, (e5, t2) => e5.tapError(t2));
|
|
49154
|
+
var P = e(2, (e5, t2) => e5.tapErrorAsync(t2));
|
|
49155
|
+
var F = e(2, (e5, t2) => e5.tapBoth(t2));
|
|
49156
|
+
var I = e(2, (e5, t2) => e5.tapBothAsync(t2));
|
|
49157
|
+
var L = (e5, t2) => e5.unwrap(t2);
|
|
49158
|
+
function R(e5) {
|
|
49159
|
+
if (!(typeof e5 == `object` && e5 && (`status` in e5) && (e5.status === `ok` || e5.status === `error`)))
|
|
49160
|
+
return i(`Result.gen body must return Result.ok() or Result.err(), got: ` + (e5 === null ? `null` : typeof e5 == `object` ? JSON.stringify(e5) : String(e5)));
|
|
49161
|
+
}
|
|
49162
|
+
var z = e(2, (e5, t2) => e5.unwrapOr(t2));
|
|
49163
|
+
var B = (e5, t2) => {
|
|
49164
|
+
let n2 = e5.call(t2);
|
|
49165
|
+
if (Symbol.asyncIterator in n2)
|
|
49166
|
+
return (async () => {
|
|
49167
|
+
let e6 = n2, t3;
|
|
49168
|
+
try {
|
|
49169
|
+
t3 = await e6.next();
|
|
49170
|
+
} catch (e7) {
|
|
49171
|
+
throw i(`generator body threw`, e7);
|
|
49172
|
+
}
|
|
49173
|
+
if (R(t3.value), !t3.done)
|
|
49174
|
+
try {
|
|
49175
|
+
await e6.return?.(undefined);
|
|
49176
|
+
} catch (e7) {
|
|
49177
|
+
throw i(`generator cleanup threw`, e7);
|
|
49178
|
+
}
|
|
49179
|
+
return t3.value;
|
|
49180
|
+
})();
|
|
49181
|
+
let r = n2, a2;
|
|
49182
|
+
try {
|
|
49183
|
+
a2 = r.next();
|
|
49184
|
+
} catch (e6) {
|
|
49185
|
+
throw i(`generator body threw`, e6);
|
|
49186
|
+
}
|
|
49187
|
+
if (R(a2.value), !a2.done)
|
|
49188
|
+
try {
|
|
49189
|
+
r.return?.(undefined);
|
|
49190
|
+
} catch (e6) {
|
|
49191
|
+
throw i(`generator cleanup threw`, e6);
|
|
49192
|
+
}
|
|
49193
|
+
return a2.value;
|
|
49194
|
+
};
|
|
49195
|
+
async function* V(e5) {
|
|
49196
|
+
return yield* await e5;
|
|
49197
|
+
}
|
|
49198
|
+
function H(e5) {
|
|
49199
|
+
return typeof e5 == `object` && !!e5 && `status` in e5 && (e5.status === `ok` || e5.status === `error`);
|
|
49200
|
+
}
|
|
49201
|
+
var U = (e5) => typeof e5 == `object` && !!e5 && (`then` in e5) && typeof e5.then == `function`;
|
|
49202
|
+
var W = (e5, t2) => w(e5, t2);
|
|
49203
|
+
var G = (e5, t2, n2) => U(e5) ? Promise.resolve(e5).catch((e6) => {
|
|
49204
|
+
throw i(t2, e6);
|
|
49205
|
+
}).then(n2) : n2(e5);
|
|
49206
|
+
var K = (e5, t2) => (`issues` in e5) && e5.issues ? d(t2(e5.issues)) : l(e5.value);
|
|
49207
|
+
var q = (e5, t2) => G(W(() => e5[`~standard`].validate(t2), `Result.codec serialize schema threw`), `Result.codec serialize schema threw`, (e6) => K(e6, (e7) => new C({ value: t2, issues: e7 })));
|
|
49208
|
+
var J = (e5, t2) => G(W(() => e5[`~standard`].validate(t2), `Result.codec deserialize schema threw`), `Result.codec deserialize schema threw`, (e6) => K(e6, (e7) => new S({ value: t2, issues: e7 })));
|
|
49209
|
+
var Y = (e5, t2) => U(e5) ? Promise.resolve(e5).then((e6) => e6.unwrap(t2)) : e5.unwrap(t2);
|
|
49210
|
+
var X = (e5) => {
|
|
49211
|
+
let t2 = (e6) => e6.status === `ok` ? l(e6.value) : S.is(e6.error) ? e6.unwrap(`Result.codec deserializeUnsafe failed`) : d(e6.error);
|
|
49212
|
+
return U(e5) ? Promise.resolve(e5).then(t2) : t2(e5);
|
|
49213
|
+
};
|
|
49214
|
+
var re = (e5) => {
|
|
49215
|
+
let t2 = (e6) => e6.status === `error` ? d(e6.error) : l({ status: `ok`, value: e6.value }), n2 = (e6) => e6.status === `error` ? d(e6.error) : l({ status: `error`, error: e6.value });
|
|
49216
|
+
function r(r2) {
|
|
49217
|
+
if (r2.status === `ok`) {
|
|
49218
|
+
let n3 = q(e5.serialize.ok, r2.value);
|
|
49219
|
+
return U(n3) ? Promise.resolve(n3).then(t2) : t2(n3);
|
|
49220
|
+
}
|
|
49221
|
+
let i3 = q(e5.serialize.err, r2.error);
|
|
49222
|
+
return U(i3) ? Promise.resolve(i3).then(n2) : n2(i3);
|
|
49223
|
+
}
|
|
49224
|
+
let i2 = (e6) => e6.status === `error` ? d(e6.error) : l(e6.value), a2 = (e6) => e6.status === `error` ? d(e6.error) : d(e6.value);
|
|
49225
|
+
function o2(t3) {
|
|
49226
|
+
if (!H(t3))
|
|
49227
|
+
return d(new S({ value: t3 }));
|
|
49228
|
+
if (t3.status === `ok`) {
|
|
49229
|
+
let n4 = J(e5.deserialize.ok, t3.value);
|
|
49230
|
+
return U(n4) ? Promise.resolve(n4).then(i2) : i2(n4);
|
|
49231
|
+
}
|
|
49232
|
+
let n3 = J(e5.deserialize.err, t3.error);
|
|
49233
|
+
return U(n3) ? Promise.resolve(n3).then(a2) : a2(n3);
|
|
49234
|
+
}
|
|
49235
|
+
function s2(e6) {
|
|
49236
|
+
return Y(r(e6), `Result.codec serializeUnsafe failed`);
|
|
49237
|
+
}
|
|
49238
|
+
function c2(e6) {
|
|
49239
|
+
return X(o2(e6));
|
|
49240
|
+
}
|
|
49241
|
+
return { serialize: r, serializeUnsafe: s2, deserialize: o2, deserializeUnsafe: c2 };
|
|
49242
|
+
};
|
|
49243
|
+
var Z = async (e5, t2) => {
|
|
49244
|
+
try {
|
|
49245
|
+
return await Promise.all(e5);
|
|
49246
|
+
} catch (e6) {
|
|
49247
|
+
return i(t2, e6);
|
|
49248
|
+
}
|
|
49249
|
+
};
|
|
49250
|
+
var Q = (e5) => {
|
|
49251
|
+
let t2 = [];
|
|
49252
|
+
for (let n2 of e5) {
|
|
49253
|
+
if (n2.status === `error`)
|
|
49254
|
+
return n2;
|
|
49255
|
+
t2.push(n2.value);
|
|
49256
|
+
}
|
|
49257
|
+
return l(t2);
|
|
49258
|
+
};
|
|
49259
|
+
var ie = async (e5) => Q(await Z(e5, `Result.allAsync input promise rejected`));
|
|
49260
|
+
var $ = (e5) => {
|
|
49261
|
+
let t2 = [], n2 = [];
|
|
49262
|
+
for (let r of e5)
|
|
49263
|
+
r.status === `ok` ? t2.push(r.value) : n2.push(r.error);
|
|
49264
|
+
return [t2, n2];
|
|
49265
|
+
};
|
|
49266
|
+
var ae = { ok: l, isOk: u, err: d, isError: f, try: T, tryPromise: E, map: D, mapError: O, tryRecover: k, andThen: A, tryRecoverAsync: ee, andThenAsync: te, match: ne, tap: j, tapAsync: M, tapError: N, tapErrorAsync: P, tapBoth: F, tapBothAsync: I, unwrap: L, unwrapOr: z, gen: B, await: V, codec: re, all: Q, allAsync: ie, partition: $, partitionAsync: async (e5) => $(await Z(e5, `Result.partitionAsync input promise rejected`)), flatten: (e5) => e5.status === `ok` ? e5.value : e5 };
|
|
49267
|
+
|
|
49268
|
+
// ../markup/dist/diagnostics.js
|
|
49269
|
+
var diagnosticsMessage = (diagnostics) => diagnostics.map((diagnostic) => diagnostic.message).join(`
|
|
48682
49270
|
`);
|
|
49271
|
+
var SmlParseError = class extends h("SmlParseError") {
|
|
49272
|
+
constructor(args2) {
|
|
49273
|
+
super({
|
|
49274
|
+
diagnostics: args2.diagnostics,
|
|
49275
|
+
message: diagnosticsMessage(args2.diagnostics)
|
|
49276
|
+
});
|
|
49277
|
+
}
|
|
49278
|
+
};
|
|
49279
|
+
var SmlCompileError = class extends h("SmlCompileError") {
|
|
49280
|
+
constructor(args2) {
|
|
49281
|
+
super({
|
|
49282
|
+
diagnostics: args2.diagnostics,
|
|
49283
|
+
message: diagnosticsMessage(args2.diagnostics)
|
|
49284
|
+
});
|
|
48683
49285
|
}
|
|
48684
49286
|
};
|
|
48685
49287
|
var buildLineMap = (source) => {
|
|
@@ -49198,7 +49800,7 @@ var parseThemeCss = (css) => {
|
|
|
49198
49800
|
end: Math.min(1, length)
|
|
49199
49801
|
});
|
|
49200
49802
|
if (diagnostics.length > 0)
|
|
49201
|
-
return
|
|
49803
|
+
return ae.err(diagnostics);
|
|
49202
49804
|
const nonEmpty = (entries3) => Object.keys(entries3).length > 0 ? entries3 : undefined;
|
|
49203
49805
|
const colors2 = nonEmpty(accumulator.colors);
|
|
49204
49806
|
const colorsDark = nonEmpty(accumulator.colorsDark);
|
|
@@ -49209,7 +49811,7 @@ var parseThemeCss = (css) => {
|
|
|
49209
49811
|
const fontFamilies = nonEmpty(accumulator.fontFamilies);
|
|
49210
49812
|
const containerPx = nonEmpty(accumulator.containerPx);
|
|
49211
49813
|
const tracking = nonEmpty(accumulator.tracking);
|
|
49212
|
-
return
|
|
49814
|
+
return ae.ok({
|
|
49213
49815
|
colors: colors2,
|
|
49214
49816
|
colorsDark,
|
|
49215
49817
|
spacingPx: accumulator.spacingPx,
|
|
@@ -49362,7 +49964,7 @@ var pull = make42("pull", {
|
|
|
49362
49964
|
command: "samva email design pull --file emails/theme.css",
|
|
49363
49965
|
description: "Write the org theme to a specific path"
|
|
49364
49966
|
}
|
|
49365
|
-
]), withHandler(({ file: file4, dryRun, json: json2 }) =>
|
|
49967
|
+
]), withHandler(({ file: file4, dryRun, json: json2 }) => gen3(function* () {
|
|
49366
49968
|
const target = resolve4(file4);
|
|
49367
49969
|
if (dryRun)
|
|
49368
49970
|
return yield* json2 ? printJson({ dryRun: true, action: "theme.pull", file: target }) : log2(`[dry-run] Would write the org theme to ${target}.`);
|
|
@@ -49382,7 +49984,7 @@ var pull = make42("pull", {
|
|
|
49382
49984
|
}
|
|
49383
49985
|
const css = printThemeCss(fromServerTheme(theme));
|
|
49384
49986
|
const fs = yield* FileSystem;
|
|
49385
|
-
yield* fs.makeDirectory(dirname2(target), { recursive: true }).pipe(
|
|
49987
|
+
yield* fs.makeDirectory(dirname2(target), { recursive: true }).pipe(andThen3(fs.writeFileString(target, css)), mapError3((cause) => new SamvaCliError({ message: `Could not write ${target}: ${String(cause)}` })));
|
|
49386
49988
|
if (json2) {
|
|
49387
49989
|
return yield* printJson({
|
|
49388
49990
|
action: "design.pull",
|
|
@@ -49408,15 +50010,15 @@ var push = make42("push", {
|
|
|
49408
50010
|
command: "samva email design push --dry-run",
|
|
49409
50011
|
description: "Preview without updating the org theme (may read current tokens)"
|
|
49410
50012
|
}
|
|
49411
|
-
]), withHandler(({ file: file4, dryRun, json: json2 }) =>
|
|
50013
|
+
]), withHandler(({ file: file4, dryRun, json: json2 }) => gen3(function* () {
|
|
49412
50014
|
const target = resolve4(file4);
|
|
49413
50015
|
const fs = yield* FileSystem;
|
|
49414
50016
|
const css = yield* fs.readFileString(target).pipe(mapError3(() => new SamvaCliError({
|
|
49415
50017
|
message: `Could not read ${target}. Run \`samva email design pull\` first, or point --file at your @theme CSS.`
|
|
49416
50018
|
})));
|
|
49417
50019
|
const parsed = parseThemeCss(css);
|
|
49418
|
-
if (
|
|
49419
|
-
const diagnostics = parsed.
|
|
50020
|
+
if (ae.isError(parsed)) {
|
|
50021
|
+
const diagnostics = parsed.error;
|
|
49420
50022
|
if (json2) {
|
|
49421
50023
|
yield* printJson({
|
|
49422
50024
|
action: "theme.push",
|
|
@@ -49441,11 +50043,11 @@ var push = make42("push", {
|
|
|
49441
50043
|
}
|
|
49442
50044
|
const client = yield* getClientProvider;
|
|
49443
50045
|
const current = yield* get15().pipe(client.provide, mapError3((error2) => new SamvaCliError({ message: formatApiError("Could not read design", error2) })));
|
|
49444
|
-
const { fontFamilies, notices } = buildPushFontFamilies(parsed.
|
|
50046
|
+
const { fontFamilies, notices } = buildPushFontFamilies(parsed.value.fontFamilies, current.design?.theme?.fontFamilies ?? undefined);
|
|
49445
50047
|
for (const notice of notices) {
|
|
49446
50048
|
yield* logWarning(notice);
|
|
49447
50049
|
}
|
|
49448
|
-
const theme = toServerTheme(parsed.
|
|
50050
|
+
const theme = toServerTheme(parsed.value, fontFamilies);
|
|
49449
50051
|
const design = { ...current.design, theme };
|
|
49450
50052
|
if (dryRun) {
|
|
49451
50053
|
if (json2) {
|
|
@@ -49533,7 +50135,7 @@ var domainVerificationReadback = getClientProvider.pipe(flatMap5((client) => lis
|
|
|
49533
50135
|
status: "failed",
|
|
49534
50136
|
detail: detailFromError(error2)
|
|
49535
50137
|
})));
|
|
49536
|
-
var doctorCommand = make42("doctor", { json: jsonFlag }).pipe(withDescription3("Read local configuration and remote email state"), withExamples([{ command: "samva email doctor --json" }]), withHandler(({ json: json2 }) =>
|
|
50138
|
+
var doctorCommand = make42("doctor", { json: jsonFlag }).pipe(withDescription3("Read local configuration and remote email state"), withExamples([{ command: "samva email doctor --json" }]), withHandler(({ json: json2 }) => gen3(function* () {
|
|
49537
50139
|
const context3 = yield* resolveExecutionContext;
|
|
49538
50140
|
const authSource = context3.apiKey ? "SAMVA_API_KEY" : context3.credentials ? "stored OAuth credential" : "none";
|
|
49539
50141
|
const checks = yield* all4([
|
|
@@ -49588,7 +50190,7 @@ var list11 = make42("list", {
|
|
|
49588
50190
|
}).pipe(withDescription3("List email sending domains"), withExamples([
|
|
49589
50191
|
{ command: "samva email domains list" },
|
|
49590
50192
|
{ command: "samva email domains list --json" }
|
|
49591
|
-
]), withHandler(({ page, limit, all: all5, json: json2 }) =>
|
|
50193
|
+
]), withHandler(({ page, limit, all: all5, json: json2 }) => gen3(function* () {
|
|
49592
50194
|
if (all5 && !isJsonLinesRequested())
|
|
49593
50195
|
return yield* new CliUsageError({
|
|
49594
50196
|
code: "all_requires_jsonl",
|
|
@@ -49642,7 +50244,7 @@ var add4 = make42("add", {
|
|
|
49642
50244
|
command: "samva email domains add --domain example.com",
|
|
49643
50245
|
description: "Apply domain add"
|
|
49644
50246
|
}
|
|
49645
|
-
]), withHandler(({ domain, dryRun, json: json2 }) =>
|
|
50247
|
+
]), withHandler(({ domain, dryRun, json: json2 }) => gen3(function* () {
|
|
49646
50248
|
if (dryRun) {
|
|
49647
50249
|
if (json2)
|
|
49648
50250
|
return yield* printJson({ dryRun: true, action: "email.domains.add", domain });
|
|
@@ -49655,9 +50257,9 @@ var add4 = make42("add", {
|
|
|
49655
50257
|
if (!conflict) {
|
|
49656
50258
|
return fail6(new SamvaCliError({ message: formatApiError("Could not add domain", error2) }));
|
|
49657
50259
|
}
|
|
49658
|
-
const findExisting =
|
|
50260
|
+
const findExisting = gen3(function* () {
|
|
49659
50261
|
if (typeof conflict.id === "string" && conflict.id.length > 0) {
|
|
49660
|
-
const fetched = yield* getDomainById({ id: conflict.id }).pipe(client.provide, catchTag3("ResourceNotFoundError", () =>
|
|
50262
|
+
const fetched = yield* getDomainById({ id: conflict.id }).pipe(client.provide, catchTag3("ResourceNotFoundError", () => void_4), mapError3((lookupError) => new SamvaCliError({
|
|
49661
50263
|
message: formatApiError("Domain already exists but could not fetch it by id", lookupError)
|
|
49662
50264
|
})));
|
|
49663
50265
|
if (fetched)
|
|
@@ -49680,7 +50282,7 @@ var add4 = make42("add", {
|
|
|
49680
50282
|
message: formatApiError("Could not add domain", error2)
|
|
49681
50283
|
});
|
|
49682
50284
|
});
|
|
49683
|
-
return
|
|
50285
|
+
return gen3(function* () {
|
|
49684
50286
|
const existing = yield* findExisting;
|
|
49685
50287
|
if (json2)
|
|
49686
50288
|
yield* printJson({ ...existing, idempotent: true });
|
|
@@ -49688,7 +50290,7 @@ var add4 = make42("add", {
|
|
|
49688
50290
|
yield* logWarning(`Domain "${existing.domain}" already exists (phase: ${existing.phase}).`);
|
|
49689
50291
|
});
|
|
49690
50292
|
},
|
|
49691
|
-
onSuccess: (data) =>
|
|
50293
|
+
onSuccess: (data) => gen3(function* () {
|
|
49692
50294
|
if (json2)
|
|
49693
50295
|
return yield* printJson(data);
|
|
49694
50296
|
yield* logInfo(`Domain "${data.domain}" staged (phase: ${data.phase}). Add these DNS records:
|
|
@@ -49715,7 +50317,7 @@ var check3 = make42("check", {
|
|
|
49715
50317
|
command: "samva email domains check dom_abc123",
|
|
49716
50318
|
description: "Poll domain verification"
|
|
49717
50319
|
}
|
|
49718
|
-
]), withHandler(({ id: id2, json: json2 }) =>
|
|
50320
|
+
]), withHandler(({ id: id2, json: json2 }) => gen3(function* () {
|
|
49719
50321
|
const client = yield* getClientProvider;
|
|
49720
50322
|
const data = yield* advanceDomainVerification({ id: id2 }).pipe(client.provide, mapError3((error2) => new SamvaCliError({ message: formatApiError("Could not check domain", error2) })));
|
|
49721
50323
|
if (json2)
|
|
@@ -49725,9 +50327,77 @@ var check3 = make42("check", {
|
|
|
49725
50327
|
["Phase", data.phase],
|
|
49726
50328
|
["Last checked", data.checkedAt],
|
|
49727
50329
|
["Next check", data.nextCheckAt],
|
|
49728
|
-
["Failure", data.failure?.message]
|
|
50330
|
+
["Failure", data.failure?.message],
|
|
50331
|
+
["Health reason", data.health.reason],
|
|
50332
|
+
["Action owner", data.health.actionOwner],
|
|
50333
|
+
["Action", data.health.action],
|
|
50334
|
+
["Freshness", data.health.freshness],
|
|
50335
|
+
["Observed", data.health.observedAt],
|
|
50336
|
+
["Stale at", data.health.staleAt],
|
|
50337
|
+
["Next retry", data.health.nextRetryAt],
|
|
50338
|
+
["Sending", data.sending.status],
|
|
50339
|
+
["Sending reason", data.sending.reason],
|
|
50340
|
+
["Sending action owner", data.sending.actionOwner],
|
|
50341
|
+
["Sending action", data.sending.action],
|
|
50342
|
+
["Sending freshness", data.sending.freshness],
|
|
50343
|
+
["DMARC", data.dmarc.status],
|
|
50344
|
+
["DMARC policy", data.dmarc.effectivePolicy],
|
|
50345
|
+
["DMARC guidance", data.dmarc.guidance],
|
|
50346
|
+
["Rotation", data.rotation?.phase],
|
|
50347
|
+
["Rotation selector", data.rotation?.selector]
|
|
49729
50348
|
]);
|
|
49730
50349
|
}).pipe(json2 ? provideService2(MinimumLogLevel2, "None") : identity)));
|
|
50350
|
+
var rotateDkim = make42("rotate-dkim", {
|
|
50351
|
+
id: string6("id").pipe(withDescription4("Organization-owned domain id")),
|
|
50352
|
+
idempotencyKey: string5("idempotency-key").pipe(withDescription2("Stable key for this rotation; reuse the same key when retrying")),
|
|
50353
|
+
dryRun: boolean4("dry-run").pipe(withDescription2("Preview staging without calling the API"), withDefault3(false)),
|
|
50354
|
+
json: jsonFlag
|
|
50355
|
+
}).pipe(withDescription3("Stage a new DKIM selector for DNS publication; retain the former record"), withExamples([
|
|
50356
|
+
{
|
|
50357
|
+
command: "samva email domains rotate-dkim dom_abc123 --idempotency-key rotation-2026-09 --dry-run"
|
|
50358
|
+
},
|
|
50359
|
+
{
|
|
50360
|
+
command: "samva email domains rotate-dkim dom_abc123 --idempotency-key rotation-2026-09 --json"
|
|
50361
|
+
}
|
|
50362
|
+
]), withHandler(fnUntraced2(function* ({ id: id2, idempotencyKey, dryRun, json: json2 }) {
|
|
50363
|
+
if (idempotencyKey.length < 1 || idempotencyKey.length > 255) {
|
|
50364
|
+
return yield* new CliUsageError({
|
|
50365
|
+
code: "invalid_idempotency_key",
|
|
50366
|
+
message: "--idempotency-key must contain between 1 and 255 characters. Example: samva email domains rotate-dkim dom_abc123 --idempotency-key rotation-2026-09"
|
|
50367
|
+
});
|
|
50368
|
+
}
|
|
50369
|
+
if (dryRun) {
|
|
50370
|
+
return yield* json2 ? printJson({ dryRun: true, action: "email.domains.rotate-dkim", id: id2, idempotencyKey }) : log2(`[dry-run] Would stage a new DKIM selector for ${id2}. The former DNS record must remain published.`);
|
|
50371
|
+
}
|
|
50372
|
+
const client = yield* getClientProvider;
|
|
50373
|
+
const data = yield* rotateDomainDkim({ id: id2, idempotencyKey }).pipe(client.provide, mapError3((error2) => new SamvaCliError({
|
|
50374
|
+
message: formatApiError("Could not stage DKIM rotation", error2)
|
|
50375
|
+
})));
|
|
50376
|
+
if (json2)
|
|
50377
|
+
return yield* printJson(data);
|
|
50378
|
+
yield* printFields([
|
|
50379
|
+
["Rotation", data.id],
|
|
50380
|
+
["Domain ID", data.domainId],
|
|
50381
|
+
["Phase", data.phase],
|
|
50382
|
+
["Selector", data.selector]
|
|
50383
|
+
]);
|
|
50384
|
+
yield* log2("Publish this DKIM DNS record:");
|
|
50385
|
+
yield* printFields([
|
|
50386
|
+
["Type", data.record.type],
|
|
50387
|
+
["Name", data.record.name],
|
|
50388
|
+
["Value", data.record.value],
|
|
50389
|
+
["TTL", data.record.ttl]
|
|
50390
|
+
]);
|
|
50391
|
+
yield* log2("Keep this former DKIM DNS record published:");
|
|
50392
|
+
yield* printFields([
|
|
50393
|
+
["Type", data.formerRecord.type],
|
|
50394
|
+
["Name", data.formerRecord.name],
|
|
50395
|
+
["Value", data.formerRecord.value],
|
|
50396
|
+
["Minimum retain until", data.minimumRetainUntil]
|
|
50397
|
+
]);
|
|
50398
|
+
yield* log2("The minimum retention date does not authorize deletion. Retirement requires separate approval and verification that at least two actual former-record TTLs have elapsed.");
|
|
50399
|
+
yield* log2(`After DNS publication, advance verification: samva email domains check ${id2}`);
|
|
50400
|
+
})));
|
|
49731
50401
|
var remove16 = make42("remove", {
|
|
49732
50402
|
id: string6("id").pipe(withDescription4("Domain id to permanently remove")),
|
|
49733
50403
|
dryRun: boolean4("dry-run").pipe(withDescription2("Print the deletion plan without calling the API"), withDefault3(false)),
|
|
@@ -49736,7 +50406,7 @@ var remove16 = make42("remove", {
|
|
|
49736
50406
|
}).pipe(withDescription3("Permanently remove an email sending domain"), withExamples([
|
|
49737
50407
|
{ command: "samva email domains remove dom_abc123 --dry-run" },
|
|
49738
50408
|
{ command: "samva email domains remove dom_abc123 --yes" }
|
|
49739
|
-
]), withHandler(({ id: id2, dryRun, yes, json: json2 }) =>
|
|
50409
|
+
]), withHandler(({ id: id2, dryRun, yes, json: json2 }) => gen3(function* () {
|
|
49740
50410
|
if (dryRun)
|
|
49741
50411
|
return yield* json2 ? printJson({ dryRun: true, action: "email.domains.remove", id: id2 }) : log2(`[dry-run] Would permanently remove domain ${id2}.`);
|
|
49742
50412
|
yield* confirmDestructive({
|
|
@@ -49751,7 +50421,7 @@ var remove16 = make42("remove", {
|
|
|
49751
50421
|
return yield* printJson(data);
|
|
49752
50422
|
yield* log2(`Removed domain ${id2}.`);
|
|
49753
50423
|
}).pipe(json2 ? provideService2(MinimumLogLevel2, "None") : identity)));
|
|
49754
|
-
var printCustomTracking = (data) =>
|
|
50424
|
+
var printCustomTracking = (data) => gen3(function* () {
|
|
49755
50425
|
if (!data.enabled || data.customTracking === null) {
|
|
49756
50426
|
return yield* log2("Custom tracking is not enabled for this domain.");
|
|
49757
50427
|
}
|
|
@@ -49784,7 +50454,7 @@ var customEnable = make42("enable", {
|
|
|
49784
50454
|
}).pipe(withDescription3("Enable a custom tracking domain"), withExamples([
|
|
49785
50455
|
{ command: "samva email domains custom-tracking enable dom_abc123" },
|
|
49786
50456
|
{ command: "samva email domains custom-tracking enable dom_abc123 --label links" }
|
|
49787
|
-
]), withHandler(({ id: id2, label, dryRun, json: json2 }) =>
|
|
50457
|
+
]), withHandler(({ id: id2, label, dryRun, json: json2 }) => gen3(function* () {
|
|
49788
50458
|
const chosenLabel = getOrUndefined(label);
|
|
49789
50459
|
if (dryRun) {
|
|
49790
50460
|
return yield* json2 ? printJson({
|
|
@@ -49808,7 +50478,7 @@ var customEnable = make42("enable", {
|
|
|
49808
50478
|
var customStatus = make42("status", {
|
|
49809
50479
|
id: string6("id").pipe(withDescription4("Domain id to inspect")),
|
|
49810
50480
|
json: jsonFlag
|
|
49811
|
-
}).pipe(withDescription3("Show a domain's custom tracking status"), withExamples([{ command: "samva email domains custom-tracking status dom_abc123" }]), withHandler(({ id: id2, json: json2 }) =>
|
|
50481
|
+
}).pipe(withDescription3("Show a domain's custom tracking status"), withExamples([{ command: "samva email domains custom-tracking status dom_abc123" }]), withHandler(({ id: id2, json: json2 }) => gen3(function* () {
|
|
49812
50482
|
const client = yield* getClientProvider;
|
|
49813
50483
|
const data = yield* getCustomTracking({ id: id2 }).pipe(client.provide, mapError3((error2) => new SamvaCliError({
|
|
49814
50484
|
message: formatApiError("Could not get custom tracking status", error2)
|
|
@@ -49825,7 +50495,7 @@ var customDisable = make42("disable", {
|
|
|
49825
50495
|
}).pipe(withDescription3("Disable and tear down a custom tracking domain"), withExamples([
|
|
49826
50496
|
{ command: "samva email domains custom-tracking disable dom_abc123 --dry-run" },
|
|
49827
50497
|
{ command: "samva email domains custom-tracking disable dom_abc123 --yes" }
|
|
49828
|
-
]), withHandler(({ id: id2, dryRun, yes, json: json2 }) =>
|
|
50498
|
+
]), withHandler(({ id: id2, dryRun, yes, json: json2 }) => gen3(function* () {
|
|
49829
50499
|
if (dryRun) {
|
|
49830
50500
|
return yield* json2 ? printJson({ dryRun: true, action: "email.domains.custom-tracking.disable", id: id2 }) : log2(`[dry-run] Would disable custom tracking for ${id2}.`);
|
|
49831
50501
|
}
|
|
@@ -49846,13 +50516,13 @@ var customDisable = make42("disable", {
|
|
|
49846
50516
|
var customTracking = make42("custom-tracking").pipe(withDescription3("Manage a domain's custom tracking (custom open/click subdomain)"), withExamples([{ command: "samva email domains custom-tracking enable dom_abc123" }]), withSubcommands([customEnable, customStatus, customDisable]));
|
|
49847
50517
|
var domainsCommand = make42("domains").pipe(withDescription3("Manage email sending domains"), withExamples([
|
|
49848
50518
|
{ command: "samva email domains list", description: "List configured domains" }
|
|
49849
|
-
]), withSubcommands([list11, add4, check3, remove16, customTracking]));
|
|
50519
|
+
]), withSubcommands([list11, add4, check3, rotateDkim, remove16, customTracking]));
|
|
49850
50520
|
|
|
49851
50521
|
// src/commands/email/receiving.ts
|
|
49852
50522
|
var status2 = make42("status", {
|
|
49853
50523
|
domainId: string6("domain-id").pipe(withDescription4("Sending domain id")),
|
|
49854
50524
|
json: jsonFlag
|
|
49855
|
-
}).pipe(withDescription3("Get a domain's receiving prerequisite status"), withExamples([{ command: "samva email receiving status dom_abc123 --json" }]), withHandler(({ domainId, json: json2 }) =>
|
|
50525
|
+
}).pipe(withDescription3("Get a domain's receiving prerequisite status"), withExamples([{ command: "samva email receiving status dom_abc123 --json" }]), withHandler(({ domainId, json: json2 }) => gen3(function* () {
|
|
49856
50526
|
const client = yield* getClientProvider;
|
|
49857
50527
|
const data = yield* getDomainVerification({ id: domainId }).pipe(client.provide, mapError3((error2) => new SamvaCliError({
|
|
49858
50528
|
message: formatApiError("Could not get receiving status", error2)
|
|
@@ -49878,7 +50548,7 @@ var enable = make42("enable", {
|
|
|
49878
50548
|
{
|
|
49879
50549
|
command: "samva email receiving enable dom_abc123 --domain example.com --address replies@example.com"
|
|
49880
50550
|
}
|
|
49881
|
-
]), withHandler(({ domainId, domain, address, catchAll, dryRun, json: json2 }) =>
|
|
50551
|
+
]), withHandler(({ domainId, domain, address, catchAll, dryRun, json: json2 }) => gen3(function* () {
|
|
49882
50552
|
const request3 = { domain, catchAll, addresses: [...address] };
|
|
49883
50553
|
if (dryRun)
|
|
49884
50554
|
return yield* json2 ? printJson({ dryRun: true, action: "email.receiving.enable", domainId, request: request3 }) : log2(`[dry-run] Would enable receiving for ${domain} (${address.join(", ")}).`);
|
|
@@ -49896,7 +50566,7 @@ var receivingCommand = make42("receiving").pipe(withDescription3("Configure inbo
|
|
|
49896
50566
|
// src/lib/stdin.ts
|
|
49897
50567
|
import { readFile as readFile3 } from "fs/promises";
|
|
49898
50568
|
import { isatty as isatty2 } from "tty";
|
|
49899
|
-
var readStdinUtf8 =
|
|
50569
|
+
var readStdinUtf8 = gen3(function* () {
|
|
49900
50570
|
if (isatty2(0)) {
|
|
49901
50571
|
return yield* new SamvaCliError({
|
|
49902
50572
|
message: "Expected piped stdin for `-`; redirect input (e.g. `echo \u2026 | samva \u2026`) or pass the body inline instead of `-`."
|
|
@@ -49981,11 +50651,11 @@ var durationFromFlag = (raw3) => {
|
|
|
49981
50651
|
});
|
|
49982
50652
|
};
|
|
49983
50653
|
var getMessage = (id2) => getClientProvider.pipe(flatMap5((client) => get16({ id: id2 }).pipe(client.provide, mapError3((error2) => new SamvaCliError({ message: formatApiError("Could not get message", error2) })))));
|
|
49984
|
-
var waitForMessage = (initial, timeout4) =>
|
|
50654
|
+
var waitForMessage = (initial, timeout4) => gen3(function* () {
|
|
49985
50655
|
let latest = initial;
|
|
49986
50656
|
if (classifyMessageLifecycle(latest) !== "pending")
|
|
49987
50657
|
return latest;
|
|
49988
|
-
const poll2 =
|
|
50658
|
+
const poll2 = gen3(function* () {
|
|
49989
50659
|
latest = yield* getMessage(initial.id);
|
|
49990
50660
|
if (classifyMessageLifecycle(latest) === "pending") {
|
|
49991
50661
|
return yield* new MessageStillPending({
|
|
@@ -50000,7 +50670,7 @@ var waitForMessage = (initial, timeout4) => gen4(function* () {
|
|
|
50000
50670
|
const result4 = yield* poll2.pipe(timeoutOption2(timeout4), catch_3((error2) => messageLifecycleError("message_observation_failed", formatApiError(`Could not continue observing message ${latest.id}`, error2), projectMessage(latest))));
|
|
50001
50671
|
return getOrElse(result4, () => latest);
|
|
50002
50672
|
});
|
|
50003
|
-
var lifecycleResult = (message, timeout4) =>
|
|
50673
|
+
var lifecycleResult = (message, timeout4) => gen3(function* () {
|
|
50004
50674
|
const result4 = yield* waitForMessage(message, timeout4);
|
|
50005
50675
|
const resultTerminal = classifyMessageLifecycle(result4);
|
|
50006
50676
|
return { message: result4, resultTerminal, timedOut: resultTerminal === "pending" };
|
|
@@ -50044,7 +50714,7 @@ var list12 = make42("list", {
|
|
|
50044
50714
|
endDate,
|
|
50045
50715
|
all: all5,
|
|
50046
50716
|
json: json2
|
|
50047
|
-
}) =>
|
|
50717
|
+
}) => gen3(function* () {
|
|
50048
50718
|
if (all5 && !isJsonLinesRequested()) {
|
|
50049
50719
|
return yield* new CliUsageError({
|
|
50050
50720
|
code: "all_requires_jsonl",
|
|
@@ -50099,7 +50769,7 @@ var list12 = make42("list", {
|
|
|
50099
50769
|
]);
|
|
50100
50770
|
}).pipe(json2 ? provideService2(MinimumLogLevel2, "None") : identity)));
|
|
50101
50771
|
var get22 = make42("get", { id: string6("id"), json: jsonFlag }).pipe(withDescription3("Get a message"), withExamples([{ command: "samva messages get msg_abc123 --json" }]), withHandler(({ id: id2, json: json2 }) => getMessage(id2).pipe(flatMap5((message) => json2 ? printJson(projectMessage(message)) : printMessage(projectMessage(message))), (effect2) => json2 ? effect2.pipe(provideService2(MinimumLogLevel2, "None")) : effect2)));
|
|
50102
|
-
var events = make42("events", { id: string6("id"), json: jsonFlag }).pipe(withDescription3("List lifecycle events for a message"), withExamples([{ command: "samva messages events msg_abc123 --json" }]), withHandler(({ id: id2, json: json2 }) =>
|
|
50772
|
+
var events = make42("events", { id: string6("id"), json: jsonFlag }).pipe(withDescription3("List lifecycle events for a message"), withExamples([{ command: "samva messages events msg_abc123 --json" }]), withHandler(({ id: id2, json: json2 }) => gen3(function* () {
|
|
50103
50773
|
const client = yield* getClientProvider;
|
|
50104
50774
|
const data = yield* getEvents({ id: id2 }).pipe(client.provide, mapError3((error2) => new SamvaCliError({
|
|
50105
50775
|
message: formatApiError("Could not list message events", error2)
|
|
@@ -50120,7 +50790,7 @@ var wait = make42("wait", {
|
|
|
50120
50790
|
}).pipe(withDescription3("Wait for a message to be delivered or read"), withExamples([
|
|
50121
50791
|
{ command: "samva messages wait msg_abc123" },
|
|
50122
50792
|
{ command: "samva messages wait msg_abc123 --timeout 30s --json" }
|
|
50123
|
-
]), withHandler(({ id: id2, timeout: timeout4, json: json2 }) =>
|
|
50793
|
+
]), withHandler(({ id: id2, timeout: timeout4, json: json2 }) => gen3(function* () {
|
|
50124
50794
|
const duration2 = yield* durationFromFlag(getOrElse(timeout4, () => DEFAULT_TIMEOUT));
|
|
50125
50795
|
const initial = yield* getMessage(id2);
|
|
50126
50796
|
const result4 = yield* lifecycleResult(initial, duration2);
|
|
@@ -50236,7 +50906,7 @@ var send2 = make42("send", {
|
|
|
50236
50906
|
wait: wait2,
|
|
50237
50907
|
timeout: timeout4,
|
|
50238
50908
|
json: json2
|
|
50239
|
-
}) =>
|
|
50909
|
+
}) => gen3(function* () {
|
|
50240
50910
|
const subjectValue = getOrUndefined(subject);
|
|
50241
50911
|
const htmlValue = getOrUndefined(html);
|
|
50242
50912
|
const textValue = getOrUndefined(text3);
|
|
@@ -50412,7 +51082,7 @@ var list13 = make42("list", {
|
|
|
50412
51082
|
}).pipe(withDescription3("List verified sender addresses"), withExamples([
|
|
50413
51083
|
{ command: "samva email senders list" },
|
|
50414
51084
|
{ command: "samva email senders list --json" }
|
|
50415
|
-
]), withHandler(({ page, limit, all: all5, json: json2 }) =>
|
|
51085
|
+
]), withHandler(({ page, limit, all: all5, json: json2 }) => gen3(function* () {
|
|
50416
51086
|
if (all5 && !isJsonLinesRequested())
|
|
50417
51087
|
return yield* new CliUsageError({
|
|
50418
51088
|
code: "all_requires_jsonl",
|
|
@@ -50470,7 +51140,7 @@ var add5 = make42("add", {
|
|
|
50470
51140
|
command: "samva email senders add --email hello@example.com",
|
|
50471
51141
|
description: "Apply sender add"
|
|
50472
51142
|
}
|
|
50473
|
-
]), withHandler(({ email, name, dryRun, json: json2 }) =>
|
|
51143
|
+
]), withHandler(({ email, name, dryRun, json: json2 }) => gen3(function* () {
|
|
50474
51144
|
const nameValue = getOrUndefined(name);
|
|
50475
51145
|
if (dryRun) {
|
|
50476
51146
|
if (json2)
|
|
@@ -50492,7 +51162,7 @@ var add5 = make42("add", {
|
|
|
50492
51162
|
if (!conflict) {
|
|
50493
51163
|
return fail6(new SamvaCliError({ message: formatApiError("Could not add sender", error2) }));
|
|
50494
51164
|
}
|
|
50495
|
-
return
|
|
51165
|
+
return gen3(function* () {
|
|
50496
51166
|
let page = 1;
|
|
50497
51167
|
while (true) {
|
|
50498
51168
|
const listed = yield* listSenders({
|
|
@@ -50526,7 +51196,7 @@ Sender already exists.`);
|
|
|
50526
51196
|
});
|
|
50527
51197
|
});
|
|
50528
51198
|
},
|
|
50529
|
-
onSuccess: (data) =>
|
|
51199
|
+
onSuccess: (data) => gen3(function* () {
|
|
50530
51200
|
if (json2)
|
|
50531
51201
|
return yield* printJson(data);
|
|
50532
51202
|
yield* printFields([
|
|
@@ -50548,7 +51218,7 @@ var check4 = make42("check", {
|
|
|
50548
51218
|
command: "samva email senders check snd_abc123",
|
|
50549
51219
|
description: "Poll sender verification"
|
|
50550
51220
|
}
|
|
50551
|
-
]), withHandler(({ id: id2, json: json2 }) =>
|
|
51221
|
+
]), withHandler(({ id: id2, json: json2 }) => gen3(function* () {
|
|
50552
51222
|
const client = yield* getClientProvider;
|
|
50553
51223
|
const data = yield* checkSenderVerification({ id: id2 }).pipe(client.provide, mapError3((error2) => new SamvaCliError({ message: formatApiError("Could not check sender", error2) })));
|
|
50554
51224
|
if (json2)
|
|
@@ -50567,7 +51237,7 @@ var remove17 = make42("remove", {
|
|
|
50567
51237
|
}).pipe(withDescription3("Permanently remove a sender identity"), withExamples([
|
|
50568
51238
|
{ command: "samva email senders remove snd_abc123 --dry-run" },
|
|
50569
51239
|
{ command: "samva email senders remove snd_abc123 --yes" }
|
|
50570
|
-
]), withHandler(({ id: id2, dryRun, yes, json: json2 }) =>
|
|
51240
|
+
]), withHandler(({ id: id2, dryRun, yes, json: json2 }) => gen3(function* () {
|
|
50571
51241
|
if (dryRun)
|
|
50572
51242
|
return yield* json2 ? printJson({ dryRun: true, action: "email.senders.remove", id: id2 }) : log2(`[dry-run] Would permanently remove sender ${id2}.`);
|
|
50573
51243
|
yield* confirmDestructive({
|
|
@@ -50592,7 +51262,7 @@ var validateRecipientEmail = (email) => decodeEffect2(TrackingRecipientEmail)(em
|
|
|
50592
51262
|
code: "invalid_recipient_email",
|
|
50593
51263
|
message: "Recipient must be a valid email address."
|
|
50594
51264
|
})));
|
|
50595
|
-
var defaultsGet = make42("get", { json: jsonFlag }).pipe(withDescription3("Get organization email tracking defaults"), withExamples([{ command: "samva email tracking defaults get --json" }]), withHandler(({ json: json2 }) =>
|
|
51265
|
+
var defaultsGet = make42("get", { json: jsonFlag }).pipe(withDescription3("Get organization email tracking defaults"), withExamples([{ command: "samva email tracking defaults get --json" }]), withHandler(({ json: json2 }) => gen3(function* () {
|
|
50596
51266
|
const client = yield* getClientProvider;
|
|
50597
51267
|
const data = yield* getTrackingDefaults().pipe(client.provide, mapError3((error2) => new SamvaCliError({
|
|
50598
51268
|
message: formatApiError("Could not get email tracking defaults", error2)
|
|
@@ -50612,7 +51282,7 @@ var defaultsSet = make42("set", {
|
|
|
50612
51282
|
}).pipe(withDescription3("Update one or both organization email tracking defaults"), withExamples([
|
|
50613
51283
|
{ command: "samva email tracking defaults set --opens off --dry-run" },
|
|
50614
51284
|
{ command: "samva email tracking defaults set --opens on --clicks off" }
|
|
50615
|
-
]), withHandler(({ opens, clicks, dryRun, json: json2 }) =>
|
|
51285
|
+
]), withHandler(({ opens, clicks, dryRun, json: json2 }) => gen3(function* () {
|
|
50616
51286
|
const opensValue = getOrUndefined(opens);
|
|
50617
51287
|
const clicksValue = getOrUndefined(clicks);
|
|
50618
51288
|
if (opensValue === undefined && clicksValue === undefined) {
|
|
@@ -50650,7 +51320,7 @@ var recipientGet = make42("get", {
|
|
|
50650
51320
|
json: jsonFlag
|
|
50651
51321
|
}).pipe(withDescription3("Get a recipient's email tracking preference"), withExamples([
|
|
50652
51322
|
{ command: "samva email tracking recipient get person@example.com --json" }
|
|
50653
|
-
]), withHandler(({ email, json: json2 }) =>
|
|
51323
|
+
]), withHandler(({ email, json: json2 }) => gen3(function* () {
|
|
50654
51324
|
const validatedEmail = yield* validateRecipientEmail(email);
|
|
50655
51325
|
const client = yield* getClientProvider;
|
|
50656
51326
|
const data = yield* getRecipientTrackingPreference({ email: validatedEmail }).pipe(client.provide, mapError3((error2) => new SamvaCliError({
|
|
@@ -50675,7 +51345,7 @@ var recipientSet = make42("set", {
|
|
|
50675
51345
|
command: "samva email tracking recipient set person@example.com --state opted-out --dry-run"
|
|
50676
51346
|
},
|
|
50677
51347
|
{ command: "samva email tracking recipient set person@example.com --state opted-in" }
|
|
50678
|
-
]), withHandler(({ email, state, dryRun, json: json2 }) =>
|
|
51348
|
+
]), withHandler(({ email, state, dryRun, json: json2 }) => gen3(function* () {
|
|
50679
51349
|
const validatedEmail = yield* validateRecipientEmail(email);
|
|
50680
51350
|
const request3 = { email: validatedEmail, optedOut: state === "opted-out" };
|
|
50681
51351
|
if (dryRun) {
|
|
@@ -50731,7 +51401,7 @@ var parseJson2 = (body, context3) => try_3({
|
|
|
50731
51401
|
try: () => JSON.parse(body),
|
|
50732
51402
|
catch: () => new SamvaCliError({ message: `Unexpected response from ${context3}.` })
|
|
50733
51403
|
});
|
|
50734
|
-
var requestDeviceCode = (apiUrl) =>
|
|
51404
|
+
var requestDeviceCode = (apiUrl) => gen3(function* () {
|
|
50735
51405
|
const res = yield* postJson(`${apiUrl}/v1/auth/device/code`, {
|
|
50736
51406
|
client_id: SAMVA_CLI_CLIENT_ID,
|
|
50737
51407
|
scope: DEVICE_SCOPE
|
|
@@ -50746,10 +51416,10 @@ var requestDeviceCode = (apiUrl) => gen4(function* () {
|
|
|
50746
51416
|
|
|
50747
51417
|
class DeviceAuthorizationPending extends TaggedError3()("DeviceAuthorizationPending", {}) {
|
|
50748
51418
|
}
|
|
50749
|
-
var pollForToken = (apiUrl, deviceCode, intervalSeconds, expiresInSeconds) =>
|
|
51419
|
+
var pollForToken = (apiUrl, deviceCode, intervalSeconds, expiresInSeconds) => gen3(function* () {
|
|
50750
51420
|
const initialInterval = seconds(Math.max(intervalSeconds, 1));
|
|
50751
51421
|
const interval = yield* make51(initialInterval);
|
|
50752
|
-
const pollOnce =
|
|
51422
|
+
const pollOnce = gen3(function* () {
|
|
50753
51423
|
const res = yield* postJson(`${apiUrl}/v1/auth/device/token`, {
|
|
50754
51424
|
grant_type: "urn:ietf:params:oauth:grant-type:device_code",
|
|
50755
51425
|
device_code: deviceCode,
|
|
@@ -50783,7 +51453,7 @@ var pollForToken = (apiUrl, deviceCode, intervalSeconds, expiresInSeconds) => ge
|
|
|
50783
51453
|
});
|
|
50784
51454
|
});
|
|
50785
51455
|
const pendingRetry = forever3.pipe(setInputType(), while_(({ input }) => input instanceof DeviceAuthorizationPending), modifyDelay(() => get10(interval)));
|
|
50786
|
-
const polling =
|
|
51456
|
+
const polling = gen3(function* () {
|
|
50787
51457
|
yield* sleep2(initialInterval);
|
|
50788
51458
|
return yield* pollOnce.pipe(retry2(pendingRetry));
|
|
50789
51459
|
});
|
|
@@ -50808,7 +51478,7 @@ var openBrowser = (url) => {
|
|
|
50808
51478
|
return;
|
|
50809
51479
|
});
|
|
50810
51480
|
child.unref();
|
|
50811
|
-
}).pipe(catchTag3("UnknownError", () =>
|
|
51481
|
+
}).pipe(catchTag3("UnknownError", () => void_4));
|
|
50812
51482
|
};
|
|
50813
51483
|
var revokeSession = (apiUrl, accessToken) => tryPromise2({
|
|
50814
51484
|
try: async () => {
|
|
@@ -50823,7 +51493,7 @@ var revokeSession = (apiUrl, accessToken) => tryPromise2({
|
|
|
50823
51493
|
},
|
|
50824
51494
|
catch: (cause) => new SamvaCliError({ message: `Sign-out request failed: ${String(cause)}` })
|
|
50825
51495
|
});
|
|
50826
|
-
var listOrganizations = (apiUrl, accessToken) =>
|
|
51496
|
+
var listOrganizations = (apiUrl, accessToken) => gen3(function* () {
|
|
50827
51497
|
const result4 = yield* tryPromise2({
|
|
50828
51498
|
try: async () => {
|
|
50829
51499
|
const res = await fetch(`${apiUrl}/v1/auth/organization/list`, {
|
|
@@ -50900,10 +51570,10 @@ To authorize the Samva CLI, visit:
|
|
|
50900
51570
|
|
|
50901
51571
|
// src/commands/logout.ts
|
|
50902
51572
|
var logoutCommand = make42("logout").pipe(withDescription3("Sign out and remove stored credentials"), withExamples([{ command: "samva logout", description: "Clear stored OAuth tokens" }]), withHandler(fnUntraced2(function* () {
|
|
50903
|
-
const credentials = yield* readCredentials.pipe(catchIf2((error2) => error2 instanceof CliConfigError && error2.code === "invalid_credential_record", () =>
|
|
51573
|
+
const credentials = yield* readCredentials.pipe(catchIf2((error2) => error2 instanceof CliConfigError && error2.code === "invalid_credential_record", () => void_4));
|
|
50904
51574
|
if (credentials) {
|
|
50905
51575
|
const apiUrl = yield* resolveApiUrl;
|
|
50906
|
-
yield* revokeSession(apiUrl, credentials.accessToken).pipe(catchTag3("SamvaCliError", () =>
|
|
51576
|
+
yield* revokeSession(apiUrl, credentials.accessToken).pipe(catchTag3("SamvaCliError", () => void_4));
|
|
50907
51577
|
}
|
|
50908
51578
|
yield* clearCredentials;
|
|
50909
51579
|
yield* printResult({ action: "logout" }, "Logged out.");
|
|
@@ -50916,7 +51586,7 @@ var periodFlag = choice3("period", [
|
|
|
50916
51586
|
"last_90_days",
|
|
50917
51587
|
"last_year"
|
|
50918
51588
|
]).pipe(withDescription2("Reporting period"), withDefault3("current"));
|
|
50919
|
-
var usageCommand = make42("usage", { period: periodFlag, json: jsonFlag }).pipe(withDescription3("Get organization usage"), withExamples([{ command: "samva org usage --period last_30_days --json" }]), withHandler(({ period, json: json2 }) =>
|
|
51589
|
+
var usageCommand = make42("usage", { period: periodFlag, json: jsonFlag }).pipe(withDescription3("Get organization usage"), withExamples([{ command: "samva org usage --period last_30_days --json" }]), withHandler(({ period, json: json2 }) => gen3(function* () {
|
|
50920
51590
|
const client = yield* getClientProvider;
|
|
50921
51591
|
const data = yield* getUsage({ period }).pipe(client.provide, mapError3((error2) => new SamvaCliError({ message: formatApiError("Could not get usage", error2) })));
|
|
50922
51592
|
if (json2)
|
|
@@ -50944,7 +51614,7 @@ var list14 = make42("list", { json: jsonFlag }).pipe(withDescription3("List the
|
|
|
50944
51614
|
description: "List orgs (OAuth) or show API-key org"
|
|
50945
51615
|
},
|
|
50946
51616
|
{ command: "samva org list --json", description: "Machine-readable org list" }
|
|
50947
|
-
]), withHandler(({ json: json2 }) =>
|
|
51617
|
+
]), withHandler(({ json: json2 }) => gen3(function* () {
|
|
50948
51618
|
const context3 = yield* resolveExecutionContext;
|
|
50949
51619
|
if (context3.credentials) {
|
|
50950
51620
|
if (isCredentialExpired(context3.credentials, yield* currentTimeMillis2)) {
|
|
@@ -51006,7 +51676,7 @@ var use = make42("use", { slug: string6("slug") }).pipe(withDescription3("Set th
|
|
|
51006
51676
|
var current = make42("current", { json: jsonFlag }).pipe(withDescription3("Show the active organization slug"), withExamples([
|
|
51007
51677
|
{ command: "samva org current", description: "Print active org slug" },
|
|
51008
51678
|
{ command: "samva org current --json", description: 'JSON: { "activeOrgSlug": "..." }' }
|
|
51009
|
-
]), withHandler(({ json: json2 }) =>
|
|
51679
|
+
]), withHandler(({ json: json2 }) => gen3(function* () {
|
|
51010
51680
|
const context3 = yield* resolveExecutionContext;
|
|
51011
51681
|
const slug = context3.orgSlug;
|
|
51012
51682
|
if (json2) {
|
|
@@ -51243,7 +51913,7 @@ var create12 = make42("create", {
|
|
|
51243
51913
|
trackClicks,
|
|
51244
51914
|
dryRun,
|
|
51245
51915
|
json: json2
|
|
51246
|
-
}) =>
|
|
51916
|
+
}) => gen3(function* () {
|
|
51247
51917
|
const htmlValue = getOrUndefined(html);
|
|
51248
51918
|
const textValue = getOrUndefined(text3);
|
|
51249
51919
|
const templateIdValue = getOrUndefined(templateId);
|
|
@@ -51350,7 +52020,7 @@ var list16 = make42("list", {
|
|
|
51350
52020
|
command: "samva scheduled-messages list --all --jsonl",
|
|
51351
52021
|
description: "Stream every page as JSONL"
|
|
51352
52022
|
}
|
|
51353
|
-
]), withHandler(({ status: status3, page, limit, all: all5, json: json2 }) =>
|
|
52023
|
+
]), withHandler(({ status: status3, page, limit, all: all5, json: json2 }) => gen3(function* () {
|
|
51354
52024
|
if (all5 && !isJsonLinesRequested()) {
|
|
51355
52025
|
return yield* new CliUsageError({
|
|
51356
52026
|
code: "all_requires_jsonl",
|
|
@@ -51403,7 +52073,7 @@ var list16 = make42("list", {
|
|
|
51403
52073
|
}
|
|
51404
52074
|
yield* log2(`Page ${String(data.pagination.page)} of ${String(data.pagination.totalPages)} (${String(data.pagination.total)} total)`);
|
|
51405
52075
|
}).pipe(json2 ? provideService2(MinimumLogLevel2, "None") : identity)));
|
|
51406
|
-
var get23 = make42("get", { id: string6("id"), json: jsonFlag }).pipe(withDescription3("Show a scheduled message by id"), withExamples([{ command: "samva scheduled-messages get sched_abc123" }]), withHandler(({ id: id2, json: json2 }) =>
|
|
52076
|
+
var get23 = make42("get", { id: string6("id"), json: jsonFlag }).pipe(withDescription3("Show a scheduled message by id"), withExamples([{ command: "samva scheduled-messages get sched_abc123" }]), withHandler(({ id: id2, json: json2 }) => gen3(function* () {
|
|
51407
52077
|
const client = yield* getClientProvider;
|
|
51408
52078
|
const data = yield* get19({ id: id2 }).pipe(client.provide, mapError3((error2) => new SamvaCliError({
|
|
51409
52079
|
message: formatApiError("Could not fetch scheduled message", error2)
|
|
@@ -51429,7 +52099,7 @@ var cancel2 = make42("cancel", {
|
|
|
51429
52099
|
}).pipe(withDescription3("Cancel a pending scheduled message"), withExamples([
|
|
51430
52100
|
{ command: "samva scheduled-messages cancel sched_abc123 --dry-run" },
|
|
51431
52101
|
{ command: "samva scheduled-messages cancel sched_abc123 --yes" }
|
|
51432
|
-
]), withHandler(({ id: id2, dryRun, yes, json: json2 }) =>
|
|
52102
|
+
]), withHandler(({ id: id2, dryRun, yes, json: json2 }) => gen3(function* () {
|
|
51433
52103
|
if (dryRun) {
|
|
51434
52104
|
return yield* json2 ? printJson({ dryRun: true, action: "scheduled.cancel", id: id2 }) : log2(`[dry-run] Would cancel scheduled message ${id2}.`);
|
|
51435
52105
|
}
|
|
@@ -51580,7 +52250,7 @@ var clone2 = make42("clone", {
|
|
|
51580
52250
|
command: "samva templates clone tmpl_abc123 --dir welcome-email",
|
|
51581
52251
|
description: "Clone a project and configure its repo-local Samva credential helper"
|
|
51582
52252
|
}
|
|
51583
|
-
]), withHandler(({ id: id2, dir, json: json2 }) =>
|
|
52253
|
+
]), withHandler(({ id: id2, dir, json: json2 }) => gen3(function* () {
|
|
51584
52254
|
const result4 = yield* cloneProject({ id: id2, dir: getOrElse(dir, () => ".") });
|
|
51585
52255
|
if (json2)
|
|
51586
52256
|
return yield* printJson(result4);
|
|
@@ -51621,7 +52291,7 @@ var init = make42("init", {
|
|
|
51621
52291
|
command: 'samva templates init --name "Welcome email" --slug welcome --dir welcome-email --json',
|
|
51622
52292
|
description: "Create deterministically for CI or a coding agent"
|
|
51623
52293
|
}
|
|
51624
|
-
]), withHandler(({ name, projectName, slug, dir, idempotencyKey, dryRun, json: json2 }) =>
|
|
52294
|
+
]), withHandler(({ name, projectName, slug, dir, idempotencyKey, dryRun, json: json2 }) => gen3(function* () {
|
|
51625
52295
|
const root = resolve5(getOrElse(dir, () => projectDirectory(name)));
|
|
51626
52296
|
const key = getOrUndefined(idempotencyKey);
|
|
51627
52297
|
const request3 = {
|
|
@@ -51668,7 +52338,7 @@ var credential = make42("credential", {
|
|
|
51668
52338
|
id: templateId,
|
|
51669
52339
|
operation: credentialOperation,
|
|
51670
52340
|
scope: choice3("scope", ["read", "write"]).pipe(withDescription2("Repository token scope"), withDefault3("write"))
|
|
51671
|
-
}).pipe(unlisted, withHandler(({ id: id2, operation, scope: scope3 }) =>
|
|
52341
|
+
}).pipe(unlisted, withHandler(({ id: id2, operation, scope: scope3 }) => gen3(function* () {
|
|
51672
52342
|
if (operation !== "get")
|
|
51673
52343
|
return;
|
|
51674
52344
|
const input = yield* readStdinUtf8;
|
|
@@ -51707,7 +52377,7 @@ var credential = make42("credential", {
|
|
|
51707
52377
|
].join(`
|
|
51708
52378
|
`)));
|
|
51709
52379
|
})));
|
|
51710
|
-
var gitConfig = (key) => runGit(["config", "--local", "--get", key]).pipe(catch_3(() =>
|
|
52380
|
+
var gitConfig = (key) => runGit(["config", "--local", "--get", key]).pipe(catch_3(() => void_4));
|
|
51711
52381
|
var publish3 = make42("publish", {
|
|
51712
52382
|
id: string5("template-id").pipe(withDescription2("Template project entry id (defaults to repo-local config)"), optional4),
|
|
51713
52383
|
commit: string5("commit").pipe(withDescription2("Exact commit or Git revision to publish"), withDefault3("HEAD")),
|
|
@@ -51718,7 +52388,7 @@ var publish3 = make42("publish", {
|
|
|
51718
52388
|
command: "samva templates publish --commit HEAD --json",
|
|
51719
52389
|
description: "Publish the current committed tree from a CLI-managed clone"
|
|
51720
52390
|
}
|
|
51721
|
-
]), withHandler(({ id: id2, commit, entry, json: json2 }) =>
|
|
52391
|
+
]), withHandler(({ id: id2, commit, entry, json: json2 }) => gen3(function* () {
|
|
51722
52392
|
const status3 = yield* runGit(["status", "--porcelain"]);
|
|
51723
52393
|
if (status3.length > 0) {
|
|
51724
52394
|
return yield* new SamvaCliError({
|
|
@@ -52191,7 +52861,7 @@ var readCatalog = fn2("templates.types.readCatalog")(function* () {
|
|
|
52191
52861
|
return entries3;
|
|
52192
52862
|
}
|
|
52193
52863
|
});
|
|
52194
|
-
var readExisting = (path3) =>
|
|
52864
|
+
var readExisting = (path3) => gen3(function* () {
|
|
52195
52865
|
const fs = yield* FileSystem;
|
|
52196
52866
|
return (yield* fs.exists(path3)) ? yield* fs.readFileString(path3) : undefined;
|
|
52197
52867
|
}).pipe(catch_3(() => succeed6(undefined)));
|
|
@@ -52280,7 +52950,7 @@ var typesCommand = make42("types", {
|
|
|
52280
52950
|
});
|
|
52281
52951
|
}
|
|
52282
52952
|
const fs = yield* FileSystem;
|
|
52283
|
-
yield* fs.makeDirectory(dirname3(path3), { recursive: true }).pipe(catch_3(() =>
|
|
52953
|
+
yield* fs.makeDirectory(dirname3(path3), { recursive: true }).pipe(catch_3(() => void_4));
|
|
52284
52954
|
yield* fs.writeFileString(path3, generated.source).pipe(mapError3((cause) => new SamvaCliError({ message: `Could not write ${path3}: ${String(cause)}` })));
|
|
52285
52955
|
const written = { ...result4, written: true };
|
|
52286
52956
|
if (json2)
|
|
@@ -52639,7 +53309,7 @@ var toTemplateBuildArtifact = (result4) => ({
|
|
|
52639
53309
|
result: result4
|
|
52640
53310
|
});
|
|
52641
53311
|
var problemLocation = (problem) => problem.line === undefined ? "" : `:${problem.line}${problem.column === undefined ? "" : `:${problem.column}`}`;
|
|
52642
|
-
var observeTemplateCheck = (dir, tsconfig, build2) =>
|
|
53312
|
+
var observeTemplateCheck = (dir, tsconfig, build2) => gen3(function* () {
|
|
52643
53313
|
const typecheck = yield* typecheckProject(tsconfig);
|
|
52644
53314
|
const typeProblems = typecheck.diagnostics.map((diagnostic) => ({
|
|
52645
53315
|
file: diagnostic.file,
|
|
@@ -52820,7 +53490,7 @@ var check6 = make42("check", {
|
|
|
52820
53490
|
command: "samva templates check --watch --jsonl",
|
|
52821
53491
|
description: "Stream one machine-readable result per observation"
|
|
52822
53492
|
}
|
|
52823
|
-
]), withHandler(({ dir, json: json2, tsconfig, watch: watch3, assetBase }) =>
|
|
53493
|
+
]), withHandler(({ dir, json: json2, tsconfig, watch: watch3, assetBase }) => gen3(function* () {
|
|
52824
53494
|
yield* validateTemplatesDir(dir);
|
|
52825
53495
|
if (watch3) {
|
|
52826
53496
|
if (json2 && !isJsonLinesRequested()) {
|
|
@@ -52852,7 +53522,7 @@ var check6 = make42("check", {
|
|
|
52852
53522
|
yield* logInfo(observation.message);
|
|
52853
53523
|
}
|
|
52854
53524
|
}).pipe(json2 ? provideService2(MinimumLogLevel2, "None") : identity)));
|
|
52855
|
-
var writeJsonFile = (target, value3) =>
|
|
53525
|
+
var writeJsonFile = (target, value3) => gen3(function* () {
|
|
52856
53526
|
const fs = yield* FileSystem;
|
|
52857
53527
|
yield* fs.makeDirectory(dirname4(target), { recursive: true });
|
|
52858
53528
|
yield* fs.writeFileString(target, `${JSON.stringify(value3, null, 2)}
|
|
@@ -52874,7 +53544,7 @@ var build2 = make42("build", {
|
|
|
52874
53544
|
command: "samva templates build --out dist/templates.json --asset-base https://cdn.example.com/email",
|
|
52875
53545
|
description: "Build executable fixtures with their imported asset URLs"
|
|
52876
53546
|
}
|
|
52877
|
-
]), withHandler(({ dir, out, json: json2, assetBase }) =>
|
|
53547
|
+
]), withHandler(({ dir, out, json: json2, assetBase }) => gen3(function* () {
|
|
52878
53548
|
const built = yield* buildDir(dir, getOrUndefined(assetBase));
|
|
52879
53549
|
const problems = collectBuildProblems(built);
|
|
52880
53550
|
if (!isSuccessfulBuild(built)) {
|
|
@@ -52917,7 +53587,7 @@ var listRemote = make42("list", {
|
|
|
52917
53587
|
limit: integer4("limit").pipe(withDescription2("Items per page"), optional4),
|
|
52918
53588
|
all: boolean4("all").pipe(withDescription2("Traverse every page (requires --jsonl)"), withDefault3(false)),
|
|
52919
53589
|
json: jsonFlag
|
|
52920
|
-
}).pipe(withDescription3("List remote templates"), withExamples([{ command: "samva templates list --json" }]), withHandler(({ page, limit, all: all5, json: json2 }) =>
|
|
53590
|
+
}).pipe(withDescription3("List remote templates"), withExamples([{ command: "samva templates list --json" }]), withHandler(({ page, limit, all: all5, json: json2 }) => gen3(function* () {
|
|
52921
53591
|
if (all5 && !isJsonLinesRequested())
|
|
52922
53592
|
return yield* new CliUsageError({
|
|
52923
53593
|
code: "all_requires_jsonl",
|
|
@@ -52958,7 +53628,7 @@ var listRemote = make42("list", {
|
|
|
52958
53628
|
["Total", data.pagination.total]
|
|
52959
53629
|
]);
|
|
52960
53630
|
}).pipe(json2 ? provideService2(MinimumLogLevel2, "None") : identity)));
|
|
52961
|
-
var getRemote = make42("get", { id: templateIdArgument2, json: jsonFlag }).pipe(withDescription3("Get a remote template"), withExamples([{ command: "samva templates get tmpl_abc123 --json" }]), withHandler(({ id: id2, json: json2 }) =>
|
|
53631
|
+
var getRemote = make42("get", { id: templateIdArgument2, json: jsonFlag }).pipe(withDescription3("Get a remote template"), withExamples([{ command: "samva templates get tmpl_abc123 --json" }]), withHandler(({ id: id2, json: json2 }) => gen3(function* () {
|
|
52962
53632
|
const client = yield* getClientProvider;
|
|
52963
53633
|
const data = yield* getById3({ id: id2 }).pipe(client.provide, mapError3((error2) => new SamvaCliError({ message: formatApiError("Could not get template", error2) })));
|
|
52964
53634
|
if (json2)
|
|
@@ -52973,7 +53643,7 @@ var createRemote = make42("create", {
|
|
|
52973
53643
|
{
|
|
52974
53644
|
command: `samva templates create --data '{"name":"Welcome","projectName":"welcome-email","idempotencyKey":"welcome-email-v1"}' --dry-run`
|
|
52975
53645
|
}
|
|
52976
|
-
]), withHandler(({ data, dryRun, json: json2 }) =>
|
|
53646
|
+
]), withHandler(({ data, dryRun, json: json2 }) => gen3(function* () {
|
|
52977
53647
|
const payload = yield* decodePayload(data, "--data", CreateTemplatePayload);
|
|
52978
53648
|
if (dryRun)
|
|
52979
53649
|
return yield* json2 ? printJson({ dryRun: true, action: "templates.create", request: payload }) : printJson(payload);
|
|
@@ -52992,7 +53662,7 @@ var updateRemote = make42("update", {
|
|
|
52992
53662
|
{
|
|
52993
53663
|
command: `samva templates update tmpl_abc123 --data '{"name":"Welcome back"}' --dry-run`
|
|
52994
53664
|
}
|
|
52995
|
-
]), withHandler(({ id: id2, data, dryRun, json: json2 }) =>
|
|
53665
|
+
]), withHandler(({ id: id2, data, dryRun, json: json2 }) => gen3(function* () {
|
|
52996
53666
|
const changes2 = yield* parseObject(data, "--data");
|
|
52997
53667
|
const payload = yield* decodePayload(JSON.stringify({ data: changes2 }), "--data", UpdateTemplatePayload);
|
|
52998
53668
|
if (dryRun)
|
|
@@ -53008,7 +53678,7 @@ var removeRemote = make42("remove", {
|
|
|
53008
53678
|
dryRun: dryRunFlag5,
|
|
53009
53679
|
yes: boolean4("yes").pipe(withDescription2("Confirm destructive state change"), withDefault3(false)),
|
|
53010
53680
|
json: jsonFlag
|
|
53011
|
-
}).pipe(withDescription3("Permanently delete a remote template"), withExamples([{ command: "samva templates remove tmpl_abc123 --dry-run" }]), withHandler(({ id: id2, dryRun, yes, json: json2 }) =>
|
|
53681
|
+
}).pipe(withDescription3("Permanently delete a remote template"), withExamples([{ command: "samva templates remove tmpl_abc123 --dry-run" }]), withHandler(({ id: id2, dryRun, yes, json: json2 }) => gen3(function* () {
|
|
53012
53682
|
if (dryRun)
|
|
53013
53683
|
return yield* json2 ? printJson({ dryRun: true, action: "templates.remove", id: id2 }) : log2(`[dry-run] Would remove template ${id2}.`);
|
|
53014
53684
|
yield* confirmDestructive({
|
|
@@ -53136,7 +53806,7 @@ var readData = (raw3) => {
|
|
|
53136
53806
|
if (path3.length === 0) {
|
|
53137
53807
|
return fail6(new CliUsageError({ code: "missing_data_file", message: "--data @ requires a file path." }));
|
|
53138
53808
|
}
|
|
53139
|
-
return
|
|
53809
|
+
return gen3(function* () {
|
|
53140
53810
|
const fs = yield* FileSystem;
|
|
53141
53811
|
return yield* fs.readFileString(path3);
|
|
53142
53812
|
}).pipe(mapError3(() => new CliUsageError({
|
|
@@ -53149,7 +53819,7 @@ var list17 = make42("list", {
|
|
|
53149
53819
|
limit: integer4("limit").pipe(withDescription2("Items per page"), optional4),
|
|
53150
53820
|
all: boolean4("all").pipe(withDescription2("Traverse every page (requires --jsonl)"), withDefault3(false)),
|
|
53151
53821
|
json: jsonFlag
|
|
53152
|
-
}).pipe(withDescription3("List customer webhooks"), withExamples([{ command: "samva webhooks list --json" }]), withHandler(({ page, limit, all: all5, json: json2 }) =>
|
|
53822
|
+
}).pipe(withDescription3("List customer webhooks"), withExamples([{ command: "samva webhooks list --json" }]), withHandler(({ page, limit, all: all5, json: json2 }) => gen3(function* () {
|
|
53153
53823
|
if (all5 && !isJsonLinesRequested())
|
|
53154
53824
|
return yield* new CliUsageError({
|
|
53155
53825
|
code: "all_requires_jsonl",
|
|
@@ -53192,7 +53862,7 @@ var list17 = make42("list", {
|
|
|
53192
53862
|
["Total", data.pagination.total]
|
|
53193
53863
|
]);
|
|
53194
53864
|
}).pipe(json2 ? provideService2(MinimumLogLevel2, "None") : identity)));
|
|
53195
|
-
var get24 = make42("get", { id: idArgument, json: jsonFlag }).pipe(withDescription3("Get a customer webhook"), withExamples([{ command: "samva webhooks get wh_abc123 --json" }]), withHandler(({ id: id2, json: json2 }) =>
|
|
53865
|
+
var get24 = make42("get", { id: idArgument, json: jsonFlag }).pipe(withDescription3("Get a customer webhook"), withExamples([{ command: "samva webhooks get wh_abc123 --json" }]), withHandler(({ id: id2, json: json2 }) => gen3(function* () {
|
|
53196
53866
|
const client = yield* getClientProvider;
|
|
53197
53867
|
const data = yield* get20({ id: id2 }).pipe(client.provide, mapError3((error2) => new SamvaCliError({ message: formatApiError("Could not get webhook", error2) })));
|
|
53198
53868
|
if (json2)
|
|
@@ -53208,7 +53878,7 @@ var logs = make42("logs", {
|
|
|
53208
53878
|
id: idArgument,
|
|
53209
53879
|
limit: integer4("limit").pipe(optional4),
|
|
53210
53880
|
json: jsonFlag
|
|
53211
|
-
}).pipe(withDescription3("List webhook delivery logs"), withExamples([{ command: "samva webhooks logs wh_abc123 --limit 25 --json" }]), withHandler(({ id: id2, limit, json: json2 }) =>
|
|
53881
|
+
}).pipe(withDescription3("List webhook delivery logs"), withExamples([{ command: "samva webhooks logs wh_abc123 --limit 25 --json" }]), withHandler(({ id: id2, limit, json: json2 }) => gen3(function* () {
|
|
53212
53882
|
const client = yield* getClientProvider;
|
|
53213
53883
|
const limitValue = getOrUndefined(limit);
|
|
53214
53884
|
const data = yield* getLogs({
|
|
@@ -53219,12 +53889,14 @@ var logs = make42("logs", {
|
|
|
53219
53889
|
return yield* printJson(data);
|
|
53220
53890
|
yield* printJson(data.data);
|
|
53221
53891
|
}).pipe(json2 ? provideService2(MinimumLogLevel2, "None") : identity)));
|
|
53892
|
+
var statsPeriodFlag = choice3("period", ["7d", "30d", "90d"]).pipe(withDescription2("How far back the daily series reaches"), withDefault3("30d"));
|
|
53222
53893
|
var stats = make42("stats", {
|
|
53223
53894
|
id: idArgument,
|
|
53895
|
+
period: statsPeriodFlag,
|
|
53224
53896
|
json: jsonFlag
|
|
53225
|
-
}).pipe(withDescription3("Get webhook delivery statistics"), withExamples([{ command: "samva webhooks stats wh_abc123 --json" }]), withHandler(({ id: id2, json: json2 }) =>
|
|
53897
|
+
}).pipe(withDescription3("Get webhook delivery statistics"), withExamples([{ command: "samva webhooks stats wh_abc123 --period 90d --json" }]), withHandler(({ id: id2, period, json: json2 }) => gen3(function* () {
|
|
53226
53898
|
const client = yield* getClientProvider;
|
|
53227
|
-
const data = yield* getStats3({ webhookId: id2 }).pipe(client.provide, mapError3((error2) => new SamvaCliError({ message: formatApiError("Could not get webhook stats", error2) })));
|
|
53899
|
+
const data = yield* getStats3({ webhookId: id2, period }).pipe(client.provide, mapError3((error2) => new SamvaCliError({ message: formatApiError("Could not get webhook stats", error2) })));
|
|
53228
53900
|
if (json2)
|
|
53229
53901
|
return yield* printJson(data);
|
|
53230
53902
|
yield* printJson(data);
|
|
@@ -53238,7 +53910,7 @@ var test2 = make42("test", {
|
|
|
53238
53910
|
{ command: "samva webhooks test wep_abc123 --dry-run" },
|
|
53239
53911
|
{ command: `samva webhooks test wep_abc123 --data '{"event":"webhook.test"}' --json` },
|
|
53240
53912
|
{ command: "samva webhooks test wep_abc123 --data @payload.json --json" }
|
|
53241
|
-
]), withHandler(({ id: id2, data, dryRun, json: json2 }) =>
|
|
53913
|
+
]), withHandler(({ id: id2, data, dryRun, json: json2 }) => gen3(function* () {
|
|
53242
53914
|
const raw3 = getOrUndefined(data);
|
|
53243
53915
|
const payload = raw3 === undefined ? yield* decodeEffect2(TestWebhookPayload)({}) : yield* readData(raw3).pipe(flatMap5((content) => parseObject2(content, "--data")), flatMap5((value3) => decodeUnknownEffect2(TestWebhookPayload)({ data: value3 })), mapError3((error2) => error2 instanceof CliUsageError || error2 instanceof SamvaCliError ? error2 : new SamvaCliError({
|
|
53244
53916
|
message: `--data does not match the API schema: ${String(error2)}`
|
|
@@ -53266,7 +53938,7 @@ var retry6 = make42("retry", {
|
|
|
53266
53938
|
deliveryId: string6("delivery-id").pipe(withDescription4("Webhook delivery id")),
|
|
53267
53939
|
dryRun: boolean4("dry-run").pipe(withDefault3(false)),
|
|
53268
53940
|
json: jsonFlag
|
|
53269
|
-
}).pipe(withDescription3("Retry a failed webhook delivery"), withExamples([{ command: "samva webhooks retry wh_abc123 del_abc123 --dry-run" }]), withHandler(({ id: id2, deliveryId, dryRun, json: json2 }) =>
|
|
53941
|
+
}).pipe(withDescription3("Retry a failed webhook delivery"), withExamples([{ command: "samva webhooks retry wh_abc123 del_abc123 --dry-run" }]), withHandler(({ id: id2, deliveryId, dryRun, json: json2 }) => gen3(function* () {
|
|
53270
53942
|
if (dryRun)
|
|
53271
53943
|
return yield* json2 ? printJson({ dryRun: true, action: "webhooks.retry", id: id2, deliveryId }) : log2(`[dry-run] Would retry delivery ${deliveryId} for webhook ${id2}.`);
|
|
53272
53944
|
const client = yield* getClientProvider;
|
|
@@ -53285,7 +53957,7 @@ var rotate2 = make42("rotate-secret", {
|
|
|
53285
53957
|
}).pipe(withDescription3("Rotate a webhook signing secret"), withExamples([
|
|
53286
53958
|
{ command: "samva webhooks rotate-secret wh_abc123 --dry-run" },
|
|
53287
53959
|
{ command: "samva webhooks rotate-secret wh_abc123 --yes --json" }
|
|
53288
|
-
]), withHandler(({ id: id2, dryRun, yes, json: json2 }) =>
|
|
53960
|
+
]), withHandler(({ id: id2, dryRun, yes, json: json2 }) => gen3(function* () {
|
|
53289
53961
|
if (dryRun)
|
|
53290
53962
|
return yield* json2 ? printJson({ dryRun: true, action: "webhooks.rotate-secret", id: id2 }) : log2(`[dry-run] Would rotate the signing secret for webhook ${id2}.`);
|
|
53291
53963
|
yield* confirmDestructive({
|
|
@@ -53313,7 +53985,7 @@ var create13 = make42("create", {
|
|
|
53313
53985
|
{
|
|
53314
53986
|
command: `samva webhooks create --data '{"name":"delivery","url":"https://example.com/hook","events":["message.delivered"]}' --dry-run`
|
|
53315
53987
|
}
|
|
53316
|
-
]), withHandler(({ data, dryRun, json: json2 }) =>
|
|
53988
|
+
]), withHandler(({ data, dryRun, json: json2 }) => gen3(function* () {
|
|
53317
53989
|
const payload = yield* decodePayload2(data, "--data", CreateWebhookPayload);
|
|
53318
53990
|
if (dryRun)
|
|
53319
53991
|
return yield* json2 ? printJson({ dryRun: true, action: "webhooks.create", request: payload }) : printJson(payload);
|
|
@@ -53332,7 +54004,7 @@ var update12 = make42("update", {
|
|
|
53332
54004
|
{
|
|
53333
54005
|
command: `samva webhooks update wh_abc123 --data '{"url":"https://example.com/new"}' --dry-run`
|
|
53334
54006
|
}
|
|
53335
|
-
]), withHandler(({ id: id2, data, dryRun, json: json2 }) =>
|
|
54007
|
+
]), withHandler(({ id: id2, data, dryRun, json: json2 }) => gen3(function* () {
|
|
53336
54008
|
const payload = yield* decodePayload2(data, "--data", UpdateWebhookPayload);
|
|
53337
54009
|
if (dryRun)
|
|
53338
54010
|
return yield* json2 ? printJson({ dryRun: true, action: "webhooks.update", id: id2, request: payload }) : printJson(payload);
|
|
@@ -53350,7 +54022,7 @@ var remove19 = make42("remove", {
|
|
|
53350
54022
|
}).pipe(withDescription3("Permanently delete a customer webhook"), withExamples([
|
|
53351
54023
|
{ command: "samva webhooks remove wh_abc123 --dry-run" },
|
|
53352
54024
|
{ command: "samva webhooks remove wh_abc123 --yes" }
|
|
53353
|
-
]), withHandler(({ id: id2, dryRun, yes, json: json2 }) =>
|
|
54025
|
+
]), withHandler(({ id: id2, dryRun, yes, json: json2 }) => gen3(function* () {
|
|
53354
54026
|
if (dryRun)
|
|
53355
54027
|
return yield* json2 ? printJson({ dryRun: true, action: "webhooks.remove", id: id2 }) : log2(`[dry-run] Would permanently remove webhook ${id2}.`);
|
|
53356
54028
|
yield* confirmDestructive({
|
|
@@ -53477,7 +54149,7 @@ var formatter = {
|
|
|
53477
54149
|
formatError: () => "",
|
|
53478
54150
|
formatErrors: () => ""
|
|
53479
54151
|
};
|
|
53480
|
-
var flushSuccessfulResults = (state, partial = false) =>
|
|
54152
|
+
var flushSuccessfulResults = (state, partial = false) => gen3(function* () {
|
|
53481
54153
|
if (outputMode === "quiet" || outputMode === "jsonl")
|
|
53482
54154
|
return;
|
|
53483
54155
|
if (outputMode === "human") {
|
|
@@ -53535,7 +54207,7 @@ var withStdoutBuffer = (program) => acquireUseRelease2(sync3(() => {
|
|
|
53535
54207
|
originalError(...values2);
|
|
53536
54208
|
};
|
|
53537
54209
|
return { originalLog, originalError, lines: lines2 };
|
|
53538
|
-
}), (state) => program.pipe(
|
|
54210
|
+
}), (state) => program.pipe(tap5(() => flushSuccessfulResults(state)), tapError3((error2) => {
|
|
53539
54211
|
if (isBareHelp(error2) && outputMode === "human") {
|
|
53540
54212
|
return sync3(() => state.lines.forEach((line) => state.originalLog(line)));
|
|
53541
54213
|
}
|
|
@@ -53553,7 +54225,7 @@ var withStdoutBuffer = (program) => acquireUseRelease2(sync3(() => {
|
|
|
53553
54225
|
console.error = state.originalError;
|
|
53554
54226
|
state.lines.length = 0;
|
|
53555
54227
|
}));
|
|
53556
|
-
var renderFailure = (error2) =>
|
|
54228
|
+
var renderFailure = (error2) => gen3(function* () {
|
|
53557
54229
|
process.exitCode = processErrorCode(error2);
|
|
53558
54230
|
if (isBareHelp(error2)) {
|
|
53559
54231
|
if (machineMode)
|
|
@@ -53578,6 +54250,6 @@ var program = (isRootMachineHelp ? validateProcessArgs(argv).pipe(flatMap5(() =>
|
|
|
53578
54250
|
message: `Unknown subcommand ${JSON.stringify(rootMachineHelp.command)} for samva.`
|
|
53579
54251
|
}))) : withStdoutBuffer(validateProcessArgs(argv).pipe(flatMap5(() => run5(cli, { version: package_default.version }))))).pipe(provide4(mergeAll2(layer13([cliLogger]), exports_BunServices.layer, layer14(formatter), exports_credential_store.layer)), matchEffect3({
|
|
53580
54252
|
onFailure: renderFailure,
|
|
53581
|
-
onSuccess: () =>
|
|
54253
|
+
onSuccess: () => void_4
|
|
53582
54254
|
}));
|
|
53583
54255
|
exports_BunRuntime.runMain(program, { disableErrorReporting: true });
|