clanka 0.8.4 → 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/AgentSkills.test.js +1 -0
- package/dist/AgentSkills.test.js.map +1 -1
- package/dist/AgentTools.d.ts.map +1 -1
- package/dist/AgentTools.js +2 -1
- package/dist/AgentTools.js.map +1 -1
- package/dist/Compaction.test.js +1 -0
- package/dist/Compaction.test.js.map +1 -1
- package/dist/CompactionTransport.test.js +1 -1
- package/dist/CompactionTransport.test.js.map +1 -1
- package/dist/bin/{Effect-BmOuzEIp.mjs → Effect-rADALOOD.mjs} +477 -267
- package/dist/bin/Effect-rADALOOD.mjs.map +1 -0
- package/dist/bin/{McpClient-CLpFJSre.mjs → McpClient-NazR2OwL.mjs} +219 -63
- package/dist/bin/McpClient-NazR2OwL.mjs.map +1 -0
- package/dist/bin/{OutputFormatter-C_gdNUl1.mjs → OutputFormatter-BVHbgF2b.mjs} +8 -8
- package/dist/bin/OutputFormatter-BVHbgF2b.mjs.map +1 -0
- package/dist/bin/{Schema-C7W9nQug.mjs → Schema-C7NXAOWA.mjs} +642 -88
- package/dist/bin/Schema-C7NXAOWA.mjs.map +1 -0
- package/dist/bin/{SemanticSearch-cqSnq90g.mjs → SemanticSearch-4Jes3jCl.mjs} +135 -90
- package/dist/bin/SemanticSearch-4Jes3jCl.mjs.map +1 -0
- package/dist/bin/{Stream-BI6Fx9yq.mjs → Stream-CSLA1_GD.mjs} +69 -48
- package/dist/bin/Stream-CSLA1_GD.mjs.map +1 -0
- package/dist/bin/cli.mjs +2865 -5333
- 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 +15 -15
- package/src/AgentSkills.test.ts +1 -0
- package/src/AgentTools.ts +2 -1
- package/src/Compaction.test.ts +1 -0
- package/src/CompactionTransport.test.ts +1 -1
- package/dist/bin/Effect-BmOuzEIp.mjs.map +0 -1
- package/dist/bin/McpClient-CLpFJSre.mjs.map +0 -1
- package/dist/bin/OutputFormatter-C_gdNUl1.mjs.map +0 -1
- package/dist/bin/Schema-C7W9nQug.mjs.map +0 -1
- package/dist/bin/SemanticSearch-cqSnq90g.mjs.map +0 -1
- package/dist/bin/Stream-BI6Fx9yq.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,21 +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
|
+
const monotonicTimeNanos = monotonicTimeNanos$1;
|
|
63
64
|
//#endregion
|
|
64
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
65
|
-
const TypeId$
|
|
65
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/dateTime.js
|
|
66
|
+
const TypeId$11 = "~effect/DateTime";
|
|
66
67
|
const TimeZoneTypeId = "~effect/DateTime/TimeZone";
|
|
67
68
|
const Proto$3 = {
|
|
68
|
-
[TypeId$
|
|
69
|
+
[TypeId$11]: TypeId$11,
|
|
69
70
|
pipe() {
|
|
70
71
|
return pipeArguments(this, arguments);
|
|
71
72
|
},
|
|
@@ -148,7 +149,7 @@ const ProtoTimeZoneOffset = {
|
|
|
148
149
|
};
|
|
149
150
|
}
|
|
150
151
|
};
|
|
151
|
-
const isDateTime$1 = (u) => hasProperty(u, TypeId$
|
|
152
|
+
const isDateTime$1 = (u) => hasProperty(u, TypeId$11);
|
|
152
153
|
const isTimeZone = (u) => hasProperty(u, TimeZoneTypeId);
|
|
153
154
|
const isUtc$1 = (self) => self._tag === "Utc";
|
|
154
155
|
const makeUtc = (epochMillis) => {
|
|
@@ -189,7 +190,7 @@ const toDate = (self) => {
|
|
|
189
190
|
const parts = self.zone.format.formatToParts(self.epochMilliseconds).filter((_) => _.type !== "literal");
|
|
190
191
|
const date = new Date(0);
|
|
191
192
|
date.setUTCFullYear(Number(parts[2].value), Number(parts[0].value) - 1, Number(parts[1].value));
|
|
192
|
-
date.setUTCHours(Number(parts[3].value), Number(parts[4].value), Number(parts[5].value), Number(parts[6].value));
|
|
193
|
+
date.setUTCHours(Number(parts[3].value), Number(parts[4].value), Number(parts[5].value), parts[6]?.type === "fractionalSecond" ? Number(parts[6].value) : (self.epochMilliseconds % 1e3 + 1e3) % 1e3);
|
|
193
194
|
self.adjustedEpochMilliseconds = date.getTime();
|
|
194
195
|
return date;
|
|
195
196
|
};
|
|
@@ -232,7 +233,7 @@ const formatIsoOffset = (self) => {
|
|
|
232
233
|
};
|
|
233
234
|
const formatIsoZoned = (self) => self.zone._tag === "Offset" ? formatIsoOffset(self) : `${formatIsoOffset(self)}[${self.zone.id}]`;
|
|
234
235
|
//#endregion
|
|
235
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
236
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/redacted.js
|
|
236
237
|
const redactedRegistry = new WeakMap();
|
|
237
238
|
const value$1 = (self) => {
|
|
238
239
|
if (redactedRegistry.has(self)) return redactedRegistry.get(self);
|
|
@@ -240,9 +241,9 @@ const value$1 = (self) => {
|
|
|
240
241
|
};
|
|
241
242
|
const stringOrRedacted = (val) => typeof val === "string" ? val : value$1(val);
|
|
242
243
|
//#endregion
|
|
243
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
244
|
-
const TypeId$
|
|
245
|
-
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);
|
|
246
247
|
const make$6 = (value, options) => {
|
|
247
248
|
const self = Object.create(Proto$2);
|
|
248
249
|
if (options?.label) self.label = options.label;
|
|
@@ -250,14 +251,14 @@ const make$6 = (value, options) => {
|
|
|
250
251
|
return self;
|
|
251
252
|
};
|
|
252
253
|
const Proto$2 = {
|
|
253
|
-
[TypeId$
|
|
254
|
+
[TypeId$10]: { _A: (_) => _ },
|
|
254
255
|
label: void 0,
|
|
255
256
|
...PipeInspectableProto,
|
|
256
257
|
toJSON() {
|
|
257
258
|
return this.toString();
|
|
258
259
|
},
|
|
259
260
|
toString() {
|
|
260
|
-
return `<redacted${isString(this.label) ? ":" + this.label : ""}>`;
|
|
261
|
+
return `<redacted${isString$1(this.label) ? ":" + this.label : ""}>`;
|
|
261
262
|
},
|
|
262
263
|
[symbol]() {
|
|
263
264
|
return hash(redactedRegistry.get(this));
|
|
@@ -269,10 +270,10 @@ const Proto$2 = {
|
|
|
269
270
|
const value = value$1;
|
|
270
271
|
const makeEquivalence = (isEquivalent) => make$8((x, y) => isEquivalent(value(x), value(y)));
|
|
271
272
|
//#endregion
|
|
272
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
273
|
-
const TypeId$
|
|
273
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/BigDecimal.js
|
|
274
|
+
const TypeId$9 = "~effect/BigDecimal";
|
|
274
275
|
const BigDecimalProto = {
|
|
275
|
-
[TypeId$
|
|
276
|
+
[TypeId$9]: TypeId$9,
|
|
276
277
|
[symbol]() {
|
|
277
278
|
const normalized = normalize(this);
|
|
278
279
|
return combine(string$1(String(normalized.value)), number$1(normalized.scale));
|
|
@@ -297,7 +298,7 @@ const BigDecimalProto = {
|
|
|
297
298
|
return pipeArguments(this, arguments);
|
|
298
299
|
}
|
|
299
300
|
};
|
|
300
|
-
const isBigDecimal = (u) => hasProperty(u, TypeId$
|
|
301
|
+
const isBigDecimal = (u) => hasProperty(u, TypeId$9);
|
|
301
302
|
const make$5 = (value, scale) => {
|
|
302
303
|
if (!Number.isSafeInteger(scale)) throw new RangeError(`Scale must be a safe integer, got ${scale}`);
|
|
303
304
|
const o = Object.create(BigDecimalProto);
|
|
@@ -373,7 +374,7 @@ const toExponential = (n) => {
|
|
|
373
374
|
};
|
|
374
375
|
const isZero = (n) => n.value === bigint0;
|
|
375
376
|
//#endregion
|
|
376
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
377
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/DateTime.js
|
|
377
378
|
const isDateTime = isDateTime$1;
|
|
378
379
|
const isUtc = isUtc$1;
|
|
379
380
|
const fromDateUnsafe = fromDateUnsafe$1;
|
|
@@ -387,8 +388,8 @@ const removeTime = removeTime$1;
|
|
|
387
388
|
const formatIso = formatIso$1;
|
|
388
389
|
const formatIsoDate = formatIsoDate$1;
|
|
389
390
|
//#endregion
|
|
390
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
391
|
-
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);
|
|
392
393
|
const decode = (str) => {
|
|
393
394
|
const stripped = stripCrlf(str);
|
|
394
395
|
const length = stripped.length;
|
|
@@ -447,7 +448,7 @@ const encodeBytes = (bytes) => {
|
|
|
447
448
|
}
|
|
448
449
|
return result;
|
|
449
450
|
};
|
|
450
|
-
const encoder = new TextEncoder();
|
|
451
|
+
const encoder$1 = new TextEncoder();
|
|
451
452
|
const stripCrlf = (str) => str.replace(/[\n\r]/g, "");
|
|
452
453
|
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
453
454
|
const codes = new Uint8Array(123).fill(255);
|
|
@@ -458,9 +459,9 @@ const getCode = (charCode) => {
|
|
|
458
459
|
return codes[charCode];
|
|
459
460
|
};
|
|
460
461
|
//#endregion
|
|
461
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
462
|
-
const TypeId$
|
|
463
|
-
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);
|
|
464
465
|
const CookieTypeId = "~effect/http/Cookies/Cookie";
|
|
465
466
|
const isCookie = (u) => hasProperty(u, CookieTypeId);
|
|
466
467
|
const CookieErrorTypeId = "~effect/http/Cookies/CookieError";
|
|
@@ -478,7 +479,7 @@ var CookiesError = class CookiesError extends TaggedError$1("CookiesError") {
|
|
|
478
479
|
}
|
|
479
480
|
};
|
|
480
481
|
const Proto$1 = {
|
|
481
|
-
[TypeId$
|
|
482
|
+
[TypeId$8]: TypeId$8,
|
|
482
483
|
...BaseProto,
|
|
483
484
|
toJSON() {
|
|
484
485
|
return {
|
|
@@ -683,12 +684,12 @@ const tryDecodeURIComponent = (str) => {
|
|
|
683
684
|
}
|
|
684
685
|
};
|
|
685
686
|
//#endregion
|
|
686
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
687
|
-
const TypeId$
|
|
688
|
-
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);
|
|
689
690
|
const Proto = {
|
|
690
691
|
...PipeInspectableProto,
|
|
691
|
-
[TypeId$
|
|
692
|
+
[TypeId$7]: TypeId$7,
|
|
692
693
|
[Symbol.iterator]() {
|
|
693
694
|
return this.params[Symbol.iterator]();
|
|
694
695
|
},
|
|
@@ -757,7 +758,7 @@ const toRecord = (self) => {
|
|
|
757
758
|
};
|
|
758
759
|
const toReadonlyRecord = toRecord;
|
|
759
760
|
//#endregion
|
|
760
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
761
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/annotations.js
|
|
761
762
|
function resolve$1(ast) {
|
|
762
763
|
return ast.checks ? ast.checks[ast.checks.length - 1].annotations : ast.annotations;
|
|
763
764
|
}
|
|
@@ -804,7 +805,7 @@ const annotationExcludedKeys = new Set([
|
|
|
804
805
|
"toCodecArbitrary"
|
|
805
806
|
]);
|
|
806
807
|
//#endregion
|
|
807
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
808
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/parser.js
|
|
808
809
|
const missing = Symbol();
|
|
809
810
|
const succeed = succeed$2;
|
|
810
811
|
const missingExit = succeed(missing);
|
|
@@ -812,16 +813,16 @@ const sameExit = succeed(missing);
|
|
|
812
813
|
const toOption = (value) => value === missing ? none() : some(value);
|
|
813
814
|
const fromOptionExit = (option) => option._tag === "None" ? missingExit : succeed(option.value);
|
|
814
815
|
//#endregion
|
|
815
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
816
|
-
const TypeId$
|
|
816
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/SchemaIssue.js
|
|
817
|
+
const TypeId$6 = "~effect/SchemaIssue/Issue";
|
|
817
818
|
function isIssue(u) {
|
|
818
|
-
return hasProperty(u, TypeId$
|
|
819
|
+
return hasProperty(u, TypeId$6) && u[TypeId$6] === TypeId$6;
|
|
819
820
|
}
|
|
820
821
|
function hasInput(issue) {
|
|
821
822
|
return Object.hasOwn(issue, "input");
|
|
822
823
|
}
|
|
823
824
|
var IssueNodeImpl = class {
|
|
824
|
-
[TypeId$
|
|
825
|
+
[TypeId$6] = TypeId$6;
|
|
825
826
|
constructor(input, options) {
|
|
826
827
|
if (options?.reportInput === true && input !== missing) this.input = input;
|
|
827
828
|
}
|
|
@@ -1025,7 +1026,7 @@ function findMessage(issue) {
|
|
|
1025
1026
|
if (typeof message === "string") return message;
|
|
1026
1027
|
}
|
|
1027
1028
|
//#endregion
|
|
1028
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
1029
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/cause.js
|
|
1029
1030
|
function getSchemaIssue(cause) {
|
|
1030
1031
|
let issue;
|
|
1031
1032
|
for (const reason of cause.reasons) {
|
|
@@ -1040,7 +1041,7 @@ function getSchemaIssueOrThrow(cause, message) {
|
|
|
1040
1041
|
return issue;
|
|
1041
1042
|
}
|
|
1042
1043
|
//#endregion
|
|
1043
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
1044
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/SchemaGetter.js
|
|
1044
1045
|
const runGetter = (self, input, options) => {
|
|
1045
1046
|
switch (self._tag) {
|
|
1046
1047
|
case "Passthrough": return succeed$3(input);
|
|
@@ -1168,7 +1169,7 @@ function dateTimeUtcFromInput$1() {
|
|
|
1168
1169
|
});
|
|
1169
1170
|
}
|
|
1170
1171
|
//#endregion
|
|
1171
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
1172
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/SchemaTransformation.js
|
|
1172
1173
|
const Middleware = class extends Class$2 {
|
|
1173
1174
|
_tag = "Middleware";
|
|
1174
1175
|
decode;
|
|
@@ -1182,9 +1183,9 @@ const Middleware = class extends Class$2 {
|
|
|
1182
1183
|
return new Middleware(this.encode, this.decode);
|
|
1183
1184
|
}
|
|
1184
1185
|
};
|
|
1185
|
-
const TypeId$
|
|
1186
|
+
const TypeId$5 = "~effect/SchemaTransformation/Transformation";
|
|
1186
1187
|
const Transformation = class extends Class$2 {
|
|
1187
|
-
[TypeId$
|
|
1188
|
+
[TypeId$5] = TypeId$5;
|
|
1188
1189
|
_tag = "Transformation";
|
|
1189
1190
|
decode;
|
|
1190
1191
|
encode;
|
|
@@ -1198,7 +1199,7 @@ const Transformation = class extends Class$2 {
|
|
|
1198
1199
|
}
|
|
1199
1200
|
};
|
|
1200
1201
|
function isTransformation(u) {
|
|
1201
|
-
return hasProperty(u, TypeId$
|
|
1202
|
+
return hasProperty(u, TypeId$5) && u[TypeId$5] === TypeId$5;
|
|
1202
1203
|
}
|
|
1203
1204
|
const makeTransformation = (options) => {
|
|
1204
1205
|
if (isTransformation(options)) return options;
|
|
@@ -1284,7 +1285,7 @@ function fromJsonString$1(options) {
|
|
|
1284
1285
|
return new Transformation(parseJson(options ?? {}), stringifyJson(options));
|
|
1285
1286
|
}
|
|
1286
1287
|
//#endregion
|
|
1287
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
1288
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/SchemaAST.js
|
|
1288
1289
|
function makeGuard(tag) {
|
|
1289
1290
|
return (ast) => ast._tag === tag;
|
|
1290
1291
|
}
|
|
@@ -1317,9 +1318,9 @@ const Context = class {
|
|
|
1317
1318
|
this.annotations = annotations;
|
|
1318
1319
|
}
|
|
1319
1320
|
};
|
|
1320
|
-
const TypeId$
|
|
1321
|
+
const TypeId$4 = "~effect/Schema";
|
|
1321
1322
|
var ASTNodeImpl = class {
|
|
1322
|
-
[TypeId$
|
|
1323
|
+
[TypeId$4] = TypeId$4;
|
|
1323
1324
|
annotations;
|
|
1324
1325
|
checks;
|
|
1325
1326
|
encoding;
|
|
@@ -1397,8 +1398,8 @@ const undefined_ = new Undefined$1();
|
|
|
1397
1398
|
const Void$1 = class extends ASTNodeImpl {
|
|
1398
1399
|
_tag = "Void";
|
|
1399
1400
|
getParser() {
|
|
1400
|
-
const succeed$
|
|
1401
|
-
return (input) => input === missing ? missingExit : succeed$
|
|
1401
|
+
const succeed$5 = succeed(void 0);
|
|
1402
|
+
return (input) => input === missing ? missingExit : succeed$5;
|
|
1402
1403
|
}
|
|
1403
1404
|
toCodecJson() {
|
|
1404
1405
|
return replaceEncoding(this, [undefinedToNull]);
|
|
@@ -1469,7 +1470,7 @@ function literalToString(ast) {
|
|
|
1469
1470
|
const String$2 = class extends ASTNodeImpl {
|
|
1470
1471
|
_tag = "String";
|
|
1471
1472
|
getParser() {
|
|
1472
|
-
return fromRefinement(this, isString);
|
|
1473
|
+
return fromRefinement(this, isString$1);
|
|
1473
1474
|
}
|
|
1474
1475
|
matchPart(s, options) {
|
|
1475
1476
|
const checks = this.checks;
|
|
@@ -1605,7 +1606,7 @@ const Arrays = class extends ASTNodeImpl {
|
|
|
1605
1606
|
if (!eff) return finish(state);
|
|
1606
1607
|
if (effectIsExit(eff)) return flatMapEager(eff, () => finish(state));
|
|
1607
1608
|
let first = true;
|
|
1608
|
-
return suspend(() => {
|
|
1609
|
+
return suspend$1(() => {
|
|
1609
1610
|
if (!first) return parse(input, options);
|
|
1610
1611
|
first = false;
|
|
1611
1612
|
return flatMap(eff, () => finish(state));
|
|
@@ -2291,7 +2292,13 @@ function parseUnionCandidates(ast, parser, candidates, input, options) {
|
|
|
2291
2292
|
if (state.out) return state.out;
|
|
2292
2293
|
return fail$2(new AnyOf(ast, state.issues ?? [], input, options));
|
|
2293
2294
|
}
|
|
2294
|
-
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
|
+
});
|
|
2295
2302
|
}
|
|
2296
2303
|
function resumeUnion(eff, state) {
|
|
2297
2304
|
return flatMapEager(eff, (_) => {
|
|
@@ -2646,10 +2653,10 @@ function containsUndefined(ast) {
|
|
|
2646
2653
|
}
|
|
2647
2654
|
}
|
|
2648
2655
|
function fromConst(ast, value) {
|
|
2649
|
-
const succeed$
|
|
2656
|
+
const succeed$4 = value === 0 ? sameExit : succeed(value);
|
|
2650
2657
|
return (input, options) => {
|
|
2651
2658
|
if (input === missing) return missingExit;
|
|
2652
|
-
if (input === value) return succeed$
|
|
2659
|
+
if (input === value) return succeed$4;
|
|
2653
2660
|
return fail$2(new InvalidType(ast, input, options));
|
|
2654
2661
|
};
|
|
2655
2662
|
}
|
|
@@ -2807,7 +2814,7 @@ const StringTree = new Declaration([], () => (input, ast, options) => isStringTr
|
|
|
2807
2814
|
});
|
|
2808
2815
|
const unknownToStringTree = new Link(StringTree, passthrough());
|
|
2809
2816
|
//#endregion
|
|
2810
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
2817
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/interpreter.js
|
|
2811
2818
|
const flatMapTransformation = (result, current, f) => result === sameExit ? f(current) : flatMapEager(result, f);
|
|
2812
2819
|
function compileTransformation(transformation) {
|
|
2813
2820
|
if (transformation._tag === "Middleware") return (result, current, options) => {
|
|
@@ -2939,7 +2946,7 @@ function compile(ast, compile, compileField, base, specialize) {
|
|
|
2939
2946
|
};
|
|
2940
2947
|
}
|
|
2941
2948
|
//#endregion
|
|
2942
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
2949
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/compilerRegistry.js
|
|
2943
2950
|
const invalid = Symbol();
|
|
2944
2951
|
const cache = new WeakMap();
|
|
2945
2952
|
let compiler;
|
|
@@ -3027,7 +3034,7 @@ function resolve(ast) {
|
|
|
3027
3034
|
return entry;
|
|
3028
3035
|
}
|
|
3029
3036
|
//#endregion
|
|
3030
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
3037
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/SchemaParser.js
|
|
3031
3038
|
function makeEffect(schema) {
|
|
3032
3039
|
const ast = schema.ast;
|
|
3033
3040
|
let parser;
|
|
@@ -3181,11 +3188,11 @@ function makeConstructorSync(ast) {
|
|
|
3181
3188
|
const normalCompiler = (ast) => resolve(ast).parser;
|
|
3182
3189
|
const constructorCompiler = (ast) => resolve(ast).makeEffect;
|
|
3183
3190
|
//#endregion
|
|
3184
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
3185
|
-
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";
|
|
3186
3193
|
const RebuildOptions = Symbol();
|
|
3187
3194
|
const SchemaProto = {
|
|
3188
|
-
[TypeId$
|
|
3195
|
+
[TypeId$3]: TypeId$3,
|
|
3189
3196
|
get make() {
|
|
3190
3197
|
const value = make$2(this);
|
|
3191
3198
|
Object.defineProperty(this, "make", {
|
|
@@ -3236,7 +3243,7 @@ function make$1(ast, options) {
|
|
|
3236
3243
|
return self;
|
|
3237
3244
|
}
|
|
3238
3245
|
//#endregion
|
|
3239
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
3246
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/JsonPointer.js
|
|
3240
3247
|
function escapeToken(token) {
|
|
3241
3248
|
return token.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
3242
3249
|
}
|
|
@@ -3263,7 +3270,7 @@ function parseUriFragment(fragment) {
|
|
|
3263
3270
|
return pointer === void 0 ? void 0 : pointer.length === 0 ? [] : pointer.slice(1).split("/").map(unescapeToken);
|
|
3264
3271
|
}
|
|
3265
3272
|
//#endregion
|
|
3266
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
3273
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/JsonSchema.js
|
|
3267
3274
|
function getReferenceKey($ref) {
|
|
3268
3275
|
const path = $ref.startsWith("#") ? parseUriFragment($ref) : void 0;
|
|
3269
3276
|
return path !== void 0 && path.length === 2 && path[0] === "$defs" ? path[1] : void 0;
|
|
@@ -3359,7 +3366,7 @@ const OPEN_API_30_TO_2020_COLLISIONS = [
|
|
|
3359
3366
|
"then"
|
|
3360
3367
|
];
|
|
3361
3368
|
//#endregion
|
|
3362
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
3369
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/toCodec.js
|
|
3363
3370
|
function toCodecJson$1(schema) {
|
|
3364
3371
|
return make$1(toCodecJsonAST(schema.ast), { schema });
|
|
3365
3372
|
}
|
|
@@ -3485,17 +3492,17 @@ const toCodecStringTreeAST = applyToSelfOrLastLinkEncodingIdempotent((ast) => {
|
|
|
3485
3492
|
return out;
|
|
3486
3493
|
}, { stopAt: isCodecArrayFromSingleLink });
|
|
3487
3494
|
//#endregion
|
|
3488
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
3495
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/RegExp.js
|
|
3489
3496
|
const RegExp$1 = globalThis.RegExp;
|
|
3490
3497
|
const escape = (string) => string.replace(/[/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
3491
3498
|
//#endregion
|
|
3492
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
3499
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/errors.js
|
|
3493
3500
|
function errorWithPath(message, path) {
|
|
3494
3501
|
if (path.length > 0) message += `\n at ${formatPath(path)}`;
|
|
3495
3502
|
return new Error(message);
|
|
3496
3503
|
}
|
|
3497
3504
|
//#endregion
|
|
3498
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
3505
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/toJsonSchemaDocument.js
|
|
3499
3506
|
function formatDefinitionReference(key) {
|
|
3500
3507
|
return `#/$defs/${formatUriFragmentToken(key)}`;
|
|
3501
3508
|
}
|
|
@@ -3578,6 +3585,27 @@ function hasOnlyKeywords(schema, allowed) {
|
|
|
3578
3585
|
function hasNoCollisions(left, rightKeys) {
|
|
3579
3586
|
return typeof left.$ref !== "string" && rightKeys.every((key) => !Object.hasOwn(left, key));
|
|
3580
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
|
+
}
|
|
3581
3609
|
const promotableAnnotationKeywords = "|title|description|default|examples|readOnly|writeOnly|";
|
|
3582
3610
|
const inlineableAnnotatedCheckKeywords = inlineableCheckKeywords + promotableAnnotationKeywords;
|
|
3583
3611
|
function appendJsonSchema(left, right, inlineCheck) {
|
|
@@ -3603,10 +3631,10 @@ function appendJsonSchema(left, right, inlineCheck) {
|
|
|
3603
3631
|
} : appendJsonSchema(base, extracted.schema, inlineCheck);
|
|
3604
3632
|
}
|
|
3605
3633
|
}
|
|
3606
|
-
if (inlineCheck
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
}
|
|
3634
|
+
if (inlineCheck) {
|
|
3635
|
+
const merged = mergeInlineCheck(left, right, rightKeys);
|
|
3636
|
+
if (merged !== void 0) return merged;
|
|
3637
|
+
}
|
|
3610
3638
|
const members = Array.isArray(right.allOf) && rightKeys.length === 1 ? right.allOf : [right];
|
|
3611
3639
|
if (Array.isArray(left.allOf)) return {
|
|
3612
3640
|
...left,
|
|
@@ -4043,7 +4071,7 @@ function toJsonSchemaDocument$1(document, options) {
|
|
|
4043
4071
|
};
|
|
4044
4072
|
}
|
|
4045
4073
|
//#endregion
|
|
4046
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
4074
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/toRepresentation.js
|
|
4047
4075
|
const defaultReferencePolicy = ({ identifier }) => identifier;
|
|
4048
4076
|
function annotationsField(annotations) {
|
|
4049
4077
|
return annotations === void 0 ? void 0 : { annotations };
|
|
@@ -4307,7 +4335,7 @@ function toRepresentations(asts, options) {
|
|
|
4307
4335
|
}
|
|
4308
4336
|
}
|
|
4309
4337
|
//#endregion
|
|
4310
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
4338
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Struct.js
|
|
4311
4339
|
const omit = dual(2, (self, keys) => {
|
|
4312
4340
|
return buildStruct(self, (k, v) => !hasPropertyKey(keys, k) ? [k, v] : void 0);
|
|
4313
4341
|
});
|
|
@@ -4331,14 +4359,456 @@ function buildStruct(source, f) {
|
|
|
4331
4359
|
return out;
|
|
4332
4360
|
}
|
|
4333
4361
|
//#endregion
|
|
4334
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
4362
|
+
//#region node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schemaError.js
|
|
4335
4363
|
const SchemaErrorTypeId = "~effect/Schema/SchemaError";
|
|
4336
4364
|
function isSchemaError$1(u) {
|
|
4337
4365
|
return hasProperty(u, "~effect/Schema/SchemaError") && u["~effect/Schema/SchemaError"] === "~effect/Schema/SchemaError";
|
|
4338
4366
|
}
|
|
4339
4367
|
//#endregion
|
|
4340
|
-
//#region node_modules/.pnpm/effect@4.0.
|
|
4341
|
-
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;
|
|
4342
4812
|
function declareConstructor() {
|
|
4343
4813
|
return (typeParameters, run, annotations) => {
|
|
4344
4814
|
return make(new Declaration(typeParameters.map(getAST), (typeParameters) => run(typeParameters.map((ast) => make(ast))), annotations));
|
|
@@ -4361,6 +4831,15 @@ var SchemaError = class extends TaggedError$1("SchemaError") {
|
|
|
4361
4831
|
get message() {
|
|
4362
4832
|
return defaultFormatter(this.issue);
|
|
4363
4833
|
}
|
|
4834
|
+
toJSON() {
|
|
4835
|
+
return {
|
|
4836
|
+
_tag: this._tag,
|
|
4837
|
+
message: this.message
|
|
4838
|
+
};
|
|
4839
|
+
}
|
|
4840
|
+
[NodeInspectSymbol]() {
|
|
4841
|
+
return this.toJSON();
|
|
4842
|
+
}
|
|
4364
4843
|
toString() {
|
|
4365
4844
|
return `SchemaError(${this.message})`;
|
|
4366
4845
|
}
|
|
@@ -4514,6 +4993,9 @@ function Literals(literals) {
|
|
|
4514
4993
|
}
|
|
4515
4994
|
const NullOr = lambda((self) => Union([self, Null]));
|
|
4516
4995
|
const UndefinedOr = lambda((self) => Union([self, Undefined]));
|
|
4996
|
+
function suspend(f) {
|
|
4997
|
+
return make(new Suspend(() => f().ast));
|
|
4998
|
+
}
|
|
4517
4999
|
function check(...checks) {
|
|
4518
5000
|
return (self) => self.check(...checks);
|
|
4519
5001
|
}
|
|
@@ -4602,6 +5084,7 @@ function toTaggedUnion(tag) {
|
|
|
4602
5084
|
const isAnyOf = (keys) => (value) => keys.includes(value[tag]);
|
|
4603
5085
|
walk(self);
|
|
4604
5086
|
return Object.assign(self, {
|
|
5087
|
+
tag,
|
|
4605
5088
|
cases,
|
|
4606
5089
|
discriminants,
|
|
4607
5090
|
isAnyOf,
|
|
@@ -4666,8 +5149,9 @@ function TaggedUnion(casesByTag) {
|
|
|
4666
5149
|
members.push(member);
|
|
4667
5150
|
}
|
|
4668
5151
|
const union = Union(members);
|
|
4669
|
-
const { guards, isAnyOf, match, matchOrElse } = toTaggedUnion("_tag")(union);
|
|
5152
|
+
const { tag, guards, isAnyOf, match, matchOrElse } = toTaggedUnion("_tag")(union);
|
|
4670
5153
|
return make(union.ast, {
|
|
5154
|
+
tag,
|
|
4671
5155
|
cases,
|
|
4672
5156
|
isAnyOf,
|
|
4673
5157
|
guards,
|
|
@@ -4684,9 +5168,6 @@ function link() {
|
|
|
4684
5168
|
};
|
|
4685
5169
|
}
|
|
4686
5170
|
const makeFilter = makeFilter$1;
|
|
4687
|
-
function makeFilterGroup(checks, annotations = void 0) {
|
|
4688
|
-
return new FilterGroup(checks, annotations);
|
|
4689
|
-
}
|
|
4690
5171
|
function isPattern(regExp, annotations) {
|
|
4691
5172
|
const source = regExp.source;
|
|
4692
5173
|
const flags = regExp.flags;
|
|
@@ -4876,7 +5357,11 @@ function isInt(annotations) {
|
|
|
4876
5357
|
id: "effect/schema/isInt",
|
|
4877
5358
|
payload: null
|
|
4878
5359
|
},
|
|
4879
|
-
toJsonSchema: () =>
|
|
5360
|
+
toJsonSchema: () => ({
|
|
5361
|
+
type: "integer",
|
|
5362
|
+
minimum: globalThis.Number.MIN_SAFE_INTEGER,
|
|
5363
|
+
maximum: globalThis.Number.MAX_SAFE_INTEGER
|
|
5364
|
+
}),
|
|
4880
5365
|
toCode: () => ({ runtime: "Schema.isInt()" }),
|
|
4881
5366
|
arbitraryConstraint: { number: "integer" },
|
|
4882
5367
|
...annotations
|
|
@@ -5077,6 +5562,40 @@ function isMaxLength(maxLength, annotations) {
|
|
|
5077
5562
|
...annotations
|
|
5078
5563
|
});
|
|
5079
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
|
+
}
|
|
5080
5599
|
function normalizeCardinality(value) {
|
|
5081
5600
|
if (!globalThis.Number.isFinite(value)) throw new globalThis.RangeError(`Expected a finite number, got ${value}`);
|
|
5082
5601
|
return Math.max(0, Math.floor(value));
|
|
@@ -5494,6 +6013,8 @@ const DateTimeUtcFromMillis = Int.pipe(decodeTo(DateTimeUtc, {
|
|
|
5494
6013
|
decode: dateTimeUtcFromInput(),
|
|
5495
6014
|
encode: transform$1(toEpochMillis)
|
|
5496
6015
|
}));
|
|
6016
|
+
const Ipv4Address = declare(isIpv4Address, { identifier: "Ipv4Address" });
|
|
6017
|
+
const Ipv6Address = declare(isIpv6Address, { identifier: "Ipv6Address" });
|
|
5497
6018
|
const Duration = declare(isDuration, {
|
|
5498
6019
|
representation: {
|
|
5499
6020
|
id: "effect/schema/Duration",
|
|
@@ -5541,6 +6062,38 @@ const Duration = declare(isDuration, {
|
|
|
5541
6062
|
}
|
|
5542
6063
|
}))
|
|
5543
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) });
|
|
5544
6097
|
function Exit(value, error, defect) {
|
|
5545
6098
|
const schema = declareConstructor()([
|
|
5546
6099
|
value,
|
|
@@ -5692,7 +6245,7 @@ const RecordFromUrlParams = UrlParams.pipe(decodeTo(Record(String$1, Union([Stri
|
|
|
5692
6245
|
function OptionFromOptional(schema) {
|
|
5693
6246
|
return optional(schema).pipe(decodeTo(Option(toType(schema)), optionFromOptional()));
|
|
5694
6247
|
}
|
|
5695
|
-
function Redacted(value$
|
|
6248
|
+
function Redacted(value$3, options) {
|
|
5696
6249
|
const label = typeof options?.label === "string" ? options.label : void 0;
|
|
5697
6250
|
const disallowJsonEncode = options?.disallowJsonEncode === true;
|
|
5698
6251
|
const normalizedOptions = label !== void 0 ? disallowJsonEncode ? {
|
|
@@ -5700,10 +6253,10 @@ function Redacted(value$4, options) {
|
|
|
5700
6253
|
disallowJsonEncode: true
|
|
5701
6254
|
} : { label } : disallowJsonEncode ? { disallowJsonEncode: true } : void 0;
|
|
5702
6255
|
const decodeLabel = label !== void 0 ? decodeUnknownEffect$1(Literal(label)) : void 0;
|
|
5703
|
-
const schema = declareConstructor()([value$
|
|
6256
|
+
const schema = declareConstructor()([value$3], ([value$4]) => (input, ast, poptions) => {
|
|
5704
6257
|
if (isRedacted(input)) {
|
|
5705
6258
|
const label = decodeLabel !== void 0 ? mapErrorEager(decodeLabel(input.label, poptions), (issue) => new Pointer(["label"], issue)) : void_$2;
|
|
5706
|
-
return flatMapEager(label, () => mapBothEager(decodeUnknownEffect$1(value$
|
|
6259
|
+
return flatMapEager(label, () => mapBothEager(decodeUnknownEffect$1(value$4)(value(input), poptions), {
|
|
5707
6260
|
onSuccess: (value) => make$6(value, { label: input.label }),
|
|
5708
6261
|
onFailure: () => {
|
|
5709
6262
|
return new Composite(ast, [new Pointer(["value"], new InvalidValue(void 0, input, poptions))], input, poptions);
|
|
@@ -5722,13 +6275,13 @@ function Redacted(value$4, options) {
|
|
|
5722
6275
|
importDeclarations: [`import * as Redacted from "effect/Redacted"`]
|
|
5723
6276
|
}),
|
|
5724
6277
|
expected: "Redacted",
|
|
5725
|
-
toCodecJson: ([value$
|
|
6278
|
+
toCodecJson: ([value$2]) => link()(value$2, {
|
|
5726
6279
|
decode: transform$1((e) => make$6(e, { label })),
|
|
5727
6280
|
encode: disallowJsonEncode ? forbidden((oe) => "Cannot serialize Redacted" + (isSome(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : transform$1(value)
|
|
5728
6281
|
}),
|
|
5729
6282
|
toEquivalence: ([value]) => makeEquivalence(value)
|
|
5730
6283
|
});
|
|
5731
|
-
return make(schema.ast, { value: value$
|
|
6284
|
+
return make(schema.ast, { value: value$3 });
|
|
5732
6285
|
}
|
|
5733
6286
|
const immerable = globalThis.Symbol.for("immer-draftable");
|
|
5734
6287
|
const payloadToken = {};
|
|
@@ -5873,11 +6426,12 @@ const Json = make(annotate(Json$1, { toCode: () => ({
|
|
|
5873
6426
|
runtime: "Schema.Json",
|
|
5874
6427
|
Type: "Schema.Json"
|
|
5875
6428
|
}) }));
|
|
6429
|
+
const JsonObject = Record(String$1, Json);
|
|
5876
6430
|
const MutableJson = make(annotate(MutableJson$1, { toCode: () => ({
|
|
5877
6431
|
runtime: "Schema.MutableJson",
|
|
5878
6432
|
Type: "Schema.MutableJson"
|
|
5879
6433
|
}) }));
|
|
5880
6434
|
//#endregion
|
|
5881
|
-
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 };
|
|
5882
6436
|
|
|
5883
|
-
//# sourceMappingURL=Schema-
|
|
6437
|
+
//# sourceMappingURL=Schema-C7NXAOWA.mjs.map
|