@m1212e/rumble 0.23.14 → 0.23.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/index.cjs +3 -3
- package/out/index.cjs.map +1 -1
- package/out/index.d.cts +112 -15
- package/out/index.d.cts.map +1 -1
- package/out/index.d.mts +112 -15
- package/out/index.d.mts.map +1 -1
- package/out/index.mjs +3 -3
- package/out/index.mjs.map +1 -1
- package/package.json +6 -6
package/out/index.d.mts
CHANGED
|
@@ -11,8 +11,8 @@ import SchemaBuilder from "@pothos/core";
|
|
|
11
11
|
import { IncomingMessage, RequestListener, ServerResponse } from "node:http";
|
|
12
12
|
import { Http2ServerRequest, Http2ServerResponse } from "node:http2";
|
|
13
13
|
import { Socket } from "node:net";
|
|
14
|
+
import { useSofa } from "@m1212e/sofa-api";
|
|
14
15
|
import { ServerOptions } from "graphql-ws";
|
|
15
|
-
import { useSofa } from "sofa-api";
|
|
16
16
|
|
|
17
17
|
//#region lib/helpers/asserts.d.ts
|
|
18
18
|
/**
|
|
@@ -398,7 +398,7 @@ type UnionToTuple<Union, Tuple extends unknown[] = []> = [Union] extends [never]
|
|
|
398
398
|
type Split$2<Str, Sep extends string, Acc extends string[] = []> = Str extends "" ? Acc : Str extends `${infer T}${Sep}${infer U}` ? Split$2<U, Sep, [...Acc, T]> : [...Acc, Str];
|
|
399
399
|
type Stringifiable = string | number | boolean | bigint | null | undefined;
|
|
400
400
|
type Primitive$1 = string | number | boolean | bigint | null | undefined | symbol;
|
|
401
|
-
type Head<xs> = xs extends [infer first, ...any] ? first : never;
|
|
401
|
+
type Head$1<xs> = xs extends [infer first, ...any] ? first : never;
|
|
402
402
|
//#endregion
|
|
403
403
|
//#region node_modules/hotscript/dist/internals/core/impl/MergeArgs.d.ts
|
|
404
404
|
type ExcludePlaceholders<xs, output extends any[] = []> = xs extends [infer first, ...infer rest] ? Equal$1<first, _> extends true ? ExcludePlaceholders<rest, output> : ExcludePlaceholders<rest, [...output, first]> : output;
|
|
@@ -518,7 +518,7 @@ type Pipe<acc, xs extends Fn[]> = xs extends [infer first extends Fn, ...infer r
|
|
|
518
518
|
interface ComposeLeft<fns extends Fn[]> extends Fn {
|
|
519
519
|
return: ComposeLeftImpl<fns, this["args"]>;
|
|
520
520
|
}
|
|
521
|
-
type ComposeLeftImpl<fns extends Fn[], args extends any[]> = fns extends [infer first extends Fn, ...infer rest extends Fn[]] ? ComposeLeftImpl<rest, [Apply<first, args>]> : Head<args>;
|
|
521
|
+
type ComposeLeftImpl<fns extends Fn[], args extends any[]> = fns extends [infer first extends Fn, ...infer rest extends Fn[]] ? ComposeLeftImpl<rest, [Apply<first, args>]> : Head$1<args>;
|
|
522
522
|
/**
|
|
523
523
|
* `PartialApply` Pre applies some arguments to a function.
|
|
524
524
|
* it takes a `Fn`, and a list of pre applied arguments,
|
|
@@ -2884,7 +2884,7 @@ declare type Or<BOOL_A extends boolean, BOOL_B extends boolean> = BOOL_A extends
|
|
|
2884
2884
|
declare type Prettify<TYPE> = IsObject<TYPE> extends true ? { [KEY in keyof TYPE]: KEY extends keyof TYPE ? TYPE[KEY] : never } : TYPE;
|
|
2885
2885
|
//#endregion
|
|
2886
2886
|
//#region node_modules/ts-algebra/lib/utils/tail.d.ts
|
|
2887
|
-
declare type Tail$
|
|
2887
|
+
declare type Tail$2<ARRAY extends unknown[]> = ARRAY extends readonly [] ? ARRAY : ARRAY extends readonly [unknown?, ...infer TAIL] ? TAIL : ARRAY;
|
|
2888
2888
|
//#endregion
|
|
2889
2889
|
//#region node_modules/ts-algebra/lib/utils/unionLast.d.ts
|
|
2890
2890
|
declare type UnionLast<UNION> = IntersectUnion$1<UNION extends unknown ? (x: UNION) => void : never> extends ((x: infer LAST) => void) ? LAST : never;
|
|
@@ -3237,7 +3237,7 @@ declare type ExcludeTuples<META_TUPLE_A extends TupleType, META_TUPLE_B extends
|
|
|
3237
3237
|
none: OmitOmittableExcludedItems<META_TUPLE_A, VALUE_EXCLUSION_RESULTS>;
|
|
3238
3238
|
}[And$1<IsTupleOpen<META_TUPLE_A>, IS_OPEN_PROPS_EXCLUSION_REPRESENTABLE> extends true ? "moreThanTwo" : GetTupleLength<REPRESENTABLE_VALUE_EXCLUSION_RESULTS>], META_TUPLE_A>;
|
|
3239
3239
|
declare type ExcludeTupleValues<META_TUPLE_A_VALUES extends Type[], META_TUPLE_B_VALUES extends Type[], IS_META_TUPLE_A_OPEN extends boolean, IS_META_TUPLE_B_OPEN extends boolean, META_TUPLE_A_OPEN_PROPS extends Type, META_TUPLE_B_OPEN_PROPS extends Type, VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[] = []> = META_TUPLE_A_VALUES extends [infer META_TUPLE_A_VALUES_HEAD, ...infer META_TUPLE_A_VALUES_TAIL] ? META_TUPLE_A_VALUES_HEAD extends Type ? META_TUPLE_A_VALUES_TAIL extends Type[] ? META_TUPLE_B_VALUES extends [infer META_TUPLE_B_VALUES_HEAD, ...infer META_TUPLE_B_VALUES_TAIL] ? META_TUPLE_B_VALUES_HEAD extends Type ? META_TUPLE_B_VALUES_TAIL extends Type[] ? ExcludeTupleValues<META_TUPLE_A_VALUES_TAIL, META_TUPLE_B_VALUES_TAIL, IS_META_TUPLE_A_OPEN, IS_META_TUPLE_B_OPEN, META_TUPLE_A_OPEN_PROPS, META_TUPLE_B_OPEN_PROPS, [...VALUE_EXCLUSION_RESULTS, ValueExclusionResult<META_TUPLE_A_VALUES_HEAD, true, true, META_TUPLE_B_VALUES_HEAD, true, true>]> : never : never : ExcludeTupleValues<META_TUPLE_A_VALUES_TAIL, [], IS_META_TUPLE_A_OPEN, IS_META_TUPLE_B_OPEN, META_TUPLE_A_OPEN_PROPS, META_TUPLE_B_OPEN_PROPS, [...VALUE_EXCLUSION_RESULTS, ValueExclusionResult<META_TUPLE_A_VALUES_HEAD, true, true, META_TUPLE_B_OPEN_PROPS, IS_META_TUPLE_B_OPEN, false>]> : never : never : META_TUPLE_B_VALUES extends [infer META_TUPLE_B_VALUES_HEAD, ...infer META_TUPLE_B_VALUES_TAIL] ? META_TUPLE_B_VALUES_HEAD extends Type ? META_TUPLE_B_VALUES_TAIL extends Type[] ? ExcludeTupleValues<[], META_TUPLE_B_VALUES_TAIL, IS_META_TUPLE_A_OPEN, IS_META_TUPLE_B_OPEN, META_TUPLE_A_OPEN_PROPS, META_TUPLE_B_OPEN_PROPS, [...VALUE_EXCLUSION_RESULTS, ValueExclusionResult<META_TUPLE_A_OPEN_PROPS, IS_META_TUPLE_A_OPEN, false, META_TUPLE_B_VALUES_HEAD, true, true>]> : never : never : VALUE_EXCLUSION_RESULTS;
|
|
3240
|
-
declare type GetTupleLength<ANY_TUPLE extends unknown[], TAIL extends unknown[] = Tail$
|
|
3240
|
+
declare type GetTupleLength<ANY_TUPLE extends unknown[], TAIL extends unknown[] = Tail$2<ANY_TUPLE>> = If<DoesExtend$1<ANY_TUPLE, []>, "none", If<DoesExtend$1<TAIL, []>, "onlyOne", "moreThanTwo">>;
|
|
3241
3241
|
declare type DoesTupleSizesMatch<META_TUPLE_A extends TupleType, META_TUPLE_B extends TupleType, VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[]> = If<And$1<IsTupleOpen<META_TUPLE_A>, Not$1<IsTupleOpen<META_TUPLE_B>>>, false, And$1<IsExcludedSmallEnough<VALUE_EXCLUSION_RESULTS>, IsExcludedBigEnough<VALUE_EXCLUSION_RESULTS>>>;
|
|
3242
3242
|
declare type IsExcludedSmallEnough<VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[]> = VALUE_EXCLUSION_RESULTS extends [infer VALUE_EXCLUSION_RESULTS_HEAD, ...infer VALUE_EXCLUSION_RESULTS_TAIL] ? VALUE_EXCLUSION_RESULTS_HEAD extends ValueExclusionResultType ? VALUE_EXCLUSION_RESULTS_TAIL extends ValueExclusionResultType[] ? If<IsOutsideOfSourceScope<VALUE_EXCLUSION_RESULTS_HEAD>, false, IsExcludedSmallEnough<VALUE_EXCLUSION_RESULTS_TAIL>> : never : never : true;
|
|
3243
3243
|
declare type IsExcludedBigEnough<VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[]> = VALUE_EXCLUSION_RESULTS extends [infer VALUE_EXCLUSION_RESULTS_HEAD, ...infer VALUE_EXCLUSION_RESULTS_TAIL] ? VALUE_EXCLUSION_RESULTS_HEAD extends ValueExclusionResultType ? VALUE_EXCLUSION_RESULTS_TAIL extends ValueExclusionResultType[] ? If<IsOutsideOfExcludedScope<VALUE_EXCLUSION_RESULTS_HEAD>, false, IsExcludedBigEnough<VALUE_EXCLUSION_RESULTS_TAIL>> : never : never : true;
|
|
@@ -3368,7 +3368,7 @@ type RecursiveSplit<STRING extends string, SEPARATOR extends string = ""> = STRI
|
|
|
3368
3368
|
type Split<STRING extends string, SEPARATOR extends string = "", RESULT extends string[] = RecursiveSplit<STRING, SEPARATOR>> = SEPARATOR extends "" ? Pop<RESULT> : RESULT;
|
|
3369
3369
|
//#endregion
|
|
3370
3370
|
//#region node_modules/json-schema-to-ts/lib/types/type-utils/tail.d.ts
|
|
3371
|
-
type Tail<ARRAY extends unknown[]> = ARRAY extends readonly [] ? ARRAY : ARRAY extends readonly [unknown?, ...infer ARRAY_TAIL] ? ARRAY_TAIL : ARRAY;
|
|
3371
|
+
type Tail$1<ARRAY extends unknown[]> = ARRAY extends readonly [] ? ARRAY : ARRAY extends readonly [unknown?, ...infer ARRAY_TAIL] ? ARRAY_TAIL : ARRAY;
|
|
3372
3372
|
//#endregion
|
|
3373
3373
|
//#region node_modules/json-schema-to-ts/lib/types/type-utils/writable.d.ts
|
|
3374
3374
|
type Writable<TYPE> = TYPE extends ((...args: unknown[]) => unknown) | Date | RegExp ? TYPE : TYPE extends ReadonlyMap<infer KEYS, infer VALUES> ? Map<Writable<KEYS>, Writable<VALUES>> : TYPE extends ReadonlySet<infer VALUES> ? Set<Writable<VALUES>> : TYPE extends ReadonlyArray<unknown> ? `${bigint}` extends `${keyof TYPE & any}` ? { -readonly [KEY in keyof TYPE]: Writable<TYPE[KEY]> } : Writable<TYPE[number]>[] : TYPE extends object ? { -readonly [KEY in keyof TYPE]: Writable<TYPE[KEY]> } : TYPE;
|
|
@@ -3468,7 +3468,7 @@ type ParseOneOfSchema<ONE_OF_SCHEMA extends OneOfSchema, OPTIONS extends ParseSc
|
|
|
3468
3468
|
type RecurseOnOneOfSchema<SUB_SCHEMAS extends readonly JSONSchema$1[], ROOT_ONE_OF_SCHEMA extends OneOfSchema, OPTIONS extends ParseSchemaOptions, RESULT = never> = SUB_SCHEMAS extends readonly [infer SUB_SCHEMAS_HEAD, ...infer SUB_SCHEMAS_TAIL] ? SUB_SCHEMAS_HEAD extends JSONSchema$1 ? SUB_SCHEMAS_TAIL extends readonly JSONSchema$1[] ? RecurseOnOneOfSchema<SUB_SCHEMAS_TAIL, ROOT_ONE_OF_SCHEMA, OPTIONS, RESULT | $Intersect<ParseSchema<Omit<ROOT_ONE_OF_SCHEMA, "oneOf">, OPTIONS>, ParseSchema<MergeSubSchema<Omit<ROOT_ONE_OF_SCHEMA, "oneOf">, SUB_SCHEMAS_HEAD>, OPTIONS>>> : never : never : RESULT;
|
|
3469
3469
|
//#endregion
|
|
3470
3470
|
//#region node_modules/json-schema-to-ts/lib/types/parse-schema/references/utils.d.ts
|
|
3471
|
-
type ParseReference<SCHEMA extends JSONSchema$1, OPTIONS extends ParseSchemaOptions, REFERENCE_SOURCE extends JSONSchema$1, PATH_IN_SOURCE extends string | undefined, MATCHING_REFERENCE extends JSONSchema$1 = (PATH_IN_SOURCE extends string ? DeepGet<REFERENCE_SOURCE, Tail<Split<PATH_IN_SOURCE, "/">>, false> : REFERENCE_SOURCE)> = $Intersect<ParseSchema<MATCHING_REFERENCE, OPTIONS>, ParseSchema<MergeSubSchema<MATCHING_REFERENCE, SCHEMA>, OPTIONS>>;
|
|
3471
|
+
type ParseReference<SCHEMA extends JSONSchema$1, OPTIONS extends ParseSchemaOptions, REFERENCE_SOURCE extends JSONSchema$1, PATH_IN_SOURCE extends string | undefined, MATCHING_REFERENCE extends JSONSchema$1 = (PATH_IN_SOURCE extends string ? DeepGet<REFERENCE_SOURCE, Tail$1<Split<PATH_IN_SOURCE, "/">>, false> : REFERENCE_SOURCE)> = $Intersect<ParseSchema<MATCHING_REFERENCE, OPTIONS>, ParseSchema<MergeSubSchema<MATCHING_REFERENCE, SCHEMA>, OPTIONS>>;
|
|
3472
3472
|
//#endregion
|
|
3473
3473
|
//#region node_modules/json-schema-to-ts/lib/types/parse-schema/references/external.d.ts
|
|
3474
3474
|
type ParseExternalReferenceSchema<REF_SCHEMA extends ReferencingSchema, OPTIONS extends ParseSchemaOptions, EXTERNAL_REFERENCE_ID extends string, SUB_PATH extends string | undefined> = OPTIONS["references"] extends { [KEY in EXTERNAL_REFERENCE_ID]: JSONSchema$1 } ? ParseReference<Omit<REF_SCHEMA, "$ref">, OPTIONS, OPTIONS["references"][EXTERNAL_REFERENCE_ID], SUB_PATH> : OPTIONS extends {
|
|
@@ -3513,9 +3513,9 @@ type ApplyMinMaxAndAdditionalItems<PARSED_ITEM_SCHEMAS extends any[], ROOT_SCHEM
|
|
|
3513
3513
|
additionalItems: JSONSchema$1;
|
|
3514
3514
|
}> ? ROOT_SCHEMA["additionalItems"] : true, OPTIONS>;
|
|
3515
3515
|
type ApplyMinMax<RECURSED_PARSED_ITEM_SCHEMAS extends any[], MIN extends number, MAX extends number | undefined, RESULT = never, HAS_ENCOUNTERED_MIN extends boolean = false, HAS_ENCOUNTERED_MAX extends boolean = false, INITIAL_PARSED_ITEM_SCHEMAS extends any[] = RECURSED_PARSED_ITEM_SCHEMAS> = And<Not<DoesExtend<MIN, RECURSED_PARSED_ITEM_SCHEMAS["length"]>>, DoesExtend<RECURSED_PARSED_ITEM_SCHEMAS, [any, ...any[]]>> extends true ? RECURSED_PARSED_ITEM_SCHEMAS extends [...infer RECURSED_PARSED_ITEM_SCHEMAS_BODY, unknown] ? ApplyMinMax<RECURSED_PARSED_ITEM_SCHEMAS_BODY, MIN, MAX, RECURSED_PARSED_ITEM_SCHEMAS["length"] extends MAX ? $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS>, HAS_ENCOUNTERED_MIN extends true ? true : DoesExtend<MIN, RECURSED_PARSED_ITEM_SCHEMAS["length"]>, HAS_ENCOUNTERED_MAX extends true ? true : DoesExtend<MAX, RECURSED_PARSED_ITEM_SCHEMAS["length"]>, INITIAL_PARSED_ITEM_SCHEMAS> : never : {
|
|
3516
|
-
result: MAX extends undefined ? RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : HAS_ENCOUNTERED_MAX extends true ? RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : MAX extends RECURSED_PARSED_ITEM_SCHEMAS["length"] ? $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : IsLongerThan<Tail<RECURSED_PARSED_ITEM_SCHEMAS>, MAX> extends true ? never : RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS>;
|
|
3516
|
+
result: MAX extends undefined ? RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : HAS_ENCOUNTERED_MAX extends true ? RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : MAX extends RECURSED_PARSED_ITEM_SCHEMAS["length"] ? $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : IsLongerThan<Tail$1<RECURSED_PARSED_ITEM_SCHEMAS>, MAX> extends true ? never : RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS>;
|
|
3517
3517
|
hasEncounteredMin: DoesExtend<MIN, RECURSED_PARSED_ITEM_SCHEMAS["length"]>;
|
|
3518
|
-
hasEncounteredMax: HAS_ENCOUNTERED_MAX extends true ? true : MAX extends RECURSED_PARSED_ITEM_SCHEMAS["length"] ? true : IsLongerThan<Tail<RECURSED_PARSED_ITEM_SCHEMAS>, MAX>;
|
|
3518
|
+
hasEncounteredMax: HAS_ENCOUNTERED_MAX extends true ? true : MAX extends RECURSED_PARSED_ITEM_SCHEMAS["length"] ? true : IsLongerThan<Tail$1<RECURSED_PARSED_ITEM_SCHEMAS>, MAX>;
|
|
3519
3519
|
completeTuple: INITIAL_PARSED_ITEM_SCHEMAS;
|
|
3520
3520
|
};
|
|
3521
3521
|
type IsLongerThan<TUPLE extends any[], LENGTH extends number | undefined, RESULT extends boolean = false> = LENGTH extends undefined ? false : TUPLE["length"] extends LENGTH ? true : TUPLE extends [any, ...infer TUPLE_TAIL] ? IsLongerThan<TUPLE_TAIL, LENGTH> : RESULT;
|
|
@@ -3599,7 +3599,7 @@ type FromSchema$1<SCHEMA extends JSONSchema$1, OPTIONS extends FromSchemaOptions
|
|
|
3599
3599
|
type MaybePromise<T> = Promise<T> | T;
|
|
3600
3600
|
type MaybePromiseLike<T> = PromiseLike<T> | T;
|
|
3601
3601
|
//#endregion
|
|
3602
|
-
//#region node_modules
|
|
3602
|
+
//#region node_modules/@whatwg-node/server/typings/utils.d.cts
|
|
3603
3603
|
interface NodeRequest {
|
|
3604
3604
|
protocol?: string | undefined;
|
|
3605
3605
|
hostname?: string | undefined;
|
|
@@ -3617,7 +3617,7 @@ interface NodeRequest {
|
|
|
3617
3617
|
}
|
|
3618
3618
|
type NodeResponse = ServerResponse | Http2ServerResponse;
|
|
3619
3619
|
//#endregion
|
|
3620
|
-
//#region node_modules
|
|
3620
|
+
//#region node_modules/@whatwg-node/server/typings/uwebsockets.d.cts
|
|
3621
3621
|
interface UWSRequest {
|
|
3622
3622
|
getMethod(): string;
|
|
3623
3623
|
forEach(callback: (key: string, value: string) => void): void;
|
|
@@ -3638,7 +3638,7 @@ interface UWSResponse {
|
|
|
3638
3638
|
}
|
|
3639
3639
|
type UWSHandler = (res: UWSResponse, req: UWSRequest) => void | Promise<void>;
|
|
3640
3640
|
//#endregion
|
|
3641
|
-
//#region node_modules
|
|
3641
|
+
//#region node_modules/@whatwg-node/server/typings/types.d.cts
|
|
3642
3642
|
interface FetchEvent extends Event {
|
|
3643
3643
|
waitUntil(f: MaybePromise<void>): void;
|
|
3644
3644
|
request: Request;
|
|
@@ -4124,10 +4124,107 @@ type PropertyValue<TJSONSchema extends JSONSchema, TProperty extends keyof TJSON
|
|
|
4124
4124
|
type ArrayItemValue<TJSONSchema extends JSONSchema> = TJSONSchema extends {
|
|
4125
4125
|
items: infer TItems extends JSONSchema;
|
|
4126
4126
|
} ? TItems : never;
|
|
4127
|
+
type HasCircularAnyOfRef<T extends JSONSchema> = T extends {
|
|
4128
|
+
properties: Record<string, JSONSchema>;
|
|
4129
|
+
} ? true extends { [K in keyof T['properties']]: PropIntroducesCycle<T['properties'][K], T> }[keyof T['properties']] ? true : false : false;
|
|
4130
|
+
type PropIntroducesCycle<S, Root> = S extends {
|
|
4131
|
+
anyOf: infer Items extends readonly JSONSchema[];
|
|
4132
|
+
} ? TupleIntroducesCycle<Items, Root> : S extends {
|
|
4133
|
+
oneOf: infer Items extends readonly JSONSchema[];
|
|
4134
|
+
} ? TupleIntroducesCycle<Items, Root> : S extends {
|
|
4135
|
+
items: infer I extends JSONSchema;
|
|
4136
|
+
} ? PropIntroducesCycle<I, Root> : S extends {
|
|
4137
|
+
$id: string;
|
|
4138
|
+
} ? false : S extends {
|
|
4139
|
+
properties: infer P extends Record<string, JSONSchema>;
|
|
4140
|
+
} ? true extends { [K in keyof P]: PropIntroducesCycle<P[K], Root> }[keyof P] ? true : AdditionalPropertiesCycle<S, Root> : AdditionalPropertiesCycle<S, Root>;
|
|
4141
|
+
type AdditionalPropertiesCycle<S, Root> = S extends {
|
|
4142
|
+
additionalProperties: infer AP extends JSONSchema;
|
|
4143
|
+
} ? PropIntroducesCycle<AP, Root> : false;
|
|
4144
|
+
type TupleIntroducesCycle<Items extends readonly JSONSchema[], Root> = Items extends readonly [infer Head extends JSONSchema, ...infer Tail extends readonly JSONSchema[]] ? MemberIntroducesCycle<Head, Root> extends true ? true : TupleIntroducesCycle<Tail, Root> : false;
|
|
4145
|
+
type MemberIntroducesCycle<Item, Root> = Item extends {
|
|
4146
|
+
$id: string;
|
|
4147
|
+
} ? [Item] extends [Root] ? true : HasSelfCircularAnyOf<Item> : false;
|
|
4148
|
+
type HasSelfCircularAnyOf<T> = T extends {
|
|
4149
|
+
properties: Record<string, JSONSchema>;
|
|
4150
|
+
} ? true extends { [K in keyof T['properties']]: DirectSelfAnyOf<T['properties'][K], T> }[keyof T['properties']] ? true : false : false;
|
|
4151
|
+
type DirectSelfAnyOf<S, Root> = S extends {
|
|
4152
|
+
anyOf: infer Items extends readonly JSONSchema[];
|
|
4153
|
+
} ? TupleHasSelf<Items, Root> : S extends {
|
|
4154
|
+
oneOf: infer Items extends readonly JSONSchema[];
|
|
4155
|
+
} ? TupleHasSelf<Items, Root> : S extends {
|
|
4156
|
+
items: infer I extends JSONSchema;
|
|
4157
|
+
} ? DirectSelfAnyOf<I, Root> : S extends {
|
|
4158
|
+
$id: string;
|
|
4159
|
+
} ? false : S extends {
|
|
4160
|
+
properties: infer P extends Record<string, JSONSchema>;
|
|
4161
|
+
} ? true extends { [K in keyof P]: DirectSelfAnyOf<P[K], Root> }[keyof P] ? true : AdditionalPropertiesSelf<S, Root> : AdditionalPropertiesSelf<S, Root>;
|
|
4162
|
+
type AdditionalPropertiesSelf<S, Root> = S extends {
|
|
4163
|
+
additionalProperties: infer AP extends JSONSchema;
|
|
4164
|
+
} ? DirectSelfAnyOf<AP, Root> : false;
|
|
4165
|
+
type TupleHasSelf<Items extends readonly JSONSchema[], Root> = Items extends readonly [infer Head extends JSONSchema, ...infer Tail extends readonly JSONSchema[]] ? [Head] extends [Root] ? true : TupleHasSelf<Tail, Root> : false;
|
|
4166
|
+
type DirectType<T extends JSONSchema> = T extends {
|
|
4167
|
+
nullable: true;
|
|
4168
|
+
} ? DirectTypeValue<T> | null : DirectTypeValue<T>;
|
|
4169
|
+
type DirectTypeValue<T extends JSONSchema> = T extends {
|
|
4170
|
+
static: infer U;
|
|
4171
|
+
} ? U : T extends {
|
|
4172
|
+
anyOf: infer Items extends readonly JSONSchema[];
|
|
4173
|
+
} ? DirectUnionType<Items> : T extends {
|
|
4174
|
+
oneOf: infer Items extends readonly JSONSchema[];
|
|
4175
|
+
} ? DirectUnionType<Items> : T extends {
|
|
4176
|
+
allOf: infer Items extends readonly JSONSchema[];
|
|
4177
|
+
} ? DirectIntersectionType<Items> : T extends {
|
|
4178
|
+
type: 'array';
|
|
4179
|
+
items: infer Items extends JSONSchema;
|
|
4180
|
+
} ? DirectType<Items>[] : T extends {
|
|
4181
|
+
type: 'string';
|
|
4182
|
+
enum: infer Vals extends readonly string[];
|
|
4183
|
+
} ? Vals[number] : T extends {
|
|
4184
|
+
type: 'string';
|
|
4185
|
+
format: 'binary';
|
|
4186
|
+
} ? File : T extends {
|
|
4187
|
+
type: 'string';
|
|
4188
|
+
} ? string : T extends {
|
|
4189
|
+
type: 'integer' | 'number';
|
|
4190
|
+
format: 'int64';
|
|
4191
|
+
} ? number | bigint : T extends {
|
|
4192
|
+
type: 'integer' | 'number';
|
|
4193
|
+
} ? number : T extends {
|
|
4194
|
+
type: 'boolean';
|
|
4195
|
+
} ? boolean : T extends {
|
|
4196
|
+
type: 'null';
|
|
4197
|
+
} ? null : T extends {
|
|
4198
|
+
type: 'object';
|
|
4199
|
+
properties: infer Props extends Record<string, JSONSchema>;
|
|
4200
|
+
required: infer Req extends readonly string[];
|
|
4201
|
+
additionalProperties: infer AP;
|
|
4202
|
+
} ? DirectNamedProps<Props, Req> & DirectIndexSignature<AP> : T extends {
|
|
4203
|
+
type: 'object';
|
|
4204
|
+
properties: infer Props extends Record<string, JSONSchema>;
|
|
4205
|
+
additionalProperties: infer AP;
|
|
4206
|
+
} ? DirectNamedProps<Props> & DirectIndexSignature<AP> : T extends {
|
|
4207
|
+
type: 'object';
|
|
4208
|
+
properties: infer Props extends Record<string, JSONSchema>;
|
|
4209
|
+
required: infer Req extends readonly string[];
|
|
4210
|
+
} ? DirectNamedProps<Props, Req> : T extends {
|
|
4211
|
+
type: 'object';
|
|
4212
|
+
properties: infer Props extends Record<string, JSONSchema>;
|
|
4213
|
+
} ? DirectNamedProps<Props> : T extends {
|
|
4214
|
+
type: 'object';
|
|
4215
|
+
additionalProperties: infer AP;
|
|
4216
|
+
} ? AP extends false ? Record<string, never> : DirectIndexSignature<AP> : T extends {
|
|
4217
|
+
type: 'object';
|
|
4218
|
+
} ? Record<string, unknown> : unknown;
|
|
4219
|
+
type DirectNamedProps<Props extends Record<string, JSONSchema>, Req extends readonly string[] | undefined = undefined> = [Req] extends [readonly string[]] ? { [K in Extract<keyof Props, Req[number]>]: DirectType<Props[K]> } & { [K in Exclude<keyof Props, Req[number]>]?: DirectType<Props[K]> } : { [K in keyof Props]?: DirectType<Props[K]> };
|
|
4220
|
+
type DirectIndexSignature<AP> = AP extends false ? unknown : AP extends true ? Record<string, unknown> : AP extends JSONSchema ? Record<string, DirectType<AP>> : Record<string, unknown>;
|
|
4221
|
+
type DirectUnionType<Items extends readonly JSONSchema[]> = Items extends readonly [infer Head extends JSONSchema, ...infer Tail extends readonly JSONSchema[]] ? DirectType<Head> | DirectUnionType<Tail> : never;
|
|
4222
|
+
type DirectIntersectionType<Items extends readonly JSONSchema[]> = Items extends readonly [infer Head extends JSONSchema, ...infer Tail extends readonly JSONSchema[]] ? DirectType<Head> & DirectIntersectionType<Tail> : unknown;
|
|
4223
|
+
type UseDirectType<T extends JSONSchema> = HasCircularAnyOfRef<T> extends true ? true : Circular<T> extends true ? true : false;
|
|
4127
4224
|
type FromSchema<T> = T extends {
|
|
4128
4225
|
static: infer U;
|
|
4129
|
-
} ? U : T extends JSONSchema ? FromSchema$1<T, {
|
|
4130
|
-
deserialize:
|
|
4226
|
+
} ? U : T extends JSONSchema ? UseDirectType<T> extends true ? DirectType<T> : FromSchema$1<T, {
|
|
4227
|
+
deserialize: [{
|
|
4131
4228
|
pattern: {
|
|
4132
4229
|
type: 'string';
|
|
4133
4230
|
format: 'binary';
|
|
@@ -4145,7 +4242,7 @@ type FromSchema<T> = T extends {
|
|
|
4145
4242
|
format: 'int64';
|
|
4146
4243
|
};
|
|
4147
4244
|
output: bigint | number;
|
|
4148
|
-
}]
|
|
4245
|
+
}];
|
|
4149
4246
|
}> : never;
|
|
4150
4247
|
type PromiseOrValue<T> = T | Promise<T>;
|
|
4151
4248
|
type StatusCodeMap<T> = { [TKey in StatusCode]?: T };
|