deepline 0.3.50 → 0.3.52

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.
@@ -1,9 +1,4 @@
1
1
  #!/usr/bin/env node
2
- var __defProp = Object.defineProperty;
3
- var __export = (target, all) => {
4
- for (var name in all)
5
- __defProp(target, name, { get: all[name], enumerable: true });
6
- };
7
2
 
8
3
  // src/cli/proxy-env.ts
9
4
  import { Agent, Dispatcher, ProxyAgent, setGlobalDispatcher } from "undici";
@@ -1065,7 +1060,7 @@ var SDK_RELEASE = {
1065
1060
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
1066
1061
  // getters keep their established compatibility behavior.
1067
1062
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
1068
- version: "0.3.50",
1063
+ version: "0.3.52",
1069
1064
  updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
1070
1065
  packageCapabilities: {
1071
1066
  updatePreferences: 1
@@ -13529,2640 +13524,36 @@ import {
13529
13524
  transformSync
13530
13525
  } from "esbuild";
13531
13526
 
13532
- // ../../node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
13533
- var value_exports = {};
13534
- __export(value_exports, {
13535
- HasPropertyKey: () => HasPropertyKey,
13536
- IsArray: () => IsArray,
13537
- IsAsyncIterator: () => IsAsyncIterator,
13538
- IsBigInt: () => IsBigInt,
13539
- IsBoolean: () => IsBoolean,
13540
- IsDate: () => IsDate,
13541
- IsFunction: () => IsFunction,
13542
- IsIterator: () => IsIterator,
13543
- IsNull: () => IsNull,
13544
- IsNumber: () => IsNumber,
13545
- IsObject: () => IsObject,
13546
- IsRegExp: () => IsRegExp,
13547
- IsString: () => IsString,
13548
- IsSymbol: () => IsSymbol,
13549
- IsUint8Array: () => IsUint8Array,
13550
- IsUndefined: () => IsUndefined
13551
- });
13552
- function HasPropertyKey(value, key) {
13553
- return key in value;
13554
- }
13555
- function IsAsyncIterator(value) {
13556
- return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value;
13557
- }
13558
- function IsArray(value) {
13559
- return Array.isArray(value);
13560
- }
13561
- function IsBigInt(value) {
13562
- return typeof value === "bigint";
13563
- }
13564
- function IsBoolean(value) {
13565
- return typeof value === "boolean";
13566
- }
13567
- function IsDate(value) {
13568
- return value instanceof globalThis.Date;
13569
- }
13570
- function IsFunction(value) {
13571
- return typeof value === "function";
13572
- }
13573
- function IsIterator(value) {
13574
- return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.iterator in value;
13575
- }
13576
- function IsNull(value) {
13577
- return value === null;
13578
- }
13579
- function IsNumber(value) {
13580
- return typeof value === "number";
13581
- }
13582
- function IsObject(value) {
13583
- return typeof value === "object" && value !== null;
13584
- }
13585
- function IsRegExp(value) {
13586
- return value instanceof globalThis.RegExp;
13587
- }
13588
- function IsString(value) {
13589
- return typeof value === "string";
13590
- }
13591
- function IsSymbol(value) {
13592
- return typeof value === "symbol";
13593
- }
13594
- function IsUint8Array(value) {
13595
- return value instanceof globalThis.Uint8Array;
13596
- }
13597
- function IsUndefined(value) {
13598
- return value === void 0;
13599
- }
13600
-
13601
- // ../../node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs
13602
- function ArrayType(value) {
13603
- return value.map((value2) => Visit(value2));
13604
- }
13605
- function DateType(value) {
13606
- return new Date(value.getTime());
13607
- }
13608
- function Uint8ArrayType(value) {
13609
- return new Uint8Array(value);
13610
- }
13611
- function RegExpType(value) {
13612
- return new RegExp(value.source, value.flags);
13613
- }
13614
- function ObjectType(value) {
13615
- const result = {};
13616
- for (const key of Object.getOwnPropertyNames(value)) {
13617
- result[key] = Visit(value[key]);
13618
- }
13619
- for (const key of Object.getOwnPropertySymbols(value)) {
13620
- result[key] = Visit(value[key]);
13621
- }
13622
- return result;
13623
- }
13624
- function Visit(value) {
13625
- return IsArray(value) ? ArrayType(value) : IsDate(value) ? DateType(value) : IsUint8Array(value) ? Uint8ArrayType(value) : IsRegExp(value) ? RegExpType(value) : IsObject(value) ? ObjectType(value) : value;
13626
- }
13627
- function Clone(value) {
13628
- return Visit(value);
13629
- }
13630
-
13631
- // ../../node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs
13632
- function CloneType(schema, options) {
13633
- return options === void 0 ? Clone(schema) : Clone({ ...options, ...schema });
13634
- }
13635
-
13636
- // ../../node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs
13637
- function IsObject2(value) {
13638
- return value !== null && typeof value === "object";
13639
- }
13640
- function IsArray2(value) {
13641
- return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value);
13642
- }
13643
- function IsUndefined2(value) {
13644
- return value === void 0;
13645
- }
13646
- function IsNumber2(value) {
13647
- return typeof value === "number";
13648
- }
13649
-
13650
- // ../../node_modules/@sinclair/typebox/build/esm/system/policy.mjs
13651
- var TypeSystemPolicy;
13652
- (function(TypeSystemPolicy2) {
13653
- TypeSystemPolicy2.InstanceMode = "default";
13654
- TypeSystemPolicy2.ExactOptionalPropertyTypes = false;
13655
- TypeSystemPolicy2.AllowArrayObject = false;
13656
- TypeSystemPolicy2.AllowNaN = false;
13657
- TypeSystemPolicy2.AllowNullVoid = false;
13658
- function IsExactOptionalProperty(value, key) {
13659
- return TypeSystemPolicy2.ExactOptionalPropertyTypes ? key in value : value[key] !== void 0;
13660
- }
13661
- TypeSystemPolicy2.IsExactOptionalProperty = IsExactOptionalProperty;
13662
- function IsObjectLike(value) {
13663
- const isObject = IsObject2(value);
13664
- return TypeSystemPolicy2.AllowArrayObject ? isObject : isObject && !IsArray2(value);
13665
- }
13666
- TypeSystemPolicy2.IsObjectLike = IsObjectLike;
13667
- function IsRecordLike(value) {
13668
- return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array);
13669
- }
13670
- TypeSystemPolicy2.IsRecordLike = IsRecordLike;
13671
- function IsNumberLike(value) {
13672
- return TypeSystemPolicy2.AllowNaN ? IsNumber2(value) : Number.isFinite(value);
13673
- }
13674
- TypeSystemPolicy2.IsNumberLike = IsNumberLike;
13675
- function IsVoidLike(value) {
13676
- const isUndefined = IsUndefined2(value);
13677
- return TypeSystemPolicy2.AllowNullVoid ? isUndefined || value === null : isUndefined;
13678
- }
13679
- TypeSystemPolicy2.IsVoidLike = IsVoidLike;
13680
- })(TypeSystemPolicy || (TypeSystemPolicy = {}));
13681
-
13682
- // ../../node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs
13683
- function ImmutableArray(value) {
13684
- return globalThis.Object.freeze(value).map((value2) => Immutable(value2));
13685
- }
13686
- function ImmutableDate(value) {
13687
- return value;
13688
- }
13689
- function ImmutableUint8Array(value) {
13690
- return value;
13691
- }
13692
- function ImmutableRegExp(value) {
13693
- return value;
13694
- }
13695
- function ImmutableObject(value) {
13696
- const result = {};
13697
- for (const key of Object.getOwnPropertyNames(value)) {
13698
- result[key] = Immutable(value[key]);
13699
- }
13700
- for (const key of Object.getOwnPropertySymbols(value)) {
13701
- result[key] = Immutable(value[key]);
13702
- }
13703
- return globalThis.Object.freeze(result);
13704
- }
13705
- function Immutable(value) {
13706
- return IsArray(value) ? ImmutableArray(value) : IsDate(value) ? ImmutableDate(value) : IsUint8Array(value) ? ImmutableUint8Array(value) : IsRegExp(value) ? ImmutableRegExp(value) : IsObject(value) ? ImmutableObject(value) : value;
13707
- }
13708
-
13709
- // ../../node_modules/@sinclair/typebox/build/esm/type/create/type.mjs
13710
- function CreateType(schema, options) {
13711
- const result = options !== void 0 ? { ...options, ...schema } : schema;
13712
- switch (TypeSystemPolicy.InstanceMode) {
13713
- case "freeze":
13714
- return Immutable(result);
13715
- case "clone":
13716
- return Clone(result);
13717
- default:
13718
- return result;
13719
- }
13720
- }
13721
-
13722
- // ../../node_modules/@sinclair/typebox/build/esm/type/error/error.mjs
13723
- var TypeBoxError = class extends Error {
13724
- constructor(message) {
13725
- super(message);
13726
- }
13727
- };
13728
-
13729
- // ../../node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs
13730
- var TransformKind = Symbol.for("TypeBox.Transform");
13731
- var ReadonlyKind = Symbol.for("TypeBox.Readonly");
13732
- var OptionalKind = Symbol.for("TypeBox.Optional");
13733
- var Hint = Symbol.for("TypeBox.Hint");
13734
- var Kind = Symbol.for("TypeBox.Kind");
13735
-
13736
- // ../../node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs
13737
- function IsReadonly(value) {
13738
- return IsObject(value) && value[ReadonlyKind] === "Readonly";
13739
- }
13740
- function IsOptional(value) {
13741
- return IsObject(value) && value[OptionalKind] === "Optional";
13742
- }
13743
- function IsAny(value) {
13744
- return IsKindOf(value, "Any");
13745
- }
13746
- function IsArgument(value) {
13747
- return IsKindOf(value, "Argument");
13748
- }
13749
- function IsArray3(value) {
13750
- return IsKindOf(value, "Array");
13751
- }
13752
- function IsAsyncIterator2(value) {
13753
- return IsKindOf(value, "AsyncIterator");
13754
- }
13755
- function IsBigInt2(value) {
13756
- return IsKindOf(value, "BigInt");
13757
- }
13758
- function IsBoolean2(value) {
13759
- return IsKindOf(value, "Boolean");
13760
- }
13761
- function IsComputed(value) {
13762
- return IsKindOf(value, "Computed");
13763
- }
13764
- function IsConstructor(value) {
13765
- return IsKindOf(value, "Constructor");
13766
- }
13767
- function IsDate2(value) {
13768
- return IsKindOf(value, "Date");
13769
- }
13770
- function IsFunction2(value) {
13771
- return IsKindOf(value, "Function");
13772
- }
13773
- function IsInteger(value) {
13774
- return IsKindOf(value, "Integer");
13775
- }
13776
- function IsIntersect(value) {
13777
- return IsKindOf(value, "Intersect");
13778
- }
13779
- function IsIterator2(value) {
13780
- return IsKindOf(value, "Iterator");
13781
- }
13782
- function IsKindOf(value, kind) {
13783
- return IsObject(value) && Kind in value && value[Kind] === kind;
13784
- }
13785
- function IsLiteralValue(value) {
13786
- return IsBoolean(value) || IsNumber(value) || IsString(value);
13787
- }
13788
- function IsLiteral(value) {
13789
- return IsKindOf(value, "Literal");
13790
- }
13791
- function IsMappedKey(value) {
13792
- return IsKindOf(value, "MappedKey");
13793
- }
13794
- function IsMappedResult(value) {
13795
- return IsKindOf(value, "MappedResult");
13796
- }
13797
- function IsNever(value) {
13798
- return IsKindOf(value, "Never");
13799
- }
13800
- function IsNot(value) {
13801
- return IsKindOf(value, "Not");
13802
- }
13803
- function IsNull2(value) {
13804
- return IsKindOf(value, "Null");
13805
- }
13806
- function IsNumber3(value) {
13807
- return IsKindOf(value, "Number");
13808
- }
13809
- function IsObject3(value) {
13810
- return IsKindOf(value, "Object");
13811
- }
13812
- function IsPromise(value) {
13813
- return IsKindOf(value, "Promise");
13814
- }
13815
- function IsRecord(value) {
13816
- return IsKindOf(value, "Record");
13817
- }
13818
- function IsRef(value) {
13819
- return IsKindOf(value, "Ref");
13820
- }
13821
- function IsRegExp2(value) {
13822
- return IsKindOf(value, "RegExp");
13823
- }
13824
- function IsString2(value) {
13825
- return IsKindOf(value, "String");
13826
- }
13827
- function IsSymbol2(value) {
13828
- return IsKindOf(value, "Symbol");
13829
- }
13830
- function IsTemplateLiteral(value) {
13831
- return IsKindOf(value, "TemplateLiteral");
13832
- }
13833
- function IsThis(value) {
13834
- return IsKindOf(value, "This");
13835
- }
13836
- function IsTransform(value) {
13837
- return IsObject(value) && TransformKind in value;
13838
- }
13839
- function IsTuple(value) {
13840
- return IsKindOf(value, "Tuple");
13841
- }
13842
- function IsUndefined3(value) {
13843
- return IsKindOf(value, "Undefined");
13844
- }
13845
- function IsUnion(value) {
13846
- return IsKindOf(value, "Union");
13847
- }
13848
- function IsUint8Array2(value) {
13849
- return IsKindOf(value, "Uint8Array");
13850
- }
13851
- function IsUnknown(value) {
13852
- return IsKindOf(value, "Unknown");
13853
- }
13854
- function IsUnsafe(value) {
13855
- return IsKindOf(value, "Unsafe");
13856
- }
13857
- function IsVoid(value) {
13858
- return IsKindOf(value, "Void");
13859
- }
13860
- function IsKind(value) {
13861
- return IsObject(value) && Kind in value && IsString(value[Kind]);
13862
- }
13863
- function IsSchema(value) {
13864
- return IsAny(value) || IsArgument(value) || IsArray3(value) || IsBoolean2(value) || IsBigInt2(value) || IsAsyncIterator2(value) || IsComputed(value) || IsConstructor(value) || IsDate2(value) || IsFunction2(value) || IsInteger(value) || IsIntersect(value) || IsIterator2(value) || IsLiteral(value) || IsMappedKey(value) || IsMappedResult(value) || IsNever(value) || IsNot(value) || IsNull2(value) || IsNumber3(value) || IsObject3(value) || IsPromise(value) || IsRecord(value) || IsRef(value) || IsRegExp2(value) || IsString2(value) || IsSymbol2(value) || IsTemplateLiteral(value) || IsThis(value) || IsTuple(value) || IsUndefined3(value) || IsUnion(value) || IsUint8Array2(value) || IsUnknown(value) || IsUnsafe(value) || IsVoid(value) || IsKind(value);
13865
- }
13866
-
13867
- // ../../node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
13868
- var type_exports = {};
13869
- __export(type_exports, {
13870
- IsAny: () => IsAny2,
13871
- IsArgument: () => IsArgument2,
13872
- IsArray: () => IsArray4,
13873
- IsAsyncIterator: () => IsAsyncIterator3,
13874
- IsBigInt: () => IsBigInt3,
13875
- IsBoolean: () => IsBoolean3,
13876
- IsComputed: () => IsComputed2,
13877
- IsConstructor: () => IsConstructor2,
13878
- IsDate: () => IsDate3,
13879
- IsFunction: () => IsFunction3,
13880
- IsImport: () => IsImport,
13881
- IsInteger: () => IsInteger2,
13882
- IsIntersect: () => IsIntersect2,
13883
- IsIterator: () => IsIterator3,
13884
- IsKind: () => IsKind2,
13885
- IsKindOf: () => IsKindOf2,
13886
- IsLiteral: () => IsLiteral2,
13887
- IsLiteralBoolean: () => IsLiteralBoolean,
13888
- IsLiteralNumber: () => IsLiteralNumber,
13889
- IsLiteralString: () => IsLiteralString,
13890
- IsLiteralValue: () => IsLiteralValue2,
13891
- IsMappedKey: () => IsMappedKey2,
13892
- IsMappedResult: () => IsMappedResult2,
13893
- IsNever: () => IsNever2,
13894
- IsNot: () => IsNot2,
13895
- IsNull: () => IsNull3,
13896
- IsNumber: () => IsNumber4,
13897
- IsObject: () => IsObject4,
13898
- IsOptional: () => IsOptional2,
13899
- IsPromise: () => IsPromise2,
13900
- IsProperties: () => IsProperties,
13901
- IsReadonly: () => IsReadonly2,
13902
- IsRecord: () => IsRecord2,
13903
- IsRecursive: () => IsRecursive,
13904
- IsRef: () => IsRef2,
13905
- IsRegExp: () => IsRegExp3,
13906
- IsSchema: () => IsSchema2,
13907
- IsString: () => IsString3,
13908
- IsSymbol: () => IsSymbol3,
13909
- IsTemplateLiteral: () => IsTemplateLiteral2,
13910
- IsThis: () => IsThis2,
13911
- IsTransform: () => IsTransform2,
13912
- IsTuple: () => IsTuple2,
13913
- IsUint8Array: () => IsUint8Array3,
13914
- IsUndefined: () => IsUndefined4,
13915
- IsUnion: () => IsUnion2,
13916
- IsUnionLiteral: () => IsUnionLiteral,
13917
- IsUnknown: () => IsUnknown2,
13918
- IsUnsafe: () => IsUnsafe2,
13919
- IsVoid: () => IsVoid2,
13920
- TypeGuardUnknownTypeError: () => TypeGuardUnknownTypeError
13921
- });
13922
- var TypeGuardUnknownTypeError = class extends TypeBoxError {
13923
- };
13924
- var KnownTypes = [
13925
- "Argument",
13926
- "Any",
13927
- "Array",
13928
- "AsyncIterator",
13929
- "BigInt",
13930
- "Boolean",
13931
- "Computed",
13932
- "Constructor",
13933
- "Date",
13934
- "Enum",
13935
- "Function",
13936
- "Integer",
13937
- "Intersect",
13938
- "Iterator",
13939
- "Literal",
13940
- "MappedKey",
13941
- "MappedResult",
13942
- "Not",
13943
- "Null",
13944
- "Number",
13945
- "Object",
13946
- "Promise",
13947
- "Record",
13948
- "Ref",
13949
- "RegExp",
13950
- "String",
13951
- "Symbol",
13952
- "TemplateLiteral",
13953
- "This",
13954
- "Tuple",
13955
- "Undefined",
13956
- "Union",
13957
- "Uint8Array",
13958
- "Unknown",
13959
- "Void"
13527
+ // ../plays/authoring-contract.ts
13528
+ import { Type } from "@sinclair/typebox";
13529
+ import { Value } from "@sinclair/typebox/value";
13530
+ var PLAY_SQL_LISTENER_WHERE_OPERATORS = [
13531
+ "eq",
13532
+ "neq",
13533
+ "in",
13534
+ "notIn",
13535
+ "isNull",
13536
+ "isNotNull",
13537
+ "ilike"
13960
13538
  ];
13961
- function IsPattern(value) {
13962
- try {
13963
- new RegExp(value);
13964
- return true;
13965
- } catch {
13966
- return false;
13967
- }
13968
- }
13969
- function IsControlCharacterFree(value) {
13970
- if (!IsString(value))
13971
- return false;
13972
- for (let i = 0; i < value.length; i++) {
13973
- const code = value.charCodeAt(i);
13974
- if (code >= 7 && code <= 13 || code === 27 || code === 127) {
13975
- return false;
13976
- }
13977
- }
13978
- return true;
13979
- }
13980
- function IsAdditionalProperties(value) {
13981
- return IsOptionalBoolean(value) || IsSchema2(value);
13982
- }
13983
- function IsOptionalBigInt(value) {
13984
- return IsUndefined(value) || IsBigInt(value);
13985
- }
13986
- function IsOptionalNumber(value) {
13987
- return IsUndefined(value) || IsNumber(value);
13988
- }
13989
- function IsOptionalBoolean(value) {
13990
- return IsUndefined(value) || IsBoolean(value);
13991
- }
13992
- function IsOptionalString(value) {
13993
- return IsUndefined(value) || IsString(value);
13994
- }
13995
- function IsOptionalPattern(value) {
13996
- return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value) && IsPattern(value);
13997
- }
13998
- function IsOptionalFormat(value) {
13999
- return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value);
14000
- }
14001
- function IsOptionalSchema(value) {
14002
- return IsUndefined(value) || IsSchema2(value);
14003
- }
14004
- function IsReadonly2(value) {
14005
- return IsObject(value) && value[ReadonlyKind] === "Readonly";
14006
- }
14007
- function IsOptional2(value) {
14008
- return IsObject(value) && value[OptionalKind] === "Optional";
14009
- }
14010
- function IsAny2(value) {
14011
- return IsKindOf2(value, "Any") && IsOptionalString(value.$id);
14012
- }
14013
- function IsArgument2(value) {
14014
- return IsKindOf2(value, "Argument") && IsNumber(value.index);
14015
- }
14016
- function IsArray4(value) {
14017
- return IsKindOf2(value, "Array") && value.type === "array" && IsOptionalString(value.$id) && IsSchema2(value.items) && IsOptionalNumber(value.minItems) && IsOptionalNumber(value.maxItems) && IsOptionalBoolean(value.uniqueItems) && IsOptionalSchema(value.contains) && IsOptionalNumber(value.minContains) && IsOptionalNumber(value.maxContains);
14018
- }
14019
- function IsAsyncIterator3(value) {
14020
- return IsKindOf2(value, "AsyncIterator") && value.type === "AsyncIterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
14021
- }
14022
- function IsBigInt3(value) {
14023
- return IsKindOf2(value, "BigInt") && value.type === "bigint" && IsOptionalString(value.$id) && IsOptionalBigInt(value.exclusiveMaximum) && IsOptionalBigInt(value.exclusiveMinimum) && IsOptionalBigInt(value.maximum) && IsOptionalBigInt(value.minimum) && IsOptionalBigInt(value.multipleOf);
14024
- }
14025
- function IsBoolean3(value) {
14026
- return IsKindOf2(value, "Boolean") && value.type === "boolean" && IsOptionalString(value.$id);
14027
- }
14028
- function IsComputed2(value) {
14029
- return IsKindOf2(value, "Computed") && IsString(value.target) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema));
14030
- }
14031
- function IsConstructor2(value) {
14032
- return IsKindOf2(value, "Constructor") && value.type === "Constructor" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
14033
- }
14034
- function IsDate3(value) {
14035
- return IsKindOf2(value, "Date") && value.type === "Date" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximumTimestamp) && IsOptionalNumber(value.exclusiveMinimumTimestamp) && IsOptionalNumber(value.maximumTimestamp) && IsOptionalNumber(value.minimumTimestamp) && IsOptionalNumber(value.multipleOfTimestamp);
14036
- }
14037
- function IsFunction3(value) {
14038
- return IsKindOf2(value, "Function") && value.type === "Function" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
14039
- }
14040
- function IsImport(value) {
14041
- return IsKindOf2(value, "Import") && HasPropertyKey(value, "$defs") && IsObject(value.$defs) && IsProperties(value.$defs) && HasPropertyKey(value, "$ref") && IsString(value.$ref) && value.$ref in value.$defs;
14042
- }
14043
- function IsInteger2(value) {
14044
- return IsKindOf2(value, "Integer") && value.type === "integer" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
14045
- }
14046
- function IsProperties(value) {
14047
- return IsObject(value) && Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema2(schema));
14048
- }
14049
- function IsIntersect2(value) {
14050
- return IsKindOf2(value, "Intersect") && (IsString(value.type) && value.type !== "object" ? false : true) && IsArray(value.allOf) && value.allOf.every((schema) => IsSchema2(schema) && !IsTransform2(schema)) && IsOptionalString(value.type) && (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) && IsOptionalString(value.$id);
14051
- }
14052
- function IsIterator3(value) {
14053
- return IsKindOf2(value, "Iterator") && value.type === "Iterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
14054
- }
14055
- function IsKindOf2(value, kind) {
14056
- return IsObject(value) && Kind in value && value[Kind] === kind;
14057
- }
14058
- function IsLiteralString(value) {
14059
- return IsLiteral2(value) && IsString(value.const);
14060
- }
14061
- function IsLiteralNumber(value) {
14062
- return IsLiteral2(value) && IsNumber(value.const);
14063
- }
14064
- function IsLiteralBoolean(value) {
14065
- return IsLiteral2(value) && IsBoolean(value.const);
14066
- }
14067
- function IsLiteral2(value) {
14068
- return IsKindOf2(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue2(value.const);
14069
- }
14070
- function IsLiteralValue2(value) {
14071
- return IsBoolean(value) || IsNumber(value) || IsString(value);
14072
- }
14073
- function IsMappedKey2(value) {
14074
- return IsKindOf2(value, "MappedKey") && IsArray(value.keys) && value.keys.every((key) => IsNumber(key) || IsString(key));
14075
- }
14076
- function IsMappedResult2(value) {
14077
- return IsKindOf2(value, "MappedResult") && IsProperties(value.properties);
14078
- }
14079
- function IsNever2(value) {
14080
- return IsKindOf2(value, "Never") && IsObject(value.not) && Object.getOwnPropertyNames(value.not).length === 0;
14081
- }
14082
- function IsNot2(value) {
14083
- return IsKindOf2(value, "Not") && IsSchema2(value.not);
14084
- }
14085
- function IsNull3(value) {
14086
- return IsKindOf2(value, "Null") && value.type === "null" && IsOptionalString(value.$id);
14087
- }
14088
- function IsNumber4(value) {
14089
- return IsKindOf2(value, "Number") && value.type === "number" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
14090
- }
14091
- function IsObject4(value) {
14092
- return IsKindOf2(value, "Object") && value.type === "object" && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties);
14093
- }
14094
- function IsPromise2(value) {
14095
- return IsKindOf2(value, "Promise") && value.type === "Promise" && IsOptionalString(value.$id) && IsSchema2(value.item);
14096
- }
14097
- function IsRecord2(value) {
14098
- return IsKindOf2(value, "Record") && value.type === "object" && IsOptionalString(value.$id) && IsAdditionalProperties(value.additionalProperties) && IsObject(value.patternProperties) && ((schema) => {
14099
- const keys = Object.getOwnPropertyNames(schema.patternProperties);
14100
- return keys.length === 1 && IsPattern(keys[0]) && IsObject(schema.patternProperties) && IsSchema2(schema.patternProperties[keys[0]]);
14101
- })(value);
14102
- }
14103
- function IsRecursive(value) {
14104
- return IsObject(value) && Hint in value && value[Hint] === "Recursive";
14105
- }
14106
- function IsRef2(value) {
14107
- return IsKindOf2(value, "Ref") && IsOptionalString(value.$id) && IsString(value.$ref);
14108
- }
14109
- function IsRegExp3(value) {
14110
- return IsKindOf2(value, "RegExp") && IsOptionalString(value.$id) && IsString(value.source) && IsString(value.flags) && IsOptionalNumber(value.maxLength) && IsOptionalNumber(value.minLength);
14111
- }
14112
- function IsString3(value) {
14113
- return IsKindOf2(value, "String") && value.type === "string" && IsOptionalString(value.$id) && IsOptionalNumber(value.minLength) && IsOptionalNumber(value.maxLength) && IsOptionalPattern(value.pattern) && IsOptionalFormat(value.format);
14114
- }
14115
- function IsSymbol3(value) {
14116
- return IsKindOf2(value, "Symbol") && value.type === "symbol" && IsOptionalString(value.$id);
14117
- }
14118
- function IsTemplateLiteral2(value) {
14119
- return IsKindOf2(value, "TemplateLiteral") && value.type === "string" && IsString(value.pattern) && value.pattern[0] === "^" && value.pattern[value.pattern.length - 1] === "$";
14120
- }
14121
- function IsThis2(value) {
14122
- return IsKindOf2(value, "This") && IsOptionalString(value.$id) && IsString(value.$ref);
14123
- }
14124
- function IsTransform2(value) {
14125
- return IsObject(value) && TransformKind in value;
14126
- }
14127
- function IsTuple2(value) {
14128
- return IsKindOf2(value, "Tuple") && value.type === "array" && IsOptionalString(value.$id) && IsNumber(value.minItems) && IsNumber(value.maxItems) && value.minItems === value.maxItems && // empty
14129
- (IsUndefined(value.items) && IsUndefined(value.additionalItems) && value.minItems === 0 || IsArray(value.items) && value.items.every((schema) => IsSchema2(schema)));
14130
- }
14131
- function IsUndefined4(value) {
14132
- return IsKindOf2(value, "Undefined") && value.type === "undefined" && IsOptionalString(value.$id);
14133
- }
14134
- function IsUnionLiteral(value) {
14135
- return IsUnion2(value) && value.anyOf.every((schema) => IsLiteralString(schema) || IsLiteralNumber(schema));
14136
- }
14137
- function IsUnion2(value) {
14138
- return IsKindOf2(value, "Union") && IsOptionalString(value.$id) && IsObject(value) && IsArray(value.anyOf) && value.anyOf.every((schema) => IsSchema2(schema));
14139
- }
14140
- function IsUint8Array3(value) {
14141
- return IsKindOf2(value, "Uint8Array") && value.type === "Uint8Array" && IsOptionalString(value.$id) && IsOptionalNumber(value.minByteLength) && IsOptionalNumber(value.maxByteLength);
14142
- }
14143
- function IsUnknown2(value) {
14144
- return IsKindOf2(value, "Unknown") && IsOptionalString(value.$id);
14145
- }
14146
- function IsUnsafe2(value) {
14147
- return IsKindOf2(value, "Unsafe");
14148
- }
14149
- function IsVoid2(value) {
14150
- return IsKindOf2(value, "Void") && value.type === "void" && IsOptionalString(value.$id);
14151
- }
14152
- function IsKind2(value) {
14153
- return IsObject(value) && Kind in value && IsString(value[Kind]) && !KnownTypes.includes(value[Kind]);
14154
- }
14155
- function IsSchema2(value) {
14156
- return IsObject(value) && (IsAny2(value) || IsArgument2(value) || IsArray4(value) || IsBoolean3(value) || IsBigInt3(value) || IsAsyncIterator3(value) || IsComputed2(value) || IsConstructor2(value) || IsDate3(value) || IsFunction3(value) || IsInteger2(value) || IsIntersect2(value) || IsIterator3(value) || IsLiteral2(value) || IsMappedKey2(value) || IsMappedResult2(value) || IsNever2(value) || IsNot2(value) || IsNull3(value) || IsNumber4(value) || IsObject4(value) || IsPromise2(value) || IsRecord2(value) || IsRef2(value) || IsRegExp3(value) || IsString3(value) || IsSymbol3(value) || IsTemplateLiteral2(value) || IsThis2(value) || IsTuple2(value) || IsUndefined4(value) || IsUnion2(value) || IsUint8Array3(value) || IsUnknown2(value) || IsUnsafe2(value) || IsVoid2(value) || IsKind2(value));
14157
- }
14158
-
14159
- // ../../node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs
14160
- var PatternBoolean = "(true|false)";
14161
- var PatternNumber = "(0|[1-9][0-9]*)";
14162
- var PatternString = "(.*)";
14163
- var PatternNever = "(?!.*)";
14164
- var PatternBooleanExact = `^${PatternBoolean}$`;
14165
- var PatternNumberExact = `^${PatternNumber}$`;
14166
- var PatternStringExact = `^${PatternString}$`;
14167
- var PatternNeverExact = `^${PatternNever}$`;
14168
-
14169
- // ../../node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs
14170
- function SetIncludes(T, S) {
14171
- return T.includes(S);
14172
- }
14173
- function SetDistinct(T) {
14174
- return [...new Set(T)];
14175
- }
14176
- function SetIntersect(T, S) {
14177
- return T.filter((L) => S.includes(L));
14178
- }
14179
- function SetIntersectManyResolve(T, Init) {
14180
- return T.reduce((Acc, L) => {
14181
- return SetIntersect(Acc, L);
14182
- }, Init);
14183
- }
14184
- function SetIntersectMany(T) {
14185
- return T.length === 1 ? T[0] : T.length > 1 ? SetIntersectManyResolve(T.slice(1), T[0]) : [];
14186
- }
14187
- function SetUnionMany(T) {
14188
- const Acc = [];
14189
- for (const L of T)
14190
- Acc.push(...L);
14191
- return Acc;
14192
- }
14193
-
14194
- // ../../node_modules/@sinclair/typebox/build/esm/type/any/any.mjs
14195
- function Any(options) {
14196
- return CreateType({ [Kind]: "Any" }, options);
14197
- }
14198
-
14199
- // ../../node_modules/@sinclair/typebox/build/esm/type/array/array.mjs
14200
- function Array2(items, options) {
14201
- return CreateType({ [Kind]: "Array", type: "array", items }, options);
14202
- }
14203
-
14204
- // ../../node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs
14205
- function Argument(index) {
14206
- return CreateType({ [Kind]: "Argument", index });
14207
- }
14208
-
14209
- // ../../node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs
14210
- function AsyncIterator(items, options) {
14211
- return CreateType({ [Kind]: "AsyncIterator", type: "AsyncIterator", items }, options);
14212
- }
14213
-
14214
- // ../../node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs
14215
- function Computed(target, parameters, options) {
14216
- return CreateType({ [Kind]: "Computed", target, parameters }, options);
14217
- }
14218
-
14219
- // ../../node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs
14220
- function DiscardKey(value, key) {
14221
- const { [key]: _, ...rest } = value;
14222
- return rest;
14223
- }
14224
- function Discard(value, keys) {
14225
- return keys.reduce((acc, key) => DiscardKey(acc, key), value);
14226
- }
14227
-
14228
- // ../../node_modules/@sinclair/typebox/build/esm/type/never/never.mjs
14229
- function Never(options) {
14230
- return CreateType({ [Kind]: "Never", not: {} }, options);
14231
- }
14232
-
14233
- // ../../node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs
14234
- function MappedResult(properties) {
14235
- return CreateType({
14236
- [Kind]: "MappedResult",
14237
- properties
14238
- });
14239
- }
14240
-
14241
- // ../../node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs
14242
- function Constructor(parameters, returns, options) {
14243
- return CreateType({ [Kind]: "Constructor", type: "Constructor", parameters, returns }, options);
14244
- }
14245
-
14246
- // ../../node_modules/@sinclair/typebox/build/esm/type/function/function.mjs
14247
- function Function2(parameters, returns, options) {
14248
- return CreateType({ [Kind]: "Function", type: "Function", parameters, returns }, options);
14249
- }
14250
-
14251
- // ../../node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs
14252
- function UnionCreate(T, options) {
14253
- return CreateType({ [Kind]: "Union", anyOf: T }, options);
14254
- }
14255
-
14256
- // ../../node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs
14257
- function IsUnionOptional(types) {
14258
- return types.some((type) => IsOptional(type));
14259
- }
14260
- function RemoveOptionalFromRest(types) {
14261
- return types.map((left) => IsOptional(left) ? RemoveOptionalFromType(left) : left);
14262
- }
14263
- function RemoveOptionalFromType(T) {
14264
- return Discard(T, [OptionalKind]);
14265
- }
14266
- function ResolveUnion(types, options) {
14267
- const isOptional = IsUnionOptional(types);
14268
- return isOptional ? Optional(UnionCreate(RemoveOptionalFromRest(types), options)) : UnionCreate(RemoveOptionalFromRest(types), options);
14269
- }
14270
- function UnionEvaluated(T, options) {
14271
- return T.length === 1 ? CreateType(T[0], options) : T.length === 0 ? Never(options) : ResolveUnion(T, options);
14272
- }
14273
-
14274
- // ../../node_modules/@sinclair/typebox/build/esm/type/union/union.mjs
14275
- function Union(types, options) {
14276
- return types.length === 0 ? Never(options) : types.length === 1 ? CreateType(types[0], options) : UnionCreate(types, options);
14277
- }
14278
-
14279
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs
14280
- var TemplateLiteralParserError = class extends TypeBoxError {
14281
- };
14282
- function Unescape(pattern) {
14283
- return pattern.replace(/\\\$/g, "$").replace(/\\\*/g, "*").replace(/\\\^/g, "^").replace(/\\\|/g, "|").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
14284
- }
14285
- function IsNonEscaped(pattern, index, char) {
14286
- return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92;
14287
- }
14288
- function IsOpenParen(pattern, index) {
14289
- return IsNonEscaped(pattern, index, "(");
14290
- }
14291
- function IsCloseParen(pattern, index) {
14292
- return IsNonEscaped(pattern, index, ")");
14293
- }
14294
- function IsSeparator(pattern, index) {
14295
- return IsNonEscaped(pattern, index, "|");
14296
- }
14297
- function IsGroup(pattern) {
14298
- if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1)))
14299
- return false;
14300
- let count = 0;
14301
- for (let index = 0; index < pattern.length; index++) {
14302
- if (IsOpenParen(pattern, index))
14303
- count += 1;
14304
- if (IsCloseParen(pattern, index))
14305
- count -= 1;
14306
- if (count === 0 && index !== pattern.length - 1)
14307
- return false;
14308
- }
14309
- return true;
14310
- }
14311
- function InGroup(pattern) {
14312
- return pattern.slice(1, pattern.length - 1);
14313
- }
14314
- function IsPrecedenceOr(pattern) {
14315
- let count = 0;
14316
- for (let index = 0; index < pattern.length; index++) {
14317
- if (IsOpenParen(pattern, index))
14318
- count += 1;
14319
- if (IsCloseParen(pattern, index))
14320
- count -= 1;
14321
- if (IsSeparator(pattern, index) && count === 0)
14322
- return true;
14323
- }
14324
- return false;
14325
- }
14326
- function IsPrecedenceAnd(pattern) {
14327
- for (let index = 0; index < pattern.length; index++) {
14328
- if (IsOpenParen(pattern, index))
14329
- return true;
14330
- }
14331
- return false;
14332
- }
14333
- function Or(pattern) {
14334
- let [count, start] = [0, 0];
14335
- const expressions = [];
14336
- for (let index = 0; index < pattern.length; index++) {
14337
- if (IsOpenParen(pattern, index))
14338
- count += 1;
14339
- if (IsCloseParen(pattern, index))
14340
- count -= 1;
14341
- if (IsSeparator(pattern, index) && count === 0) {
14342
- const range2 = pattern.slice(start, index);
14343
- if (range2.length > 0)
14344
- expressions.push(TemplateLiteralParse(range2));
14345
- start = index + 1;
14346
- }
14347
- }
14348
- const range = pattern.slice(start);
14349
- if (range.length > 0)
14350
- expressions.push(TemplateLiteralParse(range));
14351
- if (expressions.length === 0)
14352
- return { type: "const", const: "" };
14353
- if (expressions.length === 1)
14354
- return expressions[0];
14355
- return { type: "or", expr: expressions };
14356
- }
14357
- function And(pattern) {
14358
- function Group(value, index) {
14359
- if (!IsOpenParen(value, index))
14360
- throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`);
14361
- let count = 0;
14362
- for (let scan = index; scan < value.length; scan++) {
14363
- if (IsOpenParen(value, scan))
14364
- count += 1;
14365
- if (IsCloseParen(value, scan))
14366
- count -= 1;
14367
- if (count === 0)
14368
- return [index, scan];
14369
- }
14370
- throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`);
14371
- }
14372
- function Range(pattern2, index) {
14373
- for (let scan = index; scan < pattern2.length; scan++) {
14374
- if (IsOpenParen(pattern2, scan))
14375
- return [index, scan];
14376
- }
14377
- return [index, pattern2.length];
14378
- }
14379
- const expressions = [];
14380
- for (let index = 0; index < pattern.length; index++) {
14381
- if (IsOpenParen(pattern, index)) {
14382
- const [start, end] = Group(pattern, index);
14383
- const range = pattern.slice(start, end + 1);
14384
- expressions.push(TemplateLiteralParse(range));
14385
- index = end;
14386
- } else {
14387
- const [start, end] = Range(pattern, index);
14388
- const range = pattern.slice(start, end);
14389
- if (range.length > 0)
14390
- expressions.push(TemplateLiteralParse(range));
14391
- index = end - 1;
14392
- }
14393
- }
14394
- return expressions.length === 0 ? { type: "const", const: "" } : expressions.length === 1 ? expressions[0] : { type: "and", expr: expressions };
14395
- }
14396
- function TemplateLiteralParse(pattern) {
14397
- return IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) : IsPrecedenceOr(pattern) ? Or(pattern) : IsPrecedenceAnd(pattern) ? And(pattern) : { type: "const", const: Unescape(pattern) };
14398
- }
14399
- function TemplateLiteralParseExact(pattern) {
14400
- return TemplateLiteralParse(pattern.slice(1, pattern.length - 1));
14401
- }
14402
-
14403
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs
14404
- var TemplateLiteralFiniteError = class extends TypeBoxError {
14405
- };
14406
- function IsNumberExpression(expression) {
14407
- return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "0" && expression.expr[1].type === "const" && expression.expr[1].const === "[1-9][0-9]*";
14408
- }
14409
- function IsBooleanExpression(expression) {
14410
- return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "true" && expression.expr[1].type === "const" && expression.expr[1].const === "false";
14411
- }
14412
- function IsStringExpression(expression) {
14413
- return expression.type === "const" && expression.const === ".*";
14414
- }
14415
- function IsTemplateLiteralExpressionFinite(expression) {
14416
- return IsNumberExpression(expression) || IsStringExpression(expression) ? false : IsBooleanExpression(expression) ? true : expression.type === "and" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "or" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "const" ? true : (() => {
14417
- throw new TemplateLiteralFiniteError(`Unknown expression type`);
14418
- })();
14419
- }
14420
- function IsTemplateLiteralFinite(schema) {
14421
- const expression = TemplateLiteralParseExact(schema.pattern);
14422
- return IsTemplateLiteralExpressionFinite(expression);
14423
- }
14424
-
14425
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs
14426
- var TemplateLiteralGenerateError = class extends TypeBoxError {
14427
- };
14428
- function* GenerateReduce(buffer) {
14429
- if (buffer.length === 1)
14430
- return yield* buffer[0];
14431
- for (const left of buffer[0]) {
14432
- for (const right of GenerateReduce(buffer.slice(1))) {
14433
- yield `${left}${right}`;
14434
- }
14435
- }
14436
- }
14437
- function* GenerateAnd(expression) {
14438
- return yield* GenerateReduce(expression.expr.map((expr) => [...TemplateLiteralExpressionGenerate(expr)]));
14439
- }
14440
- function* GenerateOr(expression) {
14441
- for (const expr of expression.expr)
14442
- yield* TemplateLiteralExpressionGenerate(expr);
14443
- }
14444
- function* GenerateConst(expression) {
14445
- return yield expression.const;
14446
- }
14447
- function* TemplateLiteralExpressionGenerate(expression) {
14448
- return expression.type === "and" ? yield* GenerateAnd(expression) : expression.type === "or" ? yield* GenerateOr(expression) : expression.type === "const" ? yield* GenerateConst(expression) : (() => {
14449
- throw new TemplateLiteralGenerateError("Unknown expression");
14450
- })();
14451
- }
14452
- function TemplateLiteralGenerate(schema) {
14453
- const expression = TemplateLiteralParseExact(schema.pattern);
14454
- return IsTemplateLiteralExpressionFinite(expression) ? [...TemplateLiteralExpressionGenerate(expression)] : [];
14455
- }
14456
-
14457
- // ../../node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs
14458
- function Literal(value, options) {
14459
- return CreateType({
14460
- [Kind]: "Literal",
14461
- const: value,
14462
- type: typeof value
14463
- }, options);
14464
- }
14465
-
14466
- // ../../node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
14467
- function Boolean2(options) {
14468
- return CreateType({ [Kind]: "Boolean", type: "boolean" }, options);
14469
- }
14470
-
14471
- // ../../node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs
14472
- function BigInt(options) {
14473
- return CreateType({ [Kind]: "BigInt", type: "bigint" }, options);
14474
- }
14475
-
14476
- // ../../node_modules/@sinclair/typebox/build/esm/type/number/number.mjs
14477
- function Number2(options) {
14478
- return CreateType({ [Kind]: "Number", type: "number" }, options);
14479
- }
14480
-
14481
- // ../../node_modules/@sinclair/typebox/build/esm/type/string/string.mjs
14482
- function String2(options) {
14483
- return CreateType({ [Kind]: "String", type: "string" }, options);
14484
- }
14485
-
14486
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
14487
- function* FromUnion(syntax) {
14488
- const trim = syntax.trim().replace(/"|'/g, "");
14489
- return trim === "boolean" ? yield Boolean2() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt() : trim === "string" ? yield String2() : yield (() => {
14490
- const literals = trim.split("|").map((literal) => Literal(literal.trim()));
14491
- return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
14492
- })();
14493
- }
14494
- function* FromTerminal(syntax) {
14495
- if (syntax[1] !== "{") {
14496
- const L = Literal("$");
14497
- const R = FromSyntax(syntax.slice(1));
14498
- return yield* [L, ...R];
14499
- }
14500
- for (let i = 2; i < syntax.length; i++) {
14501
- if (syntax[i] === "}") {
14502
- const L = FromUnion(syntax.slice(2, i));
14503
- const R = FromSyntax(syntax.slice(i + 1));
14504
- return yield* [...L, ...R];
14505
- }
14506
- }
14507
- yield Literal(syntax);
14508
- }
14509
- function* FromSyntax(syntax) {
14510
- for (let i = 0; i < syntax.length; i++) {
14511
- if (syntax[i] === "$") {
14512
- const L = Literal(syntax.slice(0, i));
14513
- const R = FromTerminal(syntax.slice(i));
14514
- return yield* [L, ...R];
14515
- }
14516
- }
14517
- yield Literal(syntax);
14518
- }
14519
- function TemplateLiteralSyntax(syntax) {
14520
- return [...FromSyntax(syntax)];
14521
- }
14522
-
14523
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs
14524
- var TemplateLiteralPatternError = class extends TypeBoxError {
14525
- };
14526
- function Escape(value) {
14527
- return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
14528
- }
14529
- function Visit2(schema, acc) {
14530
- return IsTemplateLiteral(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) : IsUnion(schema) ? `(${schema.anyOf.map((schema2) => Visit2(schema2, acc)).join("|")})` : IsNumber3(schema) ? `${acc}${PatternNumber}` : IsInteger(schema) ? `${acc}${PatternNumber}` : IsBigInt2(schema) ? `${acc}${PatternNumber}` : IsString2(schema) ? `${acc}${PatternString}` : IsLiteral(schema) ? `${acc}${Escape(schema.const.toString())}` : IsBoolean2(schema) ? `${acc}${PatternBoolean}` : (() => {
14531
- throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`);
14532
- })();
14533
- }
14534
- function TemplateLiteralPattern(kinds) {
14535
- return `^${kinds.map((schema) => Visit2(schema, "")).join("")}$`;
14536
- }
14537
-
14538
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs
14539
- function TemplateLiteralToUnion(schema) {
14540
- const R = TemplateLiteralGenerate(schema);
14541
- const L = R.map((S) => Literal(S));
14542
- return UnionEvaluated(L);
14543
- }
14544
-
14545
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs
14546
- function TemplateLiteral(unresolved, options) {
14547
- const pattern = IsString(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved);
14548
- return CreateType({ [Kind]: "TemplateLiteral", type: "string", pattern }, options);
14549
- }
14550
-
14551
- // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs
14552
- function FromTemplateLiteral(templateLiteral) {
14553
- const keys = TemplateLiteralGenerate(templateLiteral);
14554
- return keys.map((key) => key.toString());
14555
- }
14556
- function FromUnion2(types) {
14557
- const result = [];
14558
- for (const type of types)
14559
- result.push(...IndexPropertyKeys(type));
14560
- return result;
14561
- }
14562
- function FromLiteral(literalValue) {
14563
- return [literalValue.toString()];
14564
- }
14565
- function IndexPropertyKeys(type) {
14566
- return [...new Set(IsTemplateLiteral(type) ? FromTemplateLiteral(type) : IsUnion(type) ? FromUnion2(type.anyOf) : IsLiteral(type) ? FromLiteral(type.const) : IsNumber3(type) ? ["[number]"] : IsInteger(type) ? ["[number]"] : [])];
14567
- }
14568
-
14569
- // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs
14570
- function FromProperties(type, properties, options) {
14571
- const result = {};
14572
- for (const K2 of Object.getOwnPropertyNames(properties)) {
14573
- result[K2] = Index(type, IndexPropertyKeys(properties[K2]), options);
14574
- }
14575
- return result;
14576
- }
14577
- function FromMappedResult(type, mappedResult, options) {
14578
- return FromProperties(type, mappedResult.properties, options);
14579
- }
14580
- function IndexFromMappedResult(type, mappedResult, options) {
14581
- const properties = FromMappedResult(type, mappedResult, options);
14582
- return MappedResult(properties);
14583
- }
14584
-
14585
- // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs
14586
- function FromRest(types, key) {
14587
- return types.map((type) => IndexFromPropertyKey(type, key));
14588
- }
14589
- function FromIntersectRest(types) {
14590
- return types.filter((type) => !IsNever(type));
14591
- }
14592
- function FromIntersect(types, key) {
14593
- return IntersectEvaluated(FromIntersectRest(FromRest(types, key)));
14594
- }
14595
- function FromUnionRest(types) {
14596
- return types.some((L) => IsNever(L)) ? [] : types;
14597
- }
14598
- function FromUnion3(types, key) {
14599
- return UnionEvaluated(FromUnionRest(FromRest(types, key)));
14600
- }
14601
- function FromTuple(types, key) {
14602
- return key in types ? types[key] : key === "[number]" ? UnionEvaluated(types) : Never();
14603
- }
14604
- function FromArray(type, key) {
14605
- return key === "[number]" ? type : Never();
14606
- }
14607
- function FromProperty(properties, propertyKey) {
14608
- return propertyKey in properties ? properties[propertyKey] : Never();
14609
- }
14610
- function IndexFromPropertyKey(type, propertyKey) {
14611
- return IsIntersect(type) ? FromIntersect(type.allOf, propertyKey) : IsUnion(type) ? FromUnion3(type.anyOf, propertyKey) : IsTuple(type) ? FromTuple(type.items ?? [], propertyKey) : IsArray3(type) ? FromArray(type.items, propertyKey) : IsObject3(type) ? FromProperty(type.properties, propertyKey) : Never();
14612
- }
14613
- function IndexFromPropertyKeys(type, propertyKeys) {
14614
- return propertyKeys.map((propertyKey) => IndexFromPropertyKey(type, propertyKey));
14615
- }
14616
- function FromSchema(type, propertyKeys) {
14617
- return UnionEvaluated(IndexFromPropertyKeys(type, propertyKeys));
14618
- }
14619
- function Index(type, key, options) {
14620
- if (IsRef(type) || IsRef(key)) {
14621
- const error = `Index types using Ref parameters require both Type and Key to be of TSchema`;
14622
- if (!IsSchema(type) || !IsSchema(key))
14623
- throw new TypeBoxError(error);
14624
- return Computed("Index", [type, key]);
14625
- }
14626
- if (IsMappedResult(key))
14627
- return IndexFromMappedResult(type, key, options);
14628
- if (IsMappedKey(key))
14629
- return IndexFromMappedKey(type, key, options);
14630
- return CreateType(IsSchema(key) ? FromSchema(type, IndexPropertyKeys(key)) : FromSchema(type, key), options);
14631
- }
14632
-
14633
- // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs
14634
- function MappedIndexPropertyKey(type, key, options) {
14635
- return { [key]: Index(type, [key], Clone(options)) };
14636
- }
14637
- function MappedIndexPropertyKeys(type, propertyKeys, options) {
14638
- return propertyKeys.reduce((result, left) => {
14639
- return { ...result, ...MappedIndexPropertyKey(type, left, options) };
14640
- }, {});
14641
- }
14642
- function MappedIndexProperties(type, mappedKey, options) {
14643
- return MappedIndexPropertyKeys(type, mappedKey.keys, options);
14644
- }
14645
- function IndexFromMappedKey(type, mappedKey, options) {
14646
- const properties = MappedIndexProperties(type, mappedKey, options);
14647
- return MappedResult(properties);
14648
- }
14649
-
14650
- // ../../node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs
14651
- function Iterator(items, options) {
14652
- return CreateType({ [Kind]: "Iterator", type: "Iterator", items }, options);
14653
- }
14654
-
14655
- // ../../node_modules/@sinclair/typebox/build/esm/type/object/object.mjs
14656
- function RequiredArray(properties) {
14657
- return globalThis.Object.keys(properties).filter((key) => !IsOptional(properties[key]));
14658
- }
14659
- function _Object(properties, options) {
14660
- const required = RequiredArray(properties);
14661
- const schema = required.length > 0 ? { [Kind]: "Object", type: "object", required, properties } : { [Kind]: "Object", type: "object", properties };
14662
- return CreateType(schema, options);
14663
- }
14664
- var Object2 = _Object;
14665
-
14666
- // ../../node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs
14667
- function Promise2(item, options) {
14668
- return CreateType({ [Kind]: "Promise", type: "Promise", item }, options);
14669
- }
14670
-
14671
- // ../../node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs
14672
- function RemoveReadonly(schema) {
14673
- return CreateType(Discard(schema, [ReadonlyKind]));
14674
- }
14675
- function AddReadonly(schema) {
14676
- return CreateType({ ...schema, [ReadonlyKind]: "Readonly" });
14677
- }
14678
- function ReadonlyWithFlag(schema, F) {
14679
- return F === false ? RemoveReadonly(schema) : AddReadonly(schema);
14680
- }
14681
- function Readonly(schema, enable) {
14682
- const F = enable ?? true;
14683
- return IsMappedResult(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F);
14684
- }
14685
-
14686
- // ../../node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs
14687
- function FromProperties2(K, F) {
14688
- const Acc = {};
14689
- for (const K2 of globalThis.Object.getOwnPropertyNames(K))
14690
- Acc[K2] = Readonly(K[K2], F);
14691
- return Acc;
14692
- }
14693
- function FromMappedResult2(R, F) {
14694
- return FromProperties2(R.properties, F);
14695
- }
14696
- function ReadonlyFromMappedResult(R, F) {
14697
- const P = FromMappedResult2(R, F);
14698
- return MappedResult(P);
14699
- }
14700
-
14701
- // ../../node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs
14702
- function Tuple(types, options) {
14703
- return CreateType(types.length > 0 ? { [Kind]: "Tuple", type: "array", items: types, additionalItems: false, minItems: types.length, maxItems: types.length } : { [Kind]: "Tuple", type: "array", minItems: types.length, maxItems: types.length }, options);
14704
- }
14705
-
14706
- // ../../node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs
14707
- function FromMappedResult3(K, P) {
14708
- return K in P ? FromSchemaType(K, P[K]) : MappedResult(P);
14709
- }
14710
- function MappedKeyToKnownMappedResultProperties(K) {
14711
- return { [K]: Literal(K) };
14712
- }
14713
- function MappedKeyToUnknownMappedResultProperties(P) {
14714
- const Acc = {};
14715
- for (const L of P)
14716
- Acc[L] = Literal(L);
14717
- return Acc;
14718
- }
14719
- function MappedKeyToMappedResultProperties(K, P) {
14720
- return SetIncludes(P, K) ? MappedKeyToKnownMappedResultProperties(K) : MappedKeyToUnknownMappedResultProperties(P);
14721
- }
14722
- function FromMappedKey(K, P) {
14723
- const R = MappedKeyToMappedResultProperties(K, P);
14724
- return FromMappedResult3(K, R);
14725
- }
14726
- function FromRest2(K, T) {
14727
- return T.map((L) => FromSchemaType(K, L));
14728
- }
14729
- function FromProperties3(K, T) {
14730
- const Acc = {};
14731
- for (const K2 of globalThis.Object.getOwnPropertyNames(T))
14732
- Acc[K2] = FromSchemaType(K, T[K2]);
14733
- return Acc;
14734
- }
14735
- function FromSchemaType(K, T) {
14736
- const options = { ...T };
14737
- return (
14738
- // unevaluated modifier types
14739
- IsOptional(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : (
14740
- // unevaluated mapped types
14741
- IsMappedResult(T) ? FromMappedResult3(K, T.properties) : IsMappedKey(T) ? FromMappedKey(K, T.keys) : (
14742
- // unevaluated types
14743
- IsConstructor(T) ? Constructor(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsFunction2(T) ? Function2(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsAsyncIterator2(T) ? AsyncIterator(FromSchemaType(K, T.items), options) : IsIterator2(T) ? Iterator(FromSchemaType(K, T.items), options) : IsIntersect(T) ? Intersect(FromRest2(K, T.allOf), options) : IsUnion(T) ? Union(FromRest2(K, T.anyOf), options) : IsTuple(T) ? Tuple(FromRest2(K, T.items ?? []), options) : IsObject3(T) ? Object2(FromProperties3(K, T.properties), options) : IsArray3(T) ? Array2(FromSchemaType(K, T.items), options) : IsPromise(T) ? Promise2(FromSchemaType(K, T.item), options) : T
14744
- )
14745
- )
14746
- );
14747
- }
14748
- function MappedFunctionReturnType(K, T) {
14749
- const Acc = {};
14750
- for (const L of K)
14751
- Acc[L] = FromSchemaType(L, T);
14752
- return Acc;
14753
- }
14754
- function Mapped(key, map, options) {
14755
- const K = IsSchema(key) ? IndexPropertyKeys(key) : key;
14756
- const RT = map({ [Kind]: "MappedKey", keys: K });
14757
- const R = MappedFunctionReturnType(K, RT);
14758
- return Object2(R, options);
14759
- }
14760
-
14761
- // ../../node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs
14762
- function RemoveOptional(schema) {
14763
- return CreateType(Discard(schema, [OptionalKind]));
14764
- }
14765
- function AddOptional(schema) {
14766
- return CreateType({ ...schema, [OptionalKind]: "Optional" });
14767
- }
14768
- function OptionalWithFlag(schema, F) {
14769
- return F === false ? RemoveOptional(schema) : AddOptional(schema);
14770
- }
14771
- function Optional(schema, enable) {
14772
- const F = enable ?? true;
14773
- return IsMappedResult(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F);
14774
- }
14775
-
14776
- // ../../node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs
14777
- function FromProperties4(P, F) {
14778
- const Acc = {};
14779
- for (const K2 of globalThis.Object.getOwnPropertyNames(P))
14780
- Acc[K2] = Optional(P[K2], F);
14781
- return Acc;
14782
- }
14783
- function FromMappedResult4(R, F) {
14784
- return FromProperties4(R.properties, F);
14785
- }
14786
- function OptionalFromMappedResult(R, F) {
14787
- const P = FromMappedResult4(R, F);
14788
- return MappedResult(P);
14789
- }
14790
-
14791
- // ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs
14792
- function IntersectCreate(T, options = {}) {
14793
- const allObjects = T.every((schema) => IsObject3(schema));
14794
- const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties: options.unevaluatedProperties } : {};
14795
- return CreateType(options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...clonedUnevaluatedProperties, [Kind]: "Intersect", type: "object", allOf: T } : { ...clonedUnevaluatedProperties, [Kind]: "Intersect", allOf: T }, options);
14796
- }
14797
-
14798
- // ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs
14799
- function IsIntersectOptional(types) {
14800
- return types.every((left) => IsOptional(left));
14801
- }
14802
- function RemoveOptionalFromType2(type) {
14803
- return Discard(type, [OptionalKind]);
14804
- }
14805
- function RemoveOptionalFromRest2(types) {
14806
- return types.map((left) => IsOptional(left) ? RemoveOptionalFromType2(left) : left);
14807
- }
14808
- function ResolveIntersect(types, options) {
14809
- return IsIntersectOptional(types) ? Optional(IntersectCreate(RemoveOptionalFromRest2(types), options)) : IntersectCreate(RemoveOptionalFromRest2(types), options);
14810
- }
14811
- function IntersectEvaluated(types, options = {}) {
14812
- if (types.length === 1)
14813
- return CreateType(types[0], options);
14814
- if (types.length === 0)
14815
- return Never(options);
14816
- if (types.some((schema) => IsTransform(schema)))
14817
- throw new Error("Cannot intersect transform types");
14818
- return ResolveIntersect(types, options);
14819
- }
14820
-
14821
- // ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs
14822
- function Intersect(types, options) {
14823
- if (types.length === 1)
14824
- return CreateType(types[0], options);
14825
- if (types.length === 0)
14826
- return Never(options);
14827
- if (types.some((schema) => IsTransform(schema)))
14828
- throw new Error("Cannot intersect transform types");
14829
- return IntersectCreate(types, options);
14830
- }
14831
-
14832
- // ../../node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs
14833
- function Ref(...args) {
14834
- const [$ref, options] = typeof args[0] === "string" ? [args[0], args[1]] : [args[0].$id, args[1]];
14835
- if (typeof $ref !== "string")
14836
- throw new TypeBoxError("Ref: $ref must be a string");
14837
- return CreateType({ [Kind]: "Ref", $ref }, options);
14838
- }
14839
-
14840
- // ../../node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs
14841
- function FromComputed(target, parameters) {
14842
- return Computed("Awaited", [Computed(target, parameters)]);
14843
- }
14844
- function FromRef($ref) {
14845
- return Computed("Awaited", [Ref($ref)]);
14846
- }
14847
- function FromIntersect2(types) {
14848
- return Intersect(FromRest3(types));
14849
- }
14850
- function FromUnion4(types) {
14851
- return Union(FromRest3(types));
14852
- }
14853
- function FromPromise(type) {
14854
- return Awaited(type);
14855
- }
14856
- function FromRest3(types) {
14857
- return types.map((type) => Awaited(type));
14858
- }
14859
- function Awaited(type, options) {
14860
- return CreateType(IsComputed(type) ? FromComputed(type.target, type.parameters) : IsIntersect(type) ? FromIntersect2(type.allOf) : IsUnion(type) ? FromUnion4(type.anyOf) : IsPromise(type) ? FromPromise(type.item) : IsRef(type) ? FromRef(type.$ref) : type, options);
14861
- }
14862
-
14863
- // ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs
14864
- function FromRest4(types) {
14865
- const result = [];
14866
- for (const L of types)
14867
- result.push(KeyOfPropertyKeys(L));
14868
- return result;
14869
- }
14870
- function FromIntersect3(types) {
14871
- const propertyKeysArray = FromRest4(types);
14872
- const propertyKeys = SetUnionMany(propertyKeysArray);
14873
- return propertyKeys;
14874
- }
14875
- function FromUnion5(types) {
14876
- const propertyKeysArray = FromRest4(types);
14877
- const propertyKeys = SetIntersectMany(propertyKeysArray);
14878
- return propertyKeys;
14879
- }
14880
- function FromTuple2(types) {
14881
- return types.map((_, indexer) => indexer.toString());
14882
- }
14883
- function FromArray2(_) {
14884
- return ["[number]"];
14885
- }
14886
- function FromProperties5(T) {
14887
- return globalThis.Object.getOwnPropertyNames(T);
14888
- }
14889
- function FromPatternProperties(patternProperties) {
14890
- if (!includePatternProperties)
14891
- return [];
14892
- const patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties);
14893
- return patternPropertyKeys.map((key) => {
14894
- return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key;
14895
- });
14896
- }
14897
- function KeyOfPropertyKeys(type) {
14898
- return IsIntersect(type) ? FromIntersect3(type.allOf) : IsUnion(type) ? FromUnion5(type.anyOf) : IsTuple(type) ? FromTuple2(type.items ?? []) : IsArray3(type) ? FromArray2(type.items) : IsObject3(type) ? FromProperties5(type.properties) : IsRecord(type) ? FromPatternProperties(type.patternProperties) : [];
14899
- }
14900
- var includePatternProperties = false;
14901
-
14902
- // ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
14903
- function FromComputed2(target, parameters) {
14904
- return Computed("KeyOf", [Computed(target, parameters)]);
14905
- }
14906
- function FromRef2($ref) {
14907
- return Computed("KeyOf", [Ref($ref)]);
14908
- }
14909
- function KeyOfFromType(type, options) {
14910
- const propertyKeys = KeyOfPropertyKeys(type);
14911
- const propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys);
14912
- const result = UnionEvaluated(propertyKeyTypes);
14913
- return CreateType(result, options);
14914
- }
14915
- function KeyOfPropertyKeysToRest(propertyKeys) {
14916
- return propertyKeys.map((L) => L === "[number]" ? Number2() : Literal(L));
14917
- }
14918
- function KeyOf(type, options) {
14919
- return IsComputed(type) ? FromComputed2(type.target, type.parameters) : IsRef(type) ? FromRef2(type.$ref) : IsMappedResult(type) ? KeyOfFromMappedResult(type, options) : KeyOfFromType(type, options);
14920
- }
14921
-
14922
- // ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs
14923
- function FromProperties6(properties, options) {
14924
- const result = {};
14925
- for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
14926
- result[K2] = KeyOf(properties[K2], Clone(options));
14927
- return result;
14928
- }
14929
- function FromMappedResult5(mappedResult, options) {
14930
- return FromProperties6(mappedResult.properties, options);
14931
- }
14932
- function KeyOfFromMappedResult(mappedResult, options) {
14933
- const properties = FromMappedResult5(mappedResult, options);
14934
- return MappedResult(properties);
14935
- }
14936
-
14937
- // ../../node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs
14938
- function CompositeKeys(T) {
14939
- const Acc = [];
14940
- for (const L of T)
14941
- Acc.push(...KeyOfPropertyKeys(L));
14942
- return SetDistinct(Acc);
14943
- }
14944
- function FilterNever(T) {
14945
- return T.filter((L) => !IsNever(L));
14946
- }
14947
- function CompositeProperty(T, K) {
14948
- const Acc = [];
14949
- for (const L of T)
14950
- Acc.push(...IndexFromPropertyKeys(L, [K]));
14951
- return FilterNever(Acc);
14952
- }
14953
- function CompositeProperties(T, K) {
14954
- const Acc = {};
14955
- for (const L of K) {
14956
- Acc[L] = IntersectEvaluated(CompositeProperty(T, L));
14957
- }
14958
- return Acc;
14959
- }
14960
- function Composite(T, options) {
14961
- const K = CompositeKeys(T);
14962
- const P = CompositeProperties(T, K);
14963
- const R = Object2(P, options);
14964
- return R;
14965
- }
14966
-
14967
- // ../../node_modules/@sinclair/typebox/build/esm/type/date/date.mjs
14968
- function Date2(options) {
14969
- return CreateType({ [Kind]: "Date", type: "Date" }, options);
14970
- }
14971
-
14972
- // ../../node_modules/@sinclair/typebox/build/esm/type/null/null.mjs
14973
- function Null(options) {
14974
- return CreateType({ [Kind]: "Null", type: "null" }, options);
14975
- }
14976
-
14977
- // ../../node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs
14978
- function Symbol2(options) {
14979
- return CreateType({ [Kind]: "Symbol", type: "symbol" }, options);
14980
- }
14981
-
14982
- // ../../node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs
14983
- function Undefined(options) {
14984
- return CreateType({ [Kind]: "Undefined", type: "undefined" }, options);
14985
- }
14986
-
14987
- // ../../node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs
14988
- function Uint8Array2(options) {
14989
- return CreateType({ [Kind]: "Uint8Array", type: "Uint8Array" }, options);
14990
- }
14991
-
14992
- // ../../node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs
14993
- function Unknown(options) {
14994
- return CreateType({ [Kind]: "Unknown" }, options);
14995
- }
14996
-
14997
- // ../../node_modules/@sinclair/typebox/build/esm/type/const/const.mjs
14998
- function FromArray3(T) {
14999
- return T.map((L) => FromValue(L, false));
15000
- }
15001
- function FromProperties7(value) {
15002
- const Acc = {};
15003
- for (const K of globalThis.Object.getOwnPropertyNames(value))
15004
- Acc[K] = Readonly(FromValue(value[K], false));
15005
- return Acc;
15006
- }
15007
- function ConditionalReadonly(T, root) {
15008
- return root === true ? T : Readonly(T);
15009
- }
15010
- function FromValue(value, root) {
15011
- return IsAsyncIterator(value) ? ConditionalReadonly(Any(), root) : IsIterator(value) ? ConditionalReadonly(Any(), root) : IsArray(value) ? Readonly(Tuple(FromArray3(value))) : IsUint8Array(value) ? Uint8Array2() : IsDate(value) ? Date2() : IsObject(value) ? ConditionalReadonly(Object2(FromProperties7(value)), root) : IsFunction(value) ? ConditionalReadonly(Function2([], Unknown()), root) : IsUndefined(value) ? Undefined() : IsNull(value) ? Null() : IsSymbol(value) ? Symbol2() : IsBigInt(value) ? BigInt() : IsNumber(value) ? Literal(value) : IsBoolean(value) ? Literal(value) : IsString(value) ? Literal(value) : Object2({});
15012
- }
15013
- function Const(T, options) {
15014
- return CreateType(FromValue(T, true), options);
15015
- }
15016
-
15017
- // ../../node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
15018
- function ConstructorParameters(schema, options) {
15019
- return IsConstructor(schema) ? Tuple(schema.parameters, options) : Never(options);
15020
- }
15021
-
15022
- // ../../node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs
15023
- function Enum(item, options) {
15024
- if (IsUndefined(item))
15025
- throw new Error("Enum undefined or empty");
15026
- const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]);
15027
- const values2 = [...new Set(values1)];
15028
- const anyOf = values2.map((value) => Literal(value));
15029
- return Union(anyOf, { ...options, [Hint]: "Enum" });
15030
- }
15031
-
15032
- // ../../node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs
15033
- var ExtendsResolverError = class extends TypeBoxError {
15034
- };
15035
- var ExtendsResult;
15036
- (function(ExtendsResult2) {
15037
- ExtendsResult2[ExtendsResult2["Union"] = 0] = "Union";
15038
- ExtendsResult2[ExtendsResult2["True"] = 1] = "True";
15039
- ExtendsResult2[ExtendsResult2["False"] = 2] = "False";
15040
- })(ExtendsResult || (ExtendsResult = {}));
15041
- function IntoBooleanResult(result) {
15042
- return result === ExtendsResult.False ? result : ExtendsResult.True;
15043
- }
15044
- function Throw(message) {
15045
- throw new ExtendsResolverError(message);
15046
- }
15047
- function IsStructuralRight(right) {
15048
- return type_exports.IsNever(right) || type_exports.IsIntersect(right) || type_exports.IsUnion(right) || type_exports.IsUnknown(right) || type_exports.IsAny(right);
15049
- }
15050
- function StructuralRight(left, right) {
15051
- return type_exports.IsNever(right) ? FromNeverRight(left, right) : type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) ? FromUnionRight(left, right) : type_exports.IsUnknown(right) ? FromUnknownRight(left, right) : type_exports.IsAny(right) ? FromAnyRight(left, right) : Throw("StructuralRight");
15052
- }
15053
- function FromAnyRight(left, right) {
15054
- return ExtendsResult.True;
15055
- }
15056
- function FromAny(left, right) {
15057
- return type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) && right.anyOf.some((schema) => type_exports.IsAny(schema) || type_exports.IsUnknown(schema)) ? ExtendsResult.True : type_exports.IsUnion(right) ? ExtendsResult.Union : type_exports.IsUnknown(right) ? ExtendsResult.True : type_exports.IsAny(right) ? ExtendsResult.True : ExtendsResult.Union;
15058
- }
15059
- function FromArrayRight(left, right) {
15060
- return type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : type_exports.IsNever(left) ? ExtendsResult.True : ExtendsResult.False;
15061
- }
15062
- function FromArray4(left, right) {
15063
- return type_exports.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsArray(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
15064
- }
15065
- function FromAsyncIterator(left, right) {
15066
- return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsAsyncIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
15067
- }
15068
- function FromBigInt(left, right) {
15069
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsBigInt(right) ? ExtendsResult.True : ExtendsResult.False;
15070
- }
15071
- function FromBooleanRight(left, right) {
15072
- return type_exports.IsLiteralBoolean(left) ? ExtendsResult.True : type_exports.IsBoolean(left) ? ExtendsResult.True : ExtendsResult.False;
15073
- }
15074
- function FromBoolean(left, right) {
15075
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsBoolean(right) ? ExtendsResult.True : ExtendsResult.False;
15076
- }
15077
- function FromConstructor(left, right) {
15078
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsConstructor(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit3(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.returns, right.returns));
15079
- }
15080
- function FromDate(left, right) {
15081
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsDate(right) ? ExtendsResult.True : ExtendsResult.False;
15082
- }
15083
- function FromFunction(left, right) {
15084
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsFunction(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit3(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.returns, right.returns));
15085
- }
15086
- function FromIntegerRight(left, right) {
15087
- return type_exports.IsLiteral(left) && value_exports.IsNumber(left.const) ? ExtendsResult.True : type_exports.IsNumber(left) || type_exports.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
15088
- }
15089
- function FromInteger(left, right) {
15090
- return type_exports.IsInteger(right) || type_exports.IsNumber(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : ExtendsResult.False;
15091
- }
15092
- function FromIntersectRight(left, right) {
15093
- return right.allOf.every((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
15094
- }
15095
- function FromIntersect4(left, right) {
15096
- return left.allOf.some((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
15097
- }
15098
- function FromIterator(left, right) {
15099
- return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
15100
- }
15101
- function FromLiteral2(left, right) {
15102
- return type_exports.IsLiteral(right) && right.const === left.const ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsString(right) ? FromStringRight(left, right) : type_exports.IsNumber(right) ? FromNumberRight(left, right) : type_exports.IsInteger(right) ? FromIntegerRight(left, right) : type_exports.IsBoolean(right) ? FromBooleanRight(left, right) : ExtendsResult.False;
15103
- }
15104
- function FromNeverRight(left, right) {
15105
- return ExtendsResult.False;
15106
- }
15107
- function FromNever(left, right) {
15108
- return ExtendsResult.True;
15109
- }
15110
- function UnwrapTNot(schema) {
15111
- let [current, depth] = [schema, 0];
15112
- while (true) {
15113
- if (!type_exports.IsNot(current))
15114
- break;
15115
- current = current.not;
15116
- depth += 1;
15117
- }
15118
- return depth % 2 === 0 ? current : Unknown();
15119
- }
15120
- function FromNot(left, right) {
15121
- return type_exports.IsNot(left) ? Visit3(UnwrapTNot(left), right) : type_exports.IsNot(right) ? Visit3(left, UnwrapTNot(right)) : Throw("Invalid fallthrough for Not");
15122
- }
15123
- function FromNull(left, right) {
15124
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsNull(right) ? ExtendsResult.True : ExtendsResult.False;
15125
- }
15126
- function FromNumberRight(left, right) {
15127
- return type_exports.IsLiteralNumber(left) ? ExtendsResult.True : type_exports.IsNumber(left) || type_exports.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
15128
- }
15129
- function FromNumber(left, right) {
15130
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsInteger(right) || type_exports.IsNumber(right) ? ExtendsResult.True : ExtendsResult.False;
15131
- }
15132
- function IsObjectPropertyCount(schema, count) {
15133
- return Object.getOwnPropertyNames(schema.properties).length === count;
15134
- }
15135
- function IsObjectStringLike(schema) {
15136
- return IsObjectArrayLike(schema);
15137
- }
15138
- function IsObjectSymbolLike(schema) {
15139
- return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "description" in schema.properties && type_exports.IsUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && (type_exports.IsString(schema.properties.description.anyOf[0]) && type_exports.IsUndefined(schema.properties.description.anyOf[1]) || type_exports.IsString(schema.properties.description.anyOf[1]) && type_exports.IsUndefined(schema.properties.description.anyOf[0]));
15140
- }
15141
- function IsObjectNumberLike(schema) {
15142
- return IsObjectPropertyCount(schema, 0);
15143
- }
15144
- function IsObjectBooleanLike(schema) {
15145
- return IsObjectPropertyCount(schema, 0);
15146
- }
15147
- function IsObjectBigIntLike(schema) {
15148
- return IsObjectPropertyCount(schema, 0);
15149
- }
15150
- function IsObjectDateLike(schema) {
15151
- return IsObjectPropertyCount(schema, 0);
15152
- }
15153
- function IsObjectUint8ArrayLike(schema) {
15154
- return IsObjectArrayLike(schema);
15155
- }
15156
- function IsObjectFunctionLike(schema) {
15157
- const length = Number2();
15158
- return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
15159
- }
15160
- function IsObjectConstructorLike(schema) {
15161
- return IsObjectPropertyCount(schema, 0);
15162
- }
15163
- function IsObjectArrayLike(schema) {
15164
- const length = Number2();
15165
- return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
15166
- }
15167
- function IsObjectPromiseLike(schema) {
15168
- const then = Function2([Any()], Any());
15169
- return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "then" in schema.properties && IntoBooleanResult(Visit3(schema.properties["then"], then)) === ExtendsResult.True;
15170
- }
15171
- function Property(left, right) {
15172
- return Visit3(left, right) === ExtendsResult.False ? ExtendsResult.False : type_exports.IsOptional(left) && !type_exports.IsOptional(right) ? ExtendsResult.False : ExtendsResult.True;
15173
- }
15174
- function FromObjectRight(left, right) {
15175
- return type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : type_exports.IsNever(left) || type_exports.IsLiteralString(left) && IsObjectStringLike(right) || type_exports.IsLiteralNumber(left) && IsObjectNumberLike(right) || type_exports.IsLiteralBoolean(left) && IsObjectBooleanLike(right) || type_exports.IsSymbol(left) && IsObjectSymbolLike(right) || type_exports.IsBigInt(left) && IsObjectBigIntLike(right) || type_exports.IsString(left) && IsObjectStringLike(right) || type_exports.IsSymbol(left) && IsObjectSymbolLike(right) || type_exports.IsNumber(left) && IsObjectNumberLike(right) || type_exports.IsInteger(left) && IsObjectNumberLike(right) || type_exports.IsBoolean(left) && IsObjectBooleanLike(right) || type_exports.IsUint8Array(left) && IsObjectUint8ArrayLike(right) || type_exports.IsDate(left) && IsObjectDateLike(right) || type_exports.IsConstructor(left) && IsObjectConstructorLike(right) || type_exports.IsFunction(left) && IsObjectFunctionLike(right) ? ExtendsResult.True : type_exports.IsRecord(left) && type_exports.IsString(RecordKey(left)) ? (() => {
15176
- return right[Hint] === "Record" ? ExtendsResult.True : ExtendsResult.False;
15177
- })() : type_exports.IsRecord(left) && type_exports.IsNumber(RecordKey(left)) ? (() => {
15178
- return IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False;
15179
- })() : ExtendsResult.False;
15180
- }
15181
- function FromObject(left, right) {
15182
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : !type_exports.IsObject(right) ? ExtendsResult.False : (() => {
15183
- for (const key of Object.getOwnPropertyNames(right.properties)) {
15184
- if (!(key in left.properties) && !type_exports.IsOptional(right.properties[key])) {
15185
- return ExtendsResult.False;
15186
- }
15187
- if (type_exports.IsOptional(right.properties[key])) {
15188
- return ExtendsResult.True;
15189
- }
15190
- if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) {
15191
- return ExtendsResult.False;
15192
- }
15193
- }
15194
- return ExtendsResult.True;
15195
- })();
15196
- }
15197
- function FromPromise2(left, right) {
15198
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) && IsObjectPromiseLike(right) ? ExtendsResult.True : !type_exports.IsPromise(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.item, right.item));
15199
- }
15200
- function RecordKey(schema) {
15201
- return PatternNumberExact in schema.patternProperties ? Number2() : PatternStringExact in schema.patternProperties ? String2() : Throw("Unknown record key pattern");
15202
- }
15203
- function RecordValue(schema) {
15204
- return PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] : PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] : Throw("Unable to get record value schema");
15205
- }
15206
- function FromRecordRight(left, right) {
15207
- const [Key, Value] = [RecordKey(right), RecordValue(right)];
15208
- return type_exports.IsLiteralString(left) && type_exports.IsNumber(Key) && IntoBooleanResult(Visit3(left, Value)) === ExtendsResult.True ? ExtendsResult.True : type_exports.IsUint8Array(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsString(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsArray(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsObject(left) ? (() => {
15209
- for (const key of Object.getOwnPropertyNames(left.properties)) {
15210
- if (Property(Value, left.properties[key]) === ExtendsResult.False) {
15211
- return ExtendsResult.False;
15212
- }
15213
- }
15214
- return ExtendsResult.True;
15215
- })() : ExtendsResult.False;
15216
- }
15217
- function FromRecord(left, right) {
15218
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsRecord(right) ? ExtendsResult.False : Visit3(RecordValue(left), RecordValue(right));
15219
- }
15220
- function FromRegExp(left, right) {
15221
- const L = type_exports.IsRegExp(left) ? String2() : left;
15222
- const R = type_exports.IsRegExp(right) ? String2() : right;
15223
- return Visit3(L, R);
15224
- }
15225
- function FromStringRight(left, right) {
15226
- return type_exports.IsLiteral(left) && value_exports.IsString(left.const) ? ExtendsResult.True : type_exports.IsString(left) ? ExtendsResult.True : ExtendsResult.False;
15227
- }
15228
- function FromString(left, right) {
15229
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsString(right) ? ExtendsResult.True : ExtendsResult.False;
15230
- }
15231
- function FromSymbol(left, right) {
15232
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsSymbol(right) ? ExtendsResult.True : ExtendsResult.False;
15233
- }
15234
- function FromTemplateLiteral2(left, right) {
15235
- return type_exports.IsTemplateLiteral(left) ? Visit3(TemplateLiteralToUnion(left), right) : type_exports.IsTemplateLiteral(right) ? Visit3(left, TemplateLiteralToUnion(right)) : Throw("Invalid fallthrough for TemplateLiteral");
15236
- }
15237
- function IsArrayOfTuple(left, right) {
15238
- return type_exports.IsArray(right) && left.items !== void 0 && left.items.every((schema) => Visit3(schema, right.items) === ExtendsResult.True);
15239
- }
15240
- function FromTupleRight(left, right) {
15241
- return type_exports.IsNever(left) ? ExtendsResult.True : type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : ExtendsResult.False;
15242
- }
15243
- function FromTuple3(left, right) {
15244
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : type_exports.IsArray(right) && IsArrayOfTuple(left, right) ? ExtendsResult.True : !type_exports.IsTuple(right) ? ExtendsResult.False : value_exports.IsUndefined(left.items) && !value_exports.IsUndefined(right.items) || !value_exports.IsUndefined(left.items) && value_exports.IsUndefined(right.items) ? ExtendsResult.False : value_exports.IsUndefined(left.items) && !value_exports.IsUndefined(right.items) ? ExtendsResult.True : left.items.every((schema, index) => Visit3(schema, right.items[index]) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
15245
- }
15246
- function FromUint8Array(left, right) {
15247
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsUint8Array(right) ? ExtendsResult.True : ExtendsResult.False;
15248
- }
15249
- function FromUndefined(left, right) {
15250
- return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsVoid(right) ? FromVoidRight(left, right) : type_exports.IsUndefined(right) ? ExtendsResult.True : ExtendsResult.False;
15251
- }
15252
- function FromUnionRight(left, right) {
15253
- return right.anyOf.some((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
15254
- }
15255
- function FromUnion6(left, right) {
15256
- return left.anyOf.every((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
15257
- }
15258
- function FromUnknownRight(left, right) {
15259
- return ExtendsResult.True;
15260
- }
15261
- function FromUnknown(left, right) {
15262
- return type_exports.IsNever(right) ? FromNeverRight(left, right) : type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) ? FromUnionRight(left, right) : type_exports.IsAny(right) ? FromAnyRight(left, right) : type_exports.IsString(right) ? FromStringRight(left, right) : type_exports.IsNumber(right) ? FromNumberRight(left, right) : type_exports.IsInteger(right) ? FromIntegerRight(left, right) : type_exports.IsBoolean(right) ? FromBooleanRight(left, right) : type_exports.IsArray(right) ? FromArrayRight(left, right) : type_exports.IsTuple(right) ? FromTupleRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsUnknown(right) ? ExtendsResult.True : ExtendsResult.False;
15263
- }
15264
- function FromVoidRight(left, right) {
15265
- return type_exports.IsUndefined(left) ? ExtendsResult.True : type_exports.IsUndefined(left) ? ExtendsResult.True : ExtendsResult.False;
15266
- }
15267
- function FromVoid(left, right) {
15268
- return type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) ? FromUnionRight(left, right) : type_exports.IsUnknown(right) ? FromUnknownRight(left, right) : type_exports.IsAny(right) ? FromAnyRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsVoid(right) ? ExtendsResult.True : ExtendsResult.False;
15269
- }
15270
- function Visit3(left, right) {
15271
- return (
15272
- // resolvable
15273
- type_exports.IsTemplateLiteral(left) || type_exports.IsTemplateLiteral(right) ? FromTemplateLiteral2(left, right) : type_exports.IsRegExp(left) || type_exports.IsRegExp(right) ? FromRegExp(left, right) : type_exports.IsNot(left) || type_exports.IsNot(right) ? FromNot(left, right) : (
15274
- // standard
15275
- type_exports.IsAny(left) ? FromAny(left, right) : type_exports.IsArray(left) ? FromArray4(left, right) : type_exports.IsBigInt(left) ? FromBigInt(left, right) : type_exports.IsBoolean(left) ? FromBoolean(left, right) : type_exports.IsAsyncIterator(left) ? FromAsyncIterator(left, right) : type_exports.IsConstructor(left) ? FromConstructor(left, right) : type_exports.IsDate(left) ? FromDate(left, right) : type_exports.IsFunction(left) ? FromFunction(left, right) : type_exports.IsInteger(left) ? FromInteger(left, right) : type_exports.IsIntersect(left) ? FromIntersect4(left, right) : type_exports.IsIterator(left) ? FromIterator(left, right) : type_exports.IsLiteral(left) ? FromLiteral2(left, right) : type_exports.IsNever(left) ? FromNever(left, right) : type_exports.IsNull(left) ? FromNull(left, right) : type_exports.IsNumber(left) ? FromNumber(left, right) : type_exports.IsObject(left) ? FromObject(left, right) : type_exports.IsRecord(left) ? FromRecord(left, right) : type_exports.IsString(left) ? FromString(left, right) : type_exports.IsSymbol(left) ? FromSymbol(left, right) : type_exports.IsTuple(left) ? FromTuple3(left, right) : type_exports.IsPromise(left) ? FromPromise2(left, right) : type_exports.IsUint8Array(left) ? FromUint8Array(left, right) : type_exports.IsUndefined(left) ? FromUndefined(left, right) : type_exports.IsUnion(left) ? FromUnion6(left, right) : type_exports.IsUnknown(left) ? FromUnknown(left, right) : type_exports.IsVoid(left) ? FromVoid(left, right) : Throw(`Unknown left type operand '${left[Kind]}'`)
15276
- )
15277
- );
15278
- }
15279
- function ExtendsCheck(left, right) {
15280
- return Visit3(left, right);
15281
- }
15282
-
15283
- // ../../node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs
15284
- function FromProperties8(P, Right, True, False, options) {
15285
- const Acc = {};
15286
- for (const K2 of globalThis.Object.getOwnPropertyNames(P))
15287
- Acc[K2] = Extends(P[K2], Right, True, False, Clone(options));
15288
- return Acc;
15289
- }
15290
- function FromMappedResult6(Left, Right, True, False, options) {
15291
- return FromProperties8(Left.properties, Right, True, False, options);
15292
- }
15293
- function ExtendsFromMappedResult(Left, Right, True, False, options) {
15294
- const P = FromMappedResult6(Left, Right, True, False, options);
15295
- return MappedResult(P);
15296
- }
15297
-
15298
- // ../../node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs
15299
- function ExtendsResolve(left, right, trueType, falseType) {
15300
- const R = ExtendsCheck(left, right);
15301
- return R === ExtendsResult.Union ? Union([trueType, falseType]) : R === ExtendsResult.True ? trueType : falseType;
15302
- }
15303
- function Extends(L, R, T, F, options) {
15304
- return IsMappedResult(L) ? ExtendsFromMappedResult(L, R, T, F, options) : IsMappedKey(L) ? CreateType(ExtendsFromMappedKey(L, R, T, F, options)) : CreateType(ExtendsResolve(L, R, T, F), options);
15305
- }
15306
-
15307
- // ../../node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs
15308
- function FromPropertyKey(K, U, L, R, options) {
15309
- return {
15310
- [K]: Extends(Literal(K), U, L, R, Clone(options))
15311
- };
15312
- }
15313
- function FromPropertyKeys(K, U, L, R, options) {
15314
- return K.reduce((Acc, LK) => {
15315
- return { ...Acc, ...FromPropertyKey(LK, U, L, R, options) };
15316
- }, {});
15317
- }
15318
- function FromMappedKey2(K, U, L, R, options) {
15319
- return FromPropertyKeys(K.keys, U, L, R, options);
15320
- }
15321
- function ExtendsFromMappedKey(T, U, L, R, options) {
15322
- const P = FromMappedKey2(T, U, L, R, options);
15323
- return MappedResult(P);
15324
- }
15325
-
15326
- // ../../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs
15327
- function ExcludeFromTemplateLiteral(L, R) {
15328
- return Exclude(TemplateLiteralToUnion(L), R);
15329
- }
15330
-
15331
- // ../../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs
15332
- function ExcludeRest(L, R) {
15333
- const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False);
15334
- return excluded.length === 1 ? excluded[0] : Union(excluded);
15335
- }
15336
- function Exclude(L, R, options = {}) {
15337
- if (IsTemplateLiteral(L))
15338
- return CreateType(ExcludeFromTemplateLiteral(L, R), options);
15339
- if (IsMappedResult(L))
15340
- return CreateType(ExcludeFromMappedResult(L, R), options);
15341
- return CreateType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
15342
- }
15343
-
15344
- // ../../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs
15345
- function FromProperties9(P, U) {
15346
- const Acc = {};
15347
- for (const K2 of globalThis.Object.getOwnPropertyNames(P))
15348
- Acc[K2] = Exclude(P[K2], U);
15349
- return Acc;
15350
- }
15351
- function FromMappedResult7(R, T) {
15352
- return FromProperties9(R.properties, T);
15353
- }
15354
- function ExcludeFromMappedResult(R, T) {
15355
- const P = FromMappedResult7(R, T);
15356
- return MappedResult(P);
15357
- }
15358
-
15359
- // ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs
15360
- function ExtractFromTemplateLiteral(L, R) {
15361
- return Extract(TemplateLiteralToUnion(L), R);
15362
- }
15363
-
15364
- // ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs
15365
- function ExtractRest(L, R) {
15366
- const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);
15367
- return extracted.length === 1 ? extracted[0] : Union(extracted);
15368
- }
15369
- function Extract(L, R, options) {
15370
- if (IsTemplateLiteral(L))
15371
- return CreateType(ExtractFromTemplateLiteral(L, R), options);
15372
- if (IsMappedResult(L))
15373
- return CreateType(ExtractFromMappedResult(L, R), options);
15374
- return CreateType(IsUnion(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
15375
- }
15376
-
15377
- // ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs
15378
- function FromProperties10(P, T) {
15379
- const Acc = {};
15380
- for (const K2 of globalThis.Object.getOwnPropertyNames(P))
15381
- Acc[K2] = Extract(P[K2], T);
15382
- return Acc;
15383
- }
15384
- function FromMappedResult8(R, T) {
15385
- return FromProperties10(R.properties, T);
15386
- }
15387
- function ExtractFromMappedResult(R, T) {
15388
- const P = FromMappedResult8(R, T);
15389
- return MappedResult(P);
15390
- }
15391
-
15392
- // ../../node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
15393
- function InstanceType(schema, options) {
15394
- return IsConstructor(schema) ? CreateType(schema.returns, options) : Never(options);
15395
- }
15396
-
15397
- // ../../node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
15398
- function ReadonlyOptional(schema) {
15399
- return Readonly(Optional(schema));
15400
- }
15401
-
15402
- // ../../node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
15403
- function RecordCreateFromPattern(pattern, T, options) {
15404
- return CreateType({ [Kind]: "Record", type: "object", patternProperties: { [pattern]: T } }, options);
15405
- }
15406
- function RecordCreateFromKeys(K, T, options) {
15407
- const result = {};
15408
- for (const K2 of K)
15409
- result[K2] = T;
15410
- return Object2(result, { ...options, [Hint]: "Record" });
15411
- }
15412
- function FromTemplateLiteralKey(K, T, options) {
15413
- return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
15414
- }
15415
- function FromUnionKey(key, type, options) {
15416
- return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
15417
- }
15418
- function FromLiteralKey(key, type, options) {
15419
- return RecordCreateFromKeys([key.toString()], type, options);
15420
- }
15421
- function FromRegExpKey(key, type, options) {
15422
- return RecordCreateFromPattern(key.source, type, options);
15423
- }
15424
- function FromStringKey(key, type, options) {
15425
- const pattern = IsUndefined(key.pattern) ? PatternStringExact : key.pattern;
15426
- return RecordCreateFromPattern(pattern, type, options);
15427
- }
15428
- function FromAnyKey(_, type, options) {
15429
- return RecordCreateFromPattern(PatternStringExact, type, options);
15430
- }
15431
- function FromNeverKey(_key, type, options) {
15432
- return RecordCreateFromPattern(PatternNeverExact, type, options);
15433
- }
15434
- function FromBooleanKey(_key, type, options) {
15435
- return Object2({ true: type, false: type }, options);
15436
- }
15437
- function FromIntegerKey(_key, type, options) {
15438
- return RecordCreateFromPattern(PatternNumberExact, type, options);
15439
- }
15440
- function FromNumberKey(_, type, options) {
15441
- return RecordCreateFromPattern(PatternNumberExact, type, options);
15442
- }
15443
- function Record(key, type, options = {}) {
15444
- return IsUnion(key) ? FromUnionKey(key.anyOf, type, options) : IsTemplateLiteral(key) ? FromTemplateLiteralKey(key, type, options) : IsLiteral(key) ? FromLiteralKey(key.const, type, options) : IsBoolean2(key) ? FromBooleanKey(key, type, options) : IsInteger(key) ? FromIntegerKey(key, type, options) : IsNumber3(key) ? FromNumberKey(key, type, options) : IsRegExp2(key) ? FromRegExpKey(key, type, options) : IsString2(key) ? FromStringKey(key, type, options) : IsAny(key) ? FromAnyKey(key, type, options) : IsNever(key) ? FromNeverKey(key, type, options) : Never(options);
15445
- }
15446
- function RecordPattern(record) {
15447
- return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];
15448
- }
15449
- function RecordKey2(type) {
15450
- const pattern = RecordPattern(type);
15451
- return pattern === PatternStringExact ? String2() : pattern === PatternNumberExact ? Number2() : String2({ pattern });
15452
- }
15453
- function RecordValue2(type) {
15454
- return type.patternProperties[RecordPattern(type)];
15455
- }
15456
-
15457
- // ../../node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs
15458
- function FromConstructor2(args, type) {
15459
- type.parameters = FromTypes(args, type.parameters);
15460
- type.returns = FromType(args, type.returns);
15461
- return type;
15462
- }
15463
- function FromFunction2(args, type) {
15464
- type.parameters = FromTypes(args, type.parameters);
15465
- type.returns = FromType(args, type.returns);
15466
- return type;
15467
- }
15468
- function FromIntersect5(args, type) {
15469
- type.allOf = FromTypes(args, type.allOf);
15470
- return type;
15471
- }
15472
- function FromUnion7(args, type) {
15473
- type.anyOf = FromTypes(args, type.anyOf);
15474
- return type;
15475
- }
15476
- function FromTuple4(args, type) {
15477
- if (IsUndefined(type.items))
15478
- return type;
15479
- type.items = FromTypes(args, type.items);
15480
- return type;
15481
- }
15482
- function FromArray5(args, type) {
15483
- type.items = FromType(args, type.items);
15484
- return type;
15485
- }
15486
- function FromAsyncIterator2(args, type) {
15487
- type.items = FromType(args, type.items);
15488
- return type;
15489
- }
15490
- function FromIterator2(args, type) {
15491
- type.items = FromType(args, type.items);
15492
- return type;
15493
- }
15494
- function FromPromise3(args, type) {
15495
- type.item = FromType(args, type.item);
15496
- return type;
15497
- }
15498
- function FromObject2(args, type) {
15499
- const mappedProperties = FromProperties11(args, type.properties);
15500
- return { ...type, ...Object2(mappedProperties) };
15501
- }
15502
- function FromRecord2(args, type) {
15503
- const mappedKey = FromType(args, RecordKey2(type));
15504
- const mappedValue = FromType(args, RecordValue2(type));
15505
- const result = Record(mappedKey, mappedValue);
15506
- return { ...type, ...result };
15507
- }
15508
- function FromArgument(args, argument) {
15509
- return argument.index in args ? args[argument.index] : Unknown();
15510
- }
15511
- function FromProperty2(args, type) {
15512
- const isReadonly = IsReadonly(type);
15513
- const isOptional = IsOptional(type);
15514
- const mapped = FromType(args, type);
15515
- return isReadonly && isOptional ? ReadonlyOptional(mapped) : isReadonly && !isOptional ? Readonly(mapped) : !isReadonly && isOptional ? Optional(mapped) : mapped;
15516
- }
15517
- function FromProperties11(args, properties) {
15518
- return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => {
15519
- return { ...result, [key]: FromProperty2(args, properties[key]) };
15520
- }, {});
15521
- }
15522
- function FromTypes(args, types) {
15523
- return types.map((type) => FromType(args, type));
15524
- }
15525
- function FromType(args, type) {
15526
- return IsConstructor(type) ? FromConstructor2(args, type) : IsFunction2(type) ? FromFunction2(args, type) : IsIntersect(type) ? FromIntersect5(args, type) : IsUnion(type) ? FromUnion7(args, type) : IsTuple(type) ? FromTuple4(args, type) : IsArray3(type) ? FromArray5(args, type) : IsAsyncIterator2(type) ? FromAsyncIterator2(args, type) : IsIterator2(type) ? FromIterator2(args, type) : IsPromise(type) ? FromPromise3(args, type) : IsObject3(type) ? FromObject2(args, type) : IsRecord(type) ? FromRecord2(args, type) : IsArgument(type) ? FromArgument(args, type) : type;
15527
- }
15528
- function Instantiate(type, args) {
15529
- return FromType(args, CloneType(type));
15530
- }
15531
-
15532
- // ../../node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs
15533
- function Integer(options) {
15534
- return CreateType({ [Kind]: "Integer", type: "integer" }, options);
15535
- }
15536
-
15537
- // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs
15538
- function MappedIntrinsicPropertyKey(K, M, options) {
15539
- return {
15540
- [K]: Intrinsic(Literal(K), M, Clone(options))
15541
- };
15542
- }
15543
- function MappedIntrinsicPropertyKeys(K, M, options) {
15544
- const result = K.reduce((Acc, L) => {
15545
- return { ...Acc, ...MappedIntrinsicPropertyKey(L, M, options) };
15546
- }, {});
15547
- return result;
15548
- }
15549
- function MappedIntrinsicProperties(T, M, options) {
15550
- return MappedIntrinsicPropertyKeys(T["keys"], M, options);
15551
- }
15552
- function IntrinsicFromMappedKey(T, M, options) {
15553
- const P = MappedIntrinsicProperties(T, M, options);
15554
- return MappedResult(P);
15555
- }
15556
-
15557
- // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs
15558
- function ApplyUncapitalize(value) {
15559
- const [first, rest] = [value.slice(0, 1), value.slice(1)];
15560
- return [first.toLowerCase(), rest].join("");
15561
- }
15562
- function ApplyCapitalize(value) {
15563
- const [first, rest] = [value.slice(0, 1), value.slice(1)];
15564
- return [first.toUpperCase(), rest].join("");
15565
- }
15566
- function ApplyUppercase(value) {
15567
- return value.toUpperCase();
15568
- }
15569
- function ApplyLowercase(value) {
15570
- return value.toLowerCase();
15571
- }
15572
- function FromTemplateLiteral3(schema, mode, options) {
15573
- const expression = TemplateLiteralParseExact(schema.pattern);
15574
- const finite = IsTemplateLiteralExpressionFinite(expression);
15575
- if (!finite)
15576
- return { ...schema, pattern: FromLiteralValue(schema.pattern, mode) };
15577
- const strings = [...TemplateLiteralExpressionGenerate(expression)];
15578
- const literals = strings.map((value) => Literal(value));
15579
- const mapped = FromRest5(literals, mode);
15580
- const union = Union(mapped);
15581
- return TemplateLiteral([union], options);
15582
- }
15583
- function FromLiteralValue(value, mode) {
15584
- return typeof value === "string" ? mode === "Uncapitalize" ? ApplyUncapitalize(value) : mode === "Capitalize" ? ApplyCapitalize(value) : mode === "Uppercase" ? ApplyUppercase(value) : mode === "Lowercase" ? ApplyLowercase(value) : value : value.toString();
15585
- }
15586
- function FromRest5(T, M) {
15587
- return T.map((L) => Intrinsic(L, M));
15588
- }
15589
- function Intrinsic(schema, mode, options = {}) {
15590
- return (
15591
- // Intrinsic-Mapped-Inference
15592
- IsMappedKey(schema) ? IntrinsicFromMappedKey(schema, mode, options) : (
15593
- // Standard-Inference
15594
- IsTemplateLiteral(schema) ? FromTemplateLiteral3(schema, mode, options) : IsUnion(schema) ? Union(FromRest5(schema.anyOf, mode), options) : IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : (
15595
- // Default Type
15596
- CreateType(schema, options)
15597
- )
15598
- )
15599
- );
15600
- }
15601
-
15602
- // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs
15603
- function Capitalize(T, options = {}) {
15604
- return Intrinsic(T, "Capitalize", options);
15605
- }
15606
-
15607
- // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs
15608
- function Lowercase(T, options = {}) {
15609
- return Intrinsic(T, "Lowercase", options);
15610
- }
15611
-
15612
- // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs
15613
- function Uncapitalize(T, options = {}) {
15614
- return Intrinsic(T, "Uncapitalize", options);
15615
- }
15616
-
15617
- // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs
15618
- function Uppercase(T, options = {}) {
15619
- return Intrinsic(T, "Uppercase", options);
15620
- }
15621
-
15622
- // ../../node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs
15623
- function FromProperties12(properties, propertyKeys, options) {
15624
- const result = {};
15625
- for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
15626
- result[K2] = Omit(properties[K2], propertyKeys, Clone(options));
15627
- return result;
15628
- }
15629
- function FromMappedResult9(mappedResult, propertyKeys, options) {
15630
- return FromProperties12(mappedResult.properties, propertyKeys, options);
15631
- }
15632
- function OmitFromMappedResult(mappedResult, propertyKeys, options) {
15633
- const properties = FromMappedResult9(mappedResult, propertyKeys, options);
15634
- return MappedResult(properties);
15635
- }
15636
-
15637
- // ../../node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs
15638
- function FromIntersect6(types, propertyKeys) {
15639
- return types.map((type) => OmitResolve(type, propertyKeys));
15640
- }
15641
- function FromUnion8(types, propertyKeys) {
15642
- return types.map((type) => OmitResolve(type, propertyKeys));
15643
- }
15644
- function FromProperty3(properties, key) {
15645
- const { [key]: _, ...R } = properties;
15646
- return R;
15647
- }
15648
- function FromProperties13(properties, propertyKeys) {
15649
- return propertyKeys.reduce((T, K2) => FromProperty3(T, K2), properties);
15650
- }
15651
- function FromObject3(type, propertyKeys, properties) {
15652
- const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
15653
- const mappedProperties = FromProperties13(properties, propertyKeys);
15654
- return Object2(mappedProperties, options);
15655
- }
15656
- function UnionFromPropertyKeys(propertyKeys) {
15657
- const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
15658
- return Union(result);
15659
- }
15660
- function OmitResolve(type, propertyKeys) {
15661
- return IsIntersect(type) ? Intersect(FromIntersect6(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion8(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject3(type, propertyKeys, type.properties) : Object2({});
15662
- }
15663
- function Omit(type, key, options) {
15664
- const typeKey = IsArray(key) ? UnionFromPropertyKeys(key) : key;
15665
- const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
15666
- const isTypeRef = IsRef(type);
15667
- const isKeyRef = IsRef(key);
15668
- return IsMappedResult(type) ? OmitFromMappedResult(type, propertyKeys, options) : IsMappedKey(key) ? OmitFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Omit", [type, typeKey], options) : CreateType({ ...OmitResolve(type, propertyKeys), ...options });
15669
- }
15670
-
15671
- // ../../node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs
15672
- function FromPropertyKey2(type, key, options) {
15673
- return { [key]: Omit(type, [key], Clone(options)) };
15674
- }
15675
- function FromPropertyKeys2(type, propertyKeys, options) {
15676
- return propertyKeys.reduce((Acc, LK) => {
15677
- return { ...Acc, ...FromPropertyKey2(type, LK, options) };
15678
- }, {});
15679
- }
15680
- function FromMappedKey3(type, mappedKey, options) {
15681
- return FromPropertyKeys2(type, mappedKey.keys, options);
15682
- }
15683
- function OmitFromMappedKey(type, mappedKey, options) {
15684
- const properties = FromMappedKey3(type, mappedKey, options);
15685
- return MappedResult(properties);
15686
- }
15687
-
15688
- // ../../node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs
15689
- function FromProperties14(properties, propertyKeys, options) {
15690
- const result = {};
15691
- for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
15692
- result[K2] = Pick(properties[K2], propertyKeys, Clone(options));
15693
- return result;
15694
- }
15695
- function FromMappedResult10(mappedResult, propertyKeys, options) {
15696
- return FromProperties14(mappedResult.properties, propertyKeys, options);
15697
- }
15698
- function PickFromMappedResult(mappedResult, propertyKeys, options) {
15699
- const properties = FromMappedResult10(mappedResult, propertyKeys, options);
15700
- return MappedResult(properties);
15701
- }
15702
-
15703
- // ../../node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
15704
- function FromIntersect7(types, propertyKeys) {
15705
- return types.map((type) => PickResolve(type, propertyKeys));
15706
- }
15707
- function FromUnion9(types, propertyKeys) {
15708
- return types.map((type) => PickResolve(type, propertyKeys));
15709
- }
15710
- function FromProperties15(properties, propertyKeys) {
15711
- const result = {};
15712
- for (const K2 of propertyKeys)
15713
- if (K2 in properties)
15714
- result[K2] = properties[K2];
15715
- return result;
15716
- }
15717
- function FromObject4(Type2, keys, properties) {
15718
- const options = Discard(Type2, [TransformKind, "$id", "required", "properties"]);
15719
- const mappedProperties = FromProperties15(properties, keys);
15720
- return Object2(mappedProperties, options);
15721
- }
15722
- function UnionFromPropertyKeys2(propertyKeys) {
15723
- const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
15724
- return Union(result);
15725
- }
15726
- function PickResolve(type, propertyKeys) {
15727
- return IsIntersect(type) ? Intersect(FromIntersect7(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion9(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject4(type, propertyKeys, type.properties) : Object2({});
15728
- }
15729
- function Pick(type, key, options) {
15730
- const typeKey = IsArray(key) ? UnionFromPropertyKeys2(key) : key;
15731
- const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
15732
- const isTypeRef = IsRef(type);
15733
- const isKeyRef = IsRef(key);
15734
- return IsMappedResult(type) ? PickFromMappedResult(type, propertyKeys, options) : IsMappedKey(key) ? PickFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Pick", [type, typeKey], options) : CreateType({ ...PickResolve(type, propertyKeys), ...options });
15735
- }
15736
-
15737
- // ../../node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs
15738
- function FromPropertyKey3(type, key, options) {
15739
- return {
15740
- [key]: Pick(type, [key], Clone(options))
15741
- };
15742
- }
15743
- function FromPropertyKeys3(type, propertyKeys, options) {
15744
- return propertyKeys.reduce((result, leftKey) => {
15745
- return { ...result, ...FromPropertyKey3(type, leftKey, options) };
15746
- }, {});
15747
- }
15748
- function FromMappedKey4(type, mappedKey, options) {
15749
- return FromPropertyKeys3(type, mappedKey.keys, options);
15750
- }
15751
- function PickFromMappedKey(type, mappedKey, options) {
15752
- const properties = FromMappedKey4(type, mappedKey, options);
15753
- return MappedResult(properties);
15754
- }
15755
-
15756
- // ../../node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs
15757
- function FromComputed3(target, parameters) {
15758
- return Computed("Partial", [Computed(target, parameters)]);
15759
- }
15760
- function FromRef3($ref) {
15761
- return Computed("Partial", [Ref($ref)]);
15762
- }
15763
- function FromProperties16(properties) {
15764
- const partialProperties = {};
15765
- for (const K of globalThis.Object.getOwnPropertyNames(properties))
15766
- partialProperties[K] = Optional(properties[K]);
15767
- return partialProperties;
15768
- }
15769
- function FromObject5(type, properties) {
15770
- const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
15771
- const mappedProperties = FromProperties16(properties);
15772
- return Object2(mappedProperties, options);
15773
- }
15774
- function FromRest6(types) {
15775
- return types.map((type) => PartialResolve(type));
15776
- }
15777
- function PartialResolve(type) {
15778
- return (
15779
- // Mappable
15780
- IsComputed(type) ? FromComputed3(type.target, type.parameters) : IsRef(type) ? FromRef3(type.$ref) : IsIntersect(type) ? Intersect(FromRest6(type.allOf)) : IsUnion(type) ? Union(FromRest6(type.anyOf)) : IsObject3(type) ? FromObject5(type, type.properties) : (
15781
- // Intrinsic
15782
- IsBigInt2(type) ? type : IsBoolean2(type) ? type : IsInteger(type) ? type : IsLiteral(type) ? type : IsNull2(type) ? type : IsNumber3(type) ? type : IsString2(type) ? type : IsSymbol2(type) ? type : IsUndefined3(type) ? type : (
15783
- // Passthrough
15784
- Object2({})
15785
- )
15786
- )
15787
- );
15788
- }
15789
- function Partial(type, options) {
15790
- if (IsMappedResult(type)) {
15791
- return PartialFromMappedResult(type, options);
15792
- } else {
15793
- return CreateType({ ...PartialResolve(type), ...options });
15794
- }
15795
- }
15796
-
15797
- // ../../node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs
15798
- function FromProperties17(K, options) {
15799
- const Acc = {};
15800
- for (const K2 of globalThis.Object.getOwnPropertyNames(K))
15801
- Acc[K2] = Partial(K[K2], Clone(options));
15802
- return Acc;
15803
- }
15804
- function FromMappedResult11(R, options) {
15805
- return FromProperties17(R.properties, options);
15806
- }
15807
- function PartialFromMappedResult(R, options) {
15808
- const P = FromMappedResult11(R, options);
15809
- return MappedResult(P);
15810
- }
15811
-
15812
- // ../../node_modules/@sinclair/typebox/build/esm/type/required/required.mjs
15813
- function FromComputed4(target, parameters) {
15814
- return Computed("Required", [Computed(target, parameters)]);
15815
- }
15816
- function FromRef4($ref) {
15817
- return Computed("Required", [Ref($ref)]);
15818
- }
15819
- function FromProperties18(properties) {
15820
- const requiredProperties = {};
15821
- for (const K of globalThis.Object.getOwnPropertyNames(properties))
15822
- requiredProperties[K] = Discard(properties[K], [OptionalKind]);
15823
- return requiredProperties;
15824
- }
15825
- function FromObject6(type, properties) {
15826
- const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
15827
- const mappedProperties = FromProperties18(properties);
15828
- return Object2(mappedProperties, options);
15829
- }
15830
- function FromRest7(types) {
15831
- return types.map((type) => RequiredResolve(type));
15832
- }
15833
- function RequiredResolve(type) {
15834
- return (
15835
- // Mappable
15836
- IsComputed(type) ? FromComputed4(type.target, type.parameters) : IsRef(type) ? FromRef4(type.$ref) : IsIntersect(type) ? Intersect(FromRest7(type.allOf)) : IsUnion(type) ? Union(FromRest7(type.anyOf)) : IsObject3(type) ? FromObject6(type, type.properties) : (
15837
- // Intrinsic
15838
- IsBigInt2(type) ? type : IsBoolean2(type) ? type : IsInteger(type) ? type : IsLiteral(type) ? type : IsNull2(type) ? type : IsNumber3(type) ? type : IsString2(type) ? type : IsSymbol2(type) ? type : IsUndefined3(type) ? type : (
15839
- // Passthrough
15840
- Object2({})
15841
- )
15842
- )
15843
- );
15844
- }
15845
- function Required(type, options) {
15846
- if (IsMappedResult(type)) {
15847
- return RequiredFromMappedResult(type, options);
15848
- } else {
15849
- return CreateType({ ...RequiredResolve(type), ...options });
15850
- }
15851
- }
15852
-
15853
- // ../../node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs
15854
- function FromProperties19(P, options) {
15855
- const Acc = {};
15856
- for (const K2 of globalThis.Object.getOwnPropertyNames(P))
15857
- Acc[K2] = Required(P[K2], options);
15858
- return Acc;
15859
- }
15860
- function FromMappedResult12(R, options) {
15861
- return FromProperties19(R.properties, options);
15862
- }
15863
- function RequiredFromMappedResult(R, options) {
15864
- const P = FromMappedResult12(R, options);
15865
- return MappedResult(P);
15866
- }
15867
-
15868
- // ../../node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs
15869
- function DereferenceParameters(moduleProperties, types) {
15870
- return types.map((type) => {
15871
- return IsRef(type) ? Dereference(moduleProperties, type.$ref) : FromType2(moduleProperties, type);
15872
- });
15873
- }
15874
- function Dereference(moduleProperties, ref) {
15875
- return ref in moduleProperties ? IsRef(moduleProperties[ref]) ? Dereference(moduleProperties, moduleProperties[ref].$ref) : FromType2(moduleProperties, moduleProperties[ref]) : Never();
15876
- }
15877
- function FromAwaited(parameters) {
15878
- return Awaited(parameters[0]);
15879
- }
15880
- function FromIndex(parameters) {
15881
- return Index(parameters[0], parameters[1]);
15882
- }
15883
- function FromKeyOf(parameters) {
15884
- return KeyOf(parameters[0]);
15885
- }
15886
- function FromPartial(parameters) {
15887
- return Partial(parameters[0]);
15888
- }
15889
- function FromOmit(parameters) {
15890
- return Omit(parameters[0], parameters[1]);
15891
- }
15892
- function FromPick(parameters) {
15893
- return Pick(parameters[0], parameters[1]);
15894
- }
15895
- function FromRequired(parameters) {
15896
- return Required(parameters[0]);
15897
- }
15898
- function FromComputed5(moduleProperties, target, parameters) {
15899
- const dereferenced = DereferenceParameters(moduleProperties, parameters);
15900
- return target === "Awaited" ? FromAwaited(dereferenced) : target === "Index" ? FromIndex(dereferenced) : target === "KeyOf" ? FromKeyOf(dereferenced) : target === "Partial" ? FromPartial(dereferenced) : target === "Omit" ? FromOmit(dereferenced) : target === "Pick" ? FromPick(dereferenced) : target === "Required" ? FromRequired(dereferenced) : Never();
15901
- }
15902
- function FromArray6(moduleProperties, type) {
15903
- return Array2(FromType2(moduleProperties, type));
15904
- }
15905
- function FromAsyncIterator3(moduleProperties, type) {
15906
- return AsyncIterator(FromType2(moduleProperties, type));
15907
- }
15908
- function FromConstructor3(moduleProperties, parameters, instanceType) {
15909
- return Constructor(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, instanceType));
15910
- }
15911
- function FromFunction3(moduleProperties, parameters, returnType) {
15912
- return Function2(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, returnType));
15913
- }
15914
- function FromIntersect8(moduleProperties, types) {
15915
- return Intersect(FromTypes2(moduleProperties, types));
15916
- }
15917
- function FromIterator3(moduleProperties, type) {
15918
- return Iterator(FromType2(moduleProperties, type));
15919
- }
15920
- function FromObject7(moduleProperties, properties) {
15921
- return Object2(globalThis.Object.keys(properties).reduce((result, key) => {
15922
- return { ...result, [key]: FromType2(moduleProperties, properties[key]) };
15923
- }, {}));
15924
- }
15925
- function FromRecord3(moduleProperties, type) {
15926
- const [value, pattern] = [FromType2(moduleProperties, RecordValue2(type)), RecordPattern(type)];
15927
- const result = CloneType(type);
15928
- result.patternProperties[pattern] = value;
15929
- return result;
15930
- }
15931
- function FromTransform(moduleProperties, transform) {
15932
- return IsRef(transform) ? { ...Dereference(moduleProperties, transform.$ref), [TransformKind]: transform[TransformKind] } : transform;
15933
- }
15934
- function FromTuple5(moduleProperties, types) {
15935
- return Tuple(FromTypes2(moduleProperties, types));
15936
- }
15937
- function FromUnion10(moduleProperties, types) {
15938
- return Union(FromTypes2(moduleProperties, types));
15939
- }
15940
- function FromTypes2(moduleProperties, types) {
15941
- return types.map((type) => FromType2(moduleProperties, type));
15942
- }
15943
- function FromType2(moduleProperties, type) {
15944
- return (
15945
- // Modifiers
15946
- IsOptional(type) ? CreateType(FromType2(moduleProperties, Discard(type, [OptionalKind])), type) : IsReadonly(type) ? CreateType(FromType2(moduleProperties, Discard(type, [ReadonlyKind])), type) : (
15947
- // Transform
15948
- IsTransform(type) ? CreateType(FromTransform(moduleProperties, type), type) : (
15949
- // Types
15950
- IsArray3(type) ? CreateType(FromArray6(moduleProperties, type.items), type) : IsAsyncIterator2(type) ? CreateType(FromAsyncIterator3(moduleProperties, type.items), type) : IsComputed(type) ? CreateType(FromComputed5(moduleProperties, type.target, type.parameters)) : IsConstructor(type) ? CreateType(FromConstructor3(moduleProperties, type.parameters, type.returns), type) : IsFunction2(type) ? CreateType(FromFunction3(moduleProperties, type.parameters, type.returns), type) : IsIntersect(type) ? CreateType(FromIntersect8(moduleProperties, type.allOf), type) : IsIterator2(type) ? CreateType(FromIterator3(moduleProperties, type.items), type) : IsObject3(type) ? CreateType(FromObject7(moduleProperties, type.properties), type) : IsRecord(type) ? CreateType(FromRecord3(moduleProperties, type)) : IsTuple(type) ? CreateType(FromTuple5(moduleProperties, type.items || []), type) : IsUnion(type) ? CreateType(FromUnion10(moduleProperties, type.anyOf), type) : type
15951
- )
15952
- )
15953
- );
15954
- }
15955
- function ComputeType(moduleProperties, key) {
15956
- return key in moduleProperties ? FromType2(moduleProperties, moduleProperties[key]) : Never();
15957
- }
15958
- function ComputeModuleProperties(moduleProperties) {
15959
- return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => {
15960
- return { ...result, [key]: ComputeType(moduleProperties, key) };
15961
- }, {});
15962
- }
15963
-
15964
- // ../../node_modules/@sinclair/typebox/build/esm/type/module/module.mjs
15965
- var TModule = class {
15966
- constructor($defs) {
15967
- const computed = ComputeModuleProperties($defs);
15968
- const identified = this.WithIdentifiers(computed);
15969
- this.$defs = identified;
15970
- }
15971
- /** `[Json]` Imports a Type by Key. */
15972
- Import(key, options) {
15973
- const $defs = { ...this.$defs, [key]: CreateType(this.$defs[key], options) };
15974
- return CreateType({ [Kind]: "Import", $defs, $ref: key });
15975
- }
15976
- // prettier-ignore
15977
- WithIdentifiers($defs) {
15978
- return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key) => {
15979
- return { ...result, [key]: { ...$defs[key], $id: key } };
15980
- }, {});
15981
- }
15982
- };
15983
- function Module(properties) {
15984
- return new TModule(properties);
15985
- }
15986
-
15987
- // ../../node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
15988
- function Not(type, options) {
15989
- return CreateType({ [Kind]: "Not", not: type }, options);
15990
- }
15991
-
15992
- // ../../node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
15993
- function Parameters(schema, options) {
15994
- return IsFunction2(schema) ? Tuple(schema.parameters, options) : Never();
15995
- }
15996
-
15997
- // ../../node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
15998
- var Ordinal = 0;
15999
- function Recursive(callback, options = {}) {
16000
- if (IsUndefined(options.$id))
16001
- options.$id = `T${Ordinal++}`;
16002
- const thisType = CloneType(callback({ [Kind]: "This", $ref: `${options.$id}` }));
16003
- thisType.$id = options.$id;
16004
- return CreateType({ [Hint]: "Recursive", ...thisType }, options);
16005
- }
16006
-
16007
- // ../../node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
16008
- function RegExp2(unresolved, options) {
16009
- const expr = IsString(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
16010
- return CreateType({ [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags }, options);
16011
- }
16012
-
16013
- // ../../node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs
16014
- function RestResolve(T) {
16015
- return IsIntersect(T) ? T.allOf : IsUnion(T) ? T.anyOf : IsTuple(T) ? T.items ?? [] : [];
16016
- }
16017
- function Rest(T) {
16018
- return RestResolve(T);
16019
- }
16020
-
16021
- // ../../node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
16022
- function ReturnType(schema, options) {
16023
- return IsFunction2(schema) ? CreateType(schema.returns, options) : Never(options);
16024
- }
16025
-
16026
- // ../../node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs
16027
- var TransformDecodeBuilder = class {
16028
- constructor(schema) {
16029
- this.schema = schema;
16030
- }
16031
- Decode(decode) {
16032
- return new TransformEncodeBuilder(this.schema, decode);
16033
- }
16034
- };
16035
- var TransformEncodeBuilder = class {
16036
- constructor(schema, decode) {
16037
- this.schema = schema;
16038
- this.decode = decode;
16039
- }
16040
- EncodeTransform(encode, schema) {
16041
- const Encode = (value) => schema[TransformKind].Encode(encode(value));
16042
- const Decode = (value) => this.decode(schema[TransformKind].Decode(value));
16043
- const Codec = { Encode, Decode };
16044
- return { ...schema, [TransformKind]: Codec };
16045
- }
16046
- EncodeSchema(encode, schema) {
16047
- const Codec = { Decode: this.decode, Encode: encode };
16048
- return { ...schema, [TransformKind]: Codec };
16049
- }
16050
- Encode(encode) {
16051
- return IsTransform(this.schema) ? this.EncodeTransform(encode, this.schema) : this.EncodeSchema(encode, this.schema);
16052
- }
16053
- };
16054
- function Transform(schema) {
16055
- return new TransformDecodeBuilder(schema);
16056
- }
16057
-
16058
- // ../../node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs
16059
- function Unsafe(options = {}) {
16060
- return CreateType({ [Kind]: options[Kind] ?? "Unsafe" }, options);
16061
- }
16062
-
16063
- // ../../node_modules/@sinclair/typebox/build/esm/type/void/void.mjs
16064
- function Void(options) {
16065
- return CreateType({ [Kind]: "Void", type: "void" }, options);
16066
- }
16067
-
16068
- // ../../node_modules/@sinclair/typebox/build/esm/type/type/type.mjs
16069
- var type_exports2 = {};
16070
- __export(type_exports2, {
16071
- Any: () => Any,
16072
- Argument: () => Argument,
16073
- Array: () => Array2,
16074
- AsyncIterator: () => AsyncIterator,
16075
- Awaited: () => Awaited,
16076
- BigInt: () => BigInt,
16077
- Boolean: () => Boolean2,
16078
- Capitalize: () => Capitalize,
16079
- Composite: () => Composite,
16080
- Const: () => Const,
16081
- Constructor: () => Constructor,
16082
- ConstructorParameters: () => ConstructorParameters,
16083
- Date: () => Date2,
16084
- Enum: () => Enum,
16085
- Exclude: () => Exclude,
16086
- Extends: () => Extends,
16087
- Extract: () => Extract,
16088
- Function: () => Function2,
16089
- Index: () => Index,
16090
- InstanceType: () => InstanceType,
16091
- Instantiate: () => Instantiate,
16092
- Integer: () => Integer,
16093
- Intersect: () => Intersect,
16094
- Iterator: () => Iterator,
16095
- KeyOf: () => KeyOf,
16096
- Literal: () => Literal,
16097
- Lowercase: () => Lowercase,
16098
- Mapped: () => Mapped,
16099
- Module: () => Module,
16100
- Never: () => Never,
16101
- Not: () => Not,
16102
- Null: () => Null,
16103
- Number: () => Number2,
16104
- Object: () => Object2,
16105
- Omit: () => Omit,
16106
- Optional: () => Optional,
16107
- Parameters: () => Parameters,
16108
- Partial: () => Partial,
16109
- Pick: () => Pick,
16110
- Promise: () => Promise2,
16111
- Readonly: () => Readonly,
16112
- ReadonlyOptional: () => ReadonlyOptional,
16113
- Record: () => Record,
16114
- Recursive: () => Recursive,
16115
- Ref: () => Ref,
16116
- RegExp: () => RegExp2,
16117
- Required: () => Required,
16118
- Rest: () => Rest,
16119
- ReturnType: () => ReturnType,
16120
- String: () => String2,
16121
- Symbol: () => Symbol2,
16122
- TemplateLiteral: () => TemplateLiteral,
16123
- Transform: () => Transform,
16124
- Tuple: () => Tuple,
16125
- Uint8Array: () => Uint8Array2,
16126
- Uncapitalize: () => Uncapitalize,
16127
- Undefined: () => Undefined,
16128
- Union: () => Union,
16129
- Unknown: () => Unknown,
16130
- Unsafe: () => Unsafe,
16131
- Uppercase: () => Uppercase,
16132
- Void: () => Void
16133
- });
16134
-
16135
- // ../../node_modules/@sinclair/typebox/build/esm/type/type/index.mjs
16136
- var Type = type_exports2;
16137
-
16138
- // ../plays/authoring-contract.ts
16139
- var PLAY_SQL_LISTENER_WHERE_OPERATORS = [
16140
- "eq",
16141
- "neq",
16142
- "in",
16143
- "notIn",
16144
- "isNull",
16145
- "isNotNull",
16146
- "ilike"
16147
- ];
16148
- var PLAY_SQL_LISTENER_ID_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]*$/;
16149
- var PLAY_SQL_LISTENER_TOOL_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]*\.[a-zA-Z][a-zA-Z0-9_-]*$/;
16150
- var PLAY_SQL_LISTENER_WHERE_OPERATOR_SET = new Set(
16151
- PLAY_SQL_LISTENER_WHERE_OPERATORS
16152
- );
16153
- var PLAY_AUTHORING_DOCUMENTATION = {
16154
- fetchBatching: {
16155
- warning: "A static ctx.fetch key inside a loop is a warning because every iteration must still have distinct method, URL, body, or safe headers. One durable receipt must never stand in for every request.",
16156
- guidance: "Keep the static fetch label. For a mutating batch, make the body distinct and use a replay-stable external Idempotency-Key such as `${ctx.run.id}:signals:${batchIndex}`."
16157
- },
16158
- runId: {
16159
- semantics: "ctx.run.id is stable while Deepline retries or resumes one durable run. A separately submitted run receives a new id.",
16160
- use: "Use it when deriving an external idempotency key for a sequence of batches."
16161
- },
16162
- staticCallKeys: {
16163
- constraint: "Durable call keys \u2014 the ctx.fetch key, the ctx.dataset key, the ctx.step id \u2014 must be static string literals. The key names a durable receipt, so check, publish, and replay have to agree on it before the body runs. A key computed at runtime cannot be resolved at check time and is rejected.",
16164
- consequence: "This is an architectural constraint, not a style rule. A play cannot loop over a computed key, so it cannot page a large table with a helper like page(pageNumber). Unrolling one literal key per page is not a design at any real page count.",
16165
- workaround: "Push the aggregation server-side and call it once: a SQL function, a view, or a provider endpoint that returns the whole result. Keep unrolled literal keys only for a handful of genuinely distinct calls. To fan out over rows, use ctx.dataset with a static key \u2014 the per-row receipt identity comes from the row, not from the key."
13539
+ var PLAY_SQL_LISTENER_ID_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]*$/;
13540
+ var PLAY_SQL_LISTENER_TOOL_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]*\.[a-zA-Z][a-zA-Z0-9_-]*$/;
13541
+ var PLAY_SQL_LISTENER_WHERE_OPERATOR_SET = new Set(
13542
+ PLAY_SQL_LISTENER_WHERE_OPERATORS
13543
+ );
13544
+ var PLAY_AUTHORING_DOCUMENTATION = {
13545
+ fetchBatching: {
13546
+ warning: "A static ctx.fetch key inside a loop is a warning because every iteration must still have distinct method, URL, body, or safe headers. One durable receipt must never stand in for every request.",
13547
+ guidance: "Keep the static fetch label. For a mutating batch, make the body distinct and use a replay-stable external Idempotency-Key such as `${ctx.run.id}:signals:${batchIndex}`."
13548
+ },
13549
+ runId: {
13550
+ semantics: "ctx.run.id is stable while Deepline retries or resumes one durable run. A separately submitted run receives a new id.",
13551
+ use: "Use it when deriving an external idempotency key for a sequence of batches."
13552
+ },
13553
+ staticCallKeys: {
13554
+ constraint: "Durable call keys \u2014 the ctx.fetch key, the ctx.dataset key, the ctx.step id \u2014 must be static string literals. The key names a durable receipt, so check, publish, and replay have to agree on it before the body runs. A key computed at runtime cannot be resolved at check time and is rejected.",
13555
+ consequence: "This is an architectural constraint, not a style rule. A play cannot loop over a computed key, so it cannot page a large table with a helper like page(pageNumber). Unrolling one literal key per page is not a design at any real page count.",
13556
+ workaround: "Push the aggregation server-side and call it once: a SQL function, a view, or a provider endpoint that returns the whole result. Keep unrolled literal keys only for a handful of genuinely distinct calls. To fan out over rows, use ctx.dataset with a static key \u2014 the per-row receipt identity comes from the row, not from the key."
16166
13557
  }
16167
13558
  };
16168
13559
  var PLAY_AUTHORING_STATIC_FETCH_KEY_HINT = `${PLAY_AUTHORING_DOCUMENTATION.staticCallKeys.workaround} Do not compute the key.`;
@@ -17442,8 +14833,9 @@ var PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
17442
14833
  "export type PlayCallExecution = 'inline';",
17443
14834
  `export type PlayCallOptions = { description: ${cloudReferenceType("ctx.runPlay.options.description")}; execution?: ${cloudReferenceType("ctx.runPlay.options.execution")}; timeoutMs?: ${cloudReferenceType("ctx.runPlay.options.timeoutMs")} };`,
17444
14835
  `export type RuntimeStepOptions = { semanticKey?: ${cloudReferenceType("ctx.step.semanticKey")}; staleAfterSeconds?: ${cloudReferenceType("ctx.step.staleAfterSeconds")} };`,
17445
- `export type FetchOptions = { staleAfterSeconds?: ${cloudReferenceType("ctx.fetch.staleAfterSeconds")} };`,
14836
+ `export type FetchOptions = { staleAfterSeconds?: ${cloudReferenceType("ctx.fetch.staleAfterSeconds")}; transient?: boolean };`,
17446
14837
  "export type PlayFetchResponse = { ok: boolean; status: number; statusText: string; url: string; headers: Record<string, string>; bodyText: string; json: unknown | null };",
14838
+ "export declare class CtxFetchHttpError extends Error { readonly code: 'CTX_FETCH_HTTP_ERROR'; readonly response: PlayFetchResponse; readonly status: number; readonly statusText: string; readonly url: string; readonly headers: Record<string, string>; readonly bodyText: string; readonly json: unknown | null; }",
17447
14839
  "export type StepResolver<Row, Value> = (row: Row, ctx: DeeplinePlayRuntimeContext, index: number, previousCell?: PreviousCell<Value>) => Value | Promise<Value>;",
17448
14840
  "export type DatasetColumnRunInput<Row, Value> = { readonly row: Row; readonly ctx: DeeplinePlayRuntimeContext; readonly index: number; readonly previousCell?: PreviousCell<Value> };",
17449
14841
  "export type DatasetColumnDefinition<Row, Value> = { readonly run: (input: DatasetColumnRunInput<Row, Value>) => Value | Promise<Value>; readonly runIf?: (row: Row, index: number) => boolean | Promise<boolean> };",
@@ -20345,11 +17737,17 @@ async function collectBundledPlayGraph(entryFile, profile = null, entryExportNam
20345
17737
  )
20346
17738
  );
20347
17739
  }
20348
- nodes.set(absolutePath, bundleResult);
20349
- for (const dependency of bundleResult.importedPlayDependencies) {
17740
+ const bundledNode = {
17741
+ ...bundleResult,
17742
+ artifact: artifactForProductionCompatibilityCheck(
17743
+ bundleResult.artifact
17744
+ )
17745
+ };
17746
+ nodes.set(absolutePath, bundledNode);
17747
+ for (const dependency of bundledNode.importedPlayDependencies) {
20350
17748
  await visit(dependency.filePath);
20351
17749
  }
20352
- return bundleResult;
17750
+ return bundledNode;
20353
17751
  } finally {
20354
17752
  visiting.delete(absolutePath);
20355
17753
  }