@learncard/network-brain-client 2.5.52 → 2.5.53
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/brain-client.cjs.development.cjs +181 -123
- package/dist/brain-client.cjs.development.cjs.map +2 -2
- package/dist/brain-client.cjs.production.min.cjs +15 -11
- package/dist/brain-client.cjs.production.min.cjs.map +3 -3
- package/dist/brain-client.esm.js +113 -82
- package/dist/brain-client.esm.js.map +3 -3
- package/dist/callbackLink.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/brain-client.esm.js
CHANGED
|
@@ -15736,9 +15736,8 @@ __name(date4, "date");
|
|
|
15736
15736
|
config(en_default());
|
|
15737
15737
|
|
|
15738
15738
|
// ../../../node_modules/js-base64/base64.mjs
|
|
15739
|
-
var version2 = "3.
|
|
15739
|
+
var version2 = "3.9.3";
|
|
15740
15740
|
var VERSION = version2;
|
|
15741
|
-
var _hasBuffer = typeof Buffer === "function";
|
|
15742
15741
|
var _TD = typeof TextDecoder === "function" ? new TextDecoder("utf-8", { ignoreBOM: true }) : void 0;
|
|
15743
15742
|
var _TE = typeof TextEncoder === "function" ? new TextEncoder() : void 0;
|
|
15744
15743
|
var b64ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
@@ -15764,8 +15763,8 @@ var btoaPolyfill = /* @__PURE__ */ __name((bin) => {
|
|
|
15764
15763
|
}
|
|
15765
15764
|
return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
|
|
15766
15765
|
}, "btoaPolyfill");
|
|
15767
|
-
var _btoa = typeof btoa === "function" ? (bin) => btoa(bin) :
|
|
15768
|
-
var _fromUint8Array =
|
|
15766
|
+
var _btoa = typeof btoa === "function" ? (bin) => btoa(bin) : btoaPolyfill;
|
|
15767
|
+
var _fromUint8Array = typeof Uint8Array.prototype.toBase64 === "function" ? (u8a) => u8a.toBase64() : (u8a) => {
|
|
15769
15768
|
const maxargs = 4096;
|
|
15770
15769
|
let strs = [];
|
|
15771
15770
|
for (let i = 0, l = u8a.length; i < l; i += maxargs) {
|
|
@@ -15783,9 +15782,9 @@ var cb_utob = /* @__PURE__ */ __name((c) => {
|
|
|
15783
15782
|
return _fromCC(240 | cc >>> 18 & 7) + _fromCC(128 | cc >>> 12 & 63) + _fromCC(128 | cc >>> 6 & 63) + _fromCC(128 | cc & 63);
|
|
15784
15783
|
}
|
|
15785
15784
|
}, "cb_utob");
|
|
15786
|
-
var re_utob = /[\uD800-\uDBFF][\uDC00-\
|
|
15785
|
+
var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\x00-\x7F]/g;
|
|
15787
15786
|
var utob = /* @__PURE__ */ __name((u) => u.replace(re_utob, cb_utob), "utob");
|
|
15788
|
-
var _encode2 =
|
|
15787
|
+
var _encode2 = _TE ? (s) => _fromUint8Array(_TE.encode(s)) : (s) => _btoa(utob(s));
|
|
15789
15788
|
var encode3 = /* @__PURE__ */ __name((src, urlsafe = false) => urlsafe ? _mkUriSafe(_encode2(src)) : _encode2(src), "encode");
|
|
15790
15789
|
var encodeURI = /* @__PURE__ */ __name((src) => encode3(src, true), "encodeURI");
|
|
15791
15790
|
var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
|
|
@@ -15820,10 +15819,10 @@ var atobPolyfill = /* @__PURE__ */ __name((asc) => {
|
|
|
15820
15819
|
}
|
|
15821
15820
|
return binArray.join("");
|
|
15822
15821
|
}, "atobPolyfill");
|
|
15823
|
-
var _atob = typeof atob === "function" ? (asc) => atob(_tidyB64(asc)) :
|
|
15824
|
-
var _toUint8Array =
|
|
15822
|
+
var _atob = typeof atob === "function" ? (asc) => atob(_tidyB64(asc)) : atobPolyfill;
|
|
15823
|
+
var _toUint8Array = typeof Uint8Array.fromBase64 === "function" ? (a) => Uint8Array.fromBase64(a) : (a) => _U8Afrom(_atob(a).split("").map((c) => c.charCodeAt(0)));
|
|
15825
15824
|
var toUint8Array = /* @__PURE__ */ __name((a) => _toUint8Array(_unURI(a)), "toUint8Array");
|
|
15826
|
-
var _decode2 =
|
|
15825
|
+
var _decode2 = _TD ? (a) => _TD.decode(_toUint8Array(a)) : (a) => btou(_atob(a));
|
|
15827
15826
|
var _unURI = /* @__PURE__ */ __name((a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == "-" ? "+" : "/")), "_unURI");
|
|
15828
15827
|
var decode3 = /* @__PURE__ */ __name((src) => _decode2(_unURI(src)), "decode");
|
|
15829
15828
|
var isValid = /* @__PURE__ */ __name((src) => {
|
|
@@ -31423,7 +31422,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31423
31422
|
var ZodFirstPartyTypeKind2;
|
|
31424
31423
|
/* @__PURE__ */ (function(ZodFirstPartyTypeKind22) {
|
|
31425
31424
|
})(ZodFirstPartyTypeKind2 || (ZodFirstPartyTypeKind2 = {}));
|
|
31426
|
-
var
|
|
31425
|
+
var z3 = {
|
|
31427
31426
|
...schemas_exports22,
|
|
31428
31427
|
...checks_exports22,
|
|
31429
31428
|
iso: iso_exports2
|
|
@@ -31539,7 +31538,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31539
31538
|
function convertBaseSchema2(schema, ctx) {
|
|
31540
31539
|
if (schema.not !== void 0) {
|
|
31541
31540
|
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
31542
|
-
return
|
|
31541
|
+
return z3.never();
|
|
31543
31542
|
}
|
|
31544
31543
|
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
31545
31544
|
}
|
|
@@ -31561,7 +31560,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31561
31560
|
return ctx.refs.get(refPath);
|
|
31562
31561
|
}
|
|
31563
31562
|
if (ctx.processing.has(refPath)) {
|
|
31564
|
-
return
|
|
31563
|
+
return z3.lazy(() => {
|
|
31565
31564
|
if (!ctx.refs.has(refPath)) {
|
|
31566
31565
|
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
31567
31566
|
}
|
|
@@ -31578,25 +31577,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31578
31577
|
if (schema.enum !== void 0) {
|
|
31579
31578
|
const enumValues = schema.enum;
|
|
31580
31579
|
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
31581
|
-
return
|
|
31580
|
+
return z3.null();
|
|
31582
31581
|
}
|
|
31583
31582
|
if (enumValues.length === 0) {
|
|
31584
|
-
return
|
|
31583
|
+
return z3.never();
|
|
31585
31584
|
}
|
|
31586
31585
|
if (enumValues.length === 1) {
|
|
31587
|
-
return
|
|
31586
|
+
return z3.literal(enumValues[0]);
|
|
31588
31587
|
}
|
|
31589
31588
|
if (enumValues.every((v) => typeof v === "string")) {
|
|
31590
|
-
return
|
|
31589
|
+
return z3.enum(enumValues);
|
|
31591
31590
|
}
|
|
31592
|
-
const literalSchemas = enumValues.map((v) =>
|
|
31591
|
+
const literalSchemas = enumValues.map((v) => z3.literal(v));
|
|
31593
31592
|
if (literalSchemas.length < 2) {
|
|
31594
31593
|
return literalSchemas[0];
|
|
31595
31594
|
}
|
|
31596
|
-
return
|
|
31595
|
+
return z3.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
31597
31596
|
}
|
|
31598
31597
|
if (schema.const !== void 0) {
|
|
31599
|
-
return
|
|
31598
|
+
return z3.literal(schema.const);
|
|
31600
31599
|
}
|
|
31601
31600
|
const type = schema.type;
|
|
31602
31601
|
if (Array.isArray(type)) {
|
|
@@ -31605,68 +31604,68 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31605
31604
|
return convertBaseSchema2(typeSchema, ctx);
|
|
31606
31605
|
});
|
|
31607
31606
|
if (typeSchemas.length === 0) {
|
|
31608
|
-
return
|
|
31607
|
+
return z3.never();
|
|
31609
31608
|
}
|
|
31610
31609
|
if (typeSchemas.length === 1) {
|
|
31611
31610
|
return typeSchemas[0];
|
|
31612
31611
|
}
|
|
31613
|
-
return
|
|
31612
|
+
return z3.union(typeSchemas);
|
|
31614
31613
|
}
|
|
31615
31614
|
if (!type) {
|
|
31616
|
-
return
|
|
31615
|
+
return z3.any();
|
|
31617
31616
|
}
|
|
31618
31617
|
let zodSchema;
|
|
31619
31618
|
switch (type) {
|
|
31620
31619
|
case "string": {
|
|
31621
|
-
let stringSchema =
|
|
31620
|
+
let stringSchema = z3.string();
|
|
31622
31621
|
if (schema.format) {
|
|
31623
31622
|
const format = schema.format;
|
|
31624
31623
|
if (format === "email") {
|
|
31625
|
-
stringSchema = stringSchema.check(
|
|
31624
|
+
stringSchema = stringSchema.check(z3.email());
|
|
31626
31625
|
} else if (format === "uri" || format === "uri-reference") {
|
|
31627
|
-
stringSchema = stringSchema.check(
|
|
31626
|
+
stringSchema = stringSchema.check(z3.url());
|
|
31628
31627
|
} else if (format === "uuid" || format === "guid") {
|
|
31629
|
-
stringSchema = stringSchema.check(
|
|
31628
|
+
stringSchema = stringSchema.check(z3.uuid());
|
|
31630
31629
|
} else if (format === "date-time") {
|
|
31631
|
-
stringSchema = stringSchema.check(
|
|
31630
|
+
stringSchema = stringSchema.check(z3.iso.datetime());
|
|
31632
31631
|
} else if (format === "date") {
|
|
31633
|
-
stringSchema = stringSchema.check(
|
|
31632
|
+
stringSchema = stringSchema.check(z3.iso.date());
|
|
31634
31633
|
} else if (format === "time") {
|
|
31635
|
-
stringSchema = stringSchema.check(
|
|
31634
|
+
stringSchema = stringSchema.check(z3.iso.time());
|
|
31636
31635
|
} else if (format === "duration") {
|
|
31637
|
-
stringSchema = stringSchema.check(
|
|
31636
|
+
stringSchema = stringSchema.check(z3.iso.duration());
|
|
31638
31637
|
} else if (format === "ipv4") {
|
|
31639
|
-
stringSchema = stringSchema.check(
|
|
31638
|
+
stringSchema = stringSchema.check(z3.ipv4());
|
|
31640
31639
|
} else if (format === "ipv6") {
|
|
31641
|
-
stringSchema = stringSchema.check(
|
|
31640
|
+
stringSchema = stringSchema.check(z3.ipv6());
|
|
31642
31641
|
} else if (format === "mac") {
|
|
31643
|
-
stringSchema = stringSchema.check(
|
|
31642
|
+
stringSchema = stringSchema.check(z3.mac());
|
|
31644
31643
|
} else if (format === "cidr") {
|
|
31645
|
-
stringSchema = stringSchema.check(
|
|
31644
|
+
stringSchema = stringSchema.check(z3.cidrv4());
|
|
31646
31645
|
} else if (format === "cidr-v6") {
|
|
31647
|
-
stringSchema = stringSchema.check(
|
|
31646
|
+
stringSchema = stringSchema.check(z3.cidrv6());
|
|
31648
31647
|
} else if (format === "base64") {
|
|
31649
|
-
stringSchema = stringSchema.check(
|
|
31648
|
+
stringSchema = stringSchema.check(z3.base64());
|
|
31650
31649
|
} else if (format === "base64url") {
|
|
31651
|
-
stringSchema = stringSchema.check(
|
|
31650
|
+
stringSchema = stringSchema.check(z3.base64url());
|
|
31652
31651
|
} else if (format === "e164") {
|
|
31653
|
-
stringSchema = stringSchema.check(
|
|
31652
|
+
stringSchema = stringSchema.check(z3.e164());
|
|
31654
31653
|
} else if (format === "jwt") {
|
|
31655
|
-
stringSchema = stringSchema.check(
|
|
31654
|
+
stringSchema = stringSchema.check(z3.jwt());
|
|
31656
31655
|
} else if (format === "emoji") {
|
|
31657
|
-
stringSchema = stringSchema.check(
|
|
31656
|
+
stringSchema = stringSchema.check(z3.emoji());
|
|
31658
31657
|
} else if (format === "nanoid") {
|
|
31659
|
-
stringSchema = stringSchema.check(
|
|
31658
|
+
stringSchema = stringSchema.check(z3.nanoid());
|
|
31660
31659
|
} else if (format === "cuid") {
|
|
31661
|
-
stringSchema = stringSchema.check(
|
|
31660
|
+
stringSchema = stringSchema.check(z3.cuid());
|
|
31662
31661
|
} else if (format === "cuid2") {
|
|
31663
|
-
stringSchema = stringSchema.check(
|
|
31662
|
+
stringSchema = stringSchema.check(z3.cuid2());
|
|
31664
31663
|
} else if (format === "ulid") {
|
|
31665
|
-
stringSchema = stringSchema.check(
|
|
31664
|
+
stringSchema = stringSchema.check(z3.ulid());
|
|
31666
31665
|
} else if (format === "xid") {
|
|
31667
|
-
stringSchema = stringSchema.check(
|
|
31666
|
+
stringSchema = stringSchema.check(z3.xid());
|
|
31668
31667
|
} else if (format === "ksuid") {
|
|
31669
|
-
stringSchema = stringSchema.check(
|
|
31668
|
+
stringSchema = stringSchema.check(z3.ksuid());
|
|
31670
31669
|
}
|
|
31671
31670
|
}
|
|
31672
31671
|
if (typeof schema.minLength === "number") {
|
|
@@ -31683,7 +31682,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31683
31682
|
}
|
|
31684
31683
|
case "number":
|
|
31685
31684
|
case "integer": {
|
|
31686
|
-
let numberSchema = type === "integer" ?
|
|
31685
|
+
let numberSchema = type === "integer" ? z3.number().int() : z3.number();
|
|
31687
31686
|
if (typeof schema.minimum === "number") {
|
|
31688
31687
|
numberSchema = numberSchema.min(schema.minimum);
|
|
31689
31688
|
}
|
|
@@ -31707,11 +31706,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31707
31706
|
break;
|
|
31708
31707
|
}
|
|
31709
31708
|
case "boolean": {
|
|
31710
|
-
zodSchema =
|
|
31709
|
+
zodSchema = z3.boolean();
|
|
31711
31710
|
break;
|
|
31712
31711
|
}
|
|
31713
31712
|
case "null": {
|
|
31714
|
-
zodSchema =
|
|
31713
|
+
zodSchema = z3.null();
|
|
31715
31714
|
break;
|
|
31716
31715
|
}
|
|
31717
31716
|
case "object": {
|
|
@@ -31724,14 +31723,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31724
31723
|
}
|
|
31725
31724
|
if (schema.propertyNames) {
|
|
31726
31725
|
const keySchema = convertSchema2(schema.propertyNames, ctx);
|
|
31727
|
-
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema2(schema.additionalProperties, ctx) :
|
|
31726
|
+
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema2(schema.additionalProperties, ctx) : z3.any();
|
|
31728
31727
|
if (Object.keys(shape).length === 0) {
|
|
31729
|
-
zodSchema =
|
|
31728
|
+
zodSchema = z3.record(keySchema, valueSchema);
|
|
31730
31729
|
break;
|
|
31731
31730
|
}
|
|
31732
|
-
const objectSchema2 =
|
|
31733
|
-
const recordSchema =
|
|
31734
|
-
zodSchema =
|
|
31731
|
+
const objectSchema2 = z3.object(shape).passthrough();
|
|
31732
|
+
const recordSchema = z3.looseRecord(keySchema, valueSchema);
|
|
31733
|
+
zodSchema = z3.intersection(objectSchema2, recordSchema);
|
|
31735
31734
|
break;
|
|
31736
31735
|
}
|
|
31737
31736
|
if (schema.patternProperties) {
|
|
@@ -31740,28 +31739,28 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31740
31739
|
const looseRecords = [];
|
|
31741
31740
|
for (const pattern of patternKeys) {
|
|
31742
31741
|
const patternValue = convertSchema2(patternProps[pattern], ctx);
|
|
31743
|
-
const keySchema =
|
|
31744
|
-
looseRecords.push(
|
|
31742
|
+
const keySchema = z3.string().regex(new RegExp(pattern));
|
|
31743
|
+
looseRecords.push(z3.looseRecord(keySchema, patternValue));
|
|
31745
31744
|
}
|
|
31746
31745
|
const schemasToIntersect = [];
|
|
31747
31746
|
if (Object.keys(shape).length > 0) {
|
|
31748
|
-
schemasToIntersect.push(
|
|
31747
|
+
schemasToIntersect.push(z3.object(shape).passthrough());
|
|
31749
31748
|
}
|
|
31750
31749
|
schemasToIntersect.push(...looseRecords);
|
|
31751
31750
|
if (schemasToIntersect.length === 0) {
|
|
31752
|
-
zodSchema =
|
|
31751
|
+
zodSchema = z3.object({}).passthrough();
|
|
31753
31752
|
} else if (schemasToIntersect.length === 1) {
|
|
31754
31753
|
zodSchema = schemasToIntersect[0];
|
|
31755
31754
|
} else {
|
|
31756
|
-
let result =
|
|
31755
|
+
let result = z3.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
31757
31756
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
31758
|
-
result =
|
|
31757
|
+
result = z3.intersection(result, schemasToIntersect[i]);
|
|
31759
31758
|
}
|
|
31760
31759
|
zodSchema = result;
|
|
31761
31760
|
}
|
|
31762
31761
|
break;
|
|
31763
31762
|
}
|
|
31764
|
-
const objectSchema =
|
|
31763
|
+
const objectSchema = z3.object(shape);
|
|
31765
31764
|
if (schema.additionalProperties === false) {
|
|
31766
31765
|
zodSchema = objectSchema.strict();
|
|
31767
31766
|
} else if (typeof schema.additionalProperties === "object") {
|
|
@@ -31778,33 +31777,33 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31778
31777
|
const tupleItems = prefixItems.map((item) => convertSchema2(item, ctx));
|
|
31779
31778
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema2(items, ctx) : void 0;
|
|
31780
31779
|
if (rest) {
|
|
31781
|
-
zodSchema =
|
|
31780
|
+
zodSchema = z3.tuple(tupleItems).rest(rest);
|
|
31782
31781
|
} else {
|
|
31783
|
-
zodSchema =
|
|
31782
|
+
zodSchema = z3.tuple(tupleItems);
|
|
31784
31783
|
}
|
|
31785
31784
|
if (typeof schema.minItems === "number") {
|
|
31786
|
-
zodSchema = zodSchema.check(
|
|
31785
|
+
zodSchema = zodSchema.check(z3.minLength(schema.minItems));
|
|
31787
31786
|
}
|
|
31788
31787
|
if (typeof schema.maxItems === "number") {
|
|
31789
|
-
zodSchema = zodSchema.check(
|
|
31788
|
+
zodSchema = zodSchema.check(z3.maxLength(schema.maxItems));
|
|
31790
31789
|
}
|
|
31791
31790
|
} else if (Array.isArray(items)) {
|
|
31792
31791
|
const tupleItems = items.map((item) => convertSchema2(item, ctx));
|
|
31793
31792
|
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema2(schema.additionalItems, ctx) : void 0;
|
|
31794
31793
|
if (rest) {
|
|
31795
|
-
zodSchema =
|
|
31794
|
+
zodSchema = z3.tuple(tupleItems).rest(rest);
|
|
31796
31795
|
} else {
|
|
31797
|
-
zodSchema =
|
|
31796
|
+
zodSchema = z3.tuple(tupleItems);
|
|
31798
31797
|
}
|
|
31799
31798
|
if (typeof schema.minItems === "number") {
|
|
31800
|
-
zodSchema = zodSchema.check(
|
|
31799
|
+
zodSchema = zodSchema.check(z3.minLength(schema.minItems));
|
|
31801
31800
|
}
|
|
31802
31801
|
if (typeof schema.maxItems === "number") {
|
|
31803
|
-
zodSchema = zodSchema.check(
|
|
31802
|
+
zodSchema = zodSchema.check(z3.maxLength(schema.maxItems));
|
|
31804
31803
|
}
|
|
31805
31804
|
} else if (items !== void 0) {
|
|
31806
31805
|
const element = convertSchema2(items, ctx);
|
|
31807
|
-
let arraySchema =
|
|
31806
|
+
let arraySchema = z3.array(element);
|
|
31808
31807
|
if (typeof schema.minItems === "number") {
|
|
31809
31808
|
arraySchema = arraySchema.min(schema.minItems);
|
|
31810
31809
|
}
|
|
@@ -31813,7 +31812,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31813
31812
|
}
|
|
31814
31813
|
zodSchema = arraySchema;
|
|
31815
31814
|
} else {
|
|
31816
|
-
zodSchema =
|
|
31815
|
+
zodSchema = z3.array(z3.any());
|
|
31817
31816
|
}
|
|
31818
31817
|
break;
|
|
31819
31818
|
}
|
|
@@ -31827,37 +31826,37 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31827
31826
|
__name22(convertBaseSchema2, "convertBaseSchema");
|
|
31828
31827
|
function convertSchema2(schema, ctx) {
|
|
31829
31828
|
if (typeof schema === "boolean") {
|
|
31830
|
-
return schema ?
|
|
31829
|
+
return schema ? z3.any() : z3.never();
|
|
31831
31830
|
}
|
|
31832
31831
|
let baseSchema = convertBaseSchema2(schema, ctx);
|
|
31833
31832
|
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
31834
31833
|
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
31835
31834
|
const options = schema.anyOf.map((s) => convertSchema2(s, ctx));
|
|
31836
|
-
const anyOfUnion =
|
|
31837
|
-
baseSchema = hasExplicitType ?
|
|
31835
|
+
const anyOfUnion = z3.union(options);
|
|
31836
|
+
baseSchema = hasExplicitType ? z3.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
31838
31837
|
}
|
|
31839
31838
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
31840
31839
|
const options = schema.oneOf.map((s) => convertSchema2(s, ctx));
|
|
31841
|
-
const oneOfUnion =
|
|
31842
|
-
baseSchema = hasExplicitType ?
|
|
31840
|
+
const oneOfUnion = z3.xor(options);
|
|
31841
|
+
baseSchema = hasExplicitType ? z3.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
31843
31842
|
}
|
|
31844
31843
|
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
31845
31844
|
if (schema.allOf.length === 0) {
|
|
31846
|
-
baseSchema = hasExplicitType ? baseSchema :
|
|
31845
|
+
baseSchema = hasExplicitType ? baseSchema : z3.any();
|
|
31847
31846
|
} else {
|
|
31848
31847
|
let result = hasExplicitType ? baseSchema : convertSchema2(schema.allOf[0], ctx);
|
|
31849
31848
|
const startIdx = hasExplicitType ? 0 : 1;
|
|
31850
31849
|
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
31851
|
-
result =
|
|
31850
|
+
result = z3.intersection(result, convertSchema2(schema.allOf[i], ctx));
|
|
31852
31851
|
}
|
|
31853
31852
|
baseSchema = result;
|
|
31854
31853
|
}
|
|
31855
31854
|
}
|
|
31856
31855
|
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
31857
|
-
baseSchema =
|
|
31856
|
+
baseSchema = z3.nullable(baseSchema);
|
|
31858
31857
|
}
|
|
31859
31858
|
if (schema.readOnly === true) {
|
|
31860
|
-
baseSchema =
|
|
31859
|
+
baseSchema = z3.readonly(baseSchema);
|
|
31861
31860
|
}
|
|
31862
31861
|
if (schema.default !== void 0) {
|
|
31863
31862
|
baseSchema = baseSchema.default(schema.default);
|
|
@@ -31893,7 +31892,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31893
31892
|
__name22(convertSchema2, "convertSchema");
|
|
31894
31893
|
function fromJSONSchema2(schema, params) {
|
|
31895
31894
|
if (typeof schema === "boolean") {
|
|
31896
|
-
return schema ?
|
|
31895
|
+
return schema ? z3.any() : z3.never();
|
|
31897
31896
|
}
|
|
31898
31897
|
let normalized;
|
|
31899
31898
|
try {
|
|
@@ -32624,7 +32623,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
32624
32623
|
did: LCNProfileValidator.shape.did
|
|
32625
32624
|
});
|
|
32626
32625
|
var LCNConnectionProfileValidator = LCNAuthedProfileValidator.extend({
|
|
32627
|
-
email: LCNProfileValidator.shape.email
|
|
32626
|
+
email: LCNProfileValidator.shape.email,
|
|
32627
|
+
connectedAt: external_exports2.iso.datetime().optional().describe("When the viewer and this profile became connected.")
|
|
32628
32628
|
});
|
|
32629
32629
|
var LCNVisibleProfileValidator = external_exports2.union([
|
|
32630
32630
|
LCNConnectionProfileValidator.strict(),
|
|
@@ -34340,6 +34340,37 @@ var ImageWithLoadingStateValdator = external_exports.object({
|
|
|
34340
34340
|
loading: external_exports.union([ImageResizingValidator, ImageUploadingValidator]).optional()
|
|
34341
34341
|
});
|
|
34342
34342
|
var import_types3 = __toESM(require_dist());
|
|
34343
|
+
var EnvironmentConfigurationError = class extends Error {
|
|
34344
|
+
static {
|
|
34345
|
+
__name(this, "EnvironmentConfigurationError");
|
|
34346
|
+
}
|
|
34347
|
+
static {
|
|
34348
|
+
__name2(this, "EnvironmentConfigurationError");
|
|
34349
|
+
}
|
|
34350
|
+
constructor(message) {
|
|
34351
|
+
super(message);
|
|
34352
|
+
this.name = "EnvironmentConfigurationError";
|
|
34353
|
+
}
|
|
34354
|
+
};
|
|
34355
|
+
var requiredEnvironmentString = external_exports.string().trim().min(1, "Required but missing");
|
|
34356
|
+
var optionalEnvironmentString = external_exports.preprocess(
|
|
34357
|
+
(value) => value === "" ? void 0 : value,
|
|
34358
|
+
requiredEnvironmentString.optional()
|
|
34359
|
+
);
|
|
34360
|
+
var optionalEnvironmentUrl = external_exports.preprocess(
|
|
34361
|
+
(value) => value === "" ? void 0 : value,
|
|
34362
|
+
external_exports.url("Expected a valid URL").optional()
|
|
34363
|
+
);
|
|
34364
|
+
var environmentBoolean = external_exports.enum(["true", "false", "1", "0"]).transform((value) => value === "true" || value === "1");
|
|
34365
|
+
var optionalEnvironmentBoolean = external_exports.preprocess(
|
|
34366
|
+
(value) => value === "" || value === void 0 ? void 0 : value,
|
|
34367
|
+
environmentBoolean.optional()
|
|
34368
|
+
);
|
|
34369
|
+
var environmentPort = external_exports.coerce.number().int().min(1).max(65535);
|
|
34370
|
+
var optionalEnvironmentPort = external_exports.preprocess(
|
|
34371
|
+
(value) => value === "" || value === void 0 ? void 0 : value,
|
|
34372
|
+
environmentPort.optional()
|
|
34373
|
+
);
|
|
34343
34374
|
var RegExpTransformer = {
|
|
34344
34375
|
serialize(object2) {
|
|
34345
34376
|
return JSON.stringify(object2, (_key, value) => {
|