clanka 0.8.5 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CompactionTransport.test.js +1 -1
- package/dist/CompactionTransport.test.js.map +1 -1
- package/dist/bin/{Effect-BEUn4I5E.mjs → Effect-rADALOOD.mjs} +392 -205
- package/dist/bin/Effect-rADALOOD.mjs.map +1 -0
- package/dist/bin/{McpClient-C0FVuDj2.mjs → McpClient-NazR2OwL.mjs} +4 -4
- package/dist/bin/{McpClient-C0FVuDj2.mjs.map → McpClient-NazR2OwL.mjs.map} +1 -1
- package/dist/bin/{OutputFormatter-DffD5oxX.mjs → OutputFormatter-BVHbgF2b.mjs} +3 -3
- package/dist/bin/{OutputFormatter-DffD5oxX.mjs.map → OutputFormatter-BVHbgF2b.mjs.map} +1 -1
- package/dist/bin/{Schema-CjUGw2Xh.mjs → Schema-C7NXAOWA.mjs} +640 -87
- package/dist/bin/Schema-C7NXAOWA.mjs.map +1 -0
- package/dist/bin/{SemanticSearch-CFB73IPb.mjs → SemanticSearch-4Jes3jCl.mjs} +89 -56
- package/dist/bin/SemanticSearch-4Jes3jCl.mjs.map +1 -0
- package/dist/bin/{Stream-Cu6P7ZHo.mjs → Stream-CSLA1_GD.mjs} +71 -50
- package/dist/bin/Stream-CSLA1_GD.mjs.map +1 -0
- package/dist/bin/cli.mjs +2747 -5294
- package/dist/bin/cli.mjs.map +1 -1
- package/dist/bin/{turndown.cjs-usmCKZ4b.mjs → turndown.cjs-DK29wZw3.mjs} +2 -2
- package/dist/bin/{turndown.cjs-usmCKZ4b.mjs.map → turndown.cjs-DK29wZw3.mjs.map} +1 -1
- package/package.json +7 -7
- package/src/CompactionTransport.test.ts +1 -1
- package/dist/bin/Effect-BEUn4I5E.mjs.map +0 -1
- package/dist/bin/Schema-CjUGw2Xh.mjs.map +0 -1
- package/dist/bin/SemanticSearch-CFB73IPb.mjs.map +0 -1
- package/dist/bin/Stream-Cu6P7ZHo.mjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $
|
|
2
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
1
|
+
import { $i as append, $n as fromReasons, Aa as succeed$1, Ai as iterateEager, Ao as Date$3, As as isBoolean, Bn as IllegalArgumentError, Bo as strictEqual, Bs as isNumber, Ca as flatMap$1, Co as match, Cs as optimize, Da as isSuccess$1, Do as some, Ds as symbol, Ea as isFailure, Es as structureKeys, F as failCauseSync, Fa as isDuration, Fi as monotonicTimeNanos$1, Fo as isLessThan$1, Ga as toSeconds, Go as TaggedError$2, Gs as isTagged, H as fnUntracedEager, Ha as negativeInfinity, Hs as isObjectKeyword, Ht as succeed$3, Ia as isFinite$2, Io as isLessThanOrEqualTo$1, Is as isNotNullish, It as runSyncExit, Ji as encode$1, Ko as args, L as flatMap, Lo as make$9, Ls as isNotUndefined, M as exit, Mo as String$4, Ms as isFunction, N as fail$2, Na as fromInputUnsafe, No as isGreaterThan$1, Oa as map$6, Os as hasProperty, Pa as infinity, Pi as map$2, Po as isGreaterThanOrEqualTo$1, Ps as isNever$1, Qr as failCause, R as flatMapEager, Ri as resolveConcurrency, Ro as Tuple$1, So as map$4, Ss as number$1, Ua as seconds, Uo as Error$3, Us as isPropertyKey, Ut as succeedNone, Va as nanos, Vs as isObject, Wo as PipeInspectableProto, Ws as isString$1, Wt as suspend$1, Xt as tryPromise, Y as fromResult, Zr as fail$3, Zt as try_, _s as equals, ai as ClockRef, ar as isFailReason, as as BaseProto, bo as isSome, bs as combine, ca as isArrayNonEmpty, cc as pipeArguments, cr as makeDieReason, ct as mapBothEager, do as fromNullOr, dr as map$5, ds as formatJson, dt as mapErrorEager, ec as dual, ei as isExit, fi as currentTimeMillis$1, fs as formatPath, ho as getOrNull, ic as memoizeIdempotent, ii as void_$1, in as void_$2, is as setStackTraceLimit, jo as Number$4, js as isError, k as die, ka as match$1, ki as iterateConcurrent, ko as BigInt$4, ks as isBigInt, lr as makeFailReason, ls as format$1, lt as mapEager, m as catchCause, ma as map$3, nc as identity, ni as isSuccess, ns as assignProperty$1, oa as fromIterable$1, oc as Class$2, or as isReason, pa as makeEquivalence$3, pi as effectIsExit, ps as formatPropertyKey, qn as die$1, qs as isUnknown, rc as memoize, ri as succeed$2, rr as isCause, rs as getStackTraceLimit, sc as Prototype, so as filter, ss as NodeInspectSymbol, ta as empty$2, ts as assignProperties, ua as isReadonlyArrayNonEmpty, uo as flatten, ur as makeInterruptReason, us as formatDate, vo as isNone, vs as symbol$1, wa as getOrThrow, wo as none, ws as string$1, xa as fail$1, xo as liftThrowable, xs as hash, yo as isOption, ys as array, za as millis, zo as make$8 } from "./Effect-rADALOOD.mjs";
|
|
2
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Tuple.js
|
|
3
3
|
const makeEquivalence$2 = Tuple$1;
|
|
4
4
|
//#endregion
|
|
5
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
5
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Record.js
|
|
6
6
|
const has = dual(2, (self, key) => Object.hasOwn(self, key));
|
|
7
7
|
const map$1 = dual(2, (self, f) => {
|
|
8
8
|
const out = { ...self };
|
|
@@ -20,7 +20,7 @@ const makeEquivalence$1 = (equivalence) => {
|
|
|
20
20
|
return (self, that) => is(self, that) && is(that, self);
|
|
21
21
|
};
|
|
22
22
|
//#endregion
|
|
23
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
23
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Data.js
|
|
24
24
|
const Class$1 = class extends Class$2 {
|
|
25
25
|
constructor(props) {
|
|
26
26
|
super();
|
|
@@ -51,22 +51,22 @@ function taggedMatch() {
|
|
|
51
51
|
const Error$2 = Error$3;
|
|
52
52
|
const TaggedError$1 = TaggedError$2;
|
|
53
53
|
//#endregion
|
|
54
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
54
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/encoding/EncodingError.js
|
|
55
55
|
const EncodingErrorTypeId = "~effect/encoding/EncodingError";
|
|
56
56
|
var EncodingError = class extends TaggedError$1("EncodingError") {
|
|
57
57
|
[EncodingErrorTypeId] = EncodingErrorTypeId;
|
|
58
58
|
};
|
|
59
59
|
//#endregion
|
|
60
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
60
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Clock.js
|
|
61
61
|
const Clock = ClockRef;
|
|
62
62
|
const currentTimeMillis = currentTimeMillis$1;
|
|
63
63
|
const monotonicTimeNanos = monotonicTimeNanos$1;
|
|
64
64
|
//#endregion
|
|
65
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
66
|
-
const TypeId$
|
|
65
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/dateTime.js
|
|
66
|
+
const TypeId$11 = "~effect/DateTime";
|
|
67
67
|
const TimeZoneTypeId = "~effect/DateTime/TimeZone";
|
|
68
68
|
const Proto$3 = {
|
|
69
|
-
[TypeId$
|
|
69
|
+
[TypeId$11]: TypeId$11,
|
|
70
70
|
pipe() {
|
|
71
71
|
return pipeArguments(this, arguments);
|
|
72
72
|
},
|
|
@@ -149,7 +149,7 @@ const ProtoTimeZoneOffset = {
|
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
|
-
const isDateTime$1 = (u) => hasProperty(u, TypeId$
|
|
152
|
+
const isDateTime$1 = (u) => hasProperty(u, TypeId$11);
|
|
153
153
|
const isTimeZone = (u) => hasProperty(u, TimeZoneTypeId);
|
|
154
154
|
const isUtc$1 = (self) => self._tag === "Utc";
|
|
155
155
|
const makeUtc = (epochMillis) => {
|
|
@@ -233,7 +233,7 @@ const formatIsoOffset = (self) => {
|
|
|
233
233
|
};
|
|
234
234
|
const formatIsoZoned = (self) => self.zone._tag === "Offset" ? formatIsoOffset(self) : `${formatIsoOffset(self)}[${self.zone.id}]`;
|
|
235
235
|
//#endregion
|
|
236
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
236
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/redacted.js
|
|
237
237
|
const redactedRegistry = new WeakMap();
|
|
238
238
|
const value$1 = (self) => {
|
|
239
239
|
if (redactedRegistry.has(self)) return redactedRegistry.get(self);
|
|
@@ -241,9 +241,9 @@ const value$1 = (self) => {
|
|
|
241
241
|
};
|
|
242
242
|
const stringOrRedacted = (val) => typeof val === "string" ? val : value$1(val);
|
|
243
243
|
//#endregion
|
|
244
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
245
|
-
const TypeId$
|
|
246
|
-
const isRedacted = (u) => hasProperty(u, TypeId$
|
|
244
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Redacted.js
|
|
245
|
+
const TypeId$10 = "~effect/Redacted";
|
|
246
|
+
const isRedacted = (u) => hasProperty(u, TypeId$10);
|
|
247
247
|
const make$6 = (value, options) => {
|
|
248
248
|
const self = Object.create(Proto$2);
|
|
249
249
|
if (options?.label) self.label = options.label;
|
|
@@ -251,14 +251,14 @@ const make$6 = (value, options) => {
|
|
|
251
251
|
return self;
|
|
252
252
|
};
|
|
253
253
|
const Proto$2 = {
|
|
254
|
-
[TypeId$
|
|
254
|
+
[TypeId$10]: { _A: (_) => _ },
|
|
255
255
|
label: void 0,
|
|
256
256
|
...PipeInspectableProto,
|
|
257
257
|
toJSON() {
|
|
258
258
|
return this.toString();
|
|
259
259
|
},
|
|
260
260
|
toString() {
|
|
261
|
-
return `<redacted${isString(this.label) ? ":" + this.label : ""}>`;
|
|
261
|
+
return `<redacted${isString$1(this.label) ? ":" + this.label : ""}>`;
|
|
262
262
|
},
|
|
263
263
|
[symbol]() {
|
|
264
264
|
return hash(redactedRegistry.get(this));
|
|
@@ -270,10 +270,10 @@ const Proto$2 = {
|
|
|
270
270
|
const value = value$1;
|
|
271
271
|
const makeEquivalence = (isEquivalent) => make$8((x, y) => isEquivalent(value(x), value(y)));
|
|
272
272
|
//#endregion
|
|
273
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
274
|
-
const TypeId$
|
|
273
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/BigDecimal.js
|
|
274
|
+
const TypeId$9 = "~effect/BigDecimal";
|
|
275
275
|
const BigDecimalProto = {
|
|
276
|
-
[TypeId$
|
|
276
|
+
[TypeId$9]: TypeId$9,
|
|
277
277
|
[symbol]() {
|
|
278
278
|
const normalized = normalize(this);
|
|
279
279
|
return combine(string$1(String(normalized.value)), number$1(normalized.scale));
|
|
@@ -298,7 +298,7 @@ const BigDecimalProto = {
|
|
|
298
298
|
return pipeArguments(this, arguments);
|
|
299
299
|
}
|
|
300
300
|
};
|
|
301
|
-
const isBigDecimal = (u) => hasProperty(u, TypeId$
|
|
301
|
+
const isBigDecimal = (u) => hasProperty(u, TypeId$9);
|
|
302
302
|
const make$5 = (value, scale) => {
|
|
303
303
|
if (!Number.isSafeInteger(scale)) throw new RangeError(`Scale must be a safe integer, got ${scale}`);
|
|
304
304
|
const o = Object.create(BigDecimalProto);
|
|
@@ -374,7 +374,7 @@ const toExponential = (n) => {
|
|
|
374
374
|
};
|
|
375
375
|
const isZero = (n) => n.value === bigint0;
|
|
376
376
|
//#endregion
|
|
377
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
377
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/DateTime.js
|
|
378
378
|
const isDateTime = isDateTime$1;
|
|
379
379
|
const isUtc = isUtc$1;
|
|
380
380
|
const fromDateUnsafe = fromDateUnsafe$1;
|
|
@@ -388,8 +388,8 @@ const removeTime = removeTime$1;
|
|
|
388
388
|
const formatIso = formatIso$1;
|
|
389
389
|
const formatIsoDate = formatIsoDate$1;
|
|
390
390
|
//#endregion
|
|
391
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
392
|
-
const encode = (input) => encodeBytes(typeof input === "string" ? encoder.encode(input) : input);
|
|
391
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/encoding/Base64.js
|
|
392
|
+
const encode = (input) => encodeBytes(typeof input === "string" ? encoder$1.encode(input) : input);
|
|
393
393
|
const decode = (str) => {
|
|
394
394
|
const stripped = stripCrlf(str);
|
|
395
395
|
const length = stripped.length;
|
|
@@ -448,7 +448,7 @@ const encodeBytes = (bytes) => {
|
|
|
448
448
|
}
|
|
449
449
|
return result;
|
|
450
450
|
};
|
|
451
|
-
const encoder = new TextEncoder();
|
|
451
|
+
const encoder$1 = new TextEncoder();
|
|
452
452
|
const stripCrlf = (str) => str.replace(/[\n\r]/g, "");
|
|
453
453
|
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
454
454
|
const codes = new Uint8Array(123).fill(255);
|
|
@@ -459,9 +459,9 @@ const getCode = (charCode) => {
|
|
|
459
459
|
return codes[charCode];
|
|
460
460
|
};
|
|
461
461
|
//#endregion
|
|
462
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
463
|
-
const TypeId$
|
|
464
|
-
const isCookies = (u) => hasProperty(u, TypeId$
|
|
462
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/http/Cookies.js
|
|
463
|
+
const TypeId$8 = "~effect/http/Cookies";
|
|
464
|
+
const isCookies = (u) => hasProperty(u, TypeId$8);
|
|
465
465
|
const CookieTypeId = "~effect/http/Cookies/Cookie";
|
|
466
466
|
const isCookie = (u) => hasProperty(u, CookieTypeId);
|
|
467
467
|
const CookieErrorTypeId = "~effect/http/Cookies/CookieError";
|
|
@@ -479,7 +479,7 @@ var CookiesError = class CookiesError extends TaggedError$1("CookiesError") {
|
|
|
479
479
|
}
|
|
480
480
|
};
|
|
481
481
|
const Proto$1 = {
|
|
482
|
-
[TypeId$
|
|
482
|
+
[TypeId$8]: TypeId$8,
|
|
483
483
|
...BaseProto,
|
|
484
484
|
toJSON() {
|
|
485
485
|
return {
|
|
@@ -684,12 +684,12 @@ const tryDecodeURIComponent = (str) => {
|
|
|
684
684
|
}
|
|
685
685
|
};
|
|
686
686
|
//#endregion
|
|
687
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
688
|
-
const TypeId$
|
|
689
|
-
const isUrlParams = (u) => hasProperty(u, TypeId$
|
|
687
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/http/UrlParams.js
|
|
688
|
+
const TypeId$7 = "~effect/http/UrlParams";
|
|
689
|
+
const isUrlParams = (u) => hasProperty(u, TypeId$7);
|
|
690
690
|
const Proto = {
|
|
691
691
|
...PipeInspectableProto,
|
|
692
|
-
[TypeId$
|
|
692
|
+
[TypeId$7]: TypeId$7,
|
|
693
693
|
[Symbol.iterator]() {
|
|
694
694
|
return this.params[Symbol.iterator]();
|
|
695
695
|
},
|
|
@@ -758,7 +758,7 @@ const toRecord = (self) => {
|
|
|
758
758
|
};
|
|
759
759
|
const toReadonlyRecord = toRecord;
|
|
760
760
|
//#endregion
|
|
761
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
761
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/annotations.js
|
|
762
762
|
function resolve$1(ast) {
|
|
763
763
|
return ast.checks ? ast.checks[ast.checks.length - 1].annotations : ast.annotations;
|
|
764
764
|
}
|
|
@@ -805,7 +805,7 @@ const annotationExcludedKeys = new Set([
|
|
|
805
805
|
"toCodecArbitrary"
|
|
806
806
|
]);
|
|
807
807
|
//#endregion
|
|
808
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
808
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/parser.js
|
|
809
809
|
const missing = Symbol();
|
|
810
810
|
const succeed = succeed$2;
|
|
811
811
|
const missingExit = succeed(missing);
|
|
@@ -813,16 +813,16 @@ const sameExit = succeed(missing);
|
|
|
813
813
|
const toOption = (value) => value === missing ? none() : some(value);
|
|
814
814
|
const fromOptionExit = (option) => option._tag === "None" ? missingExit : succeed(option.value);
|
|
815
815
|
//#endregion
|
|
816
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
817
|
-
const TypeId$
|
|
816
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/SchemaIssue.js
|
|
817
|
+
const TypeId$6 = "~effect/SchemaIssue/Issue";
|
|
818
818
|
function isIssue(u) {
|
|
819
|
-
return hasProperty(u, TypeId$
|
|
819
|
+
return hasProperty(u, TypeId$6) && u[TypeId$6] === TypeId$6;
|
|
820
820
|
}
|
|
821
821
|
function hasInput(issue) {
|
|
822
822
|
return Object.hasOwn(issue, "input");
|
|
823
823
|
}
|
|
824
824
|
var IssueNodeImpl = class {
|
|
825
|
-
[TypeId$
|
|
825
|
+
[TypeId$6] = TypeId$6;
|
|
826
826
|
constructor(input, options) {
|
|
827
827
|
if (options?.reportInput === true && input !== missing) this.input = input;
|
|
828
828
|
}
|
|
@@ -1026,7 +1026,7 @@ function findMessage(issue) {
|
|
|
1026
1026
|
if (typeof message === "string") return message;
|
|
1027
1027
|
}
|
|
1028
1028
|
//#endregion
|
|
1029
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
1029
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/cause.js
|
|
1030
1030
|
function getSchemaIssue(cause) {
|
|
1031
1031
|
let issue;
|
|
1032
1032
|
for (const reason of cause.reasons) {
|
|
@@ -1041,7 +1041,7 @@ function getSchemaIssueOrThrow(cause, message) {
|
|
|
1041
1041
|
return issue;
|
|
1042
1042
|
}
|
|
1043
1043
|
//#endregion
|
|
1044
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
1044
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/SchemaGetter.js
|
|
1045
1045
|
const runGetter = (self, input, options) => {
|
|
1046
1046
|
switch (self._tag) {
|
|
1047
1047
|
case "Passthrough": return succeed$3(input);
|
|
@@ -1169,7 +1169,7 @@ function dateTimeUtcFromInput$1() {
|
|
|
1169
1169
|
});
|
|
1170
1170
|
}
|
|
1171
1171
|
//#endregion
|
|
1172
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
1172
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/SchemaTransformation.js
|
|
1173
1173
|
const Middleware = class extends Class$2 {
|
|
1174
1174
|
_tag = "Middleware";
|
|
1175
1175
|
decode;
|
|
@@ -1183,9 +1183,9 @@ const Middleware = class extends Class$2 {
|
|
|
1183
1183
|
return new Middleware(this.encode, this.decode);
|
|
1184
1184
|
}
|
|
1185
1185
|
};
|
|
1186
|
-
const TypeId$
|
|
1186
|
+
const TypeId$5 = "~effect/SchemaTransformation/Transformation";
|
|
1187
1187
|
const Transformation = class extends Class$2 {
|
|
1188
|
-
[TypeId$
|
|
1188
|
+
[TypeId$5] = TypeId$5;
|
|
1189
1189
|
_tag = "Transformation";
|
|
1190
1190
|
decode;
|
|
1191
1191
|
encode;
|
|
@@ -1199,7 +1199,7 @@ const Transformation = class extends Class$2 {
|
|
|
1199
1199
|
}
|
|
1200
1200
|
};
|
|
1201
1201
|
function isTransformation(u) {
|
|
1202
|
-
return hasProperty(u, TypeId$
|
|
1202
|
+
return hasProperty(u, TypeId$5) && u[TypeId$5] === TypeId$5;
|
|
1203
1203
|
}
|
|
1204
1204
|
const makeTransformation = (options) => {
|
|
1205
1205
|
if (isTransformation(options)) return options;
|
|
@@ -1285,7 +1285,7 @@ function fromJsonString$1(options) {
|
|
|
1285
1285
|
return new Transformation(parseJson(options ?? {}), stringifyJson(options));
|
|
1286
1286
|
}
|
|
1287
1287
|
//#endregion
|
|
1288
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
1288
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/SchemaAST.js
|
|
1289
1289
|
function makeGuard(tag) {
|
|
1290
1290
|
return (ast) => ast._tag === tag;
|
|
1291
1291
|
}
|
|
@@ -1318,9 +1318,9 @@ const Context = class {
|
|
|
1318
1318
|
this.annotations = annotations;
|
|
1319
1319
|
}
|
|
1320
1320
|
};
|
|
1321
|
-
const TypeId$
|
|
1321
|
+
const TypeId$4 = "~effect/Schema";
|
|
1322
1322
|
var ASTNodeImpl = class {
|
|
1323
|
-
[TypeId$
|
|
1323
|
+
[TypeId$4] = TypeId$4;
|
|
1324
1324
|
annotations;
|
|
1325
1325
|
checks;
|
|
1326
1326
|
encoding;
|
|
@@ -1398,8 +1398,8 @@ const undefined_ = new Undefined$1();
|
|
|
1398
1398
|
const Void$1 = class extends ASTNodeImpl {
|
|
1399
1399
|
_tag = "Void";
|
|
1400
1400
|
getParser() {
|
|
1401
|
-
const succeed$
|
|
1402
|
-
return (input) => input === missing ? missingExit : succeed$
|
|
1401
|
+
const succeed$5 = succeed(void 0);
|
|
1402
|
+
return (input) => input === missing ? missingExit : succeed$5;
|
|
1403
1403
|
}
|
|
1404
1404
|
toCodecJson() {
|
|
1405
1405
|
return replaceEncoding(this, [undefinedToNull]);
|
|
@@ -1470,7 +1470,7 @@ function literalToString(ast) {
|
|
|
1470
1470
|
const String$2 = class extends ASTNodeImpl {
|
|
1471
1471
|
_tag = "String";
|
|
1472
1472
|
getParser() {
|
|
1473
|
-
return fromRefinement(this, isString);
|
|
1473
|
+
return fromRefinement(this, isString$1);
|
|
1474
1474
|
}
|
|
1475
1475
|
matchPart(s, options) {
|
|
1476
1476
|
const checks = this.checks;
|
|
@@ -1606,7 +1606,7 @@ const Arrays = class extends ASTNodeImpl {
|
|
|
1606
1606
|
if (!eff) return finish(state);
|
|
1607
1607
|
if (effectIsExit(eff)) return flatMapEager(eff, () => finish(state));
|
|
1608
1608
|
let first = true;
|
|
1609
|
-
return suspend(() => {
|
|
1609
|
+
return suspend$1(() => {
|
|
1610
1610
|
if (!first) return parse(input, options);
|
|
1611
1611
|
first = false;
|
|
1612
1612
|
return flatMap(eff, () => finish(state));
|
|
@@ -2292,7 +2292,13 @@ function parseUnionCandidates(ast, parser, candidates, input, options) {
|
|
|
2292
2292
|
if (state.out) return state.out;
|
|
2293
2293
|
return fail$2(new AnyOf(ast, state.issues ?? [], input, options));
|
|
2294
2294
|
}
|
|
2295
|
-
return resumeUnion(eff, state);
|
|
2295
|
+
if (effectIsExit(eff)) return resumeUnion(eff, state);
|
|
2296
|
+
let first = true;
|
|
2297
|
+
return suspend$1(() => {
|
|
2298
|
+
if (!first) return parseUnionCandidates(ast, parser, candidates, input, options);
|
|
2299
|
+
first = false;
|
|
2300
|
+
return resumeUnion(eff, state);
|
|
2301
|
+
});
|
|
2296
2302
|
}
|
|
2297
2303
|
function resumeUnion(eff, state) {
|
|
2298
2304
|
return flatMapEager(eff, (_) => {
|
|
@@ -2647,10 +2653,10 @@ function containsUndefined(ast) {
|
|
|
2647
2653
|
}
|
|
2648
2654
|
}
|
|
2649
2655
|
function fromConst(ast, value) {
|
|
2650
|
-
const succeed$
|
|
2656
|
+
const succeed$4 = value === 0 ? sameExit : succeed(value);
|
|
2651
2657
|
return (input, options) => {
|
|
2652
2658
|
if (input === missing) return missingExit;
|
|
2653
|
-
if (input === value) return succeed$
|
|
2659
|
+
if (input === value) return succeed$4;
|
|
2654
2660
|
return fail$2(new InvalidType(ast, input, options));
|
|
2655
2661
|
};
|
|
2656
2662
|
}
|
|
@@ -2808,7 +2814,7 @@ const StringTree = new Declaration([], () => (input, ast, options) => isStringTr
|
|
|
2808
2814
|
});
|
|
2809
2815
|
const unknownToStringTree = new Link(StringTree, passthrough());
|
|
2810
2816
|
//#endregion
|
|
2811
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
2817
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/interpreter.js
|
|
2812
2818
|
const flatMapTransformation = (result, current, f) => result === sameExit ? f(current) : flatMapEager(result, f);
|
|
2813
2819
|
function compileTransformation(transformation) {
|
|
2814
2820
|
if (transformation._tag === "Middleware") return (result, current, options) => {
|
|
@@ -2940,7 +2946,7 @@ function compile(ast, compile, compileField, base, specialize) {
|
|
|
2940
2946
|
};
|
|
2941
2947
|
}
|
|
2942
2948
|
//#endregion
|
|
2943
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
2949
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/compilerRegistry.js
|
|
2944
2950
|
const invalid = Symbol();
|
|
2945
2951
|
const cache = new WeakMap();
|
|
2946
2952
|
let compiler;
|
|
@@ -3028,7 +3034,7 @@ function resolve(ast) {
|
|
|
3028
3034
|
return entry;
|
|
3029
3035
|
}
|
|
3030
3036
|
//#endregion
|
|
3031
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
3037
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/SchemaParser.js
|
|
3032
3038
|
function makeEffect(schema) {
|
|
3033
3039
|
const ast = schema.ast;
|
|
3034
3040
|
let parser;
|
|
@@ -3182,11 +3188,11 @@ function makeConstructorSync(ast) {
|
|
|
3182
3188
|
const normalCompiler = (ast) => resolve(ast).parser;
|
|
3183
3189
|
const constructorCompiler = (ast) => resolve(ast).makeEffect;
|
|
3184
3190
|
//#endregion
|
|
3185
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
3186
|
-
const TypeId$
|
|
3191
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/make.js
|
|
3192
|
+
const TypeId$3 = "~effect/Schema/Schema";
|
|
3187
3193
|
const RebuildOptions = Symbol();
|
|
3188
3194
|
const SchemaProto = {
|
|
3189
|
-
[TypeId$
|
|
3195
|
+
[TypeId$3]: TypeId$3,
|
|
3190
3196
|
get make() {
|
|
3191
3197
|
const value = make$2(this);
|
|
3192
3198
|
Object.defineProperty(this, "make", {
|
|
@@ -3237,7 +3243,7 @@ function make$1(ast, options) {
|
|
|
3237
3243
|
return self;
|
|
3238
3244
|
}
|
|
3239
3245
|
//#endregion
|
|
3240
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
3246
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/JsonPointer.js
|
|
3241
3247
|
function escapeToken(token) {
|
|
3242
3248
|
return token.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
3243
3249
|
}
|
|
@@ -3264,7 +3270,7 @@ function parseUriFragment(fragment) {
|
|
|
3264
3270
|
return pointer === void 0 ? void 0 : pointer.length === 0 ? [] : pointer.slice(1).split("/").map(unescapeToken);
|
|
3265
3271
|
}
|
|
3266
3272
|
//#endregion
|
|
3267
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
3273
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/JsonSchema.js
|
|
3268
3274
|
function getReferenceKey($ref) {
|
|
3269
3275
|
const path = $ref.startsWith("#") ? parseUriFragment($ref) : void 0;
|
|
3270
3276
|
return path !== void 0 && path.length === 2 && path[0] === "$defs" ? path[1] : void 0;
|
|
@@ -3360,7 +3366,7 @@ const OPEN_API_30_TO_2020_COLLISIONS = [
|
|
|
3360
3366
|
"then"
|
|
3361
3367
|
];
|
|
3362
3368
|
//#endregion
|
|
3363
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
3369
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/toCodec.js
|
|
3364
3370
|
function toCodecJson$1(schema) {
|
|
3365
3371
|
return make$1(toCodecJsonAST(schema.ast), { schema });
|
|
3366
3372
|
}
|
|
@@ -3486,17 +3492,17 @@ const toCodecStringTreeAST = applyToSelfOrLastLinkEncodingIdempotent((ast) => {
|
|
|
3486
3492
|
return out;
|
|
3487
3493
|
}, { stopAt: isCodecArrayFromSingleLink });
|
|
3488
3494
|
//#endregion
|
|
3489
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
3495
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/RegExp.js
|
|
3490
3496
|
const RegExp$1 = globalThis.RegExp;
|
|
3491
3497
|
const escape = (string) => string.replace(/[/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
3492
3498
|
//#endregion
|
|
3493
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
3499
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/errors.js
|
|
3494
3500
|
function errorWithPath(message, path) {
|
|
3495
3501
|
if (path.length > 0) message += `\n at ${formatPath(path)}`;
|
|
3496
3502
|
return new Error(message);
|
|
3497
3503
|
}
|
|
3498
3504
|
//#endregion
|
|
3499
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
3505
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/toJsonSchemaDocument.js
|
|
3500
3506
|
function formatDefinitionReference(key) {
|
|
3501
3507
|
return `#/$defs/${formatUriFragmentToken(key)}`;
|
|
3502
3508
|
}
|
|
@@ -3579,6 +3585,27 @@ function hasOnlyKeywords(schema, allowed) {
|
|
|
3579
3585
|
function hasNoCollisions(left, rightKeys) {
|
|
3580
3586
|
return typeof left.$ref !== "string" && rightKeys.every((key) => !Object.hasOwn(left, key));
|
|
3581
3587
|
}
|
|
3588
|
+
const lowerBoundKeywords = "|minimum|exclusiveMinimum|minLength|minItems|minProperties|";
|
|
3589
|
+
const upperBoundKeywords = "|maximum|exclusiveMaximum|maxLength|maxItems|maxProperties|";
|
|
3590
|
+
function mergeInlineCheck(left, right, rightKeys) {
|
|
3591
|
+
if (typeof left.$ref === "string") return void 0;
|
|
3592
|
+
const out = {
|
|
3593
|
+
...left,
|
|
3594
|
+
...right
|
|
3595
|
+
};
|
|
3596
|
+
for (const key of rightKeys) {
|
|
3597
|
+
if (!Object.hasOwn(left, key)) continue;
|
|
3598
|
+
const a = left[key];
|
|
3599
|
+
const b = right[key];
|
|
3600
|
+
if (typeof a !== "number" || typeof b !== "number") return void 0;
|
|
3601
|
+
if (lowerBoundKeywords.includes(`|${key}|`)) out[key] = Math.max(a, b);
|
|
3602
|
+
else if (upperBoundKeywords.includes(`|${key}|`)) out[key] = Math.min(a, b);
|
|
3603
|
+
else return void 0;
|
|
3604
|
+
}
|
|
3605
|
+
if (typeof out.minimum === "number" && typeof out.exclusiveMinimum === "number") delete out[out.exclusiveMinimum >= out.minimum ? "minimum" : "exclusiveMinimum"];
|
|
3606
|
+
if (typeof out.maximum === "number" && typeof out.exclusiveMaximum === "number") delete out[out.exclusiveMaximum <= out.maximum ? "maximum" : "exclusiveMaximum"];
|
|
3607
|
+
return out;
|
|
3608
|
+
}
|
|
3582
3609
|
const promotableAnnotationKeywords = "|title|description|default|examples|readOnly|writeOnly|";
|
|
3583
3610
|
const inlineableAnnotatedCheckKeywords = inlineableCheckKeywords + promotableAnnotationKeywords;
|
|
3584
3611
|
function appendJsonSchema(left, right, inlineCheck) {
|
|
@@ -3604,10 +3631,10 @@ function appendJsonSchema(left, right, inlineCheck) {
|
|
|
3604
3631
|
} : appendJsonSchema(base, extracted.schema, inlineCheck);
|
|
3605
3632
|
}
|
|
3606
3633
|
}
|
|
3607
|
-
if (inlineCheck
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
}
|
|
3634
|
+
if (inlineCheck) {
|
|
3635
|
+
const merged = mergeInlineCheck(left, right, rightKeys);
|
|
3636
|
+
if (merged !== void 0) return merged;
|
|
3637
|
+
}
|
|
3611
3638
|
const members = Array.isArray(right.allOf) && rightKeys.length === 1 ? right.allOf : [right];
|
|
3612
3639
|
if (Array.isArray(left.allOf)) return {
|
|
3613
3640
|
...left,
|
|
@@ -4044,7 +4071,7 @@ function toJsonSchemaDocument$1(document, options) {
|
|
|
4044
4071
|
};
|
|
4045
4072
|
}
|
|
4046
4073
|
//#endregion
|
|
4047
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
4074
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/toRepresentation.js
|
|
4048
4075
|
const defaultReferencePolicy = ({ identifier }) => identifier;
|
|
4049
4076
|
function annotationsField(annotations) {
|
|
4050
4077
|
return annotations === void 0 ? void 0 : { annotations };
|
|
@@ -4308,7 +4335,7 @@ function toRepresentations(asts, options) {
|
|
|
4308
4335
|
}
|
|
4309
4336
|
}
|
|
4310
4337
|
//#endregion
|
|
4311
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
4338
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Struct.js
|
|
4312
4339
|
const omit = dual(2, (self, keys) => {
|
|
4313
4340
|
return buildStruct(self, (k, v) => !hasPropertyKey(keys, k) ? [k, v] : void 0);
|
|
4314
4341
|
});
|
|
@@ -4332,14 +4359,456 @@ function buildStruct(source, f) {
|
|
|
4332
4359
|
return out;
|
|
4333
4360
|
}
|
|
4334
4361
|
//#endregion
|
|
4335
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
4362
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schemaError.js
|
|
4336
4363
|
const SchemaErrorTypeId = "~effect/Schema/SchemaError";
|
|
4337
4364
|
function isSchemaError$1(u) {
|
|
4338
4365
|
return hasProperty(u, "~effect/Schema/SchemaError") && u["~effect/Schema/SchemaError"] === "~effect/Schema/SchemaError";
|
|
4339
4366
|
}
|
|
4340
4367
|
//#endregion
|
|
4341
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
4342
|
-
const TypeId =
|
|
4368
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/net/NetAddress.js
|
|
4369
|
+
const TypeId$2 = "~effect/net/NetAddress";
|
|
4370
|
+
const ipv4Value = (self) => self.value;
|
|
4371
|
+
const ipv6Words = (self) => self;
|
|
4372
|
+
const getMacBytes = (self) => self.bytes;
|
|
4373
|
+
var NetAddressError = class extends TaggedError$1("NetAddressError") {};
|
|
4374
|
+
const isAddress = (u) => hasProperty(u, TypeId$2);
|
|
4375
|
+
const isIpv4Address = (u) => isAddress(u) && u._tag === "Ipv4Address";
|
|
4376
|
+
const isIpv6Address = (u) => isAddress(u) && u._tag === "Ipv6Address";
|
|
4377
|
+
const isMacAddress = (u) => isAddress(u) && u._tag === "MacAddress";
|
|
4378
|
+
const isInetAddressV4 = (u) => isAddress(u) && u._tag === "InetAddressV4";
|
|
4379
|
+
const isInetAddressV6 = (u) => isAddress(u) && u._tag === "InetAddressV6";
|
|
4380
|
+
const isUnixPathAddress = (u) => isAddress(u) && u._tag === "UnixPathAddress";
|
|
4381
|
+
const Ipv4Proto = {
|
|
4382
|
+
...BaseProto,
|
|
4383
|
+
_tag: "Ipv4Address",
|
|
4384
|
+
[TypeId$2]: TypeId$2,
|
|
4385
|
+
[symbol$1](that) {
|
|
4386
|
+
return isIpv4Address(that) && ipv4Value(this) === ipv4Value(that);
|
|
4387
|
+
},
|
|
4388
|
+
[symbol]() {
|
|
4389
|
+
return optimize(combine(ipv4HashSeed, ipv4Value(this) | 0));
|
|
4390
|
+
},
|
|
4391
|
+
toString() {
|
|
4392
|
+
return formatIp(this);
|
|
4393
|
+
},
|
|
4394
|
+
toJSON() {
|
|
4395
|
+
return this.toString();
|
|
4396
|
+
}
|
|
4397
|
+
};
|
|
4398
|
+
const Ipv6Proto = {
|
|
4399
|
+
...BaseProto,
|
|
4400
|
+
_tag: "Ipv6Address",
|
|
4401
|
+
[TypeId$2]: TypeId$2,
|
|
4402
|
+
[symbol$1](that) {
|
|
4403
|
+
if (!isIpv6Address(that)) return false;
|
|
4404
|
+
const self = ipv6Words(this);
|
|
4405
|
+
const other = ipv6Words(that);
|
|
4406
|
+
return self.w0 === other.w0 && self.w1 === other.w1 && self.w2 === other.w2 && self.w3 === other.w3;
|
|
4407
|
+
},
|
|
4408
|
+
[symbol]() {
|
|
4409
|
+
const self = ipv6Words(this);
|
|
4410
|
+
let h = combine(ipv6HashSeed, self.w0 | 0);
|
|
4411
|
+
h = combine(h, self.w1 | 0);
|
|
4412
|
+
h = combine(h, self.w2 | 0);
|
|
4413
|
+
return optimize(combine(h, self.w3 | 0));
|
|
4414
|
+
},
|
|
4415
|
+
toString() {
|
|
4416
|
+
return formatIp(this);
|
|
4417
|
+
},
|
|
4418
|
+
toJSON() {
|
|
4419
|
+
return this.toString();
|
|
4420
|
+
}
|
|
4421
|
+
};
|
|
4422
|
+
const MacProto = {
|
|
4423
|
+
...BaseProto,
|
|
4424
|
+
_tag: "MacAddress",
|
|
4425
|
+
[TypeId$2]: TypeId$2,
|
|
4426
|
+
[symbol$1](that) {
|
|
4427
|
+
return isMacAddress(that) && bytesEqual(getMacBytes(this), getMacBytes(that));
|
|
4428
|
+
},
|
|
4429
|
+
[symbol]() {
|
|
4430
|
+
return combine(macHashSeed, array(getMacBytes(this)));
|
|
4431
|
+
},
|
|
4432
|
+
toString() {
|
|
4433
|
+
return formatMacAddress(this);
|
|
4434
|
+
},
|
|
4435
|
+
toJSON() {
|
|
4436
|
+
return this.toString();
|
|
4437
|
+
}
|
|
4438
|
+
};
|
|
4439
|
+
const bytesEqual = (self, that) => {
|
|
4440
|
+
if (self.length !== that.length) return false;
|
|
4441
|
+
for (let index = 0; index < self.length; index++) if (self[index] !== that[index]) return false;
|
|
4442
|
+
return true;
|
|
4443
|
+
};
|
|
4444
|
+
const ipv4HashSeed = string$1("Ipv4Address");
|
|
4445
|
+
const ipv6HashSeed = string$1("Ipv6Address");
|
|
4446
|
+
const macHashSeed = string$1("MacAddress");
|
|
4447
|
+
const makeIpv4 = (value) => {
|
|
4448
|
+
const self = Object.create(Ipv4Proto);
|
|
4449
|
+
self.value = value >>> 0;
|
|
4450
|
+
return Object.freeze(self);
|
|
4451
|
+
};
|
|
4452
|
+
const makeIpv6 = (w0, w1, w2, w3) => {
|
|
4453
|
+
const self = Object.create(Ipv6Proto);
|
|
4454
|
+
self.w0 = w0 >>> 0;
|
|
4455
|
+
self.w1 = w1 >>> 0;
|
|
4456
|
+
self.w2 = w2 >>> 0;
|
|
4457
|
+
self.w3 = w3 >>> 0;
|
|
4458
|
+
return Object.freeze(self);
|
|
4459
|
+
};
|
|
4460
|
+
const packOctets = (a, b, c, d) => (a << 24 | b << 16 | c << 8 | d) >>> 0;
|
|
4461
|
+
const wordToOctets = (word) => [
|
|
4462
|
+
word >>> 24,
|
|
4463
|
+
word >>> 16 & 255,
|
|
4464
|
+
word >>> 8 & 255,
|
|
4465
|
+
word & 255
|
|
4466
|
+
];
|
|
4467
|
+
const addressError = (input, message) => fail$1(new NetAddressError({
|
|
4468
|
+
input,
|
|
4469
|
+
message
|
|
4470
|
+
}));
|
|
4471
|
+
const allIntegersInRange = (values, max) => {
|
|
4472
|
+
for (let i = 0; i < values.length; i++) {
|
|
4473
|
+
const n = values[i];
|
|
4474
|
+
if (!Number.isInteger(n) || n < 0 || n > max) return false;
|
|
4475
|
+
}
|
|
4476
|
+
return true;
|
|
4477
|
+
};
|
|
4478
|
+
const ipv4FromOctets = (octets) => {
|
|
4479
|
+
if (!allIntegersInRange(octets, 255)) return addressError(octets, "octets must be integers from 0 through 255");
|
|
4480
|
+
return succeed$1(makeIpv4(packOctets(octets[0], octets[1], octets[2], octets[3])));
|
|
4481
|
+
};
|
|
4482
|
+
const ipv6FromSegments = (segments) => {
|
|
4483
|
+
if (!allIntegersInRange(segments, 65535)) return addressError(segments, "segments must be integers from 0 through 65535");
|
|
4484
|
+
return succeed$1(makeIpv6(segments[0] * 65536 + segments[1], segments[2] * 65536 + segments[3], segments[4] * 65536 + segments[5], segments[6] * 65536 + segments[7]));
|
|
4485
|
+
};
|
|
4486
|
+
const ipv4FromString = (input) => {
|
|
4487
|
+
const parts = input.split(".");
|
|
4488
|
+
if (parts.length !== 4 || parts.some((part) => !/^\d{1,3}$/.test(part))) return addressError(input, "expected exactly four decimal octets");
|
|
4489
|
+
if (parts.some((part) => part.length > 1 && part[0] === "0")) return addressError(input, "leading zeroes are not allowed");
|
|
4490
|
+
const octets = parts.map(Number);
|
|
4491
|
+
if (octets.some((part) => part > 255)) return addressError(input, "octets must be at most 255");
|
|
4492
|
+
return ipv4FromOctets([
|
|
4493
|
+
octets[0],
|
|
4494
|
+
octets[1],
|
|
4495
|
+
octets[2],
|
|
4496
|
+
octets[3]
|
|
4497
|
+
]);
|
|
4498
|
+
};
|
|
4499
|
+
const parseIpv6Segments = (input) => {
|
|
4500
|
+
if (input.includes("[") || input.includes("]") || input.includes("%")) return addressError(input, "brackets and zone identifiers are not valid in a bare IPv6 address");
|
|
4501
|
+
const halves = input.split("::");
|
|
4502
|
+
if (halves.length > 2) return addressError(input, "only one compression marker is allowed");
|
|
4503
|
+
const head = halves[0] === "" ? [] : halves[0].split(":");
|
|
4504
|
+
const tail = halves.length === 2 && halves[1] !== "" ? halves[1].split(":") : [];
|
|
4505
|
+
if (head.some((part) => part === "") || tail.some((part) => part === "")) return addressError(input, "empty segments are only valid in the compression marker");
|
|
4506
|
+
const trailing = tail.length > 0 ? tail[tail.length - 1] : head.length > 0 ? head[head.length - 1] : "";
|
|
4507
|
+
let embedded;
|
|
4508
|
+
if (trailing.includes(".")) {
|
|
4509
|
+
if (halves.length === 2 && tail.length === 0) return addressError(input, "embedded IPv4 syntax must be trailing");
|
|
4510
|
+
const parsed = map$6(ipv4FromString(trailing), (address) => {
|
|
4511
|
+
const value = ipv4Value(address);
|
|
4512
|
+
return [value >>> 16, value & 65535];
|
|
4513
|
+
});
|
|
4514
|
+
if (isFailure(parsed)) return parsed;
|
|
4515
|
+
embedded = parsed.success;
|
|
4516
|
+
if (tail.length > 0) tail.pop();
|
|
4517
|
+
else head.pop();
|
|
4518
|
+
}
|
|
4519
|
+
const explicit = head.length + tail.length + (embedded ? 2 : 0);
|
|
4520
|
+
if (halves.length === 1 ? explicit !== 8 : explicit >= 8) return addressError(input, halves.length === 1 ? "expected eight segments" : "compression must replace at least one segment");
|
|
4521
|
+
const parse = (part) => /^[0-9a-fA-F]{1,4}$/.test(part) ? Number.parseInt(part, 16) : void 0;
|
|
4522
|
+
const parsedHead = head.map(parse);
|
|
4523
|
+
const parsedTail = tail.map(parse);
|
|
4524
|
+
if (parsedHead.some((part) => part === void 0) || parsedTail.some((part) => part === void 0)) return addressError(input, "segments must contain one through four hexadecimal digits");
|
|
4525
|
+
return succeed$1([
|
|
4526
|
+
...parsedHead,
|
|
4527
|
+
...Array(8 - explicit).fill(0),
|
|
4528
|
+
...parsedTail,
|
|
4529
|
+
...embedded ?? []
|
|
4530
|
+
]);
|
|
4531
|
+
};
|
|
4532
|
+
const ipv6FromString = (input) => {
|
|
4533
|
+
return flatMap$1(parseIpv6Segments(input), (segments) => ipv6FromSegments(segments));
|
|
4534
|
+
};
|
|
4535
|
+
const ipv4ToOctets = (self) => wordToOctets(ipv4Value(self));
|
|
4536
|
+
const ipv6ToSegments = (self) => {
|
|
4537
|
+
const { w0, w1, w2, w3 } = ipv6Words(self);
|
|
4538
|
+
return [
|
|
4539
|
+
w0 >>> 16,
|
|
4540
|
+
w0 & 65535,
|
|
4541
|
+
w1 >>> 16,
|
|
4542
|
+
w1 & 65535,
|
|
4543
|
+
w2 >>> 16,
|
|
4544
|
+
w2 & 65535,
|
|
4545
|
+
w3 >>> 16,
|
|
4546
|
+
w3 & 65535
|
|
4547
|
+
];
|
|
4548
|
+
};
|
|
4549
|
+
const formatMacAddress = (self) => Array.from(getMacBytes(self), (byte) => byte.toString(16).padStart(2, "0")).join(":");
|
|
4550
|
+
const formatIp = (self) => {
|
|
4551
|
+
if (isIpv4Address(self)) return ipv4ToOctets(self).join(".");
|
|
4552
|
+
const segments = ipv6ToSegments(self);
|
|
4553
|
+
if (isIpv4Mapped(self)) return `::ffff:${segments[6] >> 8}.${segments[6] & 255}.${segments[7] >> 8}.${segments[7] & 255}`;
|
|
4554
|
+
let bestStart = -1;
|
|
4555
|
+
let bestLength = 0;
|
|
4556
|
+
let start = -1;
|
|
4557
|
+
for (let index = 0; index <= 8; index++) if (index < 8 && segments[index] === 0) {
|
|
4558
|
+
if (start === -1) start = index;
|
|
4559
|
+
} else if (start !== -1) {
|
|
4560
|
+
if (index - start > bestLength) {
|
|
4561
|
+
bestStart = start;
|
|
4562
|
+
bestLength = index - start;
|
|
4563
|
+
}
|
|
4564
|
+
start = -1;
|
|
4565
|
+
}
|
|
4566
|
+
if (bestLength < 2) return segments.map((segment) => segment.toString(16)).join(":");
|
|
4567
|
+
return `${segments.slice(0, bestStart).map((segment) => segment.toString(16)).join(":")}::${segments.slice(bestStart + bestLength).map((segment) => segment.toString(16)).join(":")}`;
|
|
4568
|
+
};
|
|
4569
|
+
const isIpv4Mapped = (self) => {
|
|
4570
|
+
const { w0, w1, w2 } = ipv6Words(self);
|
|
4571
|
+
return w0 === 0 && w1 === 0 && w2 === 65535;
|
|
4572
|
+
};
|
|
4573
|
+
const InetV4Proto = {
|
|
4574
|
+
...BaseProto,
|
|
4575
|
+
_tag: "InetAddressV4",
|
|
4576
|
+
[TypeId$2]: TypeId$2,
|
|
4577
|
+
[symbol$1](that) {
|
|
4578
|
+
return isInetAddressV4(that) && this.port === that.port && equals(this.address, that.address);
|
|
4579
|
+
},
|
|
4580
|
+
[symbol]() {
|
|
4581
|
+
return combine(hash(this.address), number$1(this.port));
|
|
4582
|
+
},
|
|
4583
|
+
toString() {
|
|
4584
|
+
return formatInet(this);
|
|
4585
|
+
},
|
|
4586
|
+
toJSON() {
|
|
4587
|
+
return this.toString();
|
|
4588
|
+
}
|
|
4589
|
+
};
|
|
4590
|
+
const InetV6Proto = {
|
|
4591
|
+
...BaseProto,
|
|
4592
|
+
_tag: "InetAddressV6",
|
|
4593
|
+
[TypeId$2]: TypeId$2,
|
|
4594
|
+
[symbol$1](that) {
|
|
4595
|
+
return isInetAddressV6(that) && this.port === that.port && this.scopeId === that.scopeId && equals(this.address, that.address);
|
|
4596
|
+
},
|
|
4597
|
+
[symbol]() {
|
|
4598
|
+
return combine(combine(hash(this.address), number$1(this.port)), number$1(this.scopeId));
|
|
4599
|
+
},
|
|
4600
|
+
toString() {
|
|
4601
|
+
return formatInet(this);
|
|
4602
|
+
},
|
|
4603
|
+
toJSON() {
|
|
4604
|
+
return this.toString();
|
|
4605
|
+
}
|
|
4606
|
+
};
|
|
4607
|
+
const formatHost$1 = (self) => formatIp(self.address) + (isInetAddressV6(self) && self.scopeId !== 0 ? `%${self.scopeId}` : "");
|
|
4608
|
+
const formatInet = (self) => {
|
|
4609
|
+
const host = formatHost$1(self);
|
|
4610
|
+
return isInetAddressV4(self) ? `${host}:${self.port}` : `[${host}]:${self.port}`;
|
|
4611
|
+
};
|
|
4612
|
+
const UnixPathProto = {
|
|
4613
|
+
...BaseProto,
|
|
4614
|
+
_tag: "UnixPathAddress",
|
|
4615
|
+
[TypeId$2]: TypeId$2,
|
|
4616
|
+
[symbol$1](that) {
|
|
4617
|
+
return isUnixPathAddress(that) && this.path === that.path;
|
|
4618
|
+
},
|
|
4619
|
+
[symbol]() {
|
|
4620
|
+
return combine(string$1("UnixPathAddress"), string$1(this.path));
|
|
4621
|
+
},
|
|
4622
|
+
toString() {
|
|
4623
|
+
return this.path;
|
|
4624
|
+
},
|
|
4625
|
+
toJSON() {
|
|
4626
|
+
return this.toString();
|
|
4627
|
+
}
|
|
4628
|
+
};
|
|
4629
|
+
//#endregion
|
|
4630
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/net/Host.js
|
|
4631
|
+
const TypeId$1 = "~effect/net/Host";
|
|
4632
|
+
const labelPattern = /^[a-z0-9_](?:[a-z0-9_-]{0,61}[a-z0-9_])?$/;
|
|
4633
|
+
const numericLabel = /^(?:\d+|0x[0-9a-f]*)$/;
|
|
4634
|
+
const validateDomainName = (name) => {
|
|
4635
|
+
if (name === ".") return void 0;
|
|
4636
|
+
const relative = name.endsWith(".") ? name.slice(0, -1) : name;
|
|
4637
|
+
if (relative.length === 0) return "domain name must not be empty";
|
|
4638
|
+
if (relative.length > 253) return "domain name must be at most 253 characters";
|
|
4639
|
+
const labels = relative.split(".");
|
|
4640
|
+
for (const label of labels) {
|
|
4641
|
+
if (label.length === 0) return "domain name labels must not be empty";
|
|
4642
|
+
if (label.length > 63) return "domain name labels must be at most 63 characters";
|
|
4643
|
+
if (!labelPattern.test(label)) return "domain name labels must contain only letters, digits, hyphens, or underscores and must not start or end with a hyphen";
|
|
4644
|
+
}
|
|
4645
|
+
if (numericLabel.test(labels[labels.length - 1])) return "the last domain name label must not be numeric";
|
|
4646
|
+
};
|
|
4647
|
+
const isDomainName = (u) => typeof u === "string" && /^[a-z0-9_.-]+$/.test(u) && validateDomainName(u) === void 0;
|
|
4648
|
+
const isHostPort = (u) => hasProperty(u, TypeId$1);
|
|
4649
|
+
const formatHost = (self) => typeof self === "string" ? self : formatIp(self);
|
|
4650
|
+
const HostPortProto = {
|
|
4651
|
+
...BaseProto,
|
|
4652
|
+
_tag: "HostPort",
|
|
4653
|
+
[TypeId$1]: TypeId$1,
|
|
4654
|
+
[symbol$1](that) {
|
|
4655
|
+
return isHostPort(that) && this.port === that.port && equals(this.host, that.host);
|
|
4656
|
+
},
|
|
4657
|
+
[symbol]() {
|
|
4658
|
+
return combine(hash(this.host), number$1(this.port));
|
|
4659
|
+
},
|
|
4660
|
+
toString() {
|
|
4661
|
+
return formatHostPort(this);
|
|
4662
|
+
},
|
|
4663
|
+
toJSON() {
|
|
4664
|
+
return this.toString();
|
|
4665
|
+
}
|
|
4666
|
+
};
|
|
4667
|
+
const formatHostPort = (self) => {
|
|
4668
|
+
const host = formatHost(self.host);
|
|
4669
|
+
return host.includes(":") ? `[${host}]:${self.port}` : `${host}:${self.port}`;
|
|
4670
|
+
};
|
|
4671
|
+
//#endregion
|
|
4672
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/net/Dns.js
|
|
4673
|
+
const RecordTypeId = "~effect/net/Dns/DnsRecord";
|
|
4674
|
+
const isUint8 = (u) => Number.isInteger(u) && u >= 0 && u <= 255;
|
|
4675
|
+
const isUint16 = (u) => Number.isInteger(u) && u >= 0 && u <= 65535;
|
|
4676
|
+
const isUint32 = (u) => Number.isInteger(u) && u >= 0 && u <= 4294967295;
|
|
4677
|
+
const isString = (u) => typeof u === "string";
|
|
4678
|
+
const isTimer = (u) => isDuration(u) && isFinite$2(u) && isUint32(toSeconds(u));
|
|
4679
|
+
const recordFields = {
|
|
4680
|
+
A: { address: isIpv4Address },
|
|
4681
|
+
AAAA: { address: isIpv6Address },
|
|
4682
|
+
CAA: {
|
|
4683
|
+
critical: (u) => typeof u === "boolean",
|
|
4684
|
+
tag: (u) => isString(u) && /^[a-z0-9]+$/i.test(u),
|
|
4685
|
+
value: isString
|
|
4686
|
+
},
|
|
4687
|
+
CNAME: { target: isDomainName },
|
|
4688
|
+
MX: {
|
|
4689
|
+
exchange: isDomainName,
|
|
4690
|
+
priority: isUint16
|
|
4691
|
+
},
|
|
4692
|
+
NAPTR: {
|
|
4693
|
+
order: isUint16,
|
|
4694
|
+
preference: isUint16,
|
|
4695
|
+
flags: isString,
|
|
4696
|
+
service: isString,
|
|
4697
|
+
regexp: isString,
|
|
4698
|
+
replacement: isDomainName
|
|
4699
|
+
},
|
|
4700
|
+
NS: { host: isDomainName },
|
|
4701
|
+
PTR: { host: (u) => isString(u) && u.length > 0 },
|
|
4702
|
+
SOA: {
|
|
4703
|
+
primary: isDomainName,
|
|
4704
|
+
admin: (u) => isString(u) && u.length > 0,
|
|
4705
|
+
serial: isUint32,
|
|
4706
|
+
refresh: isTimer,
|
|
4707
|
+
retry: isTimer,
|
|
4708
|
+
expire: isTimer,
|
|
4709
|
+
minimum: isTimer
|
|
4710
|
+
},
|
|
4711
|
+
SRV: {
|
|
4712
|
+
target: isDomainName,
|
|
4713
|
+
port: isUint16,
|
|
4714
|
+
priority: isUint16,
|
|
4715
|
+
weight: isUint16
|
|
4716
|
+
},
|
|
4717
|
+
TLSA: {
|
|
4718
|
+
certUsage: isUint8,
|
|
4719
|
+
selector: isUint8,
|
|
4720
|
+
matchingType: isUint8,
|
|
4721
|
+
data: (u) => u instanceof Uint8Array && u.length > 0
|
|
4722
|
+
},
|
|
4723
|
+
TXT: { chunks: (u) => Array.isArray(u) && u.length > 0 && u.every(isString) }
|
|
4724
|
+
};
|
|
4725
|
+
const recordTypes = Object.keys(recordFields);
|
|
4726
|
+
const isRecordType = (u) => recordTypes.includes(u);
|
|
4727
|
+
const isDnsRecord = (u) => hasProperty(u, RecordTypeId);
|
|
4728
|
+
const RecordPrototype = {
|
|
4729
|
+
...BaseProto,
|
|
4730
|
+
[RecordTypeId]: RecordTypeId,
|
|
4731
|
+
[symbol$1](that) {
|
|
4732
|
+
return isDnsRecord(that) && that._tag === this._tag && Object.keys(this).every((key) => equals(this[key], that[key]));
|
|
4733
|
+
},
|
|
4734
|
+
[symbol]() {
|
|
4735
|
+
return structureKeys(this, Object.keys(this));
|
|
4736
|
+
},
|
|
4737
|
+
toString() {
|
|
4738
|
+
return formatRecord(this);
|
|
4739
|
+
},
|
|
4740
|
+
toJSON() {
|
|
4741
|
+
return { ...this };
|
|
4742
|
+
}
|
|
4743
|
+
};
|
|
4744
|
+
const makeRecord = (type, fields) => {
|
|
4745
|
+
if (!isRecordType(type)) return fail$1(new NetAddressError({
|
|
4746
|
+
input: type,
|
|
4747
|
+
message: "unknown DNS record type"
|
|
4748
|
+
}));
|
|
4749
|
+
const input = typeof fields === "object" && fields !== null ? fields : {};
|
|
4750
|
+
const self = Object.create(RecordPrototype);
|
|
4751
|
+
self._tag = type;
|
|
4752
|
+
for (const [key, check] of Object.entries(recordFields[type])) {
|
|
4753
|
+
const value = input[key];
|
|
4754
|
+
if (!check(value)) return fail$1(new NetAddressError({
|
|
4755
|
+
input: fields,
|
|
4756
|
+
message: `invalid ${type} record ${key}`
|
|
4757
|
+
}));
|
|
4758
|
+
self[key] = Array.isArray(value) ? Object.freeze([...value]) : value instanceof Uint8Array ? new Uint8Array(value) : value;
|
|
4759
|
+
}
|
|
4760
|
+
return succeed$1(Object.freeze(self));
|
|
4761
|
+
};
|
|
4762
|
+
const encoder = new TextEncoder();
|
|
4763
|
+
const decimalEscape = (byte) => `\\${byte.toString().padStart(3, "0")}`;
|
|
4764
|
+
const quote = (value) => {
|
|
4765
|
+
let out = "\"";
|
|
4766
|
+
for (const byte of encoder.encode(value)) out += byte === 34 || byte === 92 ? `\\${String.fromCharCode(byte)}` : byte < 32 || byte > 126 ? decimalEscape(byte) : String.fromCharCode(byte);
|
|
4767
|
+
return out + "\"";
|
|
4768
|
+
};
|
|
4769
|
+
const nameSpecials = [
|
|
4770
|
+
34,
|
|
4771
|
+
36,
|
|
4772
|
+
40,
|
|
4773
|
+
41,
|
|
4774
|
+
59,
|
|
4775
|
+
64
|
|
4776
|
+
];
|
|
4777
|
+
const formatName = (text) => {
|
|
4778
|
+
const bytes = encoder.encode(text);
|
|
4779
|
+
let out = "";
|
|
4780
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
4781
|
+
const byte = bytes[i];
|
|
4782
|
+
if (byte === 92) {
|
|
4783
|
+
const next = bytes[i + 1];
|
|
4784
|
+
if (next === 46 || next === 92) {
|
|
4785
|
+
out += `\\${String.fromCharCode(next)}`;
|
|
4786
|
+
i++;
|
|
4787
|
+
} else out += "\\\\";
|
|
4788
|
+
} else if (byte <= 32 || byte > 126) out += decimalEscape(byte);
|
|
4789
|
+
else out += nameSpecials.includes(byte) ? `\\${String.fromCharCode(byte)}` : String.fromCharCode(byte);
|
|
4790
|
+
}
|
|
4791
|
+
return out;
|
|
4792
|
+
};
|
|
4793
|
+
const formatRecord = (self) => {
|
|
4794
|
+
switch (self._tag) {
|
|
4795
|
+
case "A":
|
|
4796
|
+
case "AAAA": return `${self._tag} ${formatIp(self.address)}`;
|
|
4797
|
+
case "CAA": return `CAA ${self.critical ? 128 : 0} ${self.tag} ${quote(self.value)}`;
|
|
4798
|
+
case "CNAME": return `CNAME ${self.target}`;
|
|
4799
|
+
case "MX": return `MX ${self.priority} ${self.exchange}`;
|
|
4800
|
+
case "NAPTR": return `NAPTR ${self.order} ${self.preference} ${quote(self.flags)} ${quote(self.service)} ${quote(self.regexp)} ${self.replacement}`;
|
|
4801
|
+
case "NS": return `NS ${self.host}`;
|
|
4802
|
+
case "PTR": return `PTR ${formatName(self.host)}`;
|
|
4803
|
+
case "SOA": return `SOA ${self.primary} ${formatName(self.admin)} ${self.serial} ${toSeconds(self.refresh)} ${toSeconds(self.retry)} ${toSeconds(self.expire)} ${toSeconds(self.minimum)}`;
|
|
4804
|
+
case "SRV": return `SRV ${self.priority} ${self.weight} ${self.port} ${self.target}`;
|
|
4805
|
+
case "TLSA": return `TLSA ${self.certUsage} ${self.selector} ${self.matchingType} ${encode$1(self.data).toUpperCase()}`;
|
|
4806
|
+
case "TXT": return `TXT ${self.chunks.map(quote).join(" ")}`;
|
|
4807
|
+
}
|
|
4808
|
+
};
|
|
4809
|
+
//#endregion
|
|
4810
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Schema.js
|
|
4811
|
+
const TypeId = TypeId$3;
|
|
4343
4812
|
function declareConstructor() {
|
|
4344
4813
|
return (typeParameters, run, annotations) => {
|
|
4345
4814
|
return make(new Declaration(typeParameters.map(getAST), (typeParameters) => run(typeParameters.map((ast) => make(ast))), annotations));
|
|
@@ -4362,6 +4831,15 @@ var SchemaError = class extends TaggedError$1("SchemaError") {
|
|
|
4362
4831
|
get message() {
|
|
4363
4832
|
return defaultFormatter(this.issue);
|
|
4364
4833
|
}
|
|
4834
|
+
toJSON() {
|
|
4835
|
+
return {
|
|
4836
|
+
_tag: this._tag,
|
|
4837
|
+
message: this.message
|
|
4838
|
+
};
|
|
4839
|
+
}
|
|
4840
|
+
[NodeInspectSymbol]() {
|
|
4841
|
+
return this.toJSON();
|
|
4842
|
+
}
|
|
4365
4843
|
toString() {
|
|
4366
4844
|
return `SchemaError(${this.message})`;
|
|
4367
4845
|
}
|
|
@@ -4515,6 +4993,9 @@ function Literals(literals) {
|
|
|
4515
4993
|
}
|
|
4516
4994
|
const NullOr = lambda((self) => Union([self, Null]));
|
|
4517
4995
|
const UndefinedOr = lambda((self) => Union([self, Undefined]));
|
|
4996
|
+
function suspend(f) {
|
|
4997
|
+
return make(new Suspend(() => f().ast));
|
|
4998
|
+
}
|
|
4518
4999
|
function check(...checks) {
|
|
4519
5000
|
return (self) => self.check(...checks);
|
|
4520
5001
|
}
|
|
@@ -4603,6 +5084,7 @@ function toTaggedUnion(tag) {
|
|
|
4603
5084
|
const isAnyOf = (keys) => (value) => keys.includes(value[tag]);
|
|
4604
5085
|
walk(self);
|
|
4605
5086
|
return Object.assign(self, {
|
|
5087
|
+
tag,
|
|
4606
5088
|
cases,
|
|
4607
5089
|
discriminants,
|
|
4608
5090
|
isAnyOf,
|
|
@@ -4667,8 +5149,9 @@ function TaggedUnion(casesByTag) {
|
|
|
4667
5149
|
members.push(member);
|
|
4668
5150
|
}
|
|
4669
5151
|
const union = Union(members);
|
|
4670
|
-
const { guards, isAnyOf, match, matchOrElse } = toTaggedUnion("_tag")(union);
|
|
5152
|
+
const { tag, guards, isAnyOf, match, matchOrElse } = toTaggedUnion("_tag")(union);
|
|
4671
5153
|
return make(union.ast, {
|
|
5154
|
+
tag,
|
|
4672
5155
|
cases,
|
|
4673
5156
|
isAnyOf,
|
|
4674
5157
|
guards,
|
|
@@ -4685,9 +5168,6 @@ function link() {
|
|
|
4685
5168
|
};
|
|
4686
5169
|
}
|
|
4687
5170
|
const makeFilter = makeFilter$1;
|
|
4688
|
-
function makeFilterGroup(checks, annotations = void 0) {
|
|
4689
|
-
return new FilterGroup(checks, annotations);
|
|
4690
|
-
}
|
|
4691
5171
|
function isPattern(regExp, annotations) {
|
|
4692
5172
|
const source = regExp.source;
|
|
4693
5173
|
const flags = regExp.flags;
|
|
@@ -4877,7 +5357,11 @@ function isInt(annotations) {
|
|
|
4877
5357
|
id: "effect/schema/isInt",
|
|
4878
5358
|
payload: null
|
|
4879
5359
|
},
|
|
4880
|
-
toJsonSchema: () =>
|
|
5360
|
+
toJsonSchema: () => ({
|
|
5361
|
+
type: "integer",
|
|
5362
|
+
minimum: globalThis.Number.MIN_SAFE_INTEGER,
|
|
5363
|
+
maximum: globalThis.Number.MAX_SAFE_INTEGER
|
|
5364
|
+
}),
|
|
4881
5365
|
toCode: () => ({ runtime: "Schema.isInt()" }),
|
|
4882
5366
|
arbitraryConstraint: { number: "integer" },
|
|
4883
5367
|
...annotations
|
|
@@ -5078,6 +5562,40 @@ function isMaxLength(maxLength, annotations) {
|
|
|
5078
5562
|
...annotations
|
|
5079
5563
|
});
|
|
5080
5564
|
}
|
|
5565
|
+
function isMinCodePoints(minCodePoints, annotations) {
|
|
5566
|
+
minCodePoints = normalizeCardinality(minCodePoints);
|
|
5567
|
+
return makeFilter((input) => countCodePointsUpTo(input, minCodePoints) >= minCodePoints, {
|
|
5568
|
+
expected: `a string with at least ${minCodePoints} code points`,
|
|
5569
|
+
representation: {
|
|
5570
|
+
id: "effect/schema/isMinCodePoints",
|
|
5571
|
+
payload: { minCodePoints }
|
|
5572
|
+
},
|
|
5573
|
+
toJsonSchema: () => ({ minLength: minCodePoints }),
|
|
5574
|
+
toCode: () => ({ runtime: `Schema.isMinCodePoints(${minCodePoints})` }),
|
|
5575
|
+
arbitraryConstraint: { minCodePoints },
|
|
5576
|
+
...annotations
|
|
5577
|
+
});
|
|
5578
|
+
}
|
|
5579
|
+
function isMaxCodePoints(maxCodePoints, annotations) {
|
|
5580
|
+
maxCodePoints = normalizeCardinality(maxCodePoints);
|
|
5581
|
+
return makeFilter((input) => countCodePointsUpTo(input, maxCodePoints + 1) <= maxCodePoints, {
|
|
5582
|
+
expected: `a string with at most ${maxCodePoints} code points`,
|
|
5583
|
+
representation: {
|
|
5584
|
+
id: "effect/schema/isMaxCodePoints",
|
|
5585
|
+
payload: { maxCodePoints }
|
|
5586
|
+
},
|
|
5587
|
+
toJsonSchema: () => ({ maxLength: maxCodePoints }),
|
|
5588
|
+
toCode: () => ({ runtime: `Schema.isMaxCodePoints(${maxCodePoints})` }),
|
|
5589
|
+
arbitraryConstraint: { maxCodePoints },
|
|
5590
|
+
...annotations
|
|
5591
|
+
});
|
|
5592
|
+
}
|
|
5593
|
+
function countCodePointsUpTo(input, limit) {
|
|
5594
|
+
if (limit === 0) return 0;
|
|
5595
|
+
let count = 0;
|
|
5596
|
+
for (const _ of input) if (++count >= limit) break;
|
|
5597
|
+
return count;
|
|
5598
|
+
}
|
|
5081
5599
|
function normalizeCardinality(value) {
|
|
5082
5600
|
if (!globalThis.Number.isFinite(value)) throw new globalThis.RangeError(`Expected a finite number, got ${value}`);
|
|
5083
5601
|
return Math.max(0, Math.floor(value));
|
|
@@ -5495,6 +6013,8 @@ const DateTimeUtcFromMillis = Int.pipe(decodeTo(DateTimeUtc, {
|
|
|
5495
6013
|
decode: dateTimeUtcFromInput(),
|
|
5496
6014
|
encode: transform$1(toEpochMillis)
|
|
5497
6015
|
}));
|
|
6016
|
+
const Ipv4Address = declare(isIpv4Address, { identifier: "Ipv4Address" });
|
|
6017
|
+
const Ipv6Address = declare(isIpv6Address, { identifier: "Ipv6Address" });
|
|
5498
6018
|
const Duration = declare(isDuration, {
|
|
5499
6019
|
representation: {
|
|
5500
6020
|
id: "effect/schema/Duration",
|
|
@@ -5542,6 +6062,38 @@ const Duration = declare(isDuration, {
|
|
|
5542
6062
|
}
|
|
5543
6063
|
}))
|
|
5544
6064
|
});
|
|
6065
|
+
const dnsCanonicalAddress = (schema, parse) => String$1.pipe(decodeTo(schema, transformEffect({
|
|
6066
|
+
decode: (input, options) => {
|
|
6067
|
+
const result = parse(input);
|
|
6068
|
+
if (isFailure(result)) return fail$2(new InvalidValue({ message: result.failure.message }, input, options));
|
|
6069
|
+
return formatIp(result.success) === input ? succeed$3(result.success) : fail$2(new InvalidValue({ message: "expected a canonical address" }, input, options));
|
|
6070
|
+
},
|
|
6071
|
+
encode: (address) => succeed$3(formatIp(address))
|
|
6072
|
+
})));
|
|
6073
|
+
const dnsUint32 = Int.check(isBetween({
|
|
6074
|
+
minimum: 0,
|
|
6075
|
+
maximum: 4294967295
|
|
6076
|
+
}));
|
|
6077
|
+
const dnsSeconds = dnsUint32.pipe(decodeTo(Duration, transform({
|
|
6078
|
+
decode: seconds,
|
|
6079
|
+
encode: toSeconds
|
|
6080
|
+
})));
|
|
6081
|
+
const dnsRecordOfType = (type, fields) => declare((u) => isDnsRecord(u) && u._tag === type, {
|
|
6082
|
+
identifier: `Dns${type.charAt(0)}${type.slice(1).toLowerCase()}Record`,
|
|
6083
|
+
toCodecJson: () => {
|
|
6084
|
+
const json = TaggedStruct(type, fields);
|
|
6085
|
+
return link()(json, transformEffect({
|
|
6086
|
+
decode: (input, options) => {
|
|
6087
|
+
const { _tag, ...rest } = input;
|
|
6088
|
+
const result = makeRecord(type, rest);
|
|
6089
|
+
return isSuccess$1(result) ? succeed$3(result.success) : fail$2(new InvalidValue({ message: result.failure.message }, input, options));
|
|
6090
|
+
},
|
|
6091
|
+
encode: (record) => succeed$3({ ...record })
|
|
6092
|
+
}));
|
|
6093
|
+
}
|
|
6094
|
+
});
|
|
6095
|
+
const DnsARecord = dnsRecordOfType("A", { address: dnsCanonicalAddress(Ipv4Address, ipv4FromString) });
|
|
6096
|
+
const DnsAaaaRecord = dnsRecordOfType("AAAA", { address: dnsCanonicalAddress(Ipv6Address, ipv6FromString) });
|
|
5545
6097
|
function Exit(value, error, defect) {
|
|
5546
6098
|
const schema = declareConstructor()([
|
|
5547
6099
|
value,
|
|
@@ -5693,7 +6245,7 @@ const RecordFromUrlParams = UrlParams.pipe(decodeTo(Record(String$1, Union([Stri
|
|
|
5693
6245
|
function OptionFromOptional(schema) {
|
|
5694
6246
|
return optional(schema).pipe(decodeTo(Option(toType(schema)), optionFromOptional()));
|
|
5695
6247
|
}
|
|
5696
|
-
function Redacted(value$
|
|
6248
|
+
function Redacted(value$3, options) {
|
|
5697
6249
|
const label = typeof options?.label === "string" ? options.label : void 0;
|
|
5698
6250
|
const disallowJsonEncode = options?.disallowJsonEncode === true;
|
|
5699
6251
|
const normalizedOptions = label !== void 0 ? disallowJsonEncode ? {
|
|
@@ -5701,10 +6253,10 @@ function Redacted(value$4, options) {
|
|
|
5701
6253
|
disallowJsonEncode: true
|
|
5702
6254
|
} : { label } : disallowJsonEncode ? { disallowJsonEncode: true } : void 0;
|
|
5703
6255
|
const decodeLabel = label !== void 0 ? decodeUnknownEffect$1(Literal(label)) : void 0;
|
|
5704
|
-
const schema = declareConstructor()([value$
|
|
6256
|
+
const schema = declareConstructor()([value$3], ([value$4]) => (input, ast, poptions) => {
|
|
5705
6257
|
if (isRedacted(input)) {
|
|
5706
6258
|
const label = decodeLabel !== void 0 ? mapErrorEager(decodeLabel(input.label, poptions), (issue) => new Pointer(["label"], issue)) : void_$2;
|
|
5707
|
-
return flatMapEager(label, () => mapBothEager(decodeUnknownEffect$1(value$
|
|
6259
|
+
return flatMapEager(label, () => mapBothEager(decodeUnknownEffect$1(value$4)(value(input), poptions), {
|
|
5708
6260
|
onSuccess: (value) => make$6(value, { label: input.label }),
|
|
5709
6261
|
onFailure: () => {
|
|
5710
6262
|
return new Composite(ast, [new Pointer(["value"], new InvalidValue(void 0, input, poptions))], input, poptions);
|
|
@@ -5723,13 +6275,13 @@ function Redacted(value$4, options) {
|
|
|
5723
6275
|
importDeclarations: [`import * as Redacted from "effect/Redacted"`]
|
|
5724
6276
|
}),
|
|
5725
6277
|
expected: "Redacted",
|
|
5726
|
-
toCodecJson: ([value$
|
|
6278
|
+
toCodecJson: ([value$2]) => link()(value$2, {
|
|
5727
6279
|
decode: transform$1((e) => make$6(e, { label })),
|
|
5728
6280
|
encode: disallowJsonEncode ? forbidden((oe) => "Cannot serialize Redacted" + (isSome(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : transform$1(value)
|
|
5729
6281
|
}),
|
|
5730
6282
|
toEquivalence: ([value]) => makeEquivalence(value)
|
|
5731
6283
|
});
|
|
5732
|
-
return make(schema.ast, { value: value$
|
|
6284
|
+
return make(schema.ast, { value: value$3 });
|
|
5733
6285
|
}
|
|
5734
6286
|
const immerable = globalThis.Symbol.for("immer-draftable");
|
|
5735
6287
|
const payloadToken = {};
|
|
@@ -5874,11 +6426,12 @@ const Json = make(annotate(Json$1, { toCode: () => ({
|
|
|
5874
6426
|
runtime: "Schema.Json",
|
|
5875
6427
|
Type: "Schema.Json"
|
|
5876
6428
|
}) }));
|
|
6429
|
+
const JsonObject = Record(String$1, Json);
|
|
5877
6430
|
const MutableJson = make(annotate(MutableJson$1, { toCode: () => ({
|
|
5878
6431
|
runtime: "Schema.MutableJson",
|
|
5879
6432
|
Type: "Schema.MutableJson"
|
|
5880
6433
|
}) }));
|
|
5881
6434
|
//#endregion
|
|
5882
|
-
export {
|
|
6435
|
+
export { check as $, assignProperty as $n, PropertySignature as $t, Option as A, fromInput as An, optionalKey as At, TaggedError as B, now as Bn, withDecodingDefaultKey as Bt, Natural as C, map as Cn, isPropertyNames as Ct, Null as D, InvalidValue as Dn, makeFilter as Dt, NonEmptyString as E, transformEffect$1 as En, make as Et, SchemaError as F, decode as Fn, toEncoded as Ft, URLFromString as G, stringOrRedacted as Gn, decodeEffect$1 as Gt, TrueLiterals as H, isRedacted as Hn, omit as Ht, String$1 as I, encode as In, toJsonSchemaDocument as It, UndefinedOr as J, EncodingError as Jn, Arrays as Jt, Uint8Array$1 as K, Clock as Kn, decodeUnknownEffect$1 as Kt, Struct as L, formatIso as Ln, toType as Lt, OptionFromOptional as M, toString as Mn, tag as Mt, Record as N, empty$1 as Nn, toCodecJson as Nt, NullOr as O, Pointer as On, mutable as Ot, Redacted as P, fromSetCookie as Pn, toCodecStringTree as Pt, brand as Q, taggedEnum as Qn, Objects as Qt, StructWithRest as R, formatIsoDate as Rn, withConstructorDefault as Rt, MutableJson as S, dateTimeUtcFromInput$1 as Sn, isPattern as St, NonEmptyArray as T, transform$1 as Tn, isSchemaError as Tt, Tuple as U, make$6 as Un, getReferenceKey as Ut, TaggedUnion as V, removeTime as Vn, evolve as Vt, URL$1 as W, value as Wn, _is as Wt, Unknown as X, TaggedClass$1 as Xn, FilterGroup as Xt, Union as Y, Error$2 as Yn, Filter as Yt, Void as Z, TaggedError$1 as Zn, Literal$1 as Zt, Int as _, Transformation as _n, isMaxCodePoints as _t, BooleanLiterals as a, isOptional as an, decodeUnknownOption as at, Literal as b, transformEffect as bn, isMinCodePoints as bt, DateTimeUtcFromDate as c, optionalKey$1 as cn, encodeTo as ct, Defect as d, resolveDescription as dn, instanceOf as dt, Suspend as en, makeEquivalence$1 as er, declare as et, Duration as f, resolveIdentifier as fn, is as ft, Finite as g, unknown as gn, isLessThanOrEqualTo as gt, FalseLiterals as h, toType$1 as hn, isInt as ht, BooleanFromBit as i, isNever as in, decodeUnknownEffect as it, OptionFromNullOr as j, setAll as jn, suspend as jt, Number$1 as k, empty as kn, optional as kt, DateTimeUtcFromMillis as l, replaceChecks as ln, encodeUnknownEffect as lt, Exit as m, toEncoded$1 as mn, isGreaterThanOrEqualTo as mt, ArraySchema as n, applyToSelfOrLastLinkEncoding as nn, decodeSync as nt, Class as o, mapOrSame as on, decodeUnknownSync as ot, Error$1 as p, string as pn, isFinite as pt, Uint8ArrayFromBase64 as q, monotonicTimeNanos as qn, encodeEffect$1 as qt, Boolean as r, decodeTo$1 as rn, decodeTo as rt, DateTimeUtc as s, null_ as sn, encodeEffect as st, Any as t, Union$1 as tn, map$1 as tr, decodeEffect as tt, DateTimeUtcFromString as u, resolveAt as un, fromJsonString as ut, Json as v, passthrough as vn, isMaxLength as vt, Never as w, passthrough$1 as wn, isSchema as wt, Literals as x, transformOptional as xn, isMinLength as xt, JsonObject as y, transform as yn, isMaxProperties as yt, TaggedClass as z, fromDateUnsafe as zn, withDecodingDefault as zt };
|
|
5883
6436
|
|
|
5884
|
-
//# sourceMappingURL=Schema-
|
|
6437
|
+
//# sourceMappingURL=Schema-C7NXAOWA.mjs.map
|